diff options
author | Federico Bond <federicobond@gmail.com> | 2017-06-15 06:15:35 +0800 |
---|---|---|
committer | Federico Bond <federicobond@gmail.com> | 2017-06-23 00:54:05 +0800 |
commit | f0f1e5abfa21e97253bbc9d3e9791c8f4a956d06 (patch) | |
tree | ec799d2988db92ec5e02455394f91470e9f9f702 /docs/grammar.txt | |
parent | bffb8c404f0df22c4da7cdc2a8affcbb77377582 (diff) | |
download | dexon-solidity-f0f1e5abfa21e97253bbc9d3e9791c8f4a956d06.tar.gz dexon-solidity-f0f1e5abfa21e97253bbc9d3e9791c8f4a956d06.tar.zst dexon-solidity-f0f1e5abfa21e97253bbc9d3e9791c8f4a956d06.zip |
grammar.txt: Fix grammar for f.gas(p).value(q)() style calls
Diffstat (limited to 'docs/grammar.txt')
-rw-r--r-- | docs/grammar.txt | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/docs/grammar.txt b/docs/grammar.txt index b38b7ffa..da9e27d6 100644 --- a/docs/grammar.txt +++ b/docs/grammar.txt @@ -20,9 +20,12 @@ StateVariableDeclaration = TypeName ( 'public' | 'internal' | 'private' )? Ident UsingForDeclaration = 'using' Identifier 'for' ('*' | TypeName) ';' StructDefinition = 'struct' Identifier '{' ( VariableDeclaration ';' (VariableDeclaration ';')* )? '}' + ModifierDefinition = 'modifier' Identifier ParameterList? Block +ModifierInvocation = Identifier ( '(' ExpressionList? ')' )? + FunctionDefinition = 'function' Identifier? ParameterList - ( FunctionCall | Identifier | 'constant' | 'payable' | 'external' | 'public' | 'internal' | 'private' )* + ( ModifierInvocation | 'constant' | 'payable' | 'external' | 'public' | 'internal' | 'private' )* ( 'returns' ParameterList )? ( ';' | Block ) EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';' @@ -72,8 +75,12 @@ VariableDefinition = ('var' IdentifierList | VariableDeclaration) ( '=' Expressi IdentifierList = '(' ( Identifier? ',' )* Identifier? ')' // Precedence by order (see github.com/ethereum/solidity/pull/732) -Expression = - ( Expression ('++' | '--') | FunctionCall | IndexAccess | MemberAccess | '(' Expression ')' ) +Expression + = Expression ('++' | '--') + | FunctionCall + | NewExpression + | MemberAccess + | IndexAccess | ('!' | '~' | 'delete' | '++' | '--' | '+' | '-') Expression | Expression '**' Expression | Expression ('*' | '/' | '%') Expression @@ -101,7 +108,7 @@ PrimaryExpression = Identifier ExpressionList = Expression ( ',' Expression )* NameValueList = Identifier ':' Expression ( ',' Identifier ':' Expression )* -FunctionCall = ( PrimaryExpression | NewExpression | TypeName ) ( ( '.' Identifier ) | ( '[' Expression ']' ) )* '(' FunctionCallArguments ')' +FunctionCall = Expression '(' FunctionCallArguments ')' FunctionCallArguments = '{' NameValueList? '}' | ExpressionList? |