aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-01-04 23:46:50 +0800
committerGitHub <noreply@github.com>2018-01-04 23:46:50 +0800
commitb195486501b95854603b3404f454e6333a75b765 (patch)
tree94d51b78415123c6398afd8e2cb75a6300caaa94 /docs
parentef356905ff1742257cec19523f0a9616977d961e (diff)
parentbe065a1243324fb7ae937f23369746007cb9717f (diff)
downloaddexon-solidity-b195486501b95854603b3404f454e6333a75b765.tar
dexon-solidity-b195486501b95854603b3404f454e6333a75b765.tar.gz
dexon-solidity-b195486501b95854603b3404f454e6333a75b765.tar.bz2
dexon-solidity-b195486501b95854603b3404f454e6333a75b765.tar.lz
dexon-solidity-b195486501b95854603b3404f454e6333a75b765.tar.xz
dexon-solidity-b195486501b95854603b3404f454e6333a75b765.tar.zst
dexon-solidity-b195486501b95854603b3404f454e6333a75b765.zip
Merge pull request #3358 from federicobond/improve-grammar
grammar.txt: Add optional storage location to parameters
Diffstat (limited to 'docs')
-rw-r--r--docs/grammar.txt17
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'