From eac8e3d68b9ca67f97c1f9aedef01e8e93cde323 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Mon, 5 Jan 2015 08:43:45 +0800 Subject: Implementing path lookup (bottom level of resolve) --- src/ast/path.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/ast/path.hpp') 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& nodes() { return m_nodes; } -- cgit v1.2.3