aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/parsing/Parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libsolidity/parsing/Parser.cpp')
-rw-r--r--libsolidity/parsing/Parser.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp
index e844861b..02b7d5e0 100644
--- a/libsolidity/parsing/Parser.cpp
+++ b/libsolidity/parsing/Parser.cpp
@@ -315,7 +315,18 @@ Parser::FunctionHeaderParserResult Parser::parseFunctionHeader(bool _forceEmptyN
m_scanner->next();
}
else if (_allowModifiers && token == Token::Identifier)
- result.modifiers.push_back(parseModifierInvocation());
+ {
+ // This can either be a modifier (function declaration) or the name of the
+ // variable (function type name plus variable).
+ if (
+ m_scanner->peekNextToken() == Token::Semicolon ||
+ m_scanner->peekNextToken() == Token::Assign
+ )
+ // Variable declaration, break here.
+ break;
+ else
+ result.modifiers.push_back(parseModifierInvocation());
+ }
else if (Token::isVisibilitySpecifier(token))
{
if (result.visibility != Declaration::Visibility::Default)