diff options
author | John Hodge <tpg@mutabah.net> | 2015-03-31 19:42:05 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2015-03-31 19:42:05 +0800 |
commit | 752202c3857b00d0aa53117573d4a931f79ed65d (patch) | |
tree | c1884c7206604f778c2b8607febd53489e29a7fd /src/ast/path.hpp | |
parent | f725889aedd5b64141e8f8e9924e4e59f716c225 (diff) | |
download | mrust-752202c3857b00d0aa53117573d4a931f79ed65d.tar.gz |
Add Copy impls (hacky), and parameter count checking/extending
Diffstat (limited to 'src/ast/path.hpp')
-rw-r--r-- | src/ast/path.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ast/path.hpp b/src/ast/path.hpp index 21d2dd51..7f45d360 100644 --- a/src/ast/path.hpp +++ b/src/ast/path.hpp @@ -16,6 +16,7 @@ class TypeRef; namespace AST { +class TypeParams; class Crate; class Module; class TypeAlias; @@ -246,7 +247,10 @@ public: m_binding = PathBinding(); } - void resolve(const Crate& crate); + /// Resolve the path, and set up binding + /// + /// expect_params enables checking of param counts (clear for handling 'use') + void resolve(const Crate& crate, bool expect_params=true); bool is_trivial() const { return m_class == RELATIVE && m_nodes.size() == 1 && m_nodes[0].args().size() == 0; @@ -278,6 +282,7 @@ public: friend ::Serialiser& operator<<(Serialiser& s, Path::Class pc); friend void operator>>(Deserialiser& s, Path::Class& pc); private: + void check_param_counts(const TypeParams& params, bool expect_params, PathNode& node); void bind_module(const Module& mod); void bind_enum(const Enum& ent, const ::std::vector<TypeRef>& args); void bind_enum_var(const Enum& ent, const ::std::string& name, const ::std::vector<TypeRef>& args); |