diff options
author | Marius Kintel <marius@kintel.net> | 2011-09-28 21:06:19 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2011-09-28 21:06:19 (GMT) |
commit | da08b50c03418110a74a6f2667be1d916b607b87 (patch) | |
tree | 5d8447265a6e4e34882a16d3b56b46fbf6041d3b /src/control.cc | |
parent | 2779e7dea95e16397c25d88b76634931b24e504c (diff) |
Added note about problem with modifiers using the child() module, reported by nophead
Diffstat (limited to 'src/control.cc')
-rw-r--r-- | src/control.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/control.cc b/src/control.cc index 492b909..1f79254 100644 --- a/src/control.cc +++ b/src/control.cc @@ -91,6 +91,8 @@ void for_eval(AbstractNode &node, const ModuleInstantiation &inst, size_t l, AbstractNode *ControlModule::evaluate(const Context*, const ModuleInstantiation *inst) const { + AbstractNode *node = NULL; + if (type == CHILD) { size_t n = 0; @@ -102,17 +104,20 @@ AbstractNode *ControlModule::evaluate(const Context*, const ModuleInstantiation for (int i = Context::ctx_stack.size()-1; i >= 0; i--) { const Context *c = Context::ctx_stack[i]; if (c->inst_p) { - if (n < c->inst_p->children.size()) - return c->inst_p->children[n]->evaluate(c->inst_p->ctx); - return NULL; + if (n < c->inst_p->children.size()) { + node = c->inst_p->children[n]->evaluate(c->inst_p->ctx); + // FIXME: We'd like to inherit any tags from the ModuleInstantiation + // given as parameter to this method. However, the instantition which belongs + // to the returned node cannot be changed. This causes the test + // features/child-background.scad to fail. + } + return node; } c = c->parent; } return NULL; } - AbstractNode *node; - if (type == INT_FOR) node = new AbstractIntersectionNode(inst); else |