Faulty parsing: change logic of errorBlock#13042
Merged
MarcusDenker merged 11 commits intopharo-project:Pharo12from Mar 18, 2023
Merged
Faulty parsing: change logic of errorBlock#13042MarcusDenker merged 11 commits intopharo-project:Pharo12from
MarcusDenker merged 11 commits intopharo-project:Pharo12from
Conversation
Contributor
Author
|
note: OpalCompiler uses the name |
Member
|
I somehow prefer failBlock |
MarcusDenker
approved these changes
Mar 18, 2023
Member
MarcusDenker
left a comment
There was a problem hiding this comment.
getting rid of the errorNodeBlock mechanism is very good.
For the errorBlock, I somehow prefer failBlock, but that is I guess because the compiler API uses that term.
And yes, it would be nice to get rid of it both on the level of the compiler and the parser
This was referenced Mar 19, 2023
Closed
This file contains hidden or 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
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.
This is a rewrite of #12912. I didn't like how it was done (but you might want to re-read it to compare).
Here is the new proposal, less radical but much cleaner than the current state anyway (so good enough for now).
RBParsergets aisFaultyflag used for all "faulty" parsing (no more weirdRBParser class>>errorNodeBlock).For contxt, faulty mode produces
RBParseErrorNode, then continue the parsing in degraded mode to produce faulty AST. In 'non-faulty' mode, exceptions are signaled (that just stops the parsing).errorBlockis kept (for the moment?) because it is used a lot, but is only for error notification (and most of the time non-local return). Reparation was broken by design and never performed by client at this level (not even by a test!!!). Therefore, reparation is no more possible (and parseErrorNode is now private).RBParseErrorNodeis produced (as in isFaulty mode). This was in the previous PR.Next PR will be likely about cleaning up more parser error things (messages and positions).