diff --git a/libsolidity/Parser.cpp b/libsolidity/Parser.cpp index 0506bc3e3..2a76a05a8 100644 --- a/libsolidity/Parser.cpp +++ b/libsolidity/Parser.cpp @@ -26,12 +26,14 @@ #include #include +using namespace std; + namespace dev { namespace solidity { -ASTPointer Parser::parse(std::shared_ptr const& _scanner) +ASTPointer Parser::parse(shared_ptr const& _scanner) { m_scanner = _scanner; return parseContractDefinition(); @@ -55,7 +57,7 @@ public: { if (m_location.end < 0) markEndPosition(); - return std::make_shared(m_location, std::forward(_args)...); + return make_shared(m_location, forward(_args)...); } private: @@ -79,9 +81,9 @@ ASTPointer Parser::parseContractDefinition() expectToken(Token::CONTRACT); ASTPointer name = expectIdentifierToken(); expectToken(Token::LBRACE); - std::vector> structs; - std::vector> stateVariables; - std::vector> functions; + vector> structs; + vector> stateVariables; + vector> functions; bool visibilityIsPublic = true; while (true) { @@ -119,7 +121,7 @@ ASTPointer Parser::parseFunctionDefinition(bool _isPublic) ASTNodeFactory nodeFactory(*this); ASTPointer docstring; if (m_scanner->getCurrentCommentLiteral() != "") - docstring = std::make_shared(m_scanner->getCurrentCommentLiteral()); + docstring = make_shared(m_scanner->getCurrentCommentLiteral()); expectToken(Token::FUNCTION); ASTPointer name(expectIdentifierToken()); @@ -142,7 +144,7 @@ ASTPointer Parser::parseFunctionDefinition(bool _isPublic) // create an empty parameter list at a zero-length location ASTNodeFactory nodeFactory(*this); nodeFactory.setLocationEmpty(); - returnParameters = nodeFactory.createNode(std::vector>()); + returnParameters = nodeFactory.createNode(vector>()); } ASTPointer block = parseBlock(); nodeFactory.setEndPositionFromNode(block); @@ -156,7 +158,7 @@ ASTPointer Parser::parseStructDefinition() ASTNodeFactory nodeFactory(*this); expectToken(Token::STRUCT); ASTPointer name = expectIdentifierToken(); - std::vector> members; + vector> members; expectToken(Token::LBRACE); while (m_scanner->getCurrentToken() != Token::RBRACE) { @@ -228,7 +230,7 @@ ASTPointer Parser::parseMapping() ASTPointer Parser::parseParameterList(bool _allowEmpty) { ASTNodeFactory nodeFactory(*this); - std::vector> parameters; + vector> parameters; expectToken(Token::LPAREN); if (!_allowEmpty || m_scanner->getCurrentToken() != Token::RPAREN) { @@ -249,7 +251,7 @@ ASTPointer Parser::parseBlock() { ASTNodeFactory nodeFactory(*this); expectToken(Token::LBRACE); - std::vector> statements; + vector> statements; while (m_scanner->getCurrentToken() != Token::RBRACE) statements.push_back(parseStatement()); nodeFactory.markEndPosition(); @@ -447,7 +449,7 @@ ASTPointer Parser::parseLeftHandSideExpression() case Token::LPAREN: { m_scanner->next(); - std::vector> arguments = parseFunctionCallArguments(); + vector> arguments = parseFunctionCallArguments(); nodeFactory.markEndPosition(); expectToken(Token::RPAREN); expression = nodeFactory.createNode(expression, arguments); @@ -503,9 +505,9 @@ ASTPointer Parser::parsePrimaryExpression() return expression; } -std::vector> Parser::parseFunctionCallArguments() +vector> Parser::parseFunctionCallArguments() { - std::vector> arguments; + vector> arguments; if (m_scanner->getCurrentToken() != Token::RPAREN) { arguments.push_back(parseExpression()); @@ -521,7 +523,7 @@ std::vector> Parser::parseFunctionCallArguments() void Parser::expectToken(Token::Value _value) { if (m_scanner->getCurrentToken() != _value) - BOOST_THROW_EXCEPTION(createParserError(std::string("Expected token ") + std::string(Token::getName(_value)))); + BOOST_THROW_EXCEPTION(createParserError(string("Expected token ") + string(Token::getName(_value)))); m_scanner->next(); } @@ -543,12 +545,12 @@ ASTPointer Parser::expectIdentifierToken() ASTPointer Parser::getLiteralAndAdvance() { - ASTPointer identifier = std::make_shared(m_scanner->getCurrentLiteral()); + ASTPointer identifier = make_shared(m_scanner->getCurrentLiteral()); m_scanner->next(); return identifier; } -ParserError Parser::createParserError(std::string const& _description) const +ParserError Parser::createParserError(string const& _description) const { return ParserError() << errinfo_sourcePosition(getPosition()) << errinfo_comment(_description); }