-
Notifications
You must be signed in to change notification settings - Fork 9
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
AutoQASM program transpilation should mangle OpenQASM reserved keywords (if they're not Python keywords) #12
Comments
I would like work on this issue as part of unitary hack. With my local changes, test |
@atharva-satpute can you share your local changes, for example, by pushing them to a branch or opening a draft PR? A draft PR would be best, since then we can trigger GitHub to run the unit tests and see the error messages. The simulator is used in the issue description because currently the OpenQASM syntax is only validated by the simulator - there is not currently any syntax validation during the AutoQASM serialization process itself. |
@rmshaffer, I have opened a draft PR |
@rmshaffer, could you take a look at the comments |
Sure - replied to your comment in the PR #28. Feel free to push a new revision to that PR whenever you're ready! |
I have added the changes. Let me know if any keywords are missing or if the list needs to be somewhere else. Thanks! |
Summary
In AutoQASM programs, Python symbol names which are reserved words in OpenQASM result in syntax errors in the serialized OpenQASM program. For example, a variable named
input
could be transpiled toinput_
to avoid this problem.Repro Steps
To reproduce the bug:
Expected Result
This should build and run the program successfully.
Actual Result
This fails because
input
is a reserved OpenQASM keyword, and so the generated OpenQASM program results in a syntax error.The text was updated successfully, but these errors were encountered: