Skip to content

Improve faulty parsing of assigments #12815

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

Conversation

privat
Copy link
Contributor

@privat privat commented Feb 20, 2023

Add a specific handling on the parser when a lone := is found. It produces instances of a new specific class RBAssignmentErrorNode.

Bad left values, like in a foo := 5 are likely to be consumed as unfinished statements (like a foo.), then the := that follows (and the right value) consumed as distinct statements of assignment errors (like := 5). Thus, producing an acceptable faulty AST.

A possible alternative faulty AST could be to include the unfinished left value as a child of the RBAssignmentErrorNode.
But this requires to hack the parser more (for not that much additional value)

@MarcusDenker MarcusDenker merged commit 973ee81 into pharo-project:Pharo11 Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants