aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/build/script
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-11-18 07:00:36 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2022-11-18 07:56:09 +0200
commitf50a3a56b59698ffce3965711898a94e7849aa78 (patch)
treed52f6e2343d5cc4a1f83861e61e19520c22c7ae4 /libbuild2/build/script
parentf80c8ff7ff3b1eef22a3c90943f324d45d855b97 (diff)
Complete low verbosity diagnostics rework
Diffstat (limited to 'libbuild2/build/script')
-rw-r--r--libbuild2/build/script/parser.cxx6
-rw-r--r--libbuild2/build/script/parser.hxx15
-rw-r--r--libbuild2/build/script/parser.test.cxx2
3 files changed, 12 insertions, 11 deletions
diff --git a/libbuild2/build/script/parser.cxx b/libbuild2/build/script/parser.cxx
index b406f12..5dd9179 100644
--- a/libbuild2/build/script/parser.cxx
+++ b/libbuild2/build/script/parser.cxx
@@ -1429,12 +1429,12 @@ namespace build2
exec_lines (begin, end, exec_cmd);
}
- names parser::
+ pair<names, location> parser::
execute_diag_preamble (const scope& rs, const scope& bs,
environment& e, const script& s, runner& r,
bool diag, bool enter, bool leave)
{
- tracer trace ("exec_diag_preamble");
+ tracer trace ("execute_diag_preamble");
assert (!s.diag_preamble.empty ());
@@ -1499,7 +1499,7 @@ namespace build2
if (leave)
runner_->leave (e, s.end_loc);
- return ns;
+ return make_pair (ns, dl.tokens.front ().location ());
}
void parser::
diff --git a/libbuild2/build/script/parser.hxx b/libbuild2/build/script/parser.hxx
index 1328bae..3121320 100644
--- a/libbuild2/build/script/parser.hxx
+++ b/libbuild2/build/script/parser.hxx
@@ -174,17 +174,18 @@ namespace build2
}
// If the diag argument is true, then execute the preamble including
- // the (trailing) diagnostics line and return the resulting names (see
- // exec_special() for the diagnostics line execution semantics).
- // Otherwise, execute the preamble excluding the diagnostics line and
- // return an empty names list. If requested, call the runner's enter()
- // and leave() functions that initialize/clean up the environment
- // before/after the preamble execution.
+ // the (trailing) diagnostics line and return the resulting names and
+ // its location (see exec_special() for the diagnostics line execution
+ // semantics). Otherwise, execute the preamble excluding the
+ // diagnostics line and return an empty names list and location. If
+ // requested, call the runner's enter() and leave() functions that
+ // initialize/clean up the environment before/after the preamble
+ // execution.
//
// Note: having both root and base scopes for testing (where we pass
// global scope for both).
//
- names
+ pair<names, location>
execute_diag_preamble (const scope& root, const scope& base,
environment&, const script&, runner&,
bool diag, bool enter, bool leave);
diff --git a/libbuild2/build/script/parser.test.cxx b/libbuild2/build/script/parser.test.cxx
index e1ee3ef..97eac22 100644
--- a/libbuild2/build/script/parser.test.cxx
+++ b/libbuild2/build/script/parser.test.cxx
@@ -323,7 +323,7 @@ namespace build2
e, s, r,
true /* diag */,
true /* enter */,
- true /* leave */));
+ true /* leave */).first);
cout << "diag: " << diag << endl;
}