mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
changed the position of 'anonymous' keyword: event <name>() anonymous.
- style changes
This commit is contained in:
parent
2986ecbd75
commit
5a5577f5a5
17
AST.h
17
AST.h
@ -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;
|
||||
|
@ -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)
|
||||
|
12
Parser.cpp
12
Parser.cpp
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user