From 1c60c97b6b05cbee7e106fae6d8582382cbe4b7c Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 23 Sep 2022 20:08:47 +0300 Subject: Add support for 'for' loop first form (for x:...) in script --- libbuild2/script/parser.hxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'libbuild2/script/parser.hxx') diff --git a/libbuild2/script/parser.hxx b/libbuild2/script/parser.hxx index 9edb6ca..0f276e1 100644 --- a/libbuild2/script/parser.hxx +++ b/libbuild2/script/parser.hxx @@ -42,6 +42,11 @@ namespace build2 using build2::parser::apply_value_attributes; + // The variable is optional and is only used for diagnostics. + // + void + append_value (const variable*, value& lhs, value&& rhs, const location&); + // Return true if a command line element needs to be re-lexed. // // Specifically, it needs to be re-lexed if it contains any of the @@ -159,11 +164,13 @@ namespace build2 protected: // Return false if the execution of the script should be terminated with // the success status (e.g., as a result of encountering the exit - // builtin). For unsuccessful termination the failed exception is thrown. + // builtin). For unsuccessful termination the failed exception is + // thrown. // - using exec_set_function = void (const variable&, - token&, token_type&, - const location&); + using exec_assign_function = void (const variable&, + value&&, + token_type kind, + const location&); using exec_cmd_function = void (token&, token_type&, const iteration_index*, size_t li, @@ -181,7 +188,7 @@ namespace build2 // bool exec_lines (lines::const_iterator b, lines::const_iterator e, - const function&, + const function&, const function&, const function&, const iteration_index*, size_t& li, -- cgit v1.1