From 449f183b9eb4da6ceb97fdb5fda1c767760315c2 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Nov 2020 09:05:55 +0200 Subject: Add support for module partitions --- libbuild2/cc/parser.test.cxx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'libbuild2/cc/parser.test.cxx') 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 " : "") -- cgit v1.1