aboutsummaryrefslogtreecommitdiff
path: root/build2/test/script/lexer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/test/script/lexer.cxx')
-rw-r--r--build2/test/script/lexer.cxx25
1 files changed, 21 insertions, 4 deletions
diff --git a/build2/test/script/lexer.cxx b/build2/test/script/lexer.cxx
index 7ced2b9..e5514bd 100644
--- a/build2/test/script/lexer.cxx
+++ b/build2/test/script/lexer.cxx
@@ -264,10 +264,13 @@ namespace build2
{
p = peek ();
- if (p == ':')
+ if (p == ':' || p == '<')
{
get ();
- return make_token (type::in_doc_nn);
+
+ return make_token (p == ':'
+ ? type::in_doc_nn
+ : type::in_file);
}
else
return make_token (type::in_doc);
@@ -297,10 +300,24 @@ namespace build2
{
p = peek ();
- if (p == ':')
+ if (p == ':' || p == '>')
{
get ();
- return make_token (type::out_doc_nn);
+
+ if (p == ':')
+ return make_token (type::out_doc_nn);
+
+ // File redirect.
+ //
+ p = peek ();
+
+ if (p == '&')
+ {
+ get ();
+ return make_token (type::out_file_app);
+ }
+ else
+ return make_token (type::out_file);
}
else
return make_token (type::out_doc);