aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/script/script.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'libbuild2/script/script.hxx')
-rw-r--r--libbuild2/script/script.hxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/libbuild2/script/script.hxx b/libbuild2/script/script.hxx
index 5eb4ee9..aa96b7f 100644
--- a/libbuild2/script/script.hxx
+++ b/libbuild2/script/script.hxx
@@ -28,7 +28,8 @@ namespace build2
cmd_elifn,
cmd_else,
cmd_while,
- cmd_for,
+ cmd_for_args, // `for x: ...`
+ cmd_for_stream, // `... | for x` and `for x <...`
cmd_end
};
@@ -42,7 +43,7 @@ namespace build2
union
{
- const variable* var; // Pre-entered for line_type::var.
+ const variable* var; // Pre-entered for line_type::{var,cmd_for_*}.
};
};
@@ -547,7 +548,7 @@ namespace build2
// Set variable value with optional (non-empty) attributes.
//
virtual void
- set_variable (string&& name,
+ set_variable (string name,
names&&,
const string& attrs,
const location&) = 0;
@@ -580,6 +581,17 @@ namespace build2
~environment () = default;
};
+ // Custom command function that can be executed at the end of the pipe.
+ // Should throw io_error on the underlying OS error.
+ //
+ using command_function = void (environment&,
+ const strings& args,
+ auto_fd in,
+ bool pipe,
+ const optional<deadline>&,
+ const command& deadline_cmd,
+ const location&);
+
// Helpers.
//
// Issue diagnostics with the specified prefix and fail if the string