Skip to content
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

Faulty parser: better faulty literal (byte) arrays #13300

Merged
merged 2 commits into from
Apr 6, 2023

Conversation

privat
Copy link
Contributor

@privat privat commented Apr 5, 2023

RBArrayErrorNode (and RBByteArrayErrorNode) were created to handle (byte) arrays with missing closer (or opener).
Therefore, on #[ 0 foo 2 ] where the error is not on the brackets, but on the contents, an additional and wrong error message was produced ("] expected").

Producing a valid RBLiteralArrayNode with bad contents did not work because clients (many known ones and possible unknown ones) assumed that RBLiteralArrayNode always have a legal literal value.
Various alternative solution were tried, but not with more success.

The proposed solution is to still have a RBArrayErrorNode (or RBByteArrayErrorNode) but without an error notice attached.
While possibly unintuitive, it allows an error node to not have specific error information by itself, but to contain nodes that have.

@privat privat changed the base branch from Pharo12 to Pharo11 April 5, 2023 17:52
@privat privat changed the base branch from Pharo11 to Pharo12 April 5, 2023 17:52
@privat
Copy link
Contributor Author

privat commented Apr 5, 2023

Windows is out, others are in

@MarcusDenker MarcusDenker merged commit 9087beb into pharo-project:Pharo12 Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants