aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/lexer.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-10-26 11:30:31 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-11-04 09:26:35 +0200
commit8fabd86e687ef9455f1b31abbe0b44876afdecab (patch)
tree7602d4dae7e563d72af4443fed408d384d642a51 /build2/test/script/lexer.cxx
parent94e717de9323864e8128b3de7ff213c4f609707f (diff)
Rework testscript parser in preparation for scope support
Diffstat (limited to 'build2/test/script/lexer.cxx')
-rw-r--r--build2/test/script/lexer.cxx9
1 files changed, 6 insertions, 3 deletions
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);
}
}