diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2016-08-27 02:37:10 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2016-09-06 03:28:28 +0800 |
commit | 962531af96a8a3ed6b28462d43c69d78fa48d511 (patch) | |
tree | 596929bcbcc12d93597067057edb3311de88af5a /libsolidity/parsing | |
parent | 680b83b2a44a8f943d6d78028ad4326f4b3b64c2 (diff) | |
download | dexon-solidity-962531af96a8a3ed6b28462d43c69d78fa48d511.tar.gz dexon-solidity-962531af96a8a3ed6b28462d43c69d78fa48d511.tar.zst dexon-solidity-962531af96a8a3ed6b28462d43c69d78fa48d511.zip |
Merged in changes from chriseth/payable
Diffstat (limited to 'libsolidity/parsing')
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 1d76f80a..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)) @@ -326,12 +332,6 @@ ASTPointer<FunctionDefinition> Parser::parseFunctionDefinition(ASTString const* else break; } - bool isPayable = false; - if (m_scanner->currentToken() == Token::Payable) - { - isPayable = true; - m_scanner->next(); - } ASTPointer<ParameterList> returnParameters; if (m_scanner->currentToken() == Token::Returns) { |