diff options
author | Christian <c@ethdev.com> | 2015-01-29 21:35:28 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2015-01-30 04:26:11 +0800 |
commit | 4a6ed84386ed7bc3abd2b4cf2441b29a5af38816 (patch) | |
tree | a4428b3bd31d3b05383b61e060cd768c4a7604db /AST.cpp | |
parent | 3701543ae8dd8ffbfd58e5648d45699468f10a55 (diff) | |
download | dexon-solidity-4a6ed84386ed7bc3abd2b4cf2441b29a5af38816.tar.gz dexon-solidity-4a6ed84386ed7bc3abd2b4cf2441b29a5af38816.tar.zst dexon-solidity-4a6ed84386ed7bc3abd2b4cf2441b29a5af38816.zip |
Parsing of events.
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -271,6 +271,20 @@ void ModifierInvocation::checkTypeRequirements() BOOST_THROW_EXCEPTION(createTypeError("Invalid type for argument in modifier invocation.")); } +void EventDefinition::checkTypeRequirements() +{ + int numIndexed = 0; + for (ASTPointer<VariableDeclaration> const& var: getParameters()) + { + if (var->isIndexed()) + numIndexed++; + if (!var->getType()->canLiveOutsideStorage()) + BOOST_THROW_EXCEPTION(var->createTypeError("Type is required to live outside storage.")); + } + if (numIndexed > 3) + BOOST_THROW_EXCEPTION(createTypeError("More than 3 indexed arguments for event.")); +} + void Block::checkTypeRequirements() { for (shared_ptr<Statement> const& statement: m_statements) |