From 323e774380995c04ae705e29ae0e51d62246333d Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 9 Nov 2017 17:06:35 +0200 Subject: Add support for for-loop The semantics is similar to the C++11 range-based for: list = 1 2 3 for i: $list print $i Note that there is no scoping of any kind for the loop variable ('i' in the above example). See tests/loop/for.test for some examples/ideas. In the future the plan is to also support more general while-loop as well as break and continue. --- build2/variable.hxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'build2/variable.hxx') diff --git a/build2/variable.hxx b/build2/variable.hxx index 9f7a82c..f3eea63 100644 --- a/build2/variable.hxx +++ b/build2/variable.hxx @@ -35,7 +35,11 @@ namespace build2 // below is expected to return the base pointer if its second argument // points to the base's value_type. // - const value_type* base; + const value_type* base_type; + + // Element type, if this is a vector. + // + const value_type* element_type; // Destroy the value. If it is NULL, then the type is assumed to be POD // with a trivial destructor. -- cgit v1.1