You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] dumps() emits extern calls without a semicolon, producing unparsable QASM #438
FunctionCall is an expression node, so openqasm3.printer renders it as an expression —
no semicolon, no line break. It should be wrapped in an ExpressionStatement.
Scope is narrow: only extern calls are affected. Subroutine calls and builtin calls both
round-trip correctly.
Wrap the call in qasm3_ast.ExpressionStatement before it is appended to the output
statements — _handle_extern_function_cleanup (src/pyqasm/visitor.py:591) is where the
extern statement list is assembled.
Worth a round-trip assertion in the tests either way: openqasm3.parse(pyqasm.dumps(m)) over
the existing extern fixtures would have caught this, and would catch the same class of bug for
any other node that reaches the statement list unwrapped.
Found while reviewing #425, which touches the expression-statement path but does not cause or
fix this — it reproduces identically on main.
Activity
fix: wrap extern FunctionCall in ExpressionStatement to emit semicolon
docs: add CHANGELOG entry for PR qBraid#450
test: add regression test for bare extern function call semicolon
fix: wrap extern FunctionCall in ExpressionStatement to emit semicolon