Update grammar for unicode literals

This commit is contained in:
Alex Beregszaszi 2020-07-23 14:10:14 +01:00
parent f5f86779b8
commit 1f39640392

View File

@ -253,6 +253,7 @@ primaryExpression
| numberLiteral | numberLiteral
| hexLiteral | hexLiteral
| stringLiteral | stringLiteral
| unicodeStringLiteral
| identifier ('[' ']')? | identifier ('[' ']')?
| TypeKeyword | TypeKeyword
| tupleExpression | tupleExpression
@ -461,6 +462,13 @@ StringLiteralFragment
: '"' DoubleQuotedStringCharacter* '"' : '"' DoubleQuotedStringCharacter* '"'
| '\'' SingleQuotedStringCharacter* '\'' ; | '\'' SingleQuotedStringCharacter* '\'' ;
unicodeStringLiteral
: UnicodeStringLiteralFragment+ ;
UnicodeStringLiteralFragment
: 'unicode"' DoubleQuotedStringCharacter* '"'
| 'unicode\'' SingleQuotedStringCharacter* '\'' ;
fragment fragment
DoubleQuotedStringCharacter DoubleQuotedStringCharacter
: ~["\r\n\\] | ('\\' .) ; : ~["\r\n\\] | ('\\' .) ;