Skip to content

Improve faulty parsing of assigments#12815

Merged
MarcusDenker merged 4 commits intopharo-project:Pharo11from
privat:improve-faulty-parsing-assigment
Feb 22, 2023
Merged

Improve faulty parsing of assigments#12815
MarcusDenker merged 4 commits intopharo-project:Pharo11from
privat:improve-faulty-parsing-assigment

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