-
Notifications
You must be signed in to change notification settings - Fork 250
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
Quoted::as_...
doesn't consume all tokens
#5803
Comments
Quote::as_...
doesn't consume all tokensQuoted::as_...
doesn't consume all tokens
We'll need to change the parsers these use to expect an EOF after the parser. |
I'm also thinking, given that |
Yeah. I do wonder if that could be problematic though. If there's ever when you'd parse a variable but you wanted an lvalue variable or a pattern variable or something. Not sure but if that's ever the case we'd have to split Expr into the actual 2-4 types it wraps. |
# Description ## Problem\* Resolves #5803 Resolves #6059 ## Summary\* If we ever had a token stream with a subset of valid input we'd parse just that subset instead of erroring that the full input doesn't parse. ## Additional Context We don't have EOF tokens in token streams so I used the `end()` primitive instead. ## Documentation\* Check one: - [x] No documentation needed. - [ ] Documentation included in this PR. - [ ] **[For Experimental Features]** 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.
Aim
When turning Quoted into something else, it seems once tokens were consumed to form the target type, the rest of the tokens are discarded. Maybe in that case it should error with "expecting EOF" or something like that.
For example:
Output:
Expected Behavior
The above program errors because the entire token stream doesn't parse to an expression.
Bug
Remaining tokens are silently discarded.
To Reproduce
Workaround
None
Workaround Description
No response
Additional Context
No response
Project Impact
None
Blocker Context
No response
Nargo Version
No response
NoirJS Version
No response
Proving Backend Tooling & Version
No response
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: