aboutsummaryrefslogtreecommitdiffstats
path: root/AST.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2015-01-29 21:35:28 +0800
committerChristian <c@ethdev.com>2015-01-30 04:26:11 +0800
commit4a6ed84386ed7bc3abd2b4cf2441b29a5af38816 (patch)
treea4428b3bd31d3b05383b61e060cd768c4a7604db /AST.cpp
parent3701543ae8dd8ffbfd58e5648d45699468f10a55 (diff)
downloaddexon-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.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/AST.cpp b/AST.cpp
index bc6be600..82d58d2a 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -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)