-
-
Notifications
You must be signed in to change notification settings - Fork 379
Improve faulty parsing of byte array literal (alternative version) #12818
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
Improve faulty parsing of byte array literal (alternative version) #12818
Conversation
Maybe a discussion point (that also applies to #12817 ): the choice currently (and previously) done in case of error is to consume elements until a closing bracket |
I restarted the CI run and now this looks odd: It shows an error and I can not restart it anymore. Very very odd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
I wonder, why a lot of tests are removed, is that because they seem superfluous or it is a mistake?
I think I did the conflict resolution wrong, the tests should have been added, not removed |
468be24
to
f81ebb6
Compare
I rebased the commits to solve the merge |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ci fails because of the syntax error I think
…arsing-bytearray-alt
f81ebb6
to
5d21ae0
Compare
oops. I shouldn't have solved the conflicts by hand in a text editor before the first coffee. |
tests are ok (but the windows box is dead) |
I like this solution better than the alternative, as here we know that we have a wrong ByteArray |
Parsing keeps the content of faulty elements in byte array literals by interpreting the faulty element as classic literal array elements (instead of just skipping them), and put them in an instance of
RBLiteralByteArrayErrorNode
instead of in a faultyRBLiteralByteArrayNode
instance as previously.The old way was fragile and broke clients (including compilation and execution), since a
value
of aRBLiteralByteArrayNode
can only contain bytes.Note: This is an alternative implementation of #12817 — there can be only one. that is somewhat simpler (you can compare the diffs) and more robust.
The only drawback is that
RBEnglobingErrorNode
(the superclass of the error node used) need love:contents
should have as
(I think)But I consider these to be out of the scope of the PR and should be solved independently.