aboutsummaryrefslogtreecommitdiff
path: root/build2
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-11-04 14:57:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 14:57:53 +0200
commit14dafdb39f1ce9eb205ecc978b7255c4cfc72446 (patch)
tree2f7e2d9e35f38eaea2dda57252ec88dcb2d4a0db /build2
parenta7a906256f7ed26aeb94ec9c9be4df41dd839905 (diff)
Use include-aware location in testscript
Diffstat (limited to 'build2')
-rw-r--r--build2/test/script/parser.cxx5
-rw-r--r--build2/token5
2 files changed, 6 insertions, 4 deletions
diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx
index 4d7abf9..df1cd9f 100644
--- a/build2/test/script/parser.cxx
+++ b/build2/test/script/parser.cxx
@@ -834,11 +834,8 @@ namespace build2
//
if (!group_->tdown_.empty ())
{
- // @@ Can the teardown line be from a different file?
- //
location tl (
- get_location (
- group_->tdown_.back ().tokens.front ().token));
+ group_->tdown_.back ().tokens.front ().location ());
fail (ll) << "test after teardown" <<
info (tl) << "last teardown line appears here";
diff --git a/build2/token b/build2/token
index 7432d52..b3ebf5b 100644
--- a/build2/token
+++ b/build2/token
@@ -116,6 +116,11 @@ namespace build2
const path* file;
lexer_mode_base mode;
char pair_separator;
+
+ using location_type = build2::location;
+
+ location_type
+ location () const {return location_type (file, token.line, token.column);}
};
using replay_tokens = vector<replay_token>;