diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-09 15:56:54 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-09-09 15:56:54 +0200 |
commit | ea66709a853255c7957a8a7907fd21fa7f6cfd3f (patch) | |
tree | 061f828174b4a1d9d5c5fbc0b3b7427b5eea1ee8 /build/b.cxx | |
parent | 8a9870ed59225972de389b7b4a494a57390bff1b (diff) |
Add support for quoting directive names
Now only unquoted, literal names are recognized as directives, for
example:
'print' = abc
print $print
Diffstat (limited to 'build/b.cxx')
-rw-r--r-- | build/b.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/build/b.cxx b/build/b.cxx index bbfc635..665fac8 100644 --- a/build/b.cxx +++ b/build/b.cxx @@ -146,24 +146,24 @@ main (int argc, char* argv[]) lexer l (is, "<cmdline>"); token t (l.next ()); - if (t.type () == token_type::eos) + if (t.type == token_type::eos) continue; // Whitespace-only argument. // Unless this is a name followed by = or +=, assume it is // a start of the buildspec. // - if (t.type () != token_type::name) + if (t.type != token_type::name) break; - token_type tt (l.next ().type ()); + token_type tt (l.next ().type); if (tt != token_type::equal && tt != token_type::plus_equal) break; parser p; - t = p.parse_variable (l, *global_scope, t.name (), tt); + t = p.parse_variable (l, *global_scope, t.value, tt); - if (t.type () != token_type::eos) + if (t.type != token_type::eos) fail << "unexpected " << t << " in variable " << s; } |