From 47b6aa1f5b92dbc9d65de6e507d18b57c62ed35f Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Wed, 16 Aug 2017 21:19:09 +0100 Subject: Update grammar to reflect state mutability --- docs/grammar.txt | 5 +++-- docs/types.rst | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/grammar.txt b/docs/grammar.txt index a9838ccb..90dc12ac 100644 --- a/docs/grammar.txt +++ b/docs/grammar.txt @@ -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 | diff --git a/docs/types.rst b/docs/types.rst index abf8bb17..13c848c2 100644 --- a/docs/types.rst +++ b/docs/types.rst @@ -337,7 +337,7 @@ be passed via and returned from external function calls. Function types are notated as follows:: - function () {internal|external} [constant] [payable] [returns ()] + function () {internal|external} [constant|payable] [returns ()] In contrast to the parameter types, the return types cannot be empty - if the function type should not return anything, the whole ``returns ()`` -- cgit