diff options
author | LianaHus <liana@ethdev.com> | 2015-09-15 22:33:14 +0800 |
---|---|---|
committer | LianaHus <liana@ethdev.com> | 2015-09-16 19:25:32 +0800 |
commit | 279a36b6f8249df48b92574437f57742897841a5 (patch) | |
tree | b40646e4a672ed61610c15a8e3bd28040436acae /libsolidity/Parser.cpp | |
parent | 9d43f2c186d1ad4027d42f6b155bea5500efa0e5 (diff) | |
download | dexon-solidity-279a36b6f8249df48b92574437f57742897841a5.tar dexon-solidity-279a36b6f8249df48b92574437f57742897841a5.tar.gz dexon-solidity-279a36b6f8249df48b92574437f57742897841a5.tar.bz2 dexon-solidity-279a36b6f8249df48b92574437f57742897841a5.tar.lz dexon-solidity-279a36b6f8249df48b92574437f57742897841a5.tar.xz dexon-solidity-279a36b6f8249df48b92574437f57742897841a5.tar.zst dexon-solidity-279a36b6f8249df48b92574437f57742897841a5.zip |
throw statement implementation
Diffstat (limited to 'libsolidity/Parser.cpp')
-rw-r--r-- | libsolidity/Parser.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp index 24f7734c..ac9e04c8 100644 --- a/libsolidity/Parser.cpp +++ b/libsolidity/Parser.cpp @@ -622,6 +622,16 @@ ASTPointer<Statement> Parser::parseStatement() statement = nodeFactory.createNode<Return>(expression); break; } + case Token::Throw: + { + ASTNodeFactory nodeFactory(*this); + ASTPointer<Expression> expression; + if (m_scanner->next() != Token::Semicolon) + BOOST_THROW_EXCEPTION(createParserError("Throw statement cannot have parameters.")); + + statement = nodeFactory.createNode<Throw>(/*expression*/); + break; + } case Token::Identifier: if (m_insideModifier && m_scanner->currentLiteral() == "_") { |