mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix import path grammar and grammar testing details.
This commit is contained in:
+3
-3
@@ -2,12 +2,12 @@
|
||||
Language Grammar
|
||||
****************
|
||||
|
||||
.. a4:autogrammar:: Solidity
|
||||
:only-reachable-from: Solidity.sourceUnit
|
||||
.. a4:autogrammar:: SolidityParser
|
||||
:only-reachable-from: SolidityParser.sourceUnit
|
||||
:undocumented:
|
||||
:cc-to-dash:
|
||||
|
||||
.. a4:autogrammar:: SolidityLexer
|
||||
:only-reachable-from: Solidity.sourceUnit
|
||||
:only-reachable-from: SolidityParser.sourceUnit
|
||||
:fragments:
|
||||
:cc-to-dash:
|
||||
@@ -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 ;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* Solidity is a statically typed, contract-oriented, high-level language for implementing smart contracts on the Ethereum platform.
|
||||
*/
|
||||
grammar Solidity;
|
||||
parser grammar SolidityParser;
|
||||
|
||||
options { tokenVocab=SolidityLexer; }
|
||||
|
||||
@@ -388,7 +388,7 @@ booleanLiteral: True | False;
|
||||
/**
|
||||
* A full string literal consists of either one or several consecutive quoted strings.
|
||||
*/
|
||||
stringLiteral: StringLiteral+;
|
||||
stringLiteral: (NonEmptyStringLiteral | EmptyStringLiteral)+;
|
||||
/**
|
||||
* A full hex string literal that consists of either one or several consecutive hex strings.
|
||||
*/
|
||||
Reference in New Issue
Block a user