diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-04-11 14:44:32 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-04-30 16:56:08 +0200 |
commit | a14b9bc18431c6aed8441261d28b6ff20bd25935 (patch) | |
tree | ae1f07caef838b5b03fa3f82a2cfccbb62b24ed3 /build2/cc/parser.test.cxx | |
parent | ca0f9c71be279aee845bf5328ac0af8c02c8849e (diff) |
Initial take on header unit and include translation support
Diffstat (limited to 'build2/cc/parser.test.cxx')
-rw-r--r-- | build2/cc/parser.test.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/build2/cc/parser.test.cxx b/build2/cc/parser.test.cxx index ab42e31..2269a28 100644 --- a/build2/cc/parser.test.cxx +++ b/build2/cc/parser.test.cxx @@ -39,15 +39,16 @@ namespace build2 } parser p; - translation_unit u (p.parse (is, path (file))); + unit u (p.parse (is, path (file))); + unit_type ut (u.type); - for (const module_import& m: u.mod.imports) + for (const module_import& m: u.module_info.imports) cout << (m.exported ? "export " : "") << "import " << m.name << ';' << endl; - if (!u.mod.name.empty ()) - cout << (u.mod.iface ? "export " : "") - << "module " << u.mod.name << ';' << endl; + if (ut == unit_type::module_iface || ut == unit_type::module_impl) + cout << (ut == unit_type::module_iface ? "export " : "") + << "module " << u.module_info.name << ';' << endl; } catch (const failed&) { |