From a63e1809afd9a837821d6e8376cb14a36e7fc26e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 4 Jan 2017 17:44:39 +0200 Subject: Treat any testscript line that starts with dot as directive Even though we currently only recognize the include directive, we reserve any line that begins with a dot for future. --- build2/test/script/lexer.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'build2/test/script/lexer.cxx') diff --git a/build2/test/script/lexer.cxx b/build2/test/script/lexer.cxx index ce6ed5d..bcd5885 100644 --- a/build2/test/script/lexer.cxx +++ b/build2/test/script/lexer.cxx @@ -41,10 +41,10 @@ namespace build2 case lexer_mode::first_token: { // First token on the script line. Like command_line but - // recognizes leading '+-{}' as tokens as well as variable + // recognizes leading '.+-{}' as tokens as well as variable // assignments as separators. // - // Note that to recognize only leading '+-{}' we shouldn't add + // Note that to recognize only leading '.+-{}' we shouldn't add // them to the separator strings. // s1 = ":;=+!|&<> $(#\t\n"; @@ -431,12 +431,13 @@ namespace build2 } } - // Plus/minus and left/right curly braces. + // Dot, plus/minus, and left/right curly braces. // if (m == lexer_mode::first_token) { switch (c) { + case '.': return make_token (type::dot); case '+': return make_token (type::plus); case '-': return make_token (type::minus); case '{': return make_token (type::lcbrace); -- cgit v1.1