Fix and improve grammar.txt

This commit is contained in:
Federico Bond 2017-06-14 22:59:58 -03:00
parent f0f1e5abfa
commit 9fc4c877d3
2 changed files with 8 additions and 5 deletions

View File

@ -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 )*

View File

@ -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 | ``++``, ``--`` |