diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-04 17:00:15 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2017-01-04 17:00:15 +0200 |
commit | 74918fea2ae0ce55fb6541726ec2ab607d7e2d6e (patch) | |
tree | 4c10948cf2c8b756ee73df5b028912cc93640814 /build2/test/script/parser.cxx | |
parent | 63c480abe7755c3c957d5c219a5e0ed3e9f881aa (diff) |
Change lexer modes to be semantically accurate
Diffstat (limited to 'build2/test/script/parser.cxx')
-rw-r--r-- | build2/test/script/parser.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
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. |