aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-10-28 16:25:01 +0800
committerChristian <c@ethdev.com>2014-10-28 16:25:01 +0800
commitfae8ca001ef33041b5ba5debc5a71ecc3eb5645b (patch)
treef92d70422c29f93578a5a2ea30b3f4ba0f3ceb3e
parenta29eb889a201e1ce2149aab7bead809e0a37f291 (diff)
downloaddexon-solidity-fae8ca001ef33041b5ba5debc5a71ecc3eb5645b.tar
dexon-solidity-fae8ca001ef33041b5ba5debc5a71ecc3eb5645b.tar.gz
dexon-solidity-fae8ca001ef33041b5ba5debc5a71ecc3eb5645b.tar.bz2
dexon-solidity-fae8ca001ef33041b5ba5debc5a71ecc3eb5645b.tar.lz
dexon-solidity-fae8ca001ef33041b5ba5debc5a71ecc3eb5645b.tar.xz
dexon-solidity-fae8ca001ef33041b5ba5debc5a71ecc3eb5645b.tar.zst
dexon-solidity-fae8ca001ef33041b5ba5debc5a71ecc3eb5645b.zip
Stylistic corrections.
-rw-r--r--AST.h22
-rw-r--r--Compiler.cpp10
-rw-r--r--NameAndTypeResolver.h16
3 files changed, 22 insertions, 26 deletions
diff --git a/AST.h b/AST.h
index db6637ae..5c975ee4 100644
--- a/AST.h
+++ b/AST.h
@@ -191,8 +191,8 @@ public:
bool isTypeGivenExplicitly() const { return bool(m_typeName); }
TypeName* getTypeName() const { return m_typeName.get(); }
- //! Returns the declared or inferred type. Can be an empty pointer if no type was explicitly
- //! declared and there is no assignment to the variable that fixes the type.
+ /// Returns the declared or inferred type. Can be an empty pointer if no type was explicitly
+ /// declared and there is no assignment to the variable that fixes the type.
std::shared_ptr<Type const> const& getType() const { return m_type; }
void setType(std::shared_ptr<Type const> const& _type) { m_type = _type; }
@@ -281,14 +281,14 @@ public:
explicit Statement(Location const& _location): ASTNode(_location) {}
virtual void accept(ASTVisitor& _visitor) override;
- //! Check all type requirements, throws exception if some requirement is not met.
- //! This includes checking that operators are applicable to their arguments but also that
- //! the number of function call arguments matches the number of formal parameters and so forth.
+ /// Check all type requirements, throws exception if some requirement is not met.
+ /// This includes checking that operators are applicable to their arguments but also that
+ /// the number of function call arguments matches the number of formal parameters and so forth.
virtual void checkTypeRequirements() = 0;
protected:
- //! Helper function, check that the inferred type for @a _expression is @a _expectedType or at
- //! least implicitly convertible to @a _expectedType. If not, throw exception.
+ /// Helper function, check that the inferred type for @a _expression is @a _expectedType or at
+ /// least implicitly convertible to @a _expectedType. If not, throw exception.
void expectType(Expression& _expression, Type const& _expectedType);
};
@@ -407,7 +407,7 @@ public:
std::shared_ptr<Type const> const& getType() const { return m_type; }
protected:
- //! Inferred type of the expression, only filled after a call to checkTypeRequirements().
+ /// Inferred type of the expression, only filled after a call to checkTypeRequirements().
std::shared_ptr<Type const> m_type;
};
@@ -532,8 +532,8 @@ private:
ASTPointer<Expression> m_index;
};
-/// Primary expression, i.e. an expression that do not be divided any further like a literal or
-/// a variable reference.
+/// Primary expression, i.e. an expression that cannot be divided any further. Examples are literals
+/// or variable references.
class PrimaryExpression: public Expression
{
public:
@@ -557,7 +557,7 @@ public:
private:
ASTPointer<ASTString> m_name;
- //! Declaration the name refers to.
+ /// Declaration the name refers to.
Declaration* m_referencedDeclaration;
};
diff --git a/Compiler.cpp b/Compiler.cpp
index acb0a5cc..ef568013 100644
--- a/Compiler.cpp
+++ b/Compiler.cpp
@@ -25,11 +25,9 @@
#include <libsolidity/AST.h>
#include <libsolidity/Compiler.h>
-
namespace dev {
namespace solidity {
-
void CompilerContext::setLabelPosition(uint32_t _label, uint32_t _position)
{
assert(m_labelPositions.find(_label) == m_labelPositions.end());
@@ -63,12 +61,10 @@ bytes ExpressionCompiler::getAssembledBytecode() const
}
for (AssemblyItem const& item: m_assemblyItems)
- {
if (item.getType() == AssemblyItem::Type::LABELREF)
assembled.push_back(m_context.getLabelPosition(item.getLabel()));
else
assembled.push_back(item.getData());
- }
return assembled;
}
@@ -203,17 +199,17 @@ void ExpressionCompiler::endVisit(FunctionCall& _functionCall)
}
}
-void ExpressionCompiler::endVisit(MemberAccess& _memberAccess)
+void ExpressionCompiler::endVisit(MemberAccess&)
{
}
-void ExpressionCompiler::endVisit(IndexAccess& _indexAccess)
+void ExpressionCompiler::endVisit(IndexAccess&)
{
}
-void ExpressionCompiler::endVisit(Identifier& _identifier)
+void ExpressionCompiler::endVisit(Identifier&)
{
}
diff --git a/NameAndTypeResolver.h b/NameAndTypeResolver.h
index 7abcbb0c..055835c4 100644
--- a/NameAndTypeResolver.h
+++ b/NameAndTypeResolver.h
@@ -33,8 +33,8 @@ namespace dev
namespace solidity
{
-//! Resolves name references, resolves all types and checks that all operations are valid for the
-//! inferred types. An exception is throw on the first error.
+/// Resolves name references, resolves all types and checks that all operations are valid for the
+/// inferred types. An exception is throw on the first error.
class NameAndTypeResolver: private boost::noncopyable
{
public:
@@ -46,15 +46,15 @@ public:
private:
void reset();
- //! Maps nodes declaring a scope to scopes, i.e. ContractDefinition, FunctionDeclaration and
- //! StructDefinition (@todo not yet implemented), where nullptr denotes the global scope.
+ /// Maps nodes declaring a scope to scopes, i.e. ContractDefinition, FunctionDeclaration and
+ /// StructDefinition (@todo not yet implemented), where nullptr denotes the global scope.
std::map<ASTNode*, Scope> m_scopes;
Scope* m_currentScope;
};
-//! Traverses the given AST upon construction and fills _scopes with all declarations inside the
-//! AST.
+/// Traverses the given AST upon construction and fills _scopes with all declarations inside the
+/// AST.
class DeclarationRegistrationHelper: private ASTVisitor
{
public:
@@ -78,8 +78,8 @@ private:
Scope* m_currentScope;
};
-//! Resolves references to declarations (of variables and types) and also establishes the link
-//! between a return statement and the return parameter list.
+/// Resolves references to declarations (of variables and types) and also establishes the link
+/// between a return statement and the return parameter list.
class ReferencesResolver: private ASTVisitor
{
public: