aboutsummaryrefslogtreecommitdiff
path: root/libbuild2
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2')
-rw-r--r--libbuild2/function.cxx17
-rw-r--r--libbuild2/parser.cxx26
2 files changed, 19 insertions, 24 deletions
diff --git a/libbuild2/function.cxx b/libbuild2/function.cxx
index f790809..6fa9709 100644
--- a/libbuild2/function.cxx
+++ b/libbuild2/function.cxx
@@ -207,16 +207,15 @@ namespace build2
{
// Print the call location in case the function fails.
//
- auto g (
- make_exception_guard (
- [fa, &loc, &print_call] ()
+ auto df = make_diag_frame (
+ [fa, &loc, &print_call] (const diag_record& dr)
+ {
+ if (fa)
{
- if (fa && verb != 0)
- {
- diag_record dr (info (loc));
- dr << "while calling "; print_call (dr.os);
- }
- }));
+ dr << info (loc) << "while calling ";
+ print_call (dr.os);
+ }
+ });
auto f (ovls.back ());
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 7b76d18..cae336e 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -4276,14 +4276,12 @@ namespace build2
{
// Print the location information in case the function fails.
//
- auto g (
- make_exception_guard (
- [&loc, l, r] ()
- {
- if (verb != 0)
- info (loc) << "while concatenating " << l << " to " << r <<
- info << "use quoting to force untyped concatenation";
- }));
+ auto df = make_diag_frame (
+ [&loc, l, r] (const diag_record& dr)
+ {
+ dr << info (loc) << "while concatenating " << l << " to " << r;
+ dr << info << "use quoting to force untyped concatenation";
+ });
p = ctx.functions.try_call (
scope_, "builtin.concat", vector_view<value> (a), loc);
@@ -5078,13 +5076,11 @@ namespace build2
{
// Print the location information in case the function fails.
//
- auto g (
- make_exception_guard (
- [&loc, t] ()
- {
- if (verb != 0)
- info (loc) << "while converting " << t << " to string";
- }));
+ auto df = make_diag_frame (
+ [&loc, t] (const diag_record& dr)
+ {
+ dr << info (loc) << "while converting " << t << " to string";
+ });
p = ctx.functions.try_call (
scope_, "string", vector_view<value> (&result_data, 1), loc);