Parse escaped escapes before escaped quotes (#449)

This commit is contained in:
tuohy 2024-04-02 21:57:37 -04:00 committed by GitHub
parent 6b9220d0d7
commit 384b3098c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -173,6 +173,7 @@ and symbol idx acc = parse
and cm_string idx= parse and cm_string idx= parse
| '"' | '"'
{ (String (1, true), idx+1) } { (String (1, true), idx+1) }
| "\\\\"
| "\\\"" | "\\\""
{ let idx2, terminated= string (idx + 2) false lexbuf in { let idx2, terminated= string (idx + 2) false lexbuf in
(String (1, terminated), idx2) (String (1, terminated), idx2)
@ -222,6 +223,7 @@ and comment idx depth combining= parse
and string idx combining= parse and string idx combining= parse
| '"' | '"'
{ (idx + 1, true) } { (idx + 1, true) }
| "\\\\"
| "\\\"" | "\\\""
{ string (idx + 2) false lexbuf } { string (idx + 2) false lexbuf }
| uchar as uchar | uchar as uchar