aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/lexer.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-07-13 13:24:07 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-07-13 13:41:40 +0200
commit0ce923f1b9b008cf44602255f935bf3d9c4ba90d (patch)
treea087f20a78f134ad2efde7f38f5d720b9e1155a2 /libbuild2/lexer.cxx
parent4b15244f65eb246d4e5d98ebfc1aa3137dc7275e (diff)
Reserve backtick (`) and bit-or (|) in eval context for future use
Specifically, they are reserved for future support of arithmetic evaluation contexts and evaluation pipelines, respectively.
Diffstat (limited to 'libbuild2/lexer.cxx')
-rw-r--r--libbuild2/lexer.cxx8
1 files changed, 5 insertions, 3 deletions
diff --git a/libbuild2/lexer.cxx b/libbuild2/lexer.cxx
index ff7be02..9b7d01e 100644
--- a/libbuild2/lexer.cxx
+++ b/libbuild2/lexer.cxx
@@ -120,8 +120,8 @@ namespace build2
// NOTE: remember to update special() lambda in parse_names() if
// adding any new single-character tokens to the eval mode.
//
- s1 = ":<>=!&|?, $(){}#\t\n";
- s2 = " = &| ";
+ s1 = ":<>=!&|?,` $(){}#\t\n";
+ s2 = " = & ";
break;
}
case lexer_mode::buildspec:
@@ -478,6 +478,7 @@ namespace build2
case '$': return make_token (type::dollar);
case '?': return make_token (type::question);
case ',': return make_token (type::comma);
+ case '`': return make_token (type::backtick);
case '(': return make_token (type::lparen);
case ')':
{
@@ -498,7 +499,7 @@ namespace build2
type r (type::eos);
switch (c)
{
- case '|': if (p == '|') r = type::log_or; break;
+ case '|': r = (p == '|' ? type::log_or : type::bit_or); break;
case '&': if (p == '&') r = type::log_and; break;
case '<': r = (p == '=' ? type::less_equal : type::less); break;
@@ -514,6 +515,7 @@ namespace build2
switch (r)
{
+ case type::bit_or:
case type::less:
case type::greater:
case type::log_not: break;