aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/test/script/parser.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-10-14 16:06:35 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-10-14 17:30:12 +0300
commit63b5b6416c6bde16560eb9b83a9e3122599369d5 (patch)
tree82c0f624aedebf6917aeb4c9b6648f8cdb9d3fc1 /libbuild2/test/script/parser.cxx
parentfbe94f38ee51e705202a2d5cf1f45b5e8a08d8c7 (diff)
Fix 'for [<attrs>] x: ...' to treat <attrs> as value attributes
Diffstat (limited to 'libbuild2/test/script/parser.cxx')
-rw-r--r--libbuild2/test/script/parser.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/libbuild2/test/script/parser.cxx b/libbuild2/test/script/parser.cxx
index f85b185..a30f666 100644
--- a/libbuild2/test/script/parser.cxx
+++ b/libbuild2/test/script/parser.cxx
@@ -1666,15 +1666,14 @@ namespace build2
auto exec_for = [this] (const variable& var,
value&& val,
- const location& l)
+ const attributes& val_attrs,
+ const location&)
{
value& lhs (scope_->assign (var));
- // To match the function semantics also pass the value's type
- // attribute, restoring it from RHS. Note that the value can't be
- // NULL.
- //
- apply_value (&var, lhs, move (val), type::assign, l, val.type);
+ attributes_.push_back (val_attrs);
+
+ apply_value_attributes (&var, lhs, move (val), type::assign);
if (script_->test_command_var (var.name))
scope_->reset_special ();