From 54870fb76b5f59cc2e6d69a8c7a8ef17853a0029 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 5 Dec 2016 15:09:04 +0200 Subject: Add comma, ternary, logical operators support in eval context --- build2/parser | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'build2/parser') diff --git a/build2/parser b/build2/parser index e1f6e77..45f5b16 100644 --- a/build2/parser +++ b/build2/parser @@ -110,15 +110,30 @@ namespace build2 value&& rhs, token_type kind); - // Return the value (can be NULL/typed) as well as the indication of - // whether this is a non-empty eval context (i.e., '()' potentially with - // whitespace in between). + // Return the value pack (values can be NULL/typed). Note that for an + // empty eval context ('()' potentially with whitespaces in between) the + // result is an empty pack, not a pack of one empty. // - pair + values parse_eval (token&, token_type&); + values + parse_eval_comma (token&, token_type&, bool = false); + + value + parse_eval_ternary (token&, token_type&, bool = false); + + value + parse_eval_or (token&, token_type&, bool = false); + + value + parse_eval_and (token&, token_type&, bool = false); + + value + parse_eval_comp (token&, token_type&, bool = false); + value - parse_eval_trailer (token&, token_type&); + parse_eval_value (token&, token_type&, bool = false); // Attributes stack. We can have nested attributes, for example: // -- cgit v1.1