aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libbuild2/algorithm.cxx62
1 files changed, 31 insertions, 31 deletions
diff --git a/libbuild2/algorithm.cxx b/libbuild2/algorithm.cxx
index fcff50e..d69ff95 100644
--- a/libbuild2/algorithm.cxx
+++ b/libbuild2/algorithm.cxx
@@ -827,46 +827,46 @@ namespace build2
target& t (*l.target);
target::opstate& s (t[a]);
- // Intercept and handle matching an ad hoc group member.
- //
- if (t.adhoc_group_member ())
+ try
{
- assert (!step);
+ // Intercept and handle matching an ad hoc group member.
+ //
+ if (t.adhoc_group_member ())
+ {
+ assert (!step);
- const target& g (*t.group);
+ const target& g (*t.group);
- // It feels natural to "convert" this call to the one for the group,
- // including the try_match part. Semantically, we want to achieve the
- // following:
- //
- // [try_]match (a, g);
- // match_recipe (l, group_recipe);
- //
- auto df = make_diag_frame (
- [a, &t](const diag_record& dr)
- {
- if (verb != 0)
- dr << info << "while matching group rule to " << diag_do (a, t);
- });
+ // It feels natural to "convert" this call to the one for the group,
+ // including the try_match part. Semantically, we want to achieve the
+ // following:
+ //
+ // [try_]match (a, g);
+ // match_recipe (l, group_recipe);
+ //
+ auto df = make_diag_frame (
+ [a, &t](const diag_record& dr)
+ {
+ if (verb != 0)
+ dr << info << "while matching group rule to " << diag_do (a, t);
+ });
- pair<bool, target_state> r (match_impl (a, g, 0, nullptr, try_match));
+ pair<bool, target_state> r (match_impl (a, g, 0, nullptr, try_match));
- if (r.first)
- {
- if (r.second != target_state::failed)
+ if (r.first)
{
- match_inc_dependents (a, g);
- match_recipe (l, group_recipe);
+ if (r.second != target_state::failed)
+ {
+ match_inc_dependents (a, g);
+ match_recipe (l, group_recipe);
+ }
}
- }
- else
- l.offset = target::offset_tried;
+ else
+ l.offset = target::offset_tried;
- return r; // Group state (must be consistent with matched_state()).
- }
+ return r; // Group state (must be consistent with matched_state()).
+ }
- try
- {
// Continue from where the target has been left off.
//
switch (l.offset)