diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-10-28 10:10:08 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-11-04 09:26:36 +0200 |
commit | cd40097447ff2400cb420ec973c16dadd26e6cda (patch) | |
tree | bcd1c902d487e7a60ffffd5b02b7c608829fbc57 /unit-tests/test/script/lexer/driver.cxx | |
parent | e61874e76052d3600d6f10807248f92935f3dd61 (diff) |
Implement description support in testscript
Diffstat (limited to 'unit-tests/test/script/lexer/driver.cxx')
-rw-r--r-- | unit-tests/test/script/lexer/driver.cxx | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/unit-tests/test/script/lexer/driver.cxx b/unit-tests/test/script/lexer/driver.cxx index c5beebb..abd32ba 100644 --- a/unit-tests/test/script/lexer/driver.cxx +++ b/unit-tests/test/script/lexer/driver.cxx @@ -29,13 +29,14 @@ namespace build2 assert (argc == 2); string s (argv[1]); - if (s == "script-line") m = lexer_mode::script_line; - else if (s == "first-token") m = lexer_mode::first_token; - else if (s == "second-token") m = lexer_mode::second_token; - else if (s == "variable-line") m = lexer_mode::variable_line; - else if (s == "command-line") m = lexer_mode::command_line; - else if (s == "here-line") m = lexer_mode::here_line; - else if (s == "variable") m = lexer_mode::variable; + if (s == "script-line") m = lexer_mode::script_line; + else if (s == "first-token") m = lexer_mode::first_token; + else if (s == "second-token") m = lexer_mode::second_token; + else if (s == "variable-line") m = lexer_mode::variable_line; + else if (s == "command-line") m = lexer_mode::command_line; + else if (s == "here-line") m = lexer_mode::here_line; + else if (s == "description-line") m = lexer_mode::description_line; + else if (s == "variable") m = lexer_mode::variable; else assert (false); } @@ -45,9 +46,10 @@ namespace build2 // Some modes auto-expire so we need something underneath. // - bool u (m == lexer_mode::first_token || - m == lexer_mode::second_token || - m == lexer_mode::variable_line || + bool u (m == lexer_mode::first_token || + m == lexer_mode::second_token || + m == lexer_mode::variable_line || + m == lexer_mode::description_line || m == lexer_mode::variable); lexer l (cin, path ("stdin"), u ? lexer_mode::script_line : m); |