diff options
author | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-06-30 08:38:31 (GMT) |
---|---|---|
committer | clifford <clifford@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-06-30 08:38:31 (GMT) |
commit | a70715ab8c31160f1be2a74d208681c2ad422bbb (patch) | |
tree | 51e09a6b66aae4d6a4a59e588b8429dea38ab448 /context.cc | |
parent | ed687599bf1ca36869dc64dab2b9969f1d96b4c1 (diff) |
Clifford Wolf:
Added assign() and if()
Added first for() outline
git-svn-id: http://svn.clifford.at/openscad/trunk@38 b57f626f-c46c-0410-a088-ec61d464b74c
Diffstat (limited to 'context.cc')
-rw-r--r-- | context.cc | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -23,6 +23,8 @@ Context::Context(const Context *parent) { this->parent = parent; + functions_p = NULL; + modules_p = NULL; ctx_stack.append(this); } @@ -77,7 +79,7 @@ Value Context::lookup_variable(QString name) const Value Context::evaluate_function(QString name, const QVector<QString> &argnames, const QVector<Value> &argvalues) const { - if (functions_p->contains(name)) + if (functions_p && functions_p->contains(name)) return functions_p->value(name)->evaluate(this, argnames, argvalues); if (parent) return parent->evaluate_function(name, argnames, argvalues); @@ -89,7 +91,7 @@ AbstractNode *Context::evaluate_module(QString name, const QVector<QString> &arg { if (arg_context == NULL) arg_context = this; - if (modules_p->contains(name)) + if (modules_p && modules_p->contains(name)) return modules_p->value(name)->evaluate(this, argnames, argvalues, arg_children, arg_context); if (parent) return parent->evaluate_module(name, argnames, argvalues, arg_children, arg_context); |