diff options
author | chriseth <chris@ethereum.org> | 2017-01-11 18:19:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-11 18:19:40 +0800 |
commit | 4f5da2ea147d0e658926676968a0015d44c26cf0 (patch) | |
tree | 65a30bd21a82a28e28cd86158178008d712979f3 | |
parent | 26a90af4d2ffb6a78056cc825f490096e4cc7176 (diff) | |
parent | 26eff0e0d8c0c34a614e6c7151e248168f72cab7 (diff) | |
download | dexon-solidity-4f5da2ea147d0e658926676968a0015d44c26cf0.tar dexon-solidity-4f5da2ea147d0e658926676968a0015d44c26cf0.tar.gz dexon-solidity-4f5da2ea147d0e658926676968a0015d44c26cf0.tar.bz2 dexon-solidity-4f5da2ea147d0e658926676968a0015d44c26cf0.tar.lz dexon-solidity-4f5da2ea147d0e658926676968a0015d44c26cf0.tar.xz dexon-solidity-4f5da2ea147d0e658926676968a0015d44c26cf0.tar.zst dexon-solidity-4f5da2ea147d0e658926676968a0015d44c26cf0.zip |
Merge pull request #1553 from federicobond/improve-grammar
Improve grammar specification
-rw-r--r-- | docs/grammar.txt | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/docs/grammar.txt b/docs/grammar.txt index b5d2b780..62b4a021 100644 --- a/docs/grammar.txt +++ b/docs/grammar.txt @@ -35,10 +35,10 @@ TypeNameList = '(' ( TypeName (',' TypeName )* )? ')' // semantic restriction: mappings and structs (recursively) containing mappings // are not allowed in argument lists -VariableDeclaration = TypeName Identifier +VariableDeclaration = TypeName StorageLocation? Identifier TypeName = ElementaryTypeName - | UserDefinedTypeName StorageLocation? + | UserDefinedTypeName | Mapping | ArrayTypeName | FunctionTypeName @@ -46,7 +46,7 @@ TypeName = ElementaryTypeName UserDefinedTypeName = Identifier ( '.' Identifier )* Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')' -ArrayTypeName = TypeName '[' Expression? ']' StorageLocation? +ArrayTypeName = TypeName '[' Expression? ']' FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | 'constant' | 'payable' )* ( 'returns' TypeNameList )? StorageLocation = 'memory' | 'storage' @@ -97,8 +97,14 @@ PrimaryExpression = Identifier | StringLiteral | ElementaryTypeNameExpression -FunctionCall = ( PrimaryExpression | NewExpression | TypeName ) ( ( '.' Identifier ) | ( '[' Expression ']' ) )* '(' Expression? ( ',' Expression )* ')' -NewExpression = 'new' Identifier +ExpressionList = Expression ( ',' Expression )* +NameValueList = Identifier ':' Expression ( ',' Identifier ':' Expression )* + +FunctionCall = ( PrimaryExpression | NewExpression | TypeName ) ( ( '.' Identifier ) | ( '[' Expression ']' ) )* '(' FunctionCallArguments ')' +FunctionCallArguments = '{' NameValueList? '}' + | ExpressionList? + +NewExpression = 'new' TypeName MemberAccess = Expression '.' Identifier IndexAccess = Expression '[' Expression? ']' |