From ea66709a853255c7957a8a7907fd21fa7f6cfd3f Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 9 Sep 2015 15:56:54 +0200 Subject: Add support for quoting directive names Now only unquoted, literal names are recognized as directives, for example: 'print' = abc print $print --- build/file.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'build/file.cxx') diff --git a/build/file.cxx b/build/file.cxx index f8f62f9..f6fdd10 100644 --- a/build/file.cxx +++ b/build/file.cxx @@ -274,8 +274,8 @@ namespace build token t (lex.next ()); token_type tt; - if (t.type () != token_type::name || t.name () != var || - ((tt = lex.next ().type ()) != token_type::equal && + if (t.type != token_type::name || t.value != var || + ((tt = lex.next ().type) != token_type::equal && tt != token_type::plus_equal)) { error << "variable '" << var << "' expected as first line in " << rbf; @@ -284,7 +284,7 @@ namespace build parser p; temp_scope tmp (*global_scope); - p.parse_variable (lex, tmp, t.name (), tt); + p.parse_variable (lex, tmp, t.value, tt); auto l (tmp.vars[var]); assert (l.defined ()); -- cgit v1.1