From 5a5577f5a5e8ef590810651e55a9a3192a0bf31c Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Tue, 17 Mar 2015 10:48:46 +0100 Subject: [PATCH] changed the position of 'anonymous' keyword: event () anonymous. - style changes --- AST.h | 17 +++++++++++------ ExpressionCompiler.cpp | 2 +- Parser.cpp | 12 ++++++------ 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/AST.h b/AST.h index c0ae3c164..5564d83db 100644 --- a/AST.h +++ b/AST.h @@ -553,12 +553,17 @@ private: class EventDefinition: public Declaration, public VariableScope, public Documented { public: - EventDefinition(SourceLocation const& _location, - ASTPointer const& _name, - ASTPointer const& _documentation, - ASTPointer const& _parameters, - bool _anonymous = false): - Declaration(_location, _name), Documented(_documentation), m_parameters(_parameters) , m_anonymous(_anonymous){} + EventDefinition( + SourceLocation const& _location, + ASTPointer const& _name, + ASTPointer const& _documentation, + ASTPointer const& _parameters, + bool _anonymous = false + ): + Declaration(_location, _name), + Documented(_documentation), + m_parameters(_parameters), + m_anonymous(_anonymous){} virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; diff --git a/ExpressionCompiler.cpp b/ExpressionCompiler.cpp index 99673edde..bff27e9c7 100644 --- a/ExpressionCompiler.cpp +++ b/ExpressionCompiler.cpp @@ -547,7 +547,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) m_context << u256(h256::Arith(dev::sha3(function.getCanonicalSignature(event.getName())))); ++numIndexed; } - solAssert(numIndexed <= 4 - (event.IsAnonymous() ? 1 : 0), "Too many indexed arguments."); + solAssert(numIndexed <= 4, "Too many indexed arguments."); // Copy all non-indexed arguments to memory (data) m_context << u256(0); for (unsigned arg = 0; arg < arguments.size(); ++arg) diff --git a/Parser.cpp b/Parser.cpp index 098a38344..393d2734e 100644 --- a/Parser.cpp +++ b/Parser.cpp @@ -388,18 +388,18 @@ ASTPointer Parser::parseEventDefinition() docstring = make_shared(m_scanner->getCurrentCommentLiteral()); expectToken(Token::Event); - bool anonymous = false; - if (m_scanner->getCurrentToken() == Token::Anonymous) - { - anonymous = true; - m_scanner->next(); - } ASTPointer name(expectIdentifierToken()); ASTPointer parameters; if (m_scanner->getCurrentToken() == Token::LParen) parameters = parseParameterList(true, true); else parameters = createEmptyParameterList(); + bool anonymous = false; + if (m_scanner->getCurrentToken() == Token::Anonymous) + { + anonymous = true; + m_scanner->next(); + } nodeFactory.markEndPosition(); expectToken(Token::Semicolon); return nodeFactory.createNode(name, docstring, parameters, anonymous);