mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Fix and improve grammar.txt
This commit is contained in:
parent
f0f1e5abfa
commit
9fc4c877d3
@ -77,10 +77,11 @@ IdentifierList = '(' ( Identifier? ',' )* Identifier? ')'
|
|||||||
// Precedence by order (see github.com/ethereum/solidity/pull/732)
|
// Precedence by order (see github.com/ethereum/solidity/pull/732)
|
||||||
Expression
|
Expression
|
||||||
= Expression ('++' | '--')
|
= Expression ('++' | '--')
|
||||||
| FunctionCall
|
|
||||||
| NewExpression
|
| NewExpression
|
||||||
| MemberAccess
|
|
||||||
| IndexAccess
|
| IndexAccess
|
||||||
|
| MemberAccess
|
||||||
|
| FunctionCall
|
||||||
|
| '(' Expression ')'
|
||||||
| ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
|
| ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
|
||||||
| Expression '**' Expression
|
| Expression '**' Expression
|
||||||
| Expression ('*' | '/' | '%') Expression
|
| Expression ('*' | '/' | '%') Expression
|
||||||
@ -97,12 +98,12 @@ Expression
|
|||||||
| Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
|
| Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
|
||||||
| PrimaryExpression
|
| PrimaryExpression
|
||||||
|
|
||||||
PrimaryExpression = Identifier
|
PrimaryExpression = BooleanLiteral
|
||||||
| BooleanLiteral
|
|
||||||
| NumberLiteral
|
| NumberLiteral
|
||||||
| HexLiteral
|
| HexLiteral
|
||||||
| StringLiteral
|
| StringLiteral
|
||||||
| TupleExpression
|
| TupleExpression
|
||||||
|
| Identifier
|
||||||
| ElementaryTypeNameExpression
|
| ElementaryTypeNameExpression
|
||||||
|
|
||||||
ExpressionList = Expression ( ',' Expression )*
|
ExpressionList = Expression ( ',' Expression )*
|
||||||
|
@ -394,12 +394,14 @@ The following is the order of precedence for operators, listed in order of evalu
|
|||||||
+============+=====================================+============================================+
|
+============+=====================================+============================================+
|
||||||
| *1* | Postfix increment and decrement | ``++``, ``--`` |
|
| *1* | Postfix increment and decrement | ``++``, ``--`` |
|
||||||
+ +-------------------------------------+--------------------------------------------+
|
+ +-------------------------------------+--------------------------------------------+
|
||||||
| | Function-like call | ``<func>(<args...>)`` |
|
| | New expression | ``new <typename>`` |
|
||||||
+ +-------------------------------------+--------------------------------------------+
|
+ +-------------------------------------+--------------------------------------------+
|
||||||
| | Array subscripting | ``<array>[<index>]`` |
|
| | Array subscripting | ``<array>[<index>]`` |
|
||||||
+ +-------------------------------------+--------------------------------------------+
|
+ +-------------------------------------+--------------------------------------------+
|
||||||
| | Member access | ``<object>.<member>`` |
|
| | Member access | ``<object>.<member>`` |
|
||||||
+ +-------------------------------------+--------------------------------------------+
|
+ +-------------------------------------+--------------------------------------------+
|
||||||
|
| | Function-like call | ``<func>(<args...>)`` |
|
||||||
|
+ +-------------------------------------+--------------------------------------------+
|
||||||
| | Parentheses | ``(<statement>)`` |
|
| | Parentheses | ``(<statement>)`` |
|
||||||
+------------+-------------------------------------+--------------------------------------------+
|
+------------+-------------------------------------+--------------------------------------------+
|
||||||
| *2* | Prefix increment and decrement | ``++``, ``--`` |
|
| *2* | Prefix increment and decrement | ``++``, ``--`` |
|
||||||
|
Loading…
Reference in New Issue
Block a user