diff options
Diffstat (limited to 'src/builtin.cc')
-rw-r--r-- | src/builtin.cc | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/builtin.cc b/src/builtin.cc index bdd2d3b..e116f17 100644 --- a/src/builtin.cc +++ b/src/builtin.cc @@ -16,12 +16,12 @@ Builtins *Builtins::instance(bool erase) void Builtins::init(const char *name, class AbstractModule *module) { - Builtins::instance()->rootmodule.modules[name] = module; + Builtins::instance()->globalscope.modules[name] = module; } void Builtins::init(const char *name, class AbstractFunction *function) { - Builtins::instance()->rootmodule.functions[name] = function; + Builtins::instance()->globalscope.functions[name] = function; } extern void register_builtin_functions(); @@ -80,24 +80,18 @@ std::string Builtins::isDeprecated(const std::string &name) Builtins::Builtins() { - this->rootmodule.assignments_var.push_back("$fn"); - this->rootmodule.assignments["$fn"] = new Expression(Value(0.0)); - this->rootmodule.assignments_var.push_back("$fs"); - this->rootmodule.assignments["$fs"] = new Expression(Value(2.0)); - this->rootmodule.assignments_var.push_back("$fa"); - this->rootmodule.assignments["$fa"] = new Expression(Value(12.0)); - this->rootmodule.assignments_var.push_back("$t"); - this->rootmodule.assignments["$t"] = new Expression(Value(0.0)); + this->globalscope.assignments.push_back(Assignment("$fn", new Expression(Value(0.0)))); + this->globalscope.assignments.push_back(Assignment("$fs", new Expression(Value(2.0)))); + this->globalscope.assignments.push_back(Assignment("$fa", new Expression(Value(12.0)))); + this->globalscope.assignments.push_back(Assignment("$t", new Expression(Value(0.0)))); Value::VectorType zero3; zero3.push_back(Value(0.0)); zero3.push_back(Value(0.0)); zero3.push_back(Value(0.0)); Value zero3val(zero3); - this->rootmodule.assignments_var.push_back("$vpt"); - this->rootmodule.assignments["$vpt"] = new Expression(zero3val); - this->rootmodule.assignments_var.push_back("$vpr"); - this->rootmodule.assignments["$vpr"] = new Expression(zero3val); + this->globalscope.assignments.push_back(Assignment("$vpt", new Expression(zero3val))); + this->globalscope.assignments.push_back(Assignment("$vpr", new Expression(zero3val))); } Builtins::~Builtins() |