From 744e8215261fbf81b9348d115d4916a9c88b52cc Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 20 Sep 2022 23:00:27 +0300 Subject: Add support for 'while' loop in script --- libbuild2/script/script.hxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libbuild2/script/script.hxx') diff --git a/libbuild2/script/script.hxx b/libbuild2/script/script.hxx index 5a39659..d6018f0 100644 --- a/libbuild2/script/script.hxx +++ b/libbuild2/script/script.hxx @@ -27,6 +27,7 @@ namespace build2 cmd_elif, cmd_elifn, cmd_else, + cmd_while, cmd_end }; @@ -380,6 +381,15 @@ namespace build2 ostream& operator<< (ostream&, const command_expr&); + // Stack-allocated linked list of iteration indexes of the nested loops. + // + struct iteration_index + { + size_t index; // 1-based. + + const iteration_index* prev; // NULL for the top-most loop. + }; + struct timeout { duration value; -- cgit v1.1