From c9ba59bf02debd1c6409c1ac5a75a951f18a14a0 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Sun, 4 Sep 2011 21:02:33 +0200 Subject: Implemented support for for() with scalar argument, e.g. for (i=23) echo(i) diff --git a/doc/visitor-changes.txt b/doc/visitor-changes.txt index 2fdc944..4e864bf 100644 --- a/doc/visitor-changes.txt +++ b/doc/visitor-changes.txt @@ -1,3 +1,4 @@ Changes in visitor branch: o import_dxf(): layername="" imports all layers. Importing a single layer with a zero-length name is no longer supported. FIXME: The same prob. goes for dims o cylinder(): the r parameter will now always be used in place of a missing r1 or r2 +o for() with scalar argument now works, e.g.: for (i=23) echo(i) diff --git a/src/control.cc b/src/control.cc index 36689a0..26458fb 100644 --- a/src/control.cc +++ b/src/control.cc @@ -80,6 +80,7 @@ void for_eval(AbstractNode &node, const ModuleInstantiation &inst, size_t l, } } else { + c.set_variable(it_name, it_values); for_eval(node, inst, l+1, call_argnames, call_argvalues, &c); } } else { -- cgit v0.10.1