aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/script/parser.hxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2022-09-29 09:46:58 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2022-09-29 13:45:03 +0300
commitd7cb460833e6dde3e3b958b993eee3eee4ae3bf0 (patch)
treed96f782c0c3e79b4ce21a510498517c4b1386b35 /libbuild2/script/parser.hxx
parente086480b76d995beb23b9b91bda335702f7f0d2a (diff)
Fix variable append logic in script
Diffstat (limited to 'libbuild2/script/parser.hxx')
-rw-r--r--libbuild2/script/parser.hxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/libbuild2/script/parser.hxx b/libbuild2/script/parser.hxx
index 0f276e1..3a4c46f 100644
--- a/libbuild2/script/parser.hxx
+++ b/libbuild2/script/parser.hxx
@@ -42,11 +42,6 @@ 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
@@ -167,10 +162,9 @@ namespace build2
// builtin). For unsuccessful termination the failed exception is
// thrown.
//
- using exec_assign_function = void (const variable&,
- value&&,
- token_type kind,
- const location&);
+ using exec_set_function = void (const variable&,
+ token&, token_type&,
+ const location&);
using exec_cmd_function = void (token&, token_type&,
const iteration_index*, size_t li,
@@ -181,6 +175,10 @@ namespace build2
const iteration_index*, size_t li,
const location&);
+ using exec_for_function = void (const variable&,
+ value&&,
+ const location&);
+
// If a parser implementation doesn't pre-enter variables into a pool
// during the pre-parsing phase, then they are entered during the
// execution phase and so the variable pool must be provided. Note that
@@ -188,9 +186,10 @@ namespace build2
//
bool
exec_lines (lines::const_iterator b, lines::const_iterator e,
- const function<exec_assign_function>&,
+ const function<exec_set_function>&,
const function<exec_cmd_function>&,
const function<exec_cond_function>&,
+ const function<exec_for_function>&,
const iteration_index*, size_t& li,
variable_pool* = nullptr);