diff options
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r-- | src/ast/path.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ast/path.hpp b/src/ast/path.hpp index 182802f2..05439e06 100644 --- a/src/ast/path.hpp +++ b/src/ast/path.hpp @@ -11,6 +11,8 @@ class TypeRef; namespace AST { +class Crate; + class TypeParam { public: @@ -73,6 +75,11 @@ public: ret.m_nodes.push_back(ent); return ret; } + Path operator+(PathNode&& pn) const { + Path tmp; + tmp.append( ::std::move(pn) ); + return Path(*this) += tmp; + } Path operator+(const ::std::string& s) const { Path tmp; tmp.append(PathNode(s, {})); @@ -87,6 +94,8 @@ public: m_nodes.push_back(node); } + void resolve(const Crate& crate); + bool is_relative() const { return m_class == RELATIVE; } size_t size() const { return m_nodes.size(); } ::std::vector<PathNode>& nodes() { return m_nodes; } |