It seems I accidentally introduced a bug in #117 which causes pigeon to think that a string/rune has not ended, if it contains \\"/\\'.
The reason behind this is simple: The CodeStringLiteral rule completely ignores backslashes unless they are followed by a quote. So, if a string contains the sequence \\", pigeon will ignore the first backslash and think that the remaining \" form an escape sequence and the string is not terminated.
The fix is, likewise, simple and just consumes \\ if it finds one, i.e. the current
'"' (`\"` / [^"\r\n])* '"' becomes
'"' (`\"` / `\\` / [^"\r\n])* '"'.
That way the \\ in \\" is consumed first, and the string is then correctly recognized as terminated by the remaining ".
I have the fix ready and will open a PR directly after opening the issue.
It seems I accidentally introduced a bug in #117 which causes pigeon to think that a string/rune has not ended, if it contains
\\"
/\\'
.The reason behind this is simple: The
CodeStringLiteral
rule completely ignores backslashes unless they are followed by a quote. So, if a string contains the sequence\\"
, pigeon will ignore the first backslash and think that the remaining\"
form an escape sequence and the string is not terminated.The fix is, likewise, simple and just consumes
\\
if it finds one, i.e. the current'"' (`\"` / [^"\r\n])* '"'
becomes'"' (`\"` / `\\` / [^"\r\n])* '"'
. That way the\\
in\\"
is consumed first, and the string is then correctly recognized as terminated by the remaining"
.I have the fix ready and will open a PR directly after opening the issue.