mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
C++ namespace cleanup (except tests).
This commit is contained in:
committed by
Daniel Kirchner
parent
8385256bdc
commit
6b23412fae
@@ -36,11 +36,9 @@
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
using namespace langutil;
|
||||
using namespace solidity::langutil;
|
||||
|
||||
namespace dev
|
||||
{
|
||||
namespace solidity
|
||||
namespace solidity::frontend
|
||||
{
|
||||
|
||||
ASTJsonConverter::ASTJsonConverter(bool _legacy, map<string, unsigned> _sourceIndices):
|
||||
@@ -200,7 +198,7 @@ Json::Value ASTJsonConverter::inlineAssemblyIdentifierToJson(pair<yul::Identifie
|
||||
|
||||
void ASTJsonConverter::print(ostream& _stream, ASTNode const& _node)
|
||||
{
|
||||
_stream << jsonPrettyPrint(toJson(_node));
|
||||
_stream << util::jsonPrettyPrint(toJson(_node));
|
||||
}
|
||||
|
||||
Json::Value&& ASTJsonConverter::toJson(ASTNode const& _node)
|
||||
@@ -792,13 +790,13 @@ bool ASTJsonConverter::visit(ElementaryTypeNameExpression const& _node)
|
||||
bool ASTJsonConverter::visit(Literal const& _node)
|
||||
{
|
||||
Json::Value value{_node.value()};
|
||||
if (!dev::validateUTF8(_node.value()))
|
||||
if (!util::validateUTF8(_node.value()))
|
||||
value = Json::nullValue;
|
||||
Token subdenomination = Token(_node.subDenomination());
|
||||
std::vector<pair<string, Json::Value>> attributes = {
|
||||
make_pair(m_legacy ? "token" : "kind", literalTokenKind(_node.token())),
|
||||
make_pair("value", value),
|
||||
make_pair(m_legacy ? "hexvalue" : "hexValue", toHex(asBytes(_node.value()))),
|
||||
make_pair(m_legacy ? "hexvalue" : "hexValue", util::toHex(util::asBytes(_node.value()))),
|
||||
make_pair(
|
||||
"subdenomination",
|
||||
subdenomination == Token::Illegal ?
|
||||
@@ -869,13 +867,13 @@ string ASTJsonConverter::literalTokenKind(Token _token)
|
||||
{
|
||||
switch (_token)
|
||||
{
|
||||
case dev::solidity::Token::Number:
|
||||
case Token::Number:
|
||||
return "number";
|
||||
case dev::solidity::Token::StringLiteral:
|
||||
case dev::solidity::Token::HexStringLiteral:
|
||||
case Token::StringLiteral:
|
||||
case Token::HexStringLiteral:
|
||||
return "string";
|
||||
case dev::solidity::Token::TrueLiteral:
|
||||
case dev::solidity::Token::FalseLiteral:
|
||||
case Token::TrueLiteral:
|
||||
case Token::FalseLiteral:
|
||||
return "bool";
|
||||
default:
|
||||
solAssert(false, "Unknown kind of literal token.");
|
||||
@@ -893,4 +891,3 @@ string ASTJsonConverter::type(VariableDeclaration const& _varDecl)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user