diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-04 19:02:33 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-04 19:02:33 (GMT) |
commit | c9ba59bf02debd1c6409c1ac5a75a951f18a14a0 (patch) | |
tree | f19744137fc3961ea212c944d73aa789437e327a | |
parent | a376c0b1f745e73498675f9fbf8cea833b8a11d7 (diff) |
Implemented support for for() with scalar argument, e.g. for (i=23) echo(i)
-rw-r--r-- | doc/visitor-changes.txt | 1 | ||||
-rw-r--r-- | src/control.cc | 1 |
2 files changed, 2 insertions, 0 deletions
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 { |