Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ambiguity with character code for mu in microsecond #422

Open
jlapeyre opened this issue Dec 13, 2022 · 0 comments · May be fixed by #477
Open

Ambiguity with character code for mu in microsecond #422

jlapeyre opened this issue Dec 13, 2022 · 0 comments · May be fixed by #477
Labels
bug clarify specification Change text of spec, not (mainly) semantics of spec Reference Parser ANLTR-based Python reference parser

Comments

@jlapeyre
Copy link
Contributor

jlapeyre commented Dec 13, 2022

OpenQASM version:

bcd5348

Python version:

3.10.5

Operating system:

fedora

What is the current behavior?

The lexer recognizes chr(181) + 's' as a TimeUnit representing microsecond.
The lexer does not recognize chr(956) + 's' as any TimeUnit.

However, backslash + mu [TAB] in ipython produces chr(956). (The same in Julia).
The qss parser also useschr(956) in the TimeUnit for microsecond.

Steps to reproduce the problem

Try to parse first 1µs, then 1μs. The first works, the second throws an error.
(Also, paste this into ipython or Jupyter: 'µ' == 'μ'.)

What is the expected behavior?

That's a good question.

Suggested solutions (Optional)

Perhaps allow both characters to represent the character mu in microsecond.

@jlapeyre jlapeyre added the bug label Dec 13, 2022
@jlapeyre jlapeyre changed the title Ambiguity with character code for microsecond Ambiguity with character code for mu in microsecond Dec 13, 2022
jlapeyre added a commit to jlapeyre/openqasm that referenced this issue Dec 14, 2022
… of mu

Previously only one unicode character for mu was recognized the literal for
microsecond. Now two are recognized. The new one appears frequently in Python.
It also is used in qss-qasm.

Add tests for the three was to specify microsecond.

Closes openqasm#422
@levbishop levbishop linked a pull request Jun 21, 2023 that will close this issue
@jlapeyre jlapeyre added Reference Parser ANLTR-based Python reference parser clarify specification Change text of spec, not (mainly) semantics of spec labels Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug clarify specification Change text of spec, not (mainly) semantics of spec Reference Parser ANLTR-based Python reference parser
Projects
None yet
1 participant