aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2023-05-23 09:21:40 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2023-05-29 10:20:56 +0200
commit349b34108752e2fcf1ead648ffec8e5acfe4a91c (patch)
treee7b3a980a4720a230d705a4b175299ed449aaa4f /libbuild2/parser.hxx
parenta020c97722dc8b3d2bfc93eb4f344821b1c8af18 (diff)
Explicit group: syntax parsing
Diffstat (limited to 'libbuild2/parser.hxx')
-rw-r--r--libbuild2/parser.hxx37
1 files changed, 14 insertions, 23 deletions
diff --git a/libbuild2/parser.hxx b/libbuild2/parser.hxx
index eea8507..d97cd7b 100644
--- a/libbuild2/parser.hxx
+++ b/libbuild2/parser.hxx
@@ -178,24 +178,29 @@ namespace build2
const target_type* = nullptr,
const string& = {});
- // Ad hoc target names inside < ... >.
+ // Group target names inside < ... >.
//
- struct adhoc_names_loc
+ struct group_names_loc
{
+ bool expl = false; // True -- explicit group, fase -- ad hoc.
+ location group_loc; // Group/primary target location.
+ location member_loc; // Members location.
names ns;
- location loc;
};
- using adhoc_names = small_vector<adhoc_names_loc, 1>;
+ using group_names = small_vector<group_names_loc, 1>;
vector<reference_wrapper<target>>
- enter_adhoc_members (adhoc_names_loc&&, bool);
+ enter_explicit_members (group_names_loc&&, bool);
+
+ vector<reference_wrapper<target>>
+ enter_adhoc_members (group_names_loc&&, bool);
small_vector<pair<reference_wrapper<target>, // Target.
vector<reference_wrapper<target>>>, // Ad hoc members.
1>
enter_targets (names&&, const location&,
- adhoc_names&&,
+ group_names&&,
size_t,
const attributes&);
@@ -205,7 +210,7 @@ namespace build2
void
parse_dependency (token&, token_type&,
names&&, const location&,
- adhoc_names&&,
+ group_names&&,
names&&, const location&,
const attributes&);
@@ -414,14 +419,7 @@ namespace build2
const string* separators = &name_separators)
{
names ns;
- parse_names (t, tt,
- ns,
- pmode,
- chunk,
- what,
- separators,
- 0,
- nullopt, nullptr, nullptr);
+ parse_names (t, tt, ns, pmode, chunk, what, separators);
return ns;
}
@@ -443,14 +441,7 @@ namespace build2
bool chunk = false)
{
names ns;
- auto r (parse_names (t, tt,
- ns,
- pmode,
- chunk,
- what,
- separators,
- 0,
- nullopt, nullptr, nullptr));
+ auto r (parse_names (t, tt, ns, pmode, chunk, what, separators));
value v (r.type); // Potentially typed NULL value.