From 5011d6339a185a55d6cdc3e952dea7bdd14a2ff7 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 8 Nov 2016 11:48:28 +0100 Subject: [PATCH] Added function types to the grammar. --- libsolidity/grammar.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libsolidity/grammar.txt b/libsolidity/grammar.txt index 6ad8994aa..cfa779eca 100644 --- a/libsolidity/grammar.txt +++ b/libsolidity/grammar.txt @@ -31,13 +31,16 @@ EnumDefinition = 'enum' Identifier '{' EnumValue? (',' EnumValue)* '}' IndexedParameterList = '(' ( TypeName 'indexed'? Identifier? (',' TypeName 'indexed'? Identifier?)* )? ')' ParameterList = '(' ( TypeName Identifier? (',' TypeName Identifier?)* )? ')' +TypeNameList = '(' ( TypeName (',' TypeName )* )? ')' // semantic restriction: mappings and structs (recursively) containing mappings // are not allowed in argument lists VariableDeclaration = TypeName Identifier -TypeName = ElementaryTypeName | Identifier StorageLocation? | Mapping | ArrayTypeName +TypeName = ElementaryTypeName | Identifier StorageLocation? | Mapping | ArrayTypeName | FunctionTypeName Mapping = 'mapping' '(' ElementaryTypeName '=>' TypeName ')' ArrayTypeName = TypeName StorageLocation? '[' Expression? ']' +FunctionTypeName = 'function' TypeNameList ( 'internal' | 'external' | 'constant' )* + ( 'returns' TypeNameList )? StorageLocation = 'memory' | 'storage' Block = '{' Statement* '}'