nitc: print errors if all modules are invalid
authorJean Privat <jean@pryen.org>
Tue, 6 Oct 2015 18:52:36 +0000 (14:52 -0400)
committerJean Privat <jean@pryen.org>
Tue, 6 Oct 2015 18:52:36 +0000 (14:52 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/compiler/abstract_compiler.nit

index a1827d0..3d6d939 100644 (file)
@@ -3870,7 +3870,12 @@ end
 # Here we load an process all modules passed on the command line
 var mmodules = modelbuilder.parse(arguments)
 
-if mmodules.is_empty then return
+if mmodules.is_empty then
+       toolcontext.check_errors
+       toolcontext.errors_info
+       if toolcontext.error_count > 0 then exit(1) else exit(0)
+end
+
 modelbuilder.run_phases
 
 for mmodule in mmodules do