From ce29e3d72ded432b9ac9354ac92c588142de9b89 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 20 Mar 2020 08:40:59 +0200 Subject: Lexer support for default value assignment (?=) Note: not yet supported in the parser. --- libbuild2/parser.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libbuild2/parser.cxx') 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 ( -- cgit v1.1