aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/parser.test.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-11-30 09:05:55 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-11-30 13:03:07 +0200
commit449f183b9eb4da6ceb97fdb5fda1c767760315c2 (patch)
tree336d5b4fdebc0a816ebe9fdcd38f2319ec97aa37 /libbuild2/cc/parser.test.cxx
parentc0303569afe979f3965228835ac902dce2e940c2 (diff)
Add support for module partitions
Diffstat (limited to 'libbuild2/cc/parser.test.cxx')
-rw-r--r--libbuild2/cc/parser.test.cxx17
1 files changed, 13 insertions, 4 deletions
diff --git a/libbuild2/cc/parser.test.cxx b/libbuild2/cc/parser.test.cxx
index 0c023d3..7613741 100644
--- a/libbuild2/cc/parser.test.cxx
+++ b/libbuild2/cc/parser.test.cxx
@@ -43,11 +43,20 @@ namespace build2
parser p;
unit u (p.parse (is, in));
- unit_type ut (u.type);
- if (ut == unit_type::module_iface || ut == unit_type::module_impl)
- cout << (ut == unit_type::module_iface ? "export " : "")
- << "module " << u.module_info.name << ';' << endl;
+ switch (u.type)
+ {
+ case unit_type::module_intf:
+ case unit_type::module_intf_part:
+ cout << "export ";
+ // Fall through.
+ case unit_type::module_impl:
+ case unit_type::module_impl_part:
+ cout << "module " << u.module_info.name << ';' << endl;
+ break;
+ default:
+ break;
+ }
for (const module_import& m: u.module_info.imports)
cout << (m.exported ? "export " : "")