aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/cc/parser.test.cxx
diff options
context:
space:
mode:
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 " : "")