mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Added function types to the grammar.
This commit is contained in:
parent
0e5507c78c
commit
5011d6339a
@ -31,13 +31,16 @@ EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}'
|
|||||||
|
|
||||||
IndexedParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')'
|
IndexedParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')'
|
||||||
ParameterList = '(' ( TypeName Identifier? (',' TypeName Identifier?)* )? ')'
|
ParameterList = '(' ( TypeName Identifier? (',' TypeName Identifier?)* )? ')'
|
||||||
|
TypeNameList = '(' ( TypeName (',' TypeName )* )? ')'
|
||||||
|
|
||||||
// semantic restriction: mappings and structs (recursively) containing mappings
|
// semantic restriction: mappings and structs (recursively) containing mappings
|
||||||
// are not allowed in argument lists
|
// are not allowed in argument lists
|
||||||
VariableDeclaration = TypeName Identifier
|
VariableDeclaration = TypeName Identifier
|
||||||
TypeName = ElementaryTypeName | Identifier StorageLocation? | Mapping | ArrayTypeName
|
TypeName = ElementaryTypeName | Identifier StorageLocation? | Mapping | ArrayTypeName | FunctionTypeName
|
||||||
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
|
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
|
||||||
ArrayTypeName = TypeName StorageLocation? '[' Expression? ']'
|
ArrayTypeName = TypeName StorageLocation? '[' Expression? ']'
|
||||||
|
FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | 'constant' )*
|
||||||
|
( 'returns' TypeNameList )?
|
||||||
StorageLocation = 'memory' | 'storage'
|
StorageLocation = 'memory' | 'storage'
|
||||||
|
|
||||||
Block = '{' Statement* '}'
|
Block = '{' Statement* '}'
|
||||||
|
Loading…
Reference in New Issue
Block a user