diff options
author | Christian <c@ethdev.com> | 2014-10-25 01:06:30 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-10-25 01:42:38 +0800 |
commit | 6a96b6b5ad090ed42aaebafe9ed2dbb922562b37 (patch) | |
tree | 3f1a498f427e3711cca12ca30d69f7185a776832 /AST.cpp | |
parent | 58be273506bf30619952eedf4c469879050c05ed (diff) | |
download | dexon-solidity-6a96b6b5ad090ed42aaebafe9ed2dbb922562b37.tar dexon-solidity-6a96b6b5ad090ed42aaebafe9ed2dbb922562b37.tar.gz dexon-solidity-6a96b6b5ad090ed42aaebafe9ed2dbb922562b37.tar.bz2 dexon-solidity-6a96b6b5ad090ed42aaebafe9ed2dbb922562b37.tar.lz dexon-solidity-6a96b6b5ad090ed42aaebafe9ed2dbb922562b37.tar.xz dexon-solidity-6a96b6b5ad090ed42aaebafe9ed2dbb922562b37.tar.zst dexon-solidity-6a96b6b5ad090ed42aaebafe9ed2dbb922562b37.zip |
Removed std:: where it made sense.
Diffstat (limited to 'AST.cpp')
-rw-r--r-- | AST.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
@@ -26,6 +26,8 @@ #include <libsolidity/ASTVisitor.h> #include <libsolidity/Exceptions.h> +using namespace std; + namespace dev { namespace solidity @@ -248,7 +250,7 @@ void Literal::accept(ASTVisitor& _visitor) _visitor.endVisit(*this); } -TypeError ASTNode::createTypeError(std::string const& _description) +TypeError ASTNode::createTypeError(string const& _description) { return TypeError() << errinfo_sourceLocation(getLocation()) << errinfo_comment(_description); } @@ -263,7 +265,7 @@ void Statement::expectType(Expression& _expression, const Type& _expectedType) void Block::checkTypeRequirements() { - for (std::shared_ptr<Statement> const& statement: m_statements) + for (shared_ptr<Statement> const& statement: m_statements) statement->checkTypeRequirements(); } @@ -354,7 +356,7 @@ void BinaryOperation::checkTypeRequirements() else BOOST_THROW_EXCEPTION(createTypeError("No common type found in binary operation.")); if (Token::isCompareOp(m_operator)) - m_type = std::make_shared<BoolType>(); + m_type = make_shared<BoolType>(); else { assert(Token::isBinaryOp(m_operator)); @@ -392,7 +394,7 @@ void FunctionCall::checkTypeRequirements() FunctionType const* function = dynamic_cast<FunctionType const*>(expressionType); assert(function); FunctionDefinition const& fun = function->getFunction(); - std::vector<ASTPointer<VariableDeclaration>> const& parameters = fun.getParameters(); + vector<ASTPointer<VariableDeclaration>> const& parameters = fun.getParameters(); if (parameters.size() != m_arguments.size()) BOOST_THROW_EXCEPTION(createTypeError("Wrong argument count for function call.")); for (size_t i = 0; i < m_arguments.size(); ++i) @@ -401,7 +403,7 @@ void FunctionCall::checkTypeRequirements() // @todo actually the return type should be an anonymous struct, // but we change it to the type of the first return value until we have structs if (fun.getReturnParameterList()->getParameters().empty()) - m_type = std::make_shared<VoidType>(); + m_type = make_shared<VoidType>(); else m_type = fun.getReturnParameterList()->getParameters().front()->getType(); } @@ -449,7 +451,7 @@ void Identifier::checkTypeRequirements() if (structDef) { // note that we do not have a struct type here - m_type = std::make_shared<TypeType>(std::make_shared<StructType>(*structDef)); + m_type = make_shared<TypeType>(make_shared<StructType>(*structDef)); return; } FunctionDefinition* functionDef = dynamic_cast<FunctionDefinition*>(m_referencedDeclaration); @@ -458,13 +460,13 @@ void Identifier::checkTypeRequirements() // a function reference is not a TypeType, because calling a TypeType converts to the type. // Calling a function (e.g. function(12), otherContract.function(34)) does not do a type // conversion. - m_type = std::make_shared<FunctionType>(*functionDef); + m_type = make_shared<FunctionType>(*functionDef); return; } ContractDefinition* contractDef = dynamic_cast<ContractDefinition*>(m_referencedDeclaration); if (contractDef) { - m_type = std::make_shared<TypeType>(std::make_shared<ContractType>(*contractDef)); + m_type = make_shared<TypeType>(make_shared<ContractType>(*contractDef)); return; } assert(false); // declaration reference of unknown/forbidden type @@ -472,7 +474,7 @@ void Identifier::checkTypeRequirements() void ElementaryTypeNameExpression::checkTypeRequirements() { - m_type = std::make_shared<TypeType>(Type::fromElementaryTypeName(m_typeToken)); + m_type = make_shared<TypeType>(Type::fromElementaryTypeName(m_typeToken)); } void Literal::checkTypeRequirements() |