summaryrefslogtreecommitdiff
path: root/src/context.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-12-26 15:37:00 (GMT)
committerMarius Kintel <marius@kintel.net>2011-12-26 15:37:00 (GMT)
commitcbabbaed700536b3a1f513fd5a07d25382cb137f (patch)
tree17478b52e8e8205709c6862b605caf6762445dfa /src/context.cc
parent312a25f2708fcef22e300f7bd2c1aaed61d3095d (diff)
parent4ff2d1af446c1f276c644b12e6ec4cc6db0b6d65 (diff)
Merge branch 'master' into boost_filesystem
Conflicts: openscad.pro src/module.h
Diffstat (limited to 'src/context.cc')
-rw-r--r--src/context.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/context.cc b/src/context.cc
index df884de..57df902 100644
--- a/src/context.cc
+++ b/src/context.cc
@@ -45,6 +45,7 @@ Context::Context(const Context *parent, const Module *library)
ctx_stack.push_back(this);
if (parent) document_path = parent->document_path;
if (library) {
+ // FIXME: Don't access module members directly
this->functions_p = &library->functions;
this->modules_p = &library->modules;
this->usedlibs_p = &library->usedlibs;
@@ -148,24 +149,24 @@ Value Context::evaluate_function(const std::string &name,
AbstractNode *Context::evaluate_module(const ModuleInstantiation &inst) const
{
- if (this->modules_p && this->modules_p->find(inst.modname) != this->modules_p->end()) {
- AbstractModule *m = this->modules_p->find(inst.modname)->second;
- std::string replacement = Builtins::instance()->isDeprecated(inst.modname);
+ if (this->modules_p && this->modules_p->find(inst.name()) != this->modules_p->end()) {
+ AbstractModule *m = this->modules_p->find(inst.name())->second;
+ std::string replacement = Builtins::instance()->isDeprecated(inst.name());
if (!replacement.empty()) {
- PRINTF("DEPRECATED: The %s() module will be removed in future releases. Use %s() instead.", inst.modname.c_str(), replacement.c_str());
+ PRINTF("DEPRECATED: The %s() module will be removed in future releases. Use %s() instead.", inst.name().c_str(), replacement.c_str());
}
return m->evaluate(this, &inst);
}
if (this->usedlibs_p) {
BOOST_FOREACH(const ModuleContainer::value_type &m, *this->usedlibs_p) {
- if (m.second->modules.find(inst.modname) != m.second->modules.end()) {
+ if (m.second->modules.find(inst.name()) != m.second->modules.end()) {
Context ctx(this->parent, m.second);
- return m.second->modules[inst.modname]->evaluate(&ctx, &inst);
+ return m.second->modules[inst.name()]->evaluate(&ctx, &inst);
}
}
}
if (this->parent) return this->parent->evaluate_module(inst);
- PRINTF("WARNING: Ignoring unknown module '%s'.", inst.modname.c_str());
+ PRINTF("WARNING: Ignoring unknown module '%s'.", inst.name().c_str());
return NULL;
}
contact: Jan Huwald // Impressum