diff options
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 7 | ||||
-rw-r--r-- | libsolidity/parsing/Token.h | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 1bffa5d7..0e99d1e7 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -305,6 +305,7 @@ ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(ASTString const* options.allowLocationSpecifier = true; ASTPointer<ParameterList> parameters(parseParameterList(options)); bool isDeclaredConst = false; + bool isPayable = false; Declaration::Visibility visibility(Declaration::Visibility::Default); vector<ASTPointer<ModifierInvocation>> modifiers; while (true) @@ -315,6 +316,11 @@ ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(ASTString const* isDeclaredConst = true; m_scanner->next(); } + else if (m_scanner->currentToken() == Token::Payable) + { + isPayable = true; + m_scanner->next(); + } else if (token == Token::Identifier) modifiers.push_back(parseModifierInvocation()); else if (Token::isVisibilitySpecifier(token)) @@ -354,6 +360,7 @@ ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(ASTString const* isDeclaredConst, modifiers, returnParameters, + isPayable, block ); } diff --git a/libsolidity/parsing/Token.h b/libsolidity/parsing/Token.h index 15d4860f..cc85b610 100644 --- a/libsolidity/parsing/Token.h +++ b/libsolidity/parsing/Token.h @@ -166,6 +166,7 @@ namespace solidity K(Memory, "memory", 0) \ K(Modifier, "modifier", 0) \ K(New, "new", 0) \ + K(Payable, "payable", 0) \ K(Public, "public", 0) \ K(Pragma, "pragma", 0) \ K(Private, "private", 0) \ @@ -229,7 +230,6 @@ namespace solidity K(Let, "let", 0) \ K(Match, "match", 0) \ K(Of, "of", 0) \ - K(Payable, "payable", 0) \ K(Relocatable, "relocatable", 0) \ K(Static, "static", 0) \ K(Switch, "switch", 0) \ |