summaryrefslogtreecommitdiff
path: root/src/ast/path.hpp
diff options
context:
space:
mode:
authorJohn Hodge (sonata) <tpg@mutabah.net>2015-01-05 08:43:45 +0800
committerJohn Hodge (sonata) <tpg@mutabah.net>2015-01-05 08:43:45 +0800
commiteac8e3d68b9ca67f97c1f9aedef01e8e93cde323 (patch)
tree47fc3f527b7f3d03718277347e13c3ee4bb779d2 /src/ast/path.hpp
parent4a9e7dc0e4976c03a8dbceeacc5e474509b237f9 (diff)
downloadmrust-eac8e3d68b9ca67f97c1f9aedef01e8e93cde323.tar.gz
Implementing path lookup (bottom level of resolve)
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r--src/ast/path.hpp9
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; }