mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Update grammar to reflect state mutability
This commit is contained in:
parent
83b90f3e8a
commit
47b6aa1f5b
@ -25,7 +25,7 @@ ModifierDefinition = 'modifier' Identifier ParameterList? Block
|
||||
ModifierInvocation = Identifier ( '(' ExpressionList? ')' )?
|
||||
|
||||
FunctionDefinition = 'function' Identifier? ParameterList
|
||||
( ModifierInvocation | 'constant' | 'payable' | 'external' | 'public' | 'internal' | 'private' )*
|
||||
( ModifierInvocation | StateMutability | 'external' | 'public' | 'internal' | 'private' )*
|
||||
( 'returns' ParameterList )? ( ';' | Block )
|
||||
EventDefinition = 'event' Identifier IndexedParameterList 'anonymous'? ';'
|
||||
|
||||
@ -50,9 +50,10 @@ UserDefinedTypeName = Identifier ( '.' Identifier )*
|
||||
|
||||
Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')'
|
||||
ArrayTypeName = TypeName '[' Expression? ']'
|
||||
FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | 'constant' | 'payable' )*
|
||||
FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | StateMutability )*
|
||||
( 'returns' TypeNameList )?
|
||||
StorageLocation = 'memory' | 'storage'
|
||||
StateMutability = 'constant' | 'payable'
|
||||
|
||||
Block = '{' Statement* '}'
|
||||
Statement = IfStatement | WhileStatement | ForStatement | Block | InlineAssemblyStatement |
|
||||
|
@ -337,7 +337,7 @@ be passed via and returned from external function calls.
|
||||
|
||||
Function types are notated as follows::
|
||||
|
||||
function (<parameter types>) {internal|external} [constant] [payable] [returns (<return types>)]
|
||||
function (<parameter types>) {internal|external} [constant|payable] [returns (<return types>)]
|
||||
|
||||
In contrast to the parameter types, the return types cannot be empty - if the
|
||||
function type should not return anything, the whole ``returns (<return types>)``
|
||||
|
Loading…
Reference in New Issue
Block a user