X-Git-Url: http://nitlanguage.org diff --git a/src/nitvm.nit b/src/nitvm.nit index 9a62208..dae856b 100644 --- a/src/nitvm.nit +++ b/src/nitvm.nit @@ -18,6 +18,7 @@ module nitvm import vm +import frontend::code_gen # Create a tool context to handle options and paths var toolcontext = new ToolContext @@ -34,7 +35,7 @@ toolcontext.process_options(args) var model = new Model # Add a model builder to parse files -var modelbuilder = new ModelBuilder(model, toolcontext.as(not null)) +var modelbuilder = new ModelBuilder(model, toolcontext) var arguments = toolcontext.option_context.rest var progname = arguments.first @@ -44,7 +45,7 @@ var mmodules = modelbuilder.parse([progname]) mmodules.add_all modelbuilder.parse(opt_mixins.value) modelbuilder.run_phases -if toolcontext.opt_only_metamodel.value then exit(0) +if toolcontext.opt_only_metamodel.value then toolcontext.quit var mainmodule: nullable MModule @@ -56,7 +57,7 @@ else mainmodule.set_imported_mmodules(mmodules) end -var self_mm = mainmodule.as(not null) -var self_args = arguments.as(not null) +var self_mm = mainmodule +var self_args = arguments -modelbuilder.run_naive_interpreter(self_mm, self_args) +modelbuilder.run_virtual_machine(self_mm, self_args)