diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-13 12:24:24 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2010-01-13 12:24:24 (GMT) |
commit | 7f944e1e25faa8d8c077ba78e4fd489b69270fb5 (patch) | |
tree | d9330c7943a585865855e3f3fe3dfdfc400480cd /module.cc | |
parent | 367d7b3244c0091f9ca8b5b39a62c5d49886577c (diff) |
Clifford Wolf:
Added child() statement
git-svn-id: http://svn.clifford.at/openscad/trunk@275 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'module.cc')
-rw-r--r-- | module.cc | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -117,6 +117,9 @@ AbstractNode *Module::evaluate(const Context *ctx, const ModuleInstantiation *in Context c(ctx); c.args(argnames, argexpr, inst->argnames, inst->argvalues); + c.inst_p = inst; + c.set_variable("$children", Value(double(inst->children.size()))); + c.functions_p = &functions; c.modules_p = &modules; @@ -131,12 +134,6 @@ AbstractNode *Module::evaluate(const Context *ctx, const ModuleInstantiation *in node->children.append(n); } - foreach(ModuleInstantiation *v, inst->children) { - AbstractNode *n = v->evaluate(inst->ctx); - if (n != NULL) - node->children.append(n); - } - return node; } |