From 74918fea2ae0ce55fb6541726ec2ab607d7e2d6e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Jan 2017 17:00:15 +0200 Subject: Change lexer modes to be semantically accurate --- build2/test/script/parser.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'build2/test/script/parser.cxx') diff --git a/build2/test/script/parser.cxx b/build2/test/script/parser.cxx index da61c64..99e4a66 100644 --- a/build2/test/script/parser.cxx +++ b/build2/test/script/parser.cxx @@ -57,7 +57,7 @@ namespace build2 pre_parse_ = true; - lexer l (is, *path_, lexer_mode::script_line); + lexer l (is, *path_, lexer_mode::command_line); set_lexer (&l); id_prefix_.clear (); @@ -989,7 +989,7 @@ namespace build2 try { ifdstream ifs (p); - lexer l (ifs, p, lexer_mode::script_line); + lexer l (ifs, p, lexer_mode::command_line); const path* op (path_); path_ = &p; @@ -1908,7 +1908,7 @@ namespace build2 name = path (move (n)); } - // When re-parsing we do "effective escaping" and only for + // When re-lexing we do "effective escaping" and only for // ['"\] (quotes plus the backslash itself). In particular, // there is no way to escape redirects, operators, etc. The // idea is to prefer quoting except for passing literal @@ -1921,7 +1921,9 @@ namespace build2 // cmd $args # cmd x="foo bar" // istringstream is (s); - lexer lex (is, name, lexer_mode::command_line, "\'\"\\"); + lexer lex (is, name, + lexer_mode::command_expansion, + "\'\"\\"); // Treat the first "sub-token" as always separated from what // we saw earlier. -- cgit v1.1