lezer-parser / lezer

Dev utils and issues for the Lezer core packages
34 stars 1 forks source link

Error nodes - Regression in 1.3.13+ #58

Closed unconed closed 2 months ago

unconed commented 2 months ago

I have a reduced version of a GLSL grammar which works in 1.3.12 but generates extra error nodes everywhere in 1.3.13+ (including 1.4.2).

Minimal test case is here: https://github.com/unconed/lezer-bug-2024-08-07

Compare: https://github.com/unconed/lezer-bug-2024-08-07/blob/master/1.3.12.txt https://github.com/unconed/lezer-bug-2024-08-07/blob/master/1.3.13.txt https://github.com/unconed/lezer-bug-2024-08-07/blob/master/1.4.2.txt

marijnh commented 2 months ago

The release not for this version suggests that this is what's happening:

The parser will now emit an error node when it reaches the end of the top rule but not the end of the input, and restarts parsing the top rule.

Since your top rule looks like this...

@top Program { unit }

I'd guess you want to say unit* instead, there, if multiple declarations are allowed in a file?