aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-04 08:32:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:14 +0200
commitb08b0075c1a9ac18fc848e5ed1f7d15582d313de (patch)
treee685bcd7503f72f0bf7bb36116117278b73bd691
parent685dcfe6329479f1e19313a30409ba9f6e113f7d (diff)
Allow customizing names parsing diagnostics (testscript)
-rw-r--r--build2/buildfile1
-rw-r--r--build2/test/script/parser.cxx8
2 files changed, 5 insertions, 4 deletions
diff --git a/build2/buildfile b/build2/buildfile
index 03c0dd3..f7b2dd9 100644
--- a/build2/buildfile
+++ b/build2/buildfile
@@ -80,6 +80,7 @@ test/script/{hxx cxx}{ lexer } \
test/script/{hxx cxx}{ parser } \
test/script/{hxx cxx}{ runner } \
test/script/{hxx cxx}{ script } \
+test/script/{hxx cxx}{ token } \
$libs
# Pass our compiler target to be used as build2 host.
diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx
index f067e84..827aae7 100644
--- a/build2/test/script/parser.cxx
+++ b/build2/test/script/parser.cxx
@@ -62,7 +62,7 @@ namespace build2
names_type ns;
location nl (get_location (t));
lexer_->reset_quoted (t.quoted);
- names (t, tt, ns, true);
+ names (t, tt, ns, true, "variable or program name");
// See if this is a variable assignment or a test command.
//
@@ -457,7 +457,7 @@ namespace build2
ns.clear ();
lexer_->reset_quoted (t.quoted);
nl = get_location (t);
- names (t, tt, ns, true);
+ names (t, tt, ns, true, "command");
continue;
}
}
@@ -533,7 +533,7 @@ namespace build2
{
// The next chunk should be the exit status.
//
- names_type ns (names (t, tt, true));
+ names_type ns (names (t, tt, true, "exit status"));
//@@ TODO: validate to be single, simple, non-empty name that
// converts to integer (is exit status always non-negative).
@@ -561,7 +561,7 @@ namespace build2
// Expand the line.
//
- names_type ns (names (t, tt));
+ names_type ns (names (t, tt, false, "here-document line"));
// What shall we do if the expansion results in multiple names? For,
// example if the line contains just the variable expansion and it