mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
parent
e2b787cdd0
commit
8f233b545f
@ -43,13 +43,13 @@ StorageLocation = 'memory' | 'storage'
|
|||||||
Block = '{' Statement* '}'
|
Block = '{' Statement* '}'
|
||||||
Statement = IfStatement | WhileStatement | ForStatement | Block |
|
Statement = IfStatement | WhileStatement | ForStatement | Block |
|
||||||
( PlaceholderStatement | Continue | Break | Return |
|
( PlaceholderStatement | Continue | Break | Return |
|
||||||
Throw | SimpleStatement | ExpressionStatement ) ';'
|
Throw | SimpleStatement ) ';'
|
||||||
|
|
||||||
ExpressionStatement = Expression | VariableDefinition
|
ExpressionStatement = Expression | VariableDefinition
|
||||||
IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
|
IfStatement = 'if' '(' Expression ')' Statement ( 'else' Statement )?
|
||||||
WhileStatement = 'while' '(' Expression ')' Statement
|
WhileStatement = 'while' '(' Expression ')' Statement
|
||||||
PlaceholderStatement = '_'
|
PlaceholderStatement = '_'
|
||||||
SimpleStatement = VariableDefinition | ExpressionStatement
|
SimpleStatement = ExpressionStatement
|
||||||
ForStatement = 'for' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
|
ForStatement = 'for' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
|
||||||
Continue = 'continue'
|
Continue = 'continue'
|
||||||
Break = 'break'
|
Break = 'break'
|
||||||
@ -59,7 +59,7 @@ VariableDefinition = VariableDeclaration ( '=' Expression )?
|
|||||||
|
|
||||||
// Precedence by order (see github.com/ethereum/solidity/pull/732)
|
// Precedence by order (see github.com/ethereum/solidity/pull/732)
|
||||||
Expression =
|
Expression =
|
||||||
( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' )
|
( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | NewExpression | ( TypeName? '(' Expression ')' ) )
|
||||||
| ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
|
| ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
|
||||||
| Expression '**' Expression
|
| Expression '**' Expression
|
||||||
| Expression ('*' | '/' | '%') Expression
|
| Expression ('*' | '/' | '%') Expression
|
||||||
@ -79,7 +79,7 @@ Expression =
|
|||||||
|
|
||||||
PrimaryExpression = Identifier | BooleanLiteral | NumberLiteral | StringLiteral
|
PrimaryExpression = Identifier | BooleanLiteral | NumberLiteral | StringLiteral
|
||||||
|
|
||||||
FunctionCall = Identifier '(' Expression? ( ',' Expression )* ')'
|
FunctionCall = ( Identifier | MemberAccess ) '(' Expression? ( ',' Expression )* ')'
|
||||||
NewExpression = 'new' Identifier
|
NewExpression = 'new' Identifier
|
||||||
MemberAccess = Expression '.' Identifier
|
MemberAccess = Expression '.' Identifier
|
||||||
IndexAccess = Expression '[' Expression? ']'
|
IndexAccess = Expression '[' Expression? ']'
|
||||||
|
Loading…
Reference in New Issue
Block a user