Skip to content

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

Merged
MarcusDenker merged 2 commits intopharo-project:Pharo12from
privat:faulty-byte-array
Apr 6, 2023
Merged

Faulty parser: better faulty literal (byte) arrays#13300
MarcusDenker merged 2 commits intopharo-project:Pharo12from
privat:faulty-byte-array

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