Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Thanks to your assistance with getting the parser to compile, I was able to give it a run and found that despite having changed none of the parsing logic itself, my Lua parser couldn't correctly parse some of the previous test items, such as the following:
The error was that the token representing
3
wasn't expected... which is odd because both the left and the right are basically comma separated lists, so it should have failed ony
. I realized a subtle difference though:The lhs was parsed effectively with this:
And the rhs was parsed with this:
I also noticed that this:
x = 2,
would successfully parse without having setallow_trailing
. Since these should (I believe) always parse the same input to the same end result, I looked into how parsing for separated was done, and found this subtle bug:The current implementation will always parse the separator after parsing the item. I was able to confirm this by using the tests from
master
and just moved them over tozero-copy
, as well as updated the implementation. I tried to document my implementation well enough without going overboard, so hopefully it is up to par with what you expect.