Fix import path grammar and grammar testing details.

This commit is contained in:
Daniel Kirchner
2021-04-12 14:54:36 +02:00
parent 124db22f04
commit 6fdfd8b62b
7 changed files with 29 additions and 25 deletions
+12 -5
View File
@@ -155,15 +155,20 @@ Not: '!';
BitNot: '~';
Inc: '++';
Dec: '--';
//@doc:inline
DoubleQuote: '"';
//@doc:inline
SingleQuote: '\'';
/**
* A single quoted string literal restricted to printable characters.
*/
StringLiteral: '"' DoubleQuotedStringCharacter* '"' | '\'' SingleQuotedStringCharacter* '\'';
/**
* A single non-empty quoted string literal.
* A non-empty quoted string literal restricted to printable characters.
*/
NonEmptyStringLiteral: '"' DoubleQuotedStringCharacter+ '"' | '\'' SingleQuotedStringCharacter+ '\'';
/**
* An empty string literal
*/
EmptyStringLiteral: '"' '"' | '\'' '\'';
// Note that this will also be used for Yul string literals.
//@doc:inline
fragment DoubleQuotedStringCharacter: DoubleQuotedPrintable | EscapeSequence;
@@ -200,6 +205,7 @@ fragment DoubleQuotedUnicodeStringCharacter: ~["\r\n\\] | EscapeSequence;
//@doc:inline
fragment SingleQuotedUnicodeStringCharacter: ~['\r\n\\] | EscapeSequence;
// Note that this will also be used for Yul hex string literals.
/**
* Hex strings need to consist of an even number of hex digits that may be grouped using underscores.
*/
@@ -315,6 +321,7 @@ YulDecimalNumber: '0' | ([1-9] [0-9]*);
YulStringLiteral:
'"' DoubleQuotedStringCharacter* '"'
| '\'' SingleQuotedStringCharacter* '\'';
//@doc:inline
YulHexStringLiteral: HexString;
YulWS: [ \t\r\n\u000C]+ -> skip ;