From 8fabd86e687ef9455f1b31abbe0b44876afdecab Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 26 Oct 2016 11:30:31 +0200 Subject: Rework testscript parser in preparation for scope support --- build2/test/script/lexer.cxx | 9 ++++++--- 1 file changed, 6 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 e5514bd..7442973 100644 --- a/build2/test/script/lexer.cxx +++ b/build2/test/script/lexer.cxx @@ -33,9 +33,10 @@ namespace build2 case lexer_mode::first_token: { // First token on the script line. Like script_line but recognizes - // leading plus/minus and variable assignments as separators. + // leading '+-{}' as tokens as well as variable assignments as + // separators. // - // Note that to recognize only leading plus/minus we shouldn't add + // Note that to recognize only leading '+-{}' we shouldn't add // them to the separator strings. // s1 = ";=+!|&<> $(#\t\n"; @@ -330,7 +331,7 @@ namespace build2 } } - // Plus/minus. + // Plus/minus and left/right curly braces // if (m == lexer_mode::first_token) { @@ -338,6 +339,8 @@ namespace build2 { case '+': return make_token (type::plus); case '-': return make_token (type::minus); + case '{': return make_token (type::lcbrace); + case '}': return make_token (type::rcbrace); } } -- cgit v1.1