summaryrefslogtreecommitdiff
path: root/src/parse/root.cpp
diff options
context:
space:
mode:
authorJohn Hodge (sonata) <tpg@mutabah.net>2015-01-04 09:42:53 +0800
committerJohn Hodge (sonata) <tpg@mutabah.net>2015-01-04 09:42:53 +0800
commit4a9e7dc0e4976c03a8dbceeacc5e474509b237f9 (patch)
tree5696f6f2fe862fe0a548444a188dd1fdbd831341 /src/parse/root.cpp
parent5fae00d74e717a703d1bbc90536a003a205eae95 (diff)
downloadmrust-4a9e7dc0e4976c03a8dbceeacc5e474509b237f9.tar.gz
Hacking up 'use' resolution (needs work to handle recursion)
Diffstat (limited to 'src/parse/root.cpp')
-rw-r--r--src/parse/root.cpp7
1 files changed, 4 insertions, 3 deletions
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<void(AST::Path, ::std::string)> fcn)
{
- throw ParseError::Todo("Wildcard imports");
+ fcn(base_path, ""); // HACK! Empty path indicates wilcard import
}
void Parse_Use(Preproc& lex, ::std::function<void(AST::Path, ::std::string)> fcn)
@@ -520,8 +520,9 @@ void Parse_Use(Preproc& lex, ::std::function<void(AST::Path, ::std::string)> 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);
}