aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Parser.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/parsing/Parser.h')
-rw-r--r--libsolidity/parsing/Parser.h14
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,