[Nice-commit] Nice/src/nice/tools/compiler interface.nice,1.4,1.5
Brought to you by:
bonniot
From: <bo...@us...> - 2003-06-11 22:24:39
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv21115/src/nice/tools/compiler Modified Files: interface.nice Log Message: Added the compilation listener interface. Console output is factored out in package nice.tools.compiler.console Index: interface.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/interface.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** interface.nice 22 Jan 2003 17:16:47 -0000 1.4 --- interface.nice 11 Jun 2003 22:24:06 -0000 1.5 *************** *** 20,26 **** */ ! int compile(Compilation compilation, String mainPackage, ! ?String nativeProgram = null, ?String nativeCompiler = null, ! boolean editorMode = false) { ?Throwable uncaughtException = null; --- 20,28 ---- */ ! import bossa.modules; ! ! void compile(Compilation compilation, String mainPackage, ! ?String nativeProgram = null, ?String nativeCompiler = null, ! boolean editorMode = false) { ?Throwable uncaughtException = null; *************** *** 28,34 **** try { ! OutputMessages.start(); ! bossa.util.Location.editorMode = editorMode; if (compilation.runtimeFile == null) compilation.runtimeFile = getNiceRuntime(); --- 30,36 ---- try { ! bossa.modules.Package.currentCompilation = compilation; bossa.util.Location.editorMode = editorMode; + if (compilation.runtimeFile == null) compilation.runtimeFile = getNiceRuntime(); *************** *** 36,41 **** compilation.setMainPackage(mainPackage); - bossa.modules.Package.currentCompilation = compilation; - make(compilation); --- 38,41 ---- *************** *** 45,55 **** nativeProgram, jar); } ! catch(OutputMessages.Exit e) { ! // Compilation was interrupted. ! return e.statusCode; } catch(bossa.util.UserError e){ bossa.util.Internal.warning("user error only caught in main"); ! nice.tools.compiler.OutputMessages.error(e.getMessage()); } catch(ExceptionInInitializerError e){ --- 45,54 ---- nativeProgram, jar); } ! catch(bossa.modules.Exit e) { ! // The compilation was stopped because an error prevented going further. } catch(bossa.util.UserError e){ bossa.util.Internal.warning("user error only caught in main"); ! compilation.listener.error(e.location, notNull(e.message)); } catch(ExceptionInInitializerError e){ *************** *** 62,77 **** if (uncaughtException != null) { ! Throwable exn = uncaughtException; ! OutputMessages.bug ! ("\nAn exception has occured in the compiler\n" + ! "Please fill-in a bug report at the following webpage:\n" + ! "http://sourceforge.net/tracker/?func=add&group_id=12788&atid=112788" + ! "\n\nException: " + exn.toString() + ! "\n\nStack trace:\n"); ! exn.printStackTrace(); } - - return OutputMessages.getStatusCode(); } --- 61,73 ---- if (uncaughtException != null) { ! let stackTrace = new java.io.StringWriter(500); ! uncaughtException.printStackTrace(new java.io.PrintWriter(stackTrace)); ! compilation.listener.bug ! (stackTrace: stackTrace.toString(), ! url: ! "http://sourceforge.net/tracker/?func=add&group_id=12788&atid=112788" ! ); } } |