|
|
@ -26,9 +26,21 @@ string
|
|
|
|
= '"' chars:stringCharacter* '"' { return chars.join(""); }
|
|
|
|
= '"' chars:stringCharacter* '"' { return chars.join(""); }
|
|
|
|
|
|
|
|
|
|
|
|
stringCharacter
|
|
|
|
stringCharacter
|
|
|
|
= !('"' / "\\") char:. { return char; } // Prefer a non-backslash character...
|
|
|
|
= !('"' / "\\") char:. { return char; } // Prefer a non-backslash character...
|
|
|
|
/ stringEscapedQuote { return '"'; } // ... then an escaped quotation mark...
|
|
|
|
/ stringEscapedQuote { return '"'; } // ... then an escaped quotation mark...
|
|
|
|
/ !('"') char:. { return char; } // ... and finally any other character that doesn't terminate the string.
|
|
|
|
/ stringEscapedNewline{ return "\n"; } // ... then various escaped whitespace characters...
|
|
|
|
|
|
|
|
/ stringEscapedCarriageReturn{ return "\r"; }
|
|
|
|
|
|
|
|
/ stringEscapedTab{ return "\t"; }
|
|
|
|
|
|
|
|
/ !('"') char:. { return char; } // ... and finally any other character that doesn't terminate the string.
|
|
|
|
|
|
|
|
|
|
|
|
stringEscapedQuote
|
|
|
|
stringEscapedQuote
|
|
|
|
= '\\"'
|
|
|
|
= '\\"'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stringEscapedNewline
|
|
|
|
|
|
|
|
= '\\n'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stringEscapedCarriageReturn
|
|
|
|
|
|
|
|
= '\\r'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
stringEscapedTab
|
|
|
|
|
|
|
|
= '\\t'
|
|
|
|