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

Fix ast::Assignment #63

Merged
merged 2 commits into from
Jan 20, 2024
Merged

Fix ast::Assignment #63

merged 2 commits into from
Jan 20, 2024

Commits on Jan 20, 2024

  1. Fix ast::Assignment

    Replace `Name` with `(Name | IndexedIdentifier)` in the definition of
    `AssignmentStmt` in openqasm3.ungram. This generates a method `indexed_identifier` implemented
    for `AssignmentStmt` in nodes.rs. This allowed us to remove the handcoded method `indexed_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` underlying `AssignmentStmt` may have one or two `Expr`s. The last `Expr` 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 sourgen_ast.rs does not have the logic to this at present.
    jlapeyre committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    f6c93b8 View commit details
    Browse the repository at this point in the history
  2. Add a test for previous commit.

    I said I would not, but here it is.
    jlapeyre committed Jan 20, 2024
    Configuration menu
    Copy the full SHA
    4eb5fc1 View commit details
    Browse the repository at this point in the history