diff options
author | chriseth <c@ethdev.com> | 2016-09-28 03:37:32 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-11-16 21:37:17 +0800 |
commit | cc8583ec7d6fd86ca7e129475fde32b76d102e79 (patch) | |
tree | a2df35174d6d95734207add361db5d894fe8592f /libsolidity/parsing/Parser.h | |
parent | c811691861eb51520d9fd51d56770f14990b0320 (diff) | |
download | dexon-solidity-cc8583ec7d6fd86ca7e129475fde32b76d102e79.tar.gz dexon-solidity-cc8583ec7d6fd86ca7e129475fde32b76d102e79.tar.zst dexon-solidity-cc8583ec7d6fd86ca7e129475fde32b76d102e79.zip |
Function types.
Diffstat (limited to 'libsolidity/parsing/Parser.h')
-rw-r--r-- | libsolidity/parsing/Parser.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libsolidity/parsing/Parser.h b/libsolidity/parsing/Parser.h index 26f347cb..a59d2688 100644 --- a/libsolidity/parsing/Parser.h +++ b/libsolidity/parsing/Parser.h @@ -53,6 +53,18 @@ private: bool allowLocationSpecifier = false; }; + /// This struct is shared for parsing a function header and a function type. + struct FunctionHeaderParserResult + { + ASTPointer<ASTString> name; + ASTPointer<ParameterList> parameters; + ASTPointer<ParameterList> returnParameters; + Declaration::Visibility visibility = Declaration::Visibility::Default; + bool isDeclaredConst = false; + bool isPayable = false; + std::vector<ASTPointer<ModifierInvocation>> modifiers; + }; + ///@{ ///@name Parsing functions for the AST nodes ASTPointer<PragmaDirective> parsePragmaDirective(); @@ -60,6 +72,7 @@ private: ASTPointer<ContractDefinition> parseContractDefinition(bool _isLibrary); ASTPointer<InheritanceSpecifier> parseInheritanceSpecifier(); Declaration::Visibility parseVisibilitySpecifier(Token::Value _token); + FunctionHeaderParserResult parseFunctionHeader(bool _forceEmptyName, bool _allowModifiers); ASTPointer<FunctionDefinition> parseFunctionDefinition(ASTString const* _contractName); ASTPointer<StructDefinition> parseStructDefinition(); ASTPointer<EnumDefinition> parseEnumDefinition(); @@ -75,6 +88,7 @@ private: ASTPointer<Identifier> parseIdentifier(); ASTPointer<UserDefinedTypeName> parseUserDefinedTypeName(); ASTPointer<TypeName> parseTypeName(bool _allowVar); + ASTPointer<FunctionTypeName> parseFunctionType(); ASTPointer<Mapping> parseMapping(); ASTPointer<ParameterList> parseParameterList( VarDeclParserOptions const& _options, |