Conversation
Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
cb15797 to
54d17f6
Compare
Argus reviewAuto-review is off for this repo. Tick the box below to run a review on this PR.
Estimated cost
Tip: you can also comment |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: qBraid/pyqasm/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary of changes
Closes #388.
A bare expression statement such as
a * b;is valid OpenQASM 3 and appears throughout the spec's classical types examples. The visitor's dispatch table routed everyExpressionStatementstraight to_visit_function_call, which dereferences.nameon the expression. For a non-Identifierexpression that raisedAttributeError: 'BinaryExpression' object has no attribute 'name', which escaped the public API.Expression statements have no effect on the quantum program, so they are now rejected with a
ValidationErrorreadingExpression statement has no effect, carrying the source span, rather than crashing. Function-call statements keep their existing behaviour.Added a regression test in
tests/qasm3/test_expressions.pyand a CHANGELOG entry.