mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Order expression according to PR 732
This commit is contained in:
parent
28c4a0a3ab
commit
bd2562ffd3
@ -37,7 +37,7 @@ ArrayTypeName = TypeName '[' Expression? ']'
|
||||
|
||||
Block = '{' Statement* '}'
|
||||
Statement = IfStatement | WhileStatement | ForStatement | Block |
|
||||
( Continue | Break | Return | Throw | VardefOrExprStmt ) ';'
|
||||
( Continue | Break | Return | Throw | VardefOrExprStmt | ExpressionStatement ) ';'
|
||||
|
||||
ExpressionStatement = Expression | VariableDefinition | Assignment | 'delete' Expression
|
||||
IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
|
||||
@ -51,18 +51,27 @@ Throw = 'throw'
|
||||
VariableDefinition = VariableDeclaration ( '=' Expression )?
|
||||
Assignment = Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '>>=' | '+=' | '-=' | '*=' | '/=' | '%=') Expression
|
||||
|
||||
// Precedence by order (see github.com/ethereum/solidity/pull/732)
|
||||
Expression =
|
||||
('!' | '~' | '++' | '--') expression
|
||||
| expression ('**' | '*' | '/' | '%') expression
|
||||
| expression ('|' | '^' | '&' | '<<' | '>>') expression
|
||||
| expression ('+' | '-') expression
|
||||
| expression ('<=' | '>=' | '<' | '>') expression
|
||||
| expression ('==' | '!=') expression
|
||||
| expression ('&&' | '||') expression
|
||||
( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' )
|
||||
| ('++' | '--' | '+' | '-' | '!' | '~') Expression
|
||||
| Expression '**' Expression
|
||||
| Expression ('*' | '/' | '%') Expression
|
||||
| Expression ('+' | '-') Expression
|
||||
| Expression ('<<' | '>>' | '>>>')
|
||||
| Expression '&' Expression
|
||||
| Expression '^' Expression
|
||||
| Expression '|' Expression
|
||||
| Expression ('<' | '>' | '<=' | '>=') Expression
|
||||
| Expression ('==' | '!=') Expression
|
||||
| Expression '&&' Expression
|
||||
| Expression '||' Expression
|
||||
| Expression '?' Expression ':' Expression
|
||||
| Expression ('=' | '|=' | '^=' | '&=' | '<<=' | '/=' | '%=') Expression
|
||||
| Expression ',' Expression
|
||||
| PrimaryExpression
|
||||
|
||||
PrimaryExpression = Identifier | BooleanLiteral | NumberLiteral | StringLiteral
|
||||
| FunctionCall | MemberAccess | IndexAccess | '(' Expression ')'
|
||||
|
||||
FunctionCall = Identifier '(' Expression? ( ',' Expression )* ')'
|
||||
NewExpression = 'new' Identifier
|
||||
|
Loading…
Reference in New Issue
Block a user