mna / pigeon

Command pigeon generates parsers in Go from a PEG grammar.
BSD 3-Clause "New" or "Revised" License
822 stars 66 forks source link

bootstrap.peg: Fix incorrect quote escapes and raw string length #116

Closed mavolin closed 10 months ago

mavolin commented 1 year ago

This is a PR that addresses the issue I had with compiling the first fix in #115. This is a separate bug and does not close #115, but only enables a fix for #115.

Firstly, it fixes incorrect quote escapes for interpreted string literals and rune literals, which were swapped (in interpreted strings \' could be escaped and rune literals \" could be escaped; the opposite would be correct).

Secondly, it fixes raw strings being limited to a one rune length, due to a missing *.

If I understand correctly, the tests in the test directory only test grammar/pigeon.peg but not grammar/bootrap.peg. Therefore, I'm not sure where and if to test this.

breml commented 10 months ago

Thanks for the fix @mavolin, I will now have a look at #117 as well.