grammar.txt: Fix grammar for f.gas(p).value(q)() style calls

This commit is contained in:
Federico Bond 2017-06-14 19:15:35 -03:00
parent bffb8c404f
commit f0f1e5abfa

View File

@ -20,9 +20,12 @@ StateVariableDeclaration = TypeName ( 'public' | 'internal' | 'private' )? Ident
UsingForDeclaration = 'using' Identifier 'for' ('*' | TypeName) ';' UsingForDeclaration = 'using' Identifier 'for' ('*' | TypeName) ';'
StructDefinition = 'struct' Identifier '{' StructDefinition = 'struct' Identifier '{'
( VariableDeclaration ';' (VariableDeclaration ';')* )? '}' ( VariableDeclaration ';' (VariableDeclaration ';')* )? '}'
ModifierDefinition = 'modifier' Identifier ParameterList? Block ModifierDefinition = 'modifier' Identifier ParameterList? Block
ModifierInvocation = Identifier ( '(' ExpressionList? ')' )?
FunctionDefinition = 'function' Identifier? ParameterList FunctionDefinition = 'function' Identifier? ParameterList
( FunctionCall | Identifier | 'constant' | 'payable' | 'external' | 'public' | 'internal' | 'private' )* ( ModifierInvocation | 'constant' | 'payable' | 'external' | 'public' | 'internal' | 'private' )*
( 'returns' ParameterList )? ( ';' | Block ) ( 'returns' ParameterList )? ( ';' | Block )
EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';' EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';'
@ -72,8 +75,12 @@ VariableDefinition = ('var' IdentifierList | VariableDeclaration) ( '=' Expressi
IdentifierList = '(' ( Identifier? ',' )* Identifier? ')' 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 ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' ) = Expression ('++' | '--')
| FunctionCall
| NewExpression
| MemberAccess
| IndexAccess
| ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression | ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression
| Expression '**' Expression | Expression '**' Expression
| Expression ('*' | '/' | '%') Expression | Expression ('*' | '/' | '%') Expression
@ -101,7 +108,7 @@ PrimaryExpression = Identifier
ExpressionList = Expression ( ',' Expression )* ExpressionList = Expression ( ',' Expression )*
NameValueList = Identifier ':' Expression ( ',' Identifier ':' Expression )* NameValueList = Identifier ':' Expression ( ',' Identifier ':' Expression )*
FunctionCall = ( PrimaryExpression | NewExpression | TypeName ) ( ( '.' Identifier ) | ( '[' Expression ']' ) )* '(' FunctionCallArguments ')' FunctionCall = Expression '(' FunctionCallArguments ')'
FunctionCallArguments = '{' NameValueList? '}' FunctionCallArguments = '{' NameValueList? '}'
| ExpressionList? | ExpressionList?