diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-04 15:35:39 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2018-01-05 15:10:01 +0200 |
commit | d262f63ce5a7c3810abde1f66ee3bb99d56acdd0 (patch) | |
tree | 7a7114ceb95d17ebadc56f983309fb6ac5864a39 /build2/test | |
parent | 759e714238438cccf74f035e1ba11c925b27cd55 (diff) |
Add support for variable aliases
Diffstat (limited to 'build2/test')
-rw-r--r-- | build2/test/script/script.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/build2/test/script/script.cxx b/build2/test/script/script.cxx index 99ace23..51c08cb 100644 --- a/build2/test/script/script.cxx +++ b/build2/test/script/script.cxx @@ -624,14 +624,15 @@ namespace build2 { // Search script scopes until we hit the root. // - const scope* p (this); + const scope* s (this); do { - if (const value* v = p->vars.find (var)) - return lookup (v, &p->vars); + auto p (s->vars.find (var)); + if (p.first != nullptr) + return lookup (*p.first, p.second, s->vars); } - while ((p->parent != nullptr ? (p = p->parent) : nullptr) != nullptr); + while ((s->parent != nullptr ? (s = s->parent) : nullptr) != nullptr); return find_in_buildfile (var.name); } |