[Nice-commit] Nice/src/nice/tools/compiler/console listener.nice,1.4,1.5 main.nice,1.9,1.10
Brought to you by:
bonniot
From: Arjan B. <ar...@us...> - 2005-01-13 19:27:23
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8057/F:/nice/src/nice/tools/compiler/console Modified Files: listener.nice main.nice Log Message: Print number of errors and warnings at the end of compilation if any. Index: main.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/console/main.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** main.nice 11 Aug 2004 16:09:35 -0000 1.9 --- main.nice 13 Jan 2005 19:27:09 -0000 1.10 *************** *** 166,169 **** --- 166,186 ---- int res = consOutput.statusCode; + if (res != BUG) + { + if (consOutput.errorCount > 0) + { + String msg = "compilation failed with " + consOutput.errorCount + + " error" + (consOutput.errorCount > 1 ? "s" : ""); + if (consOutput.warningCount > 0) + msg = msg + " and " + consOutput.warningCount + + " warning" + (consOutput.warningCount > 1 ? "s" : ""); + + println(msg); + } + else if (consOutput.warningCount > 0) + println("compilation completed with " + consOutput.warningCount + + " warning" + (consOutput.warningCount > 1 ? "s" : "")); + } + if (memInfo) printMemoryUsage(); Index: listener.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/console/listener.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** listener.nice 3 Sep 2004 16:21:49 -0000 1.4 --- listener.nice 13 Jan 2005 19:27:09 -0000 1.5 *************** *** 23,26 **** --- 23,29 ---- public final class ConsoleOutput extends StatusCodeListener { + int errorCount = 0; + int warningCount = 0; + progress(packageName, phase) { *************** *** 39,42 **** --- 42,46 ---- { super; + warningCount++; if (location != null) System.out.println("\n" + location + ":\nwarning: " + message); *************** *** 48,51 **** --- 52,56 ---- { super; + errorCount++; if (location != null) System.err.println("\n" + location + ":\n" + message); |