From 57abb0703ec640fdcd0b0ac165f742bbc34df533 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 14 Jun 2017 13:06:38 +0200 Subject: Next installment in C++ modules saga: module search, re-export support --- unit-tests/cc/parser/driver.cxx | 5 +++-- unit-tests/cc/parser/module.test | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'unit-tests/cc') diff --git a/unit-tests/cc/parser/driver.cxx b/unit-tests/cc/parser/driver.cxx index cdddaca..5798d9f 100644 --- a/unit-tests/cc/parser/driver.cxx +++ b/unit-tests/cc/parser/driver.cxx @@ -45,8 +45,9 @@ namespace build2 parser p; translation_unit u (p.parse (*is, path (in))); - for (const string& n: u.module_imports) - cout << "import " << n << ';' << endl; + for (const module_import& m: u.module_imports) + cout << (m.exported ? "export " : "") + << "import " << m.name << ';' << endl; if (!u.module_name.empty ()) cout << (u.module_interface ? "export " : "") diff --git a/unit-tests/cc/parser/module.test b/unit-tests/cc/parser/module.test index f2bbaf1..45e621c 100644 --- a/unit-tests/cc/parser/module.test +++ b/unit-tests/cc/parser/module.test @@ -30,12 +30,14 @@ EOI $* <>EOO export import foo; EOI -import foo; +export import foo; EOO : export-imported-block : $* <>EOO +import bar; + export {import foo;} export @@ -50,8 +52,8 @@ export import bar; } EOI -import foo; -import bar; +export import bar; +export import foo; EOO : non-module -- cgit v1.1