From 5db811ee419fd4288d043b2d4148f17424e15302 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 24 Mar 2015 20:22:16 +0800 Subject: Slow bugfixes --- src/ast/path.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ast/path.cpp') 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& args) m_binding_type = STRUCT; m_binding.struct_ = &ent; } +void Path::bind_struct_member(const Struct& ent, const ::std::vector& 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; -- cgit v1.2.3