mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
grammar.txt: Add optional storage location to parameters
This commit is contained in:
parent
efc198d515
commit
be065a1243
@ -27,14 +27,19 @@ ModifierInvocation = Identifier ( '(' ExpressionList? ')' )?
|
|||||||
FunctionDefinition = 'function' Identifier? ParameterList
|
FunctionDefinition = 'function' Identifier? ParameterList
|
||||||
( ModifierInvocation | StateMutability | 'external' | 'public' | 'internal' | 'private' )*
|
( ModifierInvocation | StateMutability | 'external' | 'public' | 'internal' | 'private' )*
|
||||||
( 'returns' ParameterList )? ( ';' | Block )
|
( 'returns' ParameterList )? ( ';' | Block )
|
||||||
EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';'
|
EventDefinition = 'event' Identifier EventParameterList 'anonymous'? ';'
|
||||||
|
|
||||||
EnumValue = Identifier
|
EnumValue = Identifier
|
||||||
EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}'
|
EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}'
|
||||||
|
|
||||||
IndexedParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')'
|
ParameterList = '(' ( Parameter (',' Parameter)* )? ')'
|
||||||
ParameterList = '(' ( TypeName Identifier? (',' TypeName Identifier?)* )? ')'
|
Parameter = TypeName StorageLocation? Identifier?
|
||||||
TypeNameList = '(' ( TypeName (',' TypeName )* )? ')'
|
|
||||||
|
EventParameterList = '(' ( EventParameter (',' EventParameter )* )? ')'
|
||||||
|
EventParameter = TypeName 'indexed'? Identifier?
|
||||||
|
|
||||||
|
FunctionTypeParameterList = '(' ( FunctionTypeParameter (',' FunctionTypeParameter )* )? ')'
|
||||||
|
FunctionTypeParameter = TypeName StorageLocation?
|
||||||
|
|
||||||
// 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
|
||||||
@ -50,8 +55,8 @@ UserDefinedTypeName = Identifier ( '.' Identifier )*
|
|||||||
|
|
||||||
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
|
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
|
||||||
ArrayTypeName = TypeName '[' Expression? ']'
|
ArrayTypeName = TypeName '[' Expression? ']'
|
||||||
FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | StateMutability )*
|
FunctionTypeName = 'function' FunctionTypeParameterList ( 'internal' | 'external' | StateMutability )*
|
||||||
( 'returns' TypeNameList )?
|
( 'returns' FunctionTypeParameterList )?
|
||||||
StorageLocation = 'memory' | 'storage'
|
StorageLocation = 'memory' | 'storage'
|
||||||
StateMutability = 'pure' | 'constant' | 'view' | 'payable'
|
StateMutability = 'pure' | 'constant' | 'view' | 'payable'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user