From 8b07e23975bc0eeafff5116d1c96996d645ea789 Mon Sep 17 00:00:00 2001 From: uji Date: Sat, 11 Mar 2023 17:29:45 +0900 Subject: [PATCH] docs/grammer: Fix the writing of unicodeStringLiteral rules. UnicodeStringLiteral rules can be written with a common prefix. (like HexString https://github.com/ethereum/solidity/blob/ef6ff2f05550e4386f2fec7753a44fe39a124488/docs/grammar/SolidityLexer.g4#L213) --- docs/grammar/SolidityLexer.g4 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/grammar/SolidityLexer.g4 b/docs/grammar/SolidityLexer.g4 index b0dfca0c4..e1d0da6a9 100644 --- a/docs/grammar/SolidityLexer.g4 +++ b/docs/grammar/SolidityLexer.g4 @@ -198,9 +198,7 @@ fragment EscapeSequence: /** * A single quoted string literal allowing arbitrary unicode characters. */ -UnicodeStringLiteral: - 'unicode"' DoubleQuotedUnicodeStringCharacter* '"' - | 'unicode\'' SingleQuotedUnicodeStringCharacter* '\''; +UnicodeStringLiteral: 'unicode' (('"' DoubleQuotedUnicodeStringCharacter* '"') | ('\'' SingleQuotedUnicodeStringCharacter* '\'')); //@doc:inline fragment DoubleQuotedUnicodeStringCharacter: ~["\r\n\\] | EscapeSequence; //@doc:inline