aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-04-27 14:54:16 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-04-27 14:54:16 +0200
commit2cfa969de8a275e0e65b095ed79a5f588c513bca (patch)
tree200dcb4725624dbfaed38d1459382c9279235560 /build2
parent3813b05824fa2616b8ab9c18ed158c0c02265337 (diff)
Redo run directive diagnostics not to rely on invalid paths
Diffstat (limited to 'build2')
-rw-r--r--build2/parser.cxx41
1 files changed, 13 insertions, 28 deletions
diff --git a/build2/parser.cxx b/build2/parser.cxx
index 15235a2..bb7123c 100644
--- a/build2/parser.cxx
+++ b/build2/parser.cxx
@@ -1212,41 +1212,26 @@ namespace build2
//
ifdstream is (move (pr.in_ofd), fdstream_mode::skip);
- // Come up with a "path" that contains both the original buildfile
- // location as well as the process name. The resulting diagnostics will
- // look like this:
+ // If there is an error in the output, our diagnostics will look like
+ // this:
//
- // buildfile:10:1 (foo stdout): unterminated single quote
+ // <stdout>:2:3 error: unterminated single quote
+ // buildfile:3:4 info: while parsing foo output
//
- path p;
{
- string s (l.file->string ());
- s += ':';
-
- if (!ops.no_line ())
- {
- s += to_string (l.line);
- s += ':';
-
- if (!ops.no_column ())
+ auto df = make_diag_frame (
+ [&args, &l](const diag_record& dr)
{
- s += to_string (l.column);
- s += ':';
- }
- }
+ dr << info (l) << "while parsing " << args[0] << " output";
+ });
- s += " (";
- s += args[0];
- s += " stdout)";
- p = path (move (s));
+ source (is,
+ path ("<stdout>"),
+ l,
+ false /* enter */,
+ false /* default_target */);
}
- source (is,
- p,
- l,
- false /* enter */,
- false /* default_target */);
-
is.close (); // Detect errors.
}
catch (const io_error&)