aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-20 08:40:59 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-20 08:40:59 +0200
commitce29e3d72ded432b9ac9354ac92c588142de9b89 (patch)
treefd7acd2d0e34b10315b5572f98619dbbf285c177 /libbuild2/parser.cxx
parentaeda0dedb2cdb0980d976ae92e1672476b62d7ed (diff)
Lexer support for default value assignment (?=)
Note: not yet supported in the parser.
Diffstat (limited to 'libbuild2/parser.cxx')
-rw-r--r--libbuild2/parser.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbuild2/parser.cxx b/libbuild2/parser.cxx
index 91f2d5c..ec5e161 100644
--- a/libbuild2/parser.cxx
+++ b/libbuild2/parser.cxx
@@ -2749,6 +2749,16 @@ namespace build2
void parser::
parse_variable (token& t, type& tt, const variable& var, type kind)
{
+ // @@ TODO: yet unclear what should the logic be here: we could expect
+ // the called to handle skipping or skip it here. Need to see how
+ // everything fits.
+ //
+ // Note that here we treat default assignment (?=) the same as normal
+ // assignment expecting the caller to check whether the assignment is
+ // necessary (and skipping evaluating the value altogether otherwise).
+ //
+ assert (kind != type::default_assign);
+
value rhs (parse_variable_value (t, tt));
value& lhs (