From 4a9e7dc0e4976c03a8dbceeacc5e474509b237f9 Mon Sep 17 00:00:00 2001 From: "John Hodge (sonata)" Date: Sun, 4 Jan 2015 09:42:53 +0800 Subject: Hacking up 'use' resolution (needs work to handle recursion) --- src/parse/root.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/parse/root.cpp') diff --git a/src/parse/root.cpp b/src/parse/root.cpp index e922b39f..1c2582f7 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -483,7 +483,7 @@ AST::Impl Parse_Impl(TokenStream& lex) void Parse_Use_Wildcard(const AST::Path& base_path, ::std::function fcn) { - throw ParseError::Todo("Wildcard imports"); + fcn(base_path, ""); // HACK! Empty path indicates wilcard import } void Parse_Use(Preproc& lex, ::std::function fcn) @@ -520,8 +520,9 @@ void Parse_Use(Preproc& lex, ::std::function fcn throw ParseError::Todo("Parse_Use - multiples"); break; case TOK_STAR: - throw ParseError::Todo("Parse_Use - wildcard/glob"); - break; + Parse_Use_Wildcard(path, fcn); + // early return - can't have anything else after + return; default: throw ParseError::Unexpected(tok); } -- cgit v1.2.3