-
Notifications
You must be signed in to change notification settings - Fork 187
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: Parse a statement as an expression #6040
Merged
Merged
+128
−15
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changes to Brillig bytecode sizes
There are no changes in circuit sizes |
asterite
reviewed
Sep 13, 2024
test_programs/compile_success_empty/comptime_parse_statement_as_expression/'
Outdated
Show resolved
Hide resolved
asterite
approved these changes
Sep 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
jfecher
changed the title
Parse a statement as an expression
fix: Parse a statement as an expression
Sep 13, 2024
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 14, 2024
…ang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 15, 2024
…ang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 15, 2024
fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 16, 2024
…ang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 16, 2024
fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 17, 2024
…oir-lang/noir#6051) feat(metaprogramming): Add `#[use_callers_scope]` (noir-lang/noir#6050) feat: show test output when running via LSP (noir-lang/noir#6049) feat: add `Expr::as_lambda` (noir-lang/noir#6048) feat: faster LSP by caching file managers (noir-lang/noir#6047) feat: implement `to_be_radix` in the comptime interpreter (noir-lang/noir#6043) fix: prevent check_can_mutate crashing on undefined variable (noir-lang/noir#6044) feat: add `Expr::as_for` and `Expr::as_for_range` (noir-lang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 17, 2024
…oir#6051) feat(metaprogramming): Add `#[use_callers_scope]` (noir-lang/noir#6050) feat: show test output when running via LSP (noir-lang/noir#6049) feat: add `Expr::as_lambda` (noir-lang/noir#6048) feat: faster LSP by caching file managers (noir-lang/noir#6047) feat: implement `to_be_radix` in the comptime interpreter (noir-lang/noir#6043) fix: prevent check_can_mutate crashing on undefined variable (noir-lang/noir#6044) feat: add `Expr::as_for` and `Expr::as_for_range` (noir-lang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 17, 2024
feat: allow visibility modifiers in struct definitions (noir-lang/noir#6054) fix: let LSP suggest fields and methods in LValue chains (noir-lang/noir#6051) feat(metaprogramming): Add `#[use_callers_scope]` (noir-lang/noir#6050) feat: show test output when running via LSP (noir-lang/noir#6049) feat: add `Expr::as_lambda` (noir-lang/noir#6048) feat: faster LSP by caching file managers (noir-lang/noir#6047) feat: implement `to_be_radix` in the comptime interpreter (noir-lang/noir#6043) fix: prevent check_can_mutate crashing on undefined variable (noir-lang/noir#6044) feat: add `Expr::as_for` and `Expr::as_for_range` (noir-lang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
AztecBot
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 17, 2024
feat: allow visibility modifiers in struct definitions (noir-lang/noir#6054) fix: let LSP suggest fields and methods in LValue chains (noir-lang/noir#6051) feat(metaprogramming): Add `#[use_callers_scope]` (noir-lang/noir#6050) feat: show test output when running via LSP (noir-lang/noir#6049) feat: add `Expr::as_lambda` (noir-lang/noir#6048) feat: faster LSP by caching file managers (noir-lang/noir#6047) feat: implement `to_be_radix` in the comptime interpreter (noir-lang/noir#6043) fix: prevent check_can_mutate crashing on undefined variable (noir-lang/noir#6044) feat: add `Expr::as_for` and `Expr::as_for_range` (noir-lang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034)
TomAFrench
added a commit
to AztecProtocol/aztec-packages
that referenced
this pull request
Sep 17, 2024
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE feat: add `Expr::as_for` and `Expr::as_for_range` (noir-lang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034) END_COMMIT_OVERRIDE --------- Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
AztecBot
added a commit
to AztecProtocol/aztec-nr
that referenced
this pull request
Sep 18, 2024
Automated pull of development from the [noir](https://github.com/noir-lang/noir) programming language, a dependency of Aztec. BEGIN_COMMIT_OVERRIDE feat: add `Expr::as_for` and `Expr::as_for_range` (noir-lang/noir#6039) fix: Fix canonicalization bug (noir-lang/noir#6033) fix: Parse a statement as an expression (noir-lang/noir#6040) chore: rename CustomAtrribute to CustomAttribute (noir-lang/noir#6038) fix: error on `&mut x` when `x` is not mutable (noir-lang/noir#6037) feat: add `Expr::as_constructor` (noir-lang/noir#5980) chore: Fix docs (noir-lang/noir#6035) chore: document array methods (noir-lang/noir#6034) END_COMMIT_OVERRIDE --------- Co-authored-by: Tom French <15848336+TomAFrench@users.noreply.github.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Problem*
Resolves #6036
Summary*
Grego was having an issue from some macros where some code was taken from a block and later put in the rhs of a
let
statement:let _ = $former_block_statement
. Since this expression originated from a block statement though, it is aToken::InternedStatement
and not a valid expression.I've updated the parser to accept interned statements in an expression position, and we just later validate that they're either
StatementKind::Expression
orStatementKind::Semi
nodes.Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.