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)
|
||||
Expression
|
||||
= Expression ('++' | '--')
|
||||
| FunctionCall
|
||||
| NewExpression
|
||||
| MemberAccess
|
||||
| IndexAccess
|
||||
| MemberAccess
|
||||
| FunctionCall
|
||||
| '(' Expression ')'
|
||||
| ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
|
||||
| Expression '**' Expression
|
||||
| Expression ('*' | '/' | '%') Expression
|
||||
@ -97,12 +98,12 @@ Expression
|
||||
| Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
|
||||
| PrimaryExpression
|
||||
|
||||
PrimaryExpression = Identifier
|
||||
| BooleanLiteral
|
||||
PrimaryExpression = BooleanLiteral
|
||||
| NumberLiteral
|
||||
| HexLiteral
|
||||
| StringLiteral
|
||||
| TupleExpression
|
||||
| Identifier
|
||||
| ElementaryTypeNameExpression
|
||||
|
||||
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 | ``++``, ``--`` |
|
||||
+ +-------------------------------------+--------------------------------------------+
|
||||
| | Function-like call | ``<func>(<args...>)`` |
|
||||
| | New expression | ``new <typename>`` |
|
||||
+ +-------------------------------------+--------------------------------------------+
|
||||
| | Array subscripting | ``<array>[<index>]`` |
|
||||
+ +-------------------------------------+--------------------------------------------+
|
||||
| | Member access | ``<object>.<member>`` |
|
||||
+ +-------------------------------------+--------------------------------------------+
|
||||
| | Function-like call | ``<func>(<args...>)`` |
|
||||
+ +-------------------------------------+--------------------------------------------+
|
||||
| | Parentheses | ``(<statement>)`` |
|
||||
+------------+-------------------------------------+--------------------------------------------+
|
||||
| *2* | Prefix increment and decrement | ``++``, ``--`` |
|
||||
|
Loading…
Reference in New Issue
Block a user