summaryrefslogtreecommitdiff
path: root/src/ast/path.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2015-03-24 20:22:16 +0800
committerJohn Hodge <tpg@mutabah.net>2015-03-24 20:22:16 +0800
commit5db811ee419fd4288d043b2d4148f17424e15302 (patch)
treeb732602bd6938cecbff23d4ab4f751160dea849e /src/ast/path.cpp
parentc2ddc804aef34ed7593d0123a3f2403a769e2ed0 (diff)
downloadmrust-5db811ee419fd4288d043b2d4148f17424e15302.tar.gz
Slow bugfixes
Diffstat (limited to 'src/ast/path.cpp')
-rw-r--r--src/ast/path.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/ast/path.cpp b/src/ast/path.cpp
index 6109fa94..1e2760ef 100644
--- a/src/ast/path.cpp
+++ b/src/ast/path.cpp
@@ -202,7 +202,8 @@ void Path::resolve(const Crate& root_crate)
goto ret;
}
else if( is_sec_last ) {
- throw ParseError::Todo("Path::resolve() struct method");
+ bind_struct_member(str, node.args(), m_nodes[i+1]);
+ goto ret;
}
else {
throw ParseError::Generic("Import of struct, too many extra nodes");
@@ -333,6 +334,12 @@ void Path::bind_struct(const Struct& ent, const ::std::vector<TypeRef>& args)
m_binding_type = STRUCT;
m_binding.struct_ = &ent;
}
+void Path::bind_struct_member(const Struct& ent, const ::std::vector<TypeRef>& args, const PathNode& member_node)
+{
+ DEBUG("Binding to struct item. This needs to be deferred");
+ m_binding_type = STRUCT_METHOD;
+ m_binding.struct_ = &ent;
+}
void Path::bind_static(const Static& ent)
{
m_binding_type = STATIC;