-
-
Notifications
You must be signed in to change notification settings - Fork 379
Fauty code: RBParser parse only faulty code #13080
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
Merged
MarcusDenker
merged 16 commits into
pharo-project:Pharo12
from
privat:fauty-code-mandatory-faulty-parsing
Mar 21, 2023
Merged
Fauty code: RBParser parse only faulty code #13080
MarcusDenker
merged 16 commits into
pharo-project:Pharo12
from
privat:fauty-code-mandatory-faulty-parsing
Mar 21, 2023
Conversation
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
Closed
OMG! Bootstrap passed! 🎉 |
Congrats :P |
The ci does not seems to like it |
It's an acquired taste. I just have to insist enough. |
I hope you got their consent :) |
CI green except windows that like nothing anyway |
This was a timeout on the windows slave :( I hope it’s not a new random failure |
MarcusDenker
approved these changes
Mar 21, 2023
This was referenced Mar 21, 2023
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.
RBParser is able (and tested) to produce AST with error nodes and precise error and warning information (notices)
The handling of error with error blocks or syntax error notifications is inferior because they are activated too early, without so much context: there is no AST yet, so such errors are only identified with a message string and a single position.
Moreover, they add complexity to the Parser code.
This PR tries to do what #12912 could not: remove errorBlock from RBParser.
What changed since then is a lot a cleanup and the RBNotice API, so I hope this will work now.
Features
RBProgramNode>>checkFaulty:
that simulates the old parser handling of error.Therefore, clients that rely on beFaulty, errorBlock and/or SyntaxErrorNotification: can just use this method on the resulting AST and should get the same behavior.
Note that the receiver is an AST node, not a parser, this is neat.
parse(Faulty)?(Expression|Method):(onError:)?
are still here, and usecheckFaulty:
to achieve the same results but in a smoother way.