Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Replace
Name
with(Name | IndexedIdentifier)
in the definition ofAssignmentStmt
in openqasm3.ungram. This generates a methodindexed_identifier
implemented forAssignmentStmt
in nodes.rs. This allowed us to remove the handcoded methodindexed_identifier
in expr_ext.rs. The latter exisited because I was going 100 mph implementing things and sticking the method in by hand was easier than updating the ungram file.The
SyntaxNode
underlyingAssignmentStmt
may have one or twoExpr
s. The lastExpr
is always the rhs. So we take this into account when we retrieve it.There is enough information in the ungrammar specification to write the method described above automatically. But
sourcgen_ast.rs
does not have the logic to this at present.See #59
There
is noare two tests added here. We need some better tools to write tests. Doing it by hand is laborious. r-a has as native facility for reading tests in comments interspersed in the source code. When they fail, the location of the test in the source code is reported. This might be nice.