-
Notifications
You must be signed in to change notification settings - Fork 232
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
Helpful error message when fn
is missing
#3768
Comments
rahul-kothari
added a commit
to AztecProtocol/aztec-packages
that referenced
this issue
Dec 12, 2023
Fix a part of the problem highlighted by #3630 Also created * noir-lang/noir#3768 * [Discussion to see why we prioritise Aztec-nr issues over noir syntax issues. E.g. if we have storage and a syntax error in a method, instead of showinf the syntax error, we say "no compute_note_hash_and_nullifier() found"](https://aztecprotocol.slack.com/archives/C03P17YHVK8/p1702312023384759)
Seems like this happen anytime there is a error. Things like missed |
5 tasks
github-merge-queue bot
pushed a commit
that referenced
this issue
Jan 25, 2024
# Description Using `force(just(Token::EOF))` to ensure the whole file is parsed appears to hide the module error. ## Problem\* Resolves #3768 ## Summary\* Before: ```bash ❯ cargo run build error: Parser: expected an end of input but found #[aztec(private)] ┌─ /Users/michaelklein/Coding/rust/noir/test_programs/compile_failure/no_fn_keyword/src/main.nr:1:1 │ 1 │ #[aztec(private)] │ ----------------- │ Aborting due to 1 previous error ``` After: ```bash error: Unexpected main, expected one of fn, internal, open, pub, struct, unconstrained, Attribute ┌─ /Users/michaelklein/Coding/rust/noir/test_programs/compile_failure/no_fn_keyword/src/main.nr:2:1 │ 2 │ main() { │ ---- │ Aborting due to 1 previous error ``` ## Additional Context ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[Exceptional Case]** Documentation to be submitted in a separate PR. # PR Checklist\* - [x] I have tested the changes locally. - [x] I have formatted the changes with [Prettier](https://prettier.io/) and/or `cargo fmt` on default settings. --------- Co-authored-by: jfecher <[email protected]>
michaelelliot
pushed a commit
to Swoir/noir_rs
that referenced
this issue
Feb 28, 2024
…col#3649) Fix a part of the problem highlighted by AztecProtocol#3630 Also created * noir-lang/noir#3768 * [Discussion to see why we prioritise Aztec-nr issues over noir syntax issues. E.g. if we have storage and a syntax error in a method, instead of showinf the syntax error, we say "no compute_note_hash_and_nullifier() found"](https://aztecprotocol.slack.com/archives/C03P17YHVK8/p1702312023384759)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Aim
It would be nice to have a specific error message when using this (wrong) syntax:
Above has the
fn
keyword missing and it throws with a generic parsing error (Expected an end of input but found contract)AztecProtocol/aztec-packages#3630
The text was updated successfully, but these errors were encountered: