-
-
Notifications
You must be signed in to change notification settings - Fork 414
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
Move syntax errors from the compiler to the parser #1907
Comments
bors bot
pushed a commit
that referenced
this issue
Apr 27, 2022
This Pull Request changes the following: - Implement redeclaration errors in the parser - Remove redeclaration errors from the compiler (this is a big step towards #1907) - Fix some failing tests on the way This requires a slight change in our public api. The Parser new requires a full `Context` instead of just the `Interner` for parsing new code. This is required, because if multiple scripts are parsed (e.g. every input in the REPL) global variables must be checked for redeclarations.
After #2027, what's missing here? |
There are still some syntax errors in the bytecompiler left: |
Razican
pushed a commit
that referenced
this issue
Jun 8, 2022
This Pull Request changes the following: - Implement redeclaration errors in the parser - Remove redeclaration errors from the compiler (this is a big step towards #1907) - Fix some failing tests on the way This requires a slight change in our public api. The Parser new requires a full `Context` instead of just the `Interner` for parsing new code. This is required, because if multiple scripts are parsed (e.g. every input in the REPL) global variables must be checked for redeclarations.
bors bot
pushed a commit
that referenced
this issue
Feb 1, 2023
This Pull Request changes the following: - Move postfix/prefix increment and decrement operations from the `Unary` expression to a new `Update` expression. - Add a special type for the `Update` expression target as it is very limited in comparision to an `Unary` target. - This makes bytecode compilation more typesafe for these operations and removes syntax errors from the bytecompiler without introducing panics (see #1907).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently we have some syntax errors that are being thrown in the compiler. They should be already be thrown in the parser.
The best case to search for them is to look for
throw_syntax_error
andconstruct_syntax_error
inboa_engine/src/bytecompiler.rs
. There may be state that must be added during the parsing for all of the errors to be moved to the parsing phase.After this is fixed,
Context::compile
should not need to return aResult
anymore.The text was updated successfully, but these errors were encountered: