mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update assembly grammar part.
This commit is contained in:
parent
cc00d8172b
commit
436696d3b6
@ -72,7 +72,7 @@ WhileStatement = 'while' '(' Expression ')' Statement
|
|||||||
PlaceholderStatement = '_'
|
PlaceholderStatement = '_'
|
||||||
SimpleStatement = VariableDefinition | ExpressionStatement
|
SimpleStatement = VariableDefinition | ExpressionStatement
|
||||||
ForStatement = 'for' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
|
ForStatement = 'for' '(' (SimpleStatement)? ';' (Expression)? ';' (ExpressionStatement)? ')' Statement
|
||||||
InlineAssemblyStatement = 'assembly' StringLiteral? InlineAssemblyBlock
|
InlineAssemblyStatement = 'assembly' StringLiteral? AssemblyBlock
|
||||||
DoWhileStatement = 'do' Statement 'while' '(' Expression ')'
|
DoWhileStatement = 'do' Statement 'while' '(' Expression ')'
|
||||||
Continue = 'continue'
|
Continue = 'continue'
|
||||||
Break = 'break'
|
Break = 'break'
|
||||||
@ -152,11 +152,30 @@ Fixed = 'fixed' | ( 'fixed' [0-9]+ 'x' [0-9]+ )
|
|||||||
|
|
||||||
Ufixed = 'ufixed' | ( 'ufixed' [0-9]+ 'x' [0-9]+ )
|
Ufixed = 'ufixed' | ( 'ufixed' [0-9]+ 'x' [0-9]+ )
|
||||||
|
|
||||||
InlineAssemblyBlock = '{' AssemblyItem* '}'
|
|
||||||
|
|
||||||
AssemblyItem = Identifier | FunctionalAssemblyExpression | InlineAssemblyBlock | AssemblyVariableDeclaration | AssemblyAssignment | AssemblyLabel | NumberLiteral | StringLiteral | HexLiteral
|
AssemblyBlock = '{' AssemblyStatement* '}'
|
||||||
AssemblyExpression = Identifier | FunctionalAssemblyExpression | NumberLiteral | StringLiteral | HexLiteral
|
|
||||||
AssemblyVariableDeclaration = 'let' Identifier ':=' AssemblyExpression
|
AssemblyStatement = AssemblyBlock
|
||||||
AssemblyAssignment = ( Identifier ':=' AssemblyExpression ) | ( '=:' Identifier )
|
| AssemblyFunctionDefinition
|
||||||
AssemblyLabel = Identifier ':'
|
| AssemblyVariableDeclaration
|
||||||
FunctionalAssemblyExpression = Identifier '(' AssemblyItem? ( ',' AssemblyItem )* ')'
|
| AssemblyAssignment
|
||||||
|
| AssemblyIf
|
||||||
|
| AssemblyExpression
|
||||||
|
| AssemblySwitch
|
||||||
|
| AssemblyForLoop
|
||||||
|
| AssemblyBreakContinue
|
||||||
|
AssemblyFunctionDefinition =
|
||||||
|
'function' Identifier '(' AssemblyIdentifierList? ')'
|
||||||
|
( '->' AssemblyIdentifierList )? AssemblyBlock
|
||||||
|
AssemblyVariableDeclaration = 'let' AssemblyIdentifierList ( ':=' AssemblyExpression )?
|
||||||
|
AssemblyAssignment = AssemblyIdentifierList ':=' AssemblyExpression
|
||||||
|
AssemblyExpression = AssemblyFunctionCall | Identifier | Literal
|
||||||
|
AssemblyIf = 'if' AssemblyExpression AssemblyBlock
|
||||||
|
AssemblySwitch = 'switch' AssemblyExpression ( Case+ AssemblyDefault? | AssemblyDefault )
|
||||||
|
AssemblyCase = 'case' Literal AssemblyBlock
|
||||||
|
AssemblyDefault = 'default' AssemblyBlock
|
||||||
|
AssemblyForLoop = 'for' AssemblyBlock AssemblyExpression AssemblyBlock AssemblyBlock
|
||||||
|
AssemblyBreakContinue = 'break' | 'continue'
|
||||||
|
AssemblyFunctionCall = Identifier '(' ( AssemblyExpression ( ',' AssemblyExpression )* )? ')'
|
||||||
|
|
||||||
|
AssemblyIdentifierList = Identifier ( ',' Identifier )*
|
||||||
|
Loading…
Reference in New Issue
Block a user