diff options
author | Liana Husikyan <liana@ethdev.com> | 2015-03-17 17:48:46 +0800 |
---|---|---|
committer | Liana Husikyan <liana@ethdev.com> | 2015-03-17 21:25:13 +0800 |
commit | 5a5577f5a5e8ef590810651e55a9a3192a0bf31c (patch) | |
tree | 45dba4eca00137d24289ba26f858a8945cfe3144 | |
parent | 2986ecbd753ad0e3f76c98280e68f7f9a464518f (diff) | |
download | dexon-solidity-5a5577f5a5e8ef590810651e55a9a3192a0bf31c.tar dexon-solidity-5a5577f5a5e8ef590810651e55a9a3192a0bf31c.tar.gz dexon-solidity-5a5577f5a5e8ef590810651e55a9a3192a0bf31c.tar.bz2 dexon-solidity-5a5577f5a5e8ef590810651e55a9a3192a0bf31c.tar.lz dexon-solidity-5a5577f5a5e8ef590810651e55a9a3192a0bf31c.tar.xz dexon-solidity-5a5577f5a5e8ef590810651e55a9a3192a0bf31c.tar.zst dexon-solidity-5a5577f5a5e8ef590810651e55a9a3192a0bf31c.zip |
changed the position of 'anonymous' keyword: event <name>() anonymous.
- style changes
-rw-r--r-- | AST.h | 17 | ||||
-rw-r--r-- | ExpressionCompiler.cpp | 2 | ||||
-rw-r--r-- | Parser.cpp | 12 |
3 files changed, 18 insertions, 13 deletions
@@ -553,12 +553,17 @@ private: class EventDefinition: public Declaration, public VariableScope, public Documented { public: - EventDefinition(SourceLocation const& _location, - ASTPointer<ASTString> const& _name, - ASTPointer<ASTString> const& _documentation, - ASTPointer<ParameterList> const& _parameters, - bool _anonymous = false): - Declaration(_location, _name), Documented(_documentation), m_parameters(_parameters) , m_anonymous(_anonymous){} + EventDefinition( + SourceLocation const& _location, + ASTPointer<ASTString> const& _name, + ASTPointer<ASTString> const& _documentation, + ASTPointer<ParameterList> 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 99673edd..bff27e9c 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) @@ -388,18 +388,18 @@ ASTPointer<EventDefinition> Parser::parseEventDefinition() docstring = make_shared<ASTString>(m_scanner->getCurrentCommentLiteral()); expectToken(Token::Event); - bool anonymous = false; - if (m_scanner->getCurrentToken() == Token::Anonymous) - { - anonymous = true; - m_scanner->next(); - } ASTPointer<ASTString> name(expectIdentifierToken()); ASTPointer<ParameterList> 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<EventDefinition>(name, docstring, parameters, anonymous); |