From e5ccf5e2bed4d55508c90b405c59964c442b0191 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 13 Feb 2015 17:34:46 +0100 Subject: [PATCH] Typo in EnumValue --- libsolidity/AST.cpp | 8 ++++---- libsolidity/AST.h | 14 +++++++------- libsolidity/ASTForward.h | 2 +- libsolidity/ASTPrinter.cpp | 4 ++-- libsolidity/ASTPrinter.h | 4 ++-- libsolidity/ASTVisitor.h | 8 ++++---- libsolidity/AST_accept.h | 4 ++-- libsolidity/Parser.cpp | 6 +++--- libsolidity/Parser.h | 2 +- libsolidity/Types.cpp | 2 +- 10 files changed, 27 insertions(+), 27 deletions(-) diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp index 2baf9dae8..9d7d2169b 100644 --- a/libsolidity/AST.cpp +++ b/libsolidity/AST.cpp @@ -206,7 +206,7 @@ vector, FunctionTypePointer>> const& ContractDefinition::getIn return *m_interfaceFunctionList; } -TypePointer EnumvValue::getType(ContractDefinition const*) const +TypePointer EnumValue::getType(ContractDefinition const*) const { EnumDefinition const* parentDef = dynamic_cast(getScope()); return make_shared(*parentDef); @@ -263,8 +263,8 @@ void StructDefinition::checkRecursion() const void EnumDefinition::checkValidityOfMembers() const { - vector> members(getMembers()); - auto compareDecls = [](ASTPointer a, ASTPointer b) + vector> members(getMembers()); + auto compareDecls = [](ASTPointer a, ASTPointer b) { return a->getName() < b->getName(); }; @@ -283,7 +283,7 @@ TypePointer EnumDefinition::getType(ContractDefinition const*) const unsigned int EnumDefinition::getMemberValue(ASTString const& _member) const { unsigned int index = 0; - for (ASTPointer const& decl: m_members) + for (ASTPointer const& decl: m_members) { if (decl->getName() == _member) return index; diff --git a/libsolidity/AST.h b/libsolidity/AST.h index 11dfef590..3485631ba 100644 --- a/libsolidity/AST.h +++ b/libsolidity/AST.h @@ -168,12 +168,12 @@ private: /** * Declaration of an Enum Value */ -class EnumvValue : public Declaration +class EnumValue: public Declaration { public: - EnumvValue(Location const& _location, - ASTPointer const& _name): - Declaration(_location, _name) {} + EnumValue(Location const& _location, + ASTPointer const& _name): + Declaration(_location, _name) {} virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; @@ -339,12 +339,12 @@ class EnumDefinition: public Declaration public: EnumDefinition(Location const& _location, ASTPointer const& _name, - std::vector> const& _members): + std::vector> const& _members): Declaration(_location, _name), m_members(_members) {} virtual void accept(ASTVisitor& _visitor) override; virtual void accept(ASTConstVisitor& _visitor) const override; - std::vector> const& getMembers() const { return m_members; } + std::vector> const& getMembers() const { return m_members; } virtual TypePointer getType(ContractDefinition const*) const override; @@ -356,7 +356,7 @@ public: private: - std::vector> m_members; + std::vector> m_members; }; /** diff --git a/libsolidity/ASTForward.h b/libsolidity/ASTForward.h index 3370e88a8..0b6817e45 100644 --- a/libsolidity/ASTForward.h +++ b/libsolidity/ASTForward.h @@ -41,7 +41,7 @@ class ContractDefinition; class InheritanceSpecifier; class StructDefinition; class EnumDefinition; -class EnumvValue; +class EnumValue; class ParameterList; class FunctionDefinition; class VariableDeclaration; diff --git a/libsolidity/ASTPrinter.cpp b/libsolidity/ASTPrinter.cpp index dd66bf0d7..d380b0029 100644 --- a/libsolidity/ASTPrinter.cpp +++ b/libsolidity/ASTPrinter.cpp @@ -77,7 +77,7 @@ bool ASTPrinter::visit(EnumDefinition const& _node) return goDeeper(); } -bool ASTPrinter::visit(EnumvValue const& _node) +bool ASTPrinter::visit(EnumValue const& _node) { writeLine("EnumValue \"" + _node.getName() + "\""); return goDeeper(); @@ -364,7 +364,7 @@ void ASTPrinter::endVisit(EnumDefinition const&) m_indentation--; } -void ASTPrinter::endVisit(EnumvValue const&) +void ASTPrinter::endVisit(EnumValue const&) { m_indentation--; } diff --git a/libsolidity/ASTPrinter.h b/libsolidity/ASTPrinter.h index dda2f1c4a..d9072aacc 100644 --- a/libsolidity/ASTPrinter.h +++ b/libsolidity/ASTPrinter.h @@ -47,7 +47,7 @@ public: bool visit(InheritanceSpecifier const& _node) override; bool visit(StructDefinition const& _node) override; bool visit(EnumDefinition const& _node) override; - bool visit(EnumvValue const& _node) override; + bool visit(EnumValue const& _node) override; bool visit(ParameterList const& _node) override; bool visit(FunctionDefinition const& _node) override; bool visit(VariableDeclaration const& _node) override; @@ -88,7 +88,7 @@ public: void endVisit(InheritanceSpecifier const&) override; void endVisit(StructDefinition const&) override; void endVisit(EnumDefinition const&) override; - void endVisit(EnumvValue const&) override; + void endVisit(EnumValue const&) override; void endVisit(ParameterList const&) override; void endVisit(FunctionDefinition const&) override; void endVisit(VariableDeclaration const&) override; diff --git a/libsolidity/ASTVisitor.h b/libsolidity/ASTVisitor.h index 392da7616..a7fa6b1cf 100644 --- a/libsolidity/ASTVisitor.h +++ b/libsolidity/ASTVisitor.h @@ -48,7 +48,7 @@ public: virtual bool visit(InheritanceSpecifier&) { return true; } virtual bool visit(StructDefinition&) { return true; } virtual bool visit(EnumDefinition&) { return true; } - virtual bool visit(EnumvValue&) { return true; } + virtual bool visit(EnumValue&) { return true; } virtual bool visit(ParameterList&) { return true; } virtual bool visit(FunctionDefinition&) { return true; } virtual bool visit(VariableDeclaration&) { return true; } @@ -91,7 +91,7 @@ public: virtual void endVisit(InheritanceSpecifier&) { } virtual void endVisit(StructDefinition&) { } virtual void endVisit(EnumDefinition&) { } - virtual void endVisit(EnumvValue&) { } + virtual void endVisit(EnumValue&) { } virtual void endVisit(ParameterList&) { } virtual void endVisit(FunctionDefinition&) { } virtual void endVisit(VariableDeclaration&) { } @@ -138,7 +138,7 @@ public: virtual bool visit(InheritanceSpecifier const&) { return true; } virtual bool visit(StructDefinition const&) { return true; } virtual bool visit(EnumDefinition const&) { return true; } - virtual bool visit(EnumvValue const&) { return true; } + virtual bool visit(EnumValue const&) { return true; } virtual bool visit(ParameterList const&) { return true; } virtual bool visit(FunctionDefinition const&) { return true; } virtual bool visit(VariableDeclaration const&) { return true; } @@ -181,7 +181,7 @@ public: virtual void endVisit(InheritanceSpecifier const&) { } virtual void endVisit(StructDefinition const&) { } virtual void endVisit(EnumDefinition const&) { } - virtual void endVisit(EnumvValue const&) { } + virtual void endVisit(EnumValue const&) { } virtual void endVisit(ParameterList const&) { } virtual void endVisit(FunctionDefinition const&) { } virtual void endVisit(VariableDeclaration const&) { } diff --git a/libsolidity/AST_accept.h b/libsolidity/AST_accept.h index e6877d937..b71e103df 100644 --- a/libsolidity/AST_accept.h +++ b/libsolidity/AST_accept.h @@ -121,13 +121,13 @@ void EnumDefinition::accept(ASTConstVisitor& _visitor) const _visitor.endVisit(*this); } -void EnumvValue::accept(ASTVisitor& _visitor) +void EnumValue::accept(ASTVisitor& _visitor) { _visitor.visit(*this); _visitor.endVisit(*this); } -void EnumvValue::accept(ASTConstVisitor& _visitor) const +void EnumValue::accept(ASTConstVisitor& _visitor) const { _visitor.visit(*this); _visitor.endVisit(*this); diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp index 3e077261b..28339a464 100644 --- a/libsolidity/Parser.cpp +++ b/libsolidity/Parser.cpp @@ -266,12 +266,12 @@ ASTPointer Parser::parseStructDefinition() return nodeFactory.createNode(name, members); } -ASTPointer Parser::parseEnumDeclaration() +ASTPointer Parser::parseEnumDeclaration() { ASTNodeFactory nodeFactory(*this); ASTPointer name = expectIdentifierToken(); nodeFactory.markEndPosition(); - return nodeFactory.createNode(name); + return nodeFactory.createNode(name); } ASTPointer Parser::parseEnumDefinition() @@ -279,7 +279,7 @@ ASTPointer Parser::parseEnumDefinition() ASTNodeFactory nodeFactory(*this); expectToken(Token::Enum); ASTPointer name = expectIdentifierToken(); - vector> members; + vector> members; expectToken(Token::LBrace); while (m_scanner->getCurrentToken() != Token::RBrace) diff --git a/libsolidity/Parser.h b/libsolidity/Parser.h index 44b14da06..172b45dd5 100644 --- a/libsolidity/Parser.h +++ b/libsolidity/Parser.h @@ -62,7 +62,7 @@ private: ASTPointer parseFunctionDefinition(ASTString const* _contractName); ASTPointer parseStructDefinition(); ASTPointer parseEnumDefinition(); - ASTPointer parseEnumDeclaration(); + ASTPointer parseEnumDeclaration(); ASTPointer parseVariableDeclaration(VarDeclParserOptions const& _options = VarDeclParserOptions()); ASTPointer parseModifierDefinition(); ASTPointer parseEventDefinition(); diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index df62773a9..06c0af320 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -952,7 +952,7 @@ MemberList const& TypeType::getMembers() const else if (m_actualType->getCategory() == Category::Enum) { EnumDefinition const& enumDef = dynamic_cast(*m_actualType).getEnumDefinition(); - for (ASTPointer const& enumValue: enumDef.getMembers()) + for (ASTPointer const& enumValue: enumDef.getMembers()) members.insert(make_pair(enumValue->getName(), make_shared(enumDef))); m_members.reset(new MemberList(members)); }