src: use `toolcontext.quit` instead of rogue `exit`
authorJean Privat <jean@pryen.org>
Sat, 7 Nov 2015 04:13:17 +0000 (23:13 -0500)
committerJean Privat <jean@pryen.org>
Sat, 7 Nov 2015 04:13:17 +0000 (23:13 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/abstract_compiler.nit
src/loader.nit
src/modelbuilder.nit
src/nit.nit
src/nitvm.nit

index 9584179..de68957 100644 (file)
@@ -3894,11 +3894,7 @@ end
 # Here we load an process all modules passed on the command line
 var mmodules = modelbuilder.parse(arguments)
 
-if mmodules.is_empty then
-       toolcontext.check_errors
-       toolcontext.errors_info
-       if toolcontext.error_count > 0 then exit(1) else exit(0)
-end
+if mmodules.is_empty then toolcontext.quit
 
 modelbuilder.run_phases
 
index c80b6dc..b3485ed 100644 (file)
@@ -104,7 +104,7 @@ redef class ModelBuilder
 
                if toolcontext.opt_only_parse.value then
                        self.toolcontext.info("*** ONLY PARSE...", 1)
-                       exit(0)
+                       self.toolcontext.quit
                end
 
                return mmodules.to_a
@@ -199,7 +199,7 @@ redef class ModelBuilder
 
                if toolcontext.opt_only_parse.value then
                        self.toolcontext.info("*** ONLY PARSE...", 1)
-                       exit(0)
+                       self.toolcontext.quit
                end
 
                return mmodules.to_a
index 00e41b5..671fcd0 100644 (file)
@@ -100,7 +100,7 @@ redef class ModelBuilder
 
                if toolcontext.opt_only_metamodel.value then
                        self.toolcontext.info("*** ONLY METAMODEL", 1)
-                       exit(0)
+                       toolcontext.quit
                end
        end
 
index 196961d..9410b4d 100644 (file)
@@ -70,7 +70,7 @@ end
 
 modelbuilder.run_phases
 
-if toolcontext.opt_only_metamodel.value then exit(0)
+if toolcontext.opt_only_metamodel.value then toolcontext.quit
 
 var mainmodule = toolcontext.make_main_module(mmodules)
 
index 088cd92..e81b20d 100644 (file)
@@ -45,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