diff options
author | Christian Parpart <christian@ethereum.org> | 2018-11-15 00:11:55 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2018-11-22 03:13:44 +0800 |
commit | d67322a1861d60a88151f7c25d6c3478a9a39acf (patch) | |
tree | af485e48c3436cd24e2db09a6a1bcf445605bae1 /libsolidity/ast | |
parent | 80371e2d25ce3eb868d6f75b99a54af9dc6c1583 (diff) | |
download | dexon-solidity-d67322a1861d60a88151f7c25d6c3478a9a39acf.tar.gz dexon-solidity-d67322a1861d60a88151f7c25d6c3478a9a39acf.tar.zst dexon-solidity-d67322a1861d60a88151f7c25d6c3478a9a39acf.zip |
Introduce namespace `langutil` in liblangutil directory.
Also:
- Use {}-style list initialisation for SourceLocation construction
- Introduce new system includes
- Changes the API of the Scanner to take source as value (with move) as opposed to as a reference
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/AST.h | 4 | ||||
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.cpp | 1 | ||||
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.h | 7 | ||||
-rw-r--r-- | libsolidity/ast/ASTPrinter.cpp | 1 | ||||
-rw-r--r-- | libsolidity/ast/Types.cpp | 1 | ||||
-rw-r--r-- | libsolidity/ast/Types.h | 2 |
6 files changed, 13 insertions, 3 deletions
diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 2c44841e..d23562ad 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -23,8 +23,8 @@ #pragma once +#include <libsolidity/parsing/Token.h> #include <libsolidity/ast/ASTForward.h> -#include <liblangutil/Token.h> #include <libsolidity/ast/Types.h> #include <libsolidity/ast/ASTAnnotations.h> #include <libsolidity/ast/ASTEnums.h> @@ -58,6 +58,8 @@ class ASTConstVisitor; class ASTNode: private boost::noncopyable { public: + using SourceLocation = langutil::SourceLocation; + explicit ASTNode(SourceLocation const& _location); virtual ~ASTNode(); diff --git a/libsolidity/ast/ASTJsonConverter.cpp b/libsolidity/ast/ASTJsonConverter.cpp index 2d26ce8a..6b9f7227 100644 --- a/libsolidity/ast/ASTJsonConverter.cpp +++ b/libsolidity/ast/ASTJsonConverter.cpp @@ -27,6 +27,7 @@ #include <libsolidity/inlineasm/AsmPrinter.h> using namespace std; +using namespace langutil; namespace dev { diff --git a/libsolidity/ast/ASTJsonConverter.h b/libsolidity/ast/ASTJsonConverter.h index da0d840a..dec3ac96 100644 --- a/libsolidity/ast/ASTJsonConverter.h +++ b/libsolidity/ast/ASTJsonConverter.h @@ -29,6 +29,11 @@ #include <libsolidity/ast/ASTAnnotations.h> #include <json/json.h> +namespace langutil +{ +struct SourceLocation; +} + namespace dev { namespace solidity @@ -120,7 +125,7 @@ private: std::string const& _nodeName, std::vector<std::pair<std::string, Json::Value>>&& _attributes ); - std::string sourceLocationToString(SourceLocation const& _location) const; + std::string sourceLocationToString(langutil::SourceLocation const& _location) const; static std::string namePathToString(std::vector<ASTString> const& _namePath); static Json::Value idOrNull(ASTNode const* _pt) { diff --git a/libsolidity/ast/ASTPrinter.cpp b/libsolidity/ast/ASTPrinter.cpp index 255cb9be..cdc6ae7d 100644 --- a/libsolidity/ast/ASTPrinter.cpp +++ b/libsolidity/ast/ASTPrinter.cpp @@ -28,6 +28,7 @@ #include <boost/algorithm/string/join.hpp> using namespace std; +using namespace langutil; namespace dev { diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index 4b31d2e8..0eab75aa 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -45,6 +45,7 @@ using namespace std; using namespace dev; +using namespace langutil; using namespace dev::solidity; namespace diff --git a/libsolidity/ast/Types.h b/libsolidity/ast/Types.h index 79a656e9..482d6735 100644 --- a/libsolidity/ast/Types.h +++ b/libsolidity/ast/Types.h @@ -25,7 +25,7 @@ #include <liblangutil/Exceptions.h> #include <libsolidity/ast/ASTForward.h> #include <libsolidity/ast/ASTEnums.h> -#include <liblangutil/Token.h> +#include <libsolidity/parsing/Token.h> #include <libdevcore/Common.h> #include <libdevcore/CommonIO.h> |