diff options
author | Marius Kintel <marius@kintel.net> | 2013-04-27 05:01:45 (GMT) |
---|---|---|
committer | Marius Kintel <marius@kintel.net> | 2013-04-27 05:01:45 (GMT) |
commit | 17df3f6275fce73119c311cc73a6ad057d3b47ee (patch) | |
tree | 6c907e241b53c40c10743bbf08754b86a13f6457 /src/openscad.cc | |
parent | 6b3daa748543f13cc7cf8eff1c9efeebd6dc3a14 (diff) | |
parent | 7858b0443e7fb09134f2b69a535417688353c0bb (diff) |
Merge pull request #328 from openscad/issue116
Issue116
Diffstat (limited to 'src/openscad.cc')
-rw-r--r-- | src/openscad.cc | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/openscad.cc b/src/openscad.cc index 878c207..3b960f3 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -28,7 +28,7 @@ #include "MainWindow.h" #include "node.h" #include "module.h" -#include "context.h" +#include "modcontext.h" #include "value.h" #include "export.h" #include "builtin.h" @@ -327,11 +327,8 @@ int main(int argc, char **argv) if (!filename) help(argv[0]); - Context root_ctx; - register_builtin(root_ctx); - Module *root_module; - ModuleInstantiation root_inst; + ModuleInstantiation root_inst("group"); AbstractNode *root_node; AbstractNode *absolute_root_node; CGAL_Nef_polyhedron root_N; @@ -351,12 +348,18 @@ int main(int argc, char **argv) if (!root_module) exit(1); root_module->handleDependencies(); + ModuleContext root_ctx; + root_ctx.registerBuiltin(); + PRINT("Root Context:"); +#if 0 && DEBUG + root_ctx.dump(NULL, NULL); +#endif fs::path fpath = boosty::absolute(fs::path(filename)); fs::path fparent = fpath.parent_path(); fs::current_path(fparent); AbstractNode::resetIndexCounter(); - absolute_root_node = root_module->evaluate(&root_ctx, &root_inst); + absolute_root_node = root_module->evaluate(&root_ctx, &root_inst, NULL); // Do we have an explicit root node (! modifier)? if (!(root_node = find_root_tag(absolute_root_node))) |