diff options
author | Federico Bond <federicobond@gmail.com> | 2017-12-24 15:43:53 +0800 |
---|---|---|
committer | Federico Bond <federicobond@gmail.com> | 2018-01-04 12:47:07 +0800 |
commit | be065a1243324fb7ae937f23369746007cb9717f (patch) | |
tree | af79d1e01ecec71e88bf8699d74a4f98478f16a0 | |
parent | efc198d515313fffcc7a56e23b0685d9efd356db (diff) | |
download | dexon-solidity-be065a1243324fb7ae937f23369746007cb9717f.tar dexon-solidity-be065a1243324fb7ae937f23369746007cb9717f.tar.gz dexon-solidity-be065a1243324fb7ae937f23369746007cb9717f.tar.bz2 dexon-solidity-be065a1243324fb7ae937f23369746007cb9717f.tar.lz dexon-solidity-be065a1243324fb7ae937f23369746007cb9717f.tar.xz dexon-solidity-be065a1243324fb7ae937f23369746007cb9717f.tar.zst dexon-solidity-be065a1243324fb7ae937f23369746007cb9717f.zip |
grammar.txt: Add optional storage location to parameters
-rw-r--r-- | docs/grammar.txt | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/docs/grammar.txt b/docs/grammar.txt index ce3fd3ad..e700c946 100644 --- a/docs/grammar.txt +++ b/docs/grammar.txt @@ -27,14 +27,19 @@ ModifierInvocation = Identifier ( '(' ExpressionList? ')' )? FunctionDefinition = 'function' Identifier? ParameterList ( ModifierInvocation | StateMutability | 'external' | 'public' | 'internal' | 'private' )* ( 'returns' ParameterList )? ( ';' | Block ) -EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';' +EventDefinition = 'event' Identifier EventParameterList 'anonymous'? ';' EnumValue = Identifier EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}' -IndexedParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')' -ParameterList = '(' ( TypeName Identifier? (',' TypeName Identifier?)* )? ')' -TypeNameList = '(' ( TypeName (',' TypeName )* )? ')' +ParameterList = '(' ( Parameter (',' Parameter)* )? ')' +Parameter = TypeName StorageLocation? Identifier? + +EventParameterList = '(' ( EventParameter (',' EventParameter )* )? ')' +EventParameter = TypeName 'indexed'? Identifier? + +FunctionTypeParameterList = '(' ( FunctionTypeParameter (',' FunctionTypeParameter )* )? ')' +FunctionTypeParameter = TypeName StorageLocation? // semantic restriction: mappings and structs (recursively) containing mappings // are not allowed in argument lists @@ -50,8 +55,8 @@ UserDefinedTypeName = Identifier ( '.' Identifier )* Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')' ArrayTypeName = TypeName '[' Expression? ']' -FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | StateMutability )* - ( 'returns' TypeNameList )? +FunctionTypeName = 'function' FunctionTypeParameterList ( 'internal' | 'external' | StateMutability )* + ( 'returns' FunctionTypeParameterList )? StorageLocation = 'memory' | 'storage' StateMutability = 'pure' | 'constant' | 'view' | 'payable' |