Closed mavolin closed 10 months ago
Thanks for the bug report. I have not yet had the time to dig into this in detail, so I can not yet confirm the issue. Never the less, feel free to create a PR with a test proofing the fix. Obviously the calculator example must not be broken with the fix applied.
Similarly to #80, pigeon counts braces (
{
and}
) enclosed in string or rune literals as code, when it should just ignore them.MWE
Code
Output
Fix
There are two possible fixes, both changing
grammar/pigeon.go:325
and adding a newCodeStringLiteral
rule:1. The 'Simple' Approach
2. Validated Strings
We could also validate the string/rune literals, since the necessary rules already exist:
I'm happy to make a PR. Note, however, that make seems to fail using first fix:
I don't know if this is another bug, or if I'm doing something wrong.