diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-23 09:23:16 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2023-05-29 10:21:12 +0200 |
commit | e05f7c7383cc48823bd408c0bc5187191a9a1c48 (patch) | |
tree | 024bb9c3be9c876b8822388baf1622cad03d7563 /libbuild2/build/script/script.cxx | |
parent | 349b34108752e2fcf1ead648ffec8e5acfe4a91c (diff) |
Explicit group: static members
Diffstat (limited to 'libbuild2/build/script/script.cxx')
-rw-r--r-- | libbuild2/build/script/script.cxx | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/libbuild2/build/script/script.cxx b/libbuild2/build/script/script.cxx index 9d9b5a8..0f31e7f 100644 --- a/libbuild2/build/script/script.cxx +++ b/libbuild2/build/script/script.cxx @@ -58,11 +58,27 @@ namespace build2 { // $> // + // What should it contain for an explicit group? While it may seem + // that just the members should be enough (and analogous to the ad + // hoc case), this won't let us get the group name for diagnostics. + // So the group name followed by all the members seems like the + // logical choice. + // names ns; - for (const target_type* m (&target); - m != nullptr; - m = m->adhoc_member) - m->as_name (ns); + + if (const group* g = target.is_a<group> ()) + { + g->as_name (ns); + for (const target_type* m: g->members) + m->as_name (ns); + } + else + { + for (const target_type* m (&target); + m != nullptr; + m = m->adhoc_member) + m->as_name (ns); + } assign (var_ts) = move (ns); } |