diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-03-30 07:59:19 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-03-30 07:59:19 +0200 |
commit | 31bd69c56bc29ec1c154a7c0623b6f0ccce78af1 (patch) | |
tree | 891b92806d386c723df5c2139706d6df356fcf18 /build2/file.cxx | |
parent | f7bba792a10864f0a64a2a579306e3b20602c1dc (diff) |
Minor parser interface rework
Diffstat (limited to 'build2/file.cxx')
-rw-r--r-- | build2/file.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/build2/file.cxx b/build2/file.cxx index 9097703..90d584d 100644 --- a/build2/file.cxx +++ b/build2/file.cxx @@ -264,7 +264,7 @@ namespace build2 // any variable expansion other than those from the global scope. // static value - extract_variable (const path& bf, const char* var) + extract_variable (const path& bf, const char* name) { try { @@ -278,18 +278,20 @@ namespace build2 token t (lex.next ()); token_type tt; - if (t.type != token_type::name || t.value != var || + if (t.type != token_type::name || t.value != name || ((tt = lex.next ().type) != token_type::assign && tt != token_type::prepend && tt != token_type::append)) { - error << "variable '" << var << "' expected as first line in " << bf; + error << "variable '" << name << "' expected as first line in " << bf; throw failed (); // Suppress "used uninitialized" warning. } + const variable& var (var_pool.find (move (t.value))); + parser p; temp_scope tmp (*global_scope); - p.parse_variable (lex, tmp, t.value, tt); + p.parse_variable (lex, tmp, var, tt); auto l (tmp.vars[var]); assert (l.defined ()); |