diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2020-05-26 14:55:40 +0300 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2020-05-27 14:38:01 +0200 |
commit | d6581aa9be74e83cc689bfdaae9aaf2e78287975 (patch) | |
tree | e741d2c6fcdb567d8c7b897d17f3f0ca2358d307 /libbuild2/test/script/parser.cxx | |
parent | e6470e37093084251b7ee60a904a78e54d13e31b (diff) |
Create build script temporary directory on demand
Diffstat (limited to 'libbuild2/test/script/parser.cxx')
-rw-r--r-- | libbuild2/test/script/parser.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libbuild2/test/script/parser.cxx b/libbuild2/test/script/parser.cxx index c206e0a..f663c11 100644 --- a/libbuild2/test/script/parser.cxx +++ b/libbuild2/test/script/parser.cxx @@ -389,7 +389,7 @@ namespace build2 // string& n (t.value); - if (n == "*" || n == "~" || n == "@" || digit (n)) + if (special_variable (n)) fail (t) << "attempt to set '" << n << "' variable directly"; // Pre-enter the variables now while we are executing serially. @@ -1598,6 +1598,14 @@ namespace build2 // The rest. // + // When add a special variable don't forget to update lexer::word(). + // + bool parser:: + special_variable (const string& n) noexcept + { + return n == "*" || n == "~" || n == "@" || digit (n); + } + lookup parser:: lookup_variable (name&& qual, string&& name, const location& loc) { |