some more style fixes

This commit is contained in:
LianaHus
2015-10-15 16:27:26 +02:00
parent 3871e77946
commit 162d021c3f
7 changed files with 14 additions and 27 deletions
+3 -3
View File
@@ -44,14 +44,14 @@ class NameAndTypeResolver: private boost::noncopyable
public:
NameAndTypeResolver(std::vector<Declaration const*> const& _globals, ErrorList& _errors);
/// Registers all declarations found in the source unit.
/// @returns false in case of type error.
/// @returns false in case of error.
bool registerDeclarations(SourceUnit& _sourceUnit);
/// Resolves all names and types referenced from the given contract.
/// @returns false in case of type error.
/// @returns false in case of error.
bool resolveNamesAndTypes(ContractDefinition& _contract);
/// Updates the given global declaration (used for "this"). Not to be used with declarations
/// that create their own scope.
/// @returns false in case of type error.
/// @returns false in case of error.
bool updateDeclaration(Declaration const& _declaration);
/// Resolves the given @a _name inside the scope @a _scope. If @a _scope is omitted,
+2 -1
View File
@@ -66,7 +66,8 @@ private:
ASTPointer<SourceUnit> Parser::parse(shared_ptr<Scanner> const& _scanner)
{
try{
try
{
m_scanner = _scanner;
ASTNodeFactory nodeFactory(*this);
vector<ASTPointer<ASTNode>> nodes;
+1 -2
View File
@@ -34,8 +34,7 @@ class Scanner;
class Parser
{
public:
Parser(ErrorList& errors):
m_errors(errors){};
Parser(ErrorList& errors): m_errors(errors){};
ASTPointer<SourceUnit> parse(std::shared_ptr<Scanner> const& _scanner);
std::shared_ptr<std::string const> const& sourceName() const;
+1 -14
View File
@@ -43,19 +43,7 @@ bool TypeChecker::checkTypeRequirements(const ContractDefinition& _contract)
if (m_errors.empty())
throw; // Something is weird here, rather throw again.
}
return Error::containsOnlyWarnings(m_errors);
// bool success = true;
// for (auto const& it: m_errors)
// {
// auto e = dynamic_cast<Error const*>(it.get());
// if (e->type() != Error::Type::Warning)
// {
// success = false;
// break;
// }
// }
// return success;
return Error::containsOnlyWarnings(m_errors);
}
TypePointer const& TypeChecker::type(Expression const& _expression) const
@@ -72,7 +60,6 @@ TypePointer const& TypeChecker::type(VariableDeclaration const& _variable) const
bool TypeChecker::visit(ContractDefinition const& _contract)
{
// We force our own visiting order here.
ASTNode::listAccept(_contract.definedStructs(), *this);
ASTNode::listAccept(_contract.baseContracts(), *this);
+1 -1
View File
@@ -42,7 +42,7 @@ namespace solidity
class TypeChecker: private ASTConstVisitor
{
public:
/// @_errors the reference to the list of errors and warnings to add them found during type checking.
/// @param _errors the reference to the list of errors and warnings to add them found during type checking.
TypeChecker(ErrorList& _errors): m_errors(_errors) {}
/// Performs type checking on the given contract and all of its sub-nodes.