nice-commit Mailing List for The Nice Programming Language (Page 62)
Brought to you by:
bonniot
You can subscribe to this list here.
2003 |
Jan
|
Feb
(60) |
Mar
(125) |
Apr
(183) |
May
(140) |
Jun
(227) |
Jul
(141) |
Aug
(181) |
Sep
(75) |
Oct
(89) |
Nov
(187) |
Dec
(162) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(69) |
Feb
(197) |
Mar
(98) |
Apr
(26) |
May
(10) |
Jun
(85) |
Jul
(88) |
Aug
(79) |
Sep
(80) |
Oct
(81) |
Nov
(53) |
Dec
(109) |
2005 |
Jan
(68) |
Feb
(77) |
Mar
(232) |
Apr
(79) |
May
(37) |
Jun
(37) |
Jul
(3) |
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
(10) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(9) |
2007 |
Jan
(2) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(17) |
Dec
(6) |
2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <bo...@pr...> - 2004-01-26 12:43:35
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11944/src/nice/tools/testsuite Modified Files: TestNice.java Log Message: Allow to wait at the end of a testsuite run, to inspect memory usage with a memory debugger. Index: TestNice.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestNice.java,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** TestNice.java 28 Nov 2003 02:57:13 -0000 1.28 --- TestNice.java 26 Jan 2004 12:42:44 -0000 1.29 *************** *** 149,152 **** --- 149,159 ---- /** + Whether to wait at the end of the run. + This is useful for profiling memory after all the work is done, + using a debugger/memory profiler. + */ + private static boolean _wait; + + /** * Classpath entry that contains the Nice standard library. * *************** *** 195,198 **** --- 202,217 ---- e.printStackTrace(); } + + if (_wait) + { + reclaimMemory(true); + + System.out.println("Test finished.\nPress return to terminate:"); + try { + new DataInputStream(System.in).readLine(); + } + catch (IOException e) {} + } + _output.endApplication(); *************** *** 200,204 **** _output.close(); - if (getTestCasesFailed() > 0) System.exit(1); --- 219,222 ---- *************** *** 210,214 **** --- 228,253 ---- } + private static void reclaimMemory(boolean clear) + { + // Reclaim memory. + bossa.modules.Package.startNewCompilation(); + mlsub.typing.NullnessKind.setSure(null); + mlsub.typing.NullnessKind.setMaybe(null); + + // Create an OutOfMemoryError, so that soft references are also let loose. + if (clear) + try { + int[] l = new int[1000]; + for (;;) + { + l = new int[l.length * 2]; + } + } + catch (OutOfMemoryError e) {} + + System.gc(); + nice.tools.compiler.console.fun.printMemoryUsage(); + } /** *************** *** 228,231 **** --- 267,272 ---- else if ("-runtime".equalsIgnoreCase(s)) _runtime = args[i++]; + else if ("-wait".equalsIgnoreCase(s)) + _wait = true; else return false; *************** *** 555,557 **** --- 596,599 ---- // Local Variables: // tab-width: 2 + // indent-tabs-mode: t // End: |
From: Daniel B. <Dan...@in...> - 2004-01-26 02:43:37
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8333/src/nice/tools/compiler Modified Files: native.nice interface.nice Log Message: Rewrite stack trace information using the SourceDebugExtension info so that file names and line numbers in Nice methods are correct. Index: native.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/native.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** native.nice 29 Jul 2003 00:38:25 -0000 1.5 --- native.nice 23 Jan 2004 13:00:23 -0000 1.6 *************** *** 53,57 **** for (?String line = in.readLine(); line != null; line = in.readLine()) ! System.out.println(line); } catch(IOException ex) {} --- 53,57 ---- for (?String line = in.readLine(); line != null; line = in.readLine()) ! println(line); } catch(IOException ex) {} *************** *** 72,75 **** println(": " + msg); else ! System.out.println(); } --- 72,75 ---- println(": " + msg); else ! java.lang.System.out.println(); } Index: interface.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/interface.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** interface.nice 15 Jun 2003 10:54:44 -0000 1.6 --- interface.nice 23 Jan 2004 13:00:24 -0000 1.7 *************** *** 21,24 **** --- 21,25 ---- import bossa.modules; + import nice.tools.util; void compile(Compilation compilation, String mainPackage, *************** *** 62,66 **** { let stackTrace = new java.io.StringWriter(500); ! uncaughtException.printStackTrace(new java.io.PrintWriter(stackTrace)); compilation.listener.bug --- 63,68 ---- { let stackTrace = new java.io.StringWriter(500); ! uncaughtException.printStackTraceWithSourceInfo ! (new java.io.PrintWriter(stackTrace)); compilation.listener.bug |
From: Daniel B. <Dan...@in...> - 2004-01-26 02:42:58
|
Update of /cvsroot/nice/Nice/src/nice/tools/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8333/src/nice/tools/util Added Files: source-lines.nice Log Message: Rewrite stack trace information using the SourceDebugExtension info so that file names and line numbers in Nice methods are correct. --- NEW FILE: source-lines.nice --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2004 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package nice.tools.util; /** Support for source information in compiled classes. @author Daniel Bonniot (bo...@us...) */ import java.io.*; public void printStackTraceWithSourceInfo(Throwable t) = printStackTraceWithSourceInfo(t, java.lang.System.err); public void printStackTraceWithSourceInfo(Throwable t, PrintStream s) = printStackTraceWithSourceInfo(t, new PrintWriter(s)); public void printStackTraceWithSourceInfo(Throwable t, PrintWriter w) { w.println("Exception in thread \"" Thread.currentThread().getName "\" " t); try { let elements = t.getStackTrace(); elements.foreach(StackTraceElement e => { (?String file, int line) = getSourceLocation(e.getClassName(), e.getLineNumber()) || (e.getFileName(), e.getLineNumber()); let location = file == null ? (e.isNativeMethod ? "Native Method" : "Unknown Source") : line < 0 ? file : (file + ":" + line); w.println("\tat " e.getClassName "." e.getMethodName "(" location ")"); }); } catch (NoSuchMethodError e) { // Fallback in case method Throwable.getStackTrace() is not available. t.printStackTrace(w); w.println(""" Warning: the above stack trace has wrong line numbers for Nice methods. Use a JVM version 1.4 or later to get the correct line numbers."""); } } let byte CLASS = 7; let byte FIELDREF = 9; let byte METHODREF = 10; let byte INTERFACE_METHODREF = 11; let byte STRING = 8; let byte INTEGER = 3; let byte FLOAT = 4; let byte LONG = 5; let byte DOUBLE = 6; let byte NAME_AND_TYPE = 12; let byte UTF8 = 1; /* Return the index of SourceDebugExtension, or null if it does not appear. */ private ?int readConstantPool(DataInputStream dstr) { var ?int result = null; let count = dstr.readUnsignedShort() - 1; for (int i = 1; i <= count; i++) { byte tag = dstr.readByte(); if (tag == UTF8) { let value = dstr.readUTF(); if (value.equals("SourceDebugExtension")) result = i; } else if (tag == LONG || tag == DOUBLE) { dstr.readLong(); i++; } else if (tag == CLASS || tag == STRING) dstr.readUnsignedShort(); else // In all other cases, 4 bytes need to be read. dstr.readInt(); } return result; } /** Fetch the SourceDebugExtension attribute from a compiled class. */ ?String sourceDebugExtension(String className) { let resourceName = className.replace('.', '/') + ".class"; let stream = new DataInputStream (java.lang.ClassLoader.getSystemResourceAsStream(resourceName)); stream.skipBytes(8); let sourceDebugExtensionIndex = readConstantPool(stream); if (sourceDebugExtensionIndex == null) return null; // Class info stream.skipBytes(6); let interfaces_count = stream.readUnsignedShort(); stream.skipBytes(2 * interfaces_count); let fields_count = stream.readUnsignedShort(); for (int i = 0; i < fields_count; i++) { stream.skipBytes(6); let attributes_count = stream.readUnsignedShort(); for (int j = 0; j < attributes_count; j++) { stream.skipBytes(2); let attribute_length = stream.readInt(); stream.skipBytes(attribute_length); } } let methods_count = stream.readUnsignedShort(); for (int i = 0; i < methods_count; i++) { stream.skipBytes(6); let attributes_count = stream.readUnsignedShort(); for (int j = 0; j < attributes_count; j++) { stream.skipBytes(2); let attribute_length = stream.readInt(); stream.skipBytes(attribute_length); } } let attributes_count = stream.readUnsignedShort(); for (int j = 0; j < attributes_count; j++) { let index = stream.readUnsignedShort(); if (index == sourceDebugExtensionIndex) { let length = stream.readInt(); let value = new byte[length]; stream.readFully(value); return new String(value, "UTF-8"); // Skip the two higher-order bytes. Problematic for large source maps? //let dummy = stream.readUnsignedShort(); //return stream.readUTF(); } let attribute_length = stream.readInt(); stream.skipBytes(attribute_length); } return null; } private (int,int,int,int,int) parseLine(String line, int defaultId) { /* Format: InputStartLine #LineFileID ,RepeatCount :OutputStartLine ,OutputLineIncrement */ let tokenizer = new StringTokenizer(line, "#,: "); int start = Integer.parseInt(tokenizer.nextToken()); int id, repeat, outStart, outInc; int pos = line.indexOf('#'); if (pos == -1) id = defaultId; else { int end = line.indexOf(':'); int end2 = line.indexOf(','); if (end2 != -1) end = end2; id = Integer.parseInt(line.substring(pos + 1, end)); } pos = line.indexOf(','); if (pos == -1) repeat = 1; else { int end = line.indexOf(':'); repeat = Integer.parseInt(line.substring(pos + 1, end)); } pos = line.indexOf(':'); int end = line.indexOf(',', pos); if (end != -1) { outStart = Integer.parseInt(line.substring(pos + 1, end)); outInc = Integer.parseInt(line.substring(end + 1)); } else { outStart = Integer.parseInt(line.substring(pos + 1)); outInc = 1; } return (start, id, repeat, outStart, outInc); } ?(String,int) getSourceLocation(String className, int lineNumber) { let map = sourceDebugExtension(className); if (map == null) return null; var resultLine = 0; var resultId = 1; let r = new BufferedReader(new StringReader(map)); if (! (r.readLine().equals("SMAP"))) return null; r.readLine(); let defaultStratum = r.readLine(); while (! (r.readLine().equals("*S " defaultStratum))) // Not the stratum we want, skip. {} List<?String> files = new ArrayList(); var section = r.readLine(); do { if (section.equals("*F")) { for (;;) { section = r.readLine(); if (section == null || section.startsWith("*")) break; let tokenizer = new StringTokenizer(section); var token = tokenizer.nextToken(); if (token.equals("+")) { let index = Integer.parseInt(tokenizer.nextToken()); let file = tokenizer.nextToken(); r.readLine(); while (files.size() < index) files.add(null); if (files.size() == index) files.add(file); else files.set(index, file); } else { let index = Integer.parseInt(token); let file = tokenizer.nextToken(); while (files.size() < index) files.add(null); if (files.size() == index) files.add(file); else files.set(index, file); } } } else if (section.equals("*L")) for (;;) { var id = 1; section = r.readLine(); if (section == null || section.startsWith("*")) break; (int start, id, int repeat, int outStart, int outInc) = parseLine(section, id); if (lineNumber >= outStart && lineNumber <= outStart + repeat * outInc) { // Found it! resultLine = start + (lineNumber - outStart)/outInc; resultId = id; if (files.get(id) != null) return (notNull(files.get(id)), resultLine); } } else if (section.equals("*E") || section.equals("*S")) // We get to the end, or to a different stratum which we don't care about break; else // Skip until we find something interesting section = r.readLine(); } while (true); return (notNull(files.get(resultId)), resultLine); } |
From: <bo...@pr...> - 2004-01-25 03:24:17
|
Update of /cvsroot/nice/Nice/distrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13058/distrib Modified Files: Nice.spec Makefile Log Message: Automatic registration of the Emacs mode for the SuSE Linux distribution. Index: Nice.spec =================================================================== RCS file: /cvsroot/nice/Nice/distrib/Nice.spec,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Nice.spec 18 Jun 2003 22:45:08 -0000 1.2 --- Nice.spec 25 Jan 2004 03:23:39 -0000 1.3 *************** *** 45,48 **** --- 45,58 ---- echo install... + %post + if [ -f /etc/SuSE-release ]; then + ln -sf nice-startup.el /usr/share/emacs/site-lisp/suse-start-nice.el + fi + + %preun + if [ "$1" = "0" ] ; then # last uninstall + rm -f /usr/share/emacs/site-lisp/suse-start-nice.el + fi + %clean echo clean... Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/distrib/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Makefile 25 Jan 2004 01:24:48 -0000 1.12 --- Makefile 25 Jan 2004 03:23:39 -0000 1.13 *************** *** 18,22 **** ZIP_ROOT = tmp/Nice ! RPMTMP = tmp/Nice-${VERSION} RPMDIR = ${CURDIR}/tmp/noarch RPMFILE = Nice-${VERSION}-1.noarch.rpm --- 18,22 ---- ZIP_ROOT = tmp/Nice ! RPMTMP = ${CURDIR}/tmp/Nice-${VERSION} RPMDIR = ${CURDIR}/tmp/noarch RPMFILE = Nice-${VERSION}-1.noarch.rpm *************** *** 47,62 **** ${clean-tmp} && mkdir tmp/$(BUILDROOT) cd $(BUILDROOT) && $(MAKE) install PREFIX=${CURDIR}/tmp/$(BUILDROOT) cd tmp && tar -czf ../${TARFILE} $(BUILDROOT) --owner=0 --group=0 .PHONY: rpm ! rpm ${RPMDIR}/${RPMFILE}: ${TARFILE} ${clean-tmp} cp rpmmacros ~/.rpmmacros mkdir -p ${RPMTMP} mkdir -p tmp/BUILD ! cd ${RPMTMP} && tar xzf ${CURDIR}/${TARFILE} && mv nice-$(VERSION) usr cd tmp && tar zcf ${CURDIR}/tmp/Nice-${VERSION}.tar.gz Nice-${VERSION} sed "s/VERSION/${VERSION}/" Nice.spec > tmp/Nice-${VERSION}.spec ! rpmbuild --target=noarch --buildroot=${CURDIR}/${RPMTMP} -bb tmp/Nice-${VERSION}.spec --- 47,72 ---- ${clean-tmp} && mkdir tmp/$(BUILDROOT) cd $(BUILDROOT) && $(MAKE) install PREFIX=${CURDIR}/tmp/$(BUILDROOT) + # Preprend a specific message for manual installations + echo -e + ';; Load this file from your .emacs file with:\n' \ + ';; (load "/usr/local/share/emacs/site-lisp/nice/nice-startup.el")'\ + '\n\n(setq load-path (cons "/usr/local/share/emacs/site-lisp/nice" load-path))\n\n' \ + > ${CURDIR}/tmp/$(BUILDROOT)/share/emacs/site-lisp/nice/nice-startup.el + cat $(BUILDROOT)/lib/share/emacs/site-lisp/nice/nice-startup.el \ + >>${CURDIR}/tmp/$(BUILDROOT)/share/emacs/site-lisp/nice/nice-startup.el cd tmp && tar -czf ../${TARFILE} $(BUILDROOT) --owner=0 --group=0 .PHONY: rpm ! rpm ${RPMDIR}/${RPMFILE}: $(DEB) ${clean-tmp} cp rpmmacros ~/.rpmmacros mkdir -p ${RPMTMP} mkdir -p tmp/BUILD ! cd $(BUILDROOT) && $(MAKE) install\ ! PREFIX=${RPMTMP}/usr \ ! LISPDIR=${RPMTMP}/usr/share/emacs/site-lisp cd tmp && tar zcf ${CURDIR}/tmp/Nice-${VERSION}.tar.gz Nice-${VERSION} sed "s/VERSION/${VERSION}/" Nice.spec > tmp/Nice-${VERSION}.spec ! rpmbuild --target=noarch --buildroot=${RPMTMP} -bb tmp/Nice-${VERSION}.spec |
From: <bo...@pr...> - 2004-01-25 03:24:17
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13058 Modified Files: NEWS Log Message: Automatic registration of the Emacs mode for the SuSE Linux distribution. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** NEWS 18 Jan 2004 20:38:40 -0000 1.17 --- NEWS 25 Jan 2004 03:23:39 -0000 1.18 *************** *** 10,13 **** --- 10,15 ---- * Stricter parsing of expression used as statement. * Improved performance of arrays used as lists. + * Fixed the file locations in the RPM package, and added automatic + registration of the emacs mode for the SuSE Linux distribution. * Bug fixes (checking of local variables in a call position, make it possible to use new Object() and dispatch on Object again, code generation of |
From: <bo...@pr...> - 2004-01-25 03:24:17
|
Update of /cvsroot/nice/Nice/lib/emacs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13058/lib/emacs Modified Files: nice-startup.el Log Message: Automatic registration of the Emacs mode for the SuSE Linux distribution. Index: nice-startup.el =================================================================== RCS file: /cvsroot/nice/Nice/lib/emacs/nice-startup.el,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** nice-startup.el 21 Feb 2002 15:12:23 -0000 1.1 --- nice-startup.el 25 Jan 2004 03:23:38 -0000 1.2 *************** *** 1,7 **** - ;; Load this file from your .emacs with: - ;; (load "/usr/local/share/emacs/site-lisp/nice/nice-startup.el") - - (setq load-path (cons "/usr/local/share/emacs/site-lisp/nice" load-path)) - (setq auto-mode-alist (cons '("\\.nicei?$" . nice-mode) auto-mode-alist)) (autoload 'nice-mode "nice-mode" "Major mode for editing Nice code." t) --- 1,2 ---- |
From: <bo...@pr...> - 2004-01-25 02:50:06
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7371 Modified Files: Makefile Log Message: Allow the jar binary to be overriden. Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/Makefile,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** Makefile 15 Dec 2003 20:13:57 -0000 1.133 --- Makefile 25 Jan 2004 02:49:23 -0000 1.134 *************** *** 26,31 **** TOP=${PWD} ! java = java javac = javac JAVAC_FLAGS = -O -g --- 26,32 ---- TOP=${PWD} ! java = java javac = javac + jar = jar JAVAC_FLAGS = -O -g *************** *** 68,79 **** mkdir -p share/java cp src/nice/tools/compiler/console.jar share/java/nice.jar ! jar umf src/nice/tools/compiler/Manifest share/java/nice.jar -C classes nice -C classes mlsub -C classes bossa -C classes gnu -C classes.old bossa -C classes.old mlsub -C classes.old nice ! if [ -r classes/lang/package.nicei ]; then cd classes; jar uf ../share/java/nice.jar nice/*/package.nicei; fi archive archive2 archive3 share/java/nice.jar: src/nice/tools/compiler/console.jar mkdir -p share/java cp src/nice/tools/compiler/console.jar share/java/nice.jar ! jar umf src/nice/tools/compiler/Manifest share/java/nice.jar -C classes nice -C classes mlsub -C classes bossa -C classes gnu ! if [ -r classes/lang/package.nicei ]; then cd classes; jar uf ../share/java/nice.jar nice/*/package.nicei; fi --- 69,80 ---- mkdir -p share/java cp src/nice/tools/compiler/console.jar share/java/nice.jar ! $(jar) umf src/nice/tools/compiler/Manifest share/java/nice.jar -C classes nice -C classes mlsub -C classes bossa -C classes gnu -C classes.old bossa -C classes.old mlsub -C classes.old nice ! if [ -r classes/lang/package.nicei ]; then cd classes; $(jar) uf ../share/java/nice.jar nice/*/package.nicei; fi archive archive2 archive3 share/java/nice.jar: src/nice/tools/compiler/console.jar mkdir -p share/java cp src/nice/tools/compiler/console.jar share/java/nice.jar ! $(jar) umf src/nice/tools/compiler/Manifest share/java/nice.jar -C classes nice -C classes mlsub -C classes bossa -C classes gnu ! if [ -r classes/lang/package.nicei ]; then cd classes; $(jar) uf ../share/java/nice.jar nice/*/package.nicei; fi *************** *** 121,130 **** gcj: cp src/nice/tools/compiler/console.jar $(GCJTEMP) ! jar umf src/mainClass $(GCJTEMP) -C classes nice/doc -C classes nice/getopt -C classes nice/lang -C classes nice/tools/ast -C classes nice/tools/code -C classes nice/tools/compiler -C classes nice/tools/util -C classes mlsub -C classes bossa -C classes gnu $(GCJ) --main=nice.tools.compiler.fun -o bin/nicec.bin $(GCJTEMP) gcj-testsuite: cp src/nice/tools/compiler/console.jar $(GCJTEMP) ! jar umf src/mainClass $(GCJTEMP) -C classes nice/doc -C classes nice/getopt -C classes nice/lang -C classes nice/tools/ast -C classes nice/tools/code -C classes nice/tools/compiler -C classes nice/tools/util -C classes nice/tools/testsuite -C classes mlsub -C classes bossa -C classes gnu $(GCJ) -g --main=nice.tools.testsuite.TestNice -o bin/testsuite.bin $(GCJTEMP) --- 122,131 ---- gcj: cp src/nice/tools/compiler/console.jar $(GCJTEMP) ! $(jar) umf src/mainClass $(GCJTEMP) -C classes nice/doc -C classes nice/getopt -C classes nice/lang -C classes nice/tools/ast -C classes nice/tools/code -C classes nice/tools/compiler -C classes nice/tools/util -C classes mlsub -C classes bossa -C classes gnu $(GCJ) --main=nice.tools.compiler.fun -o bin/nicec.bin $(GCJTEMP) gcj-testsuite: cp src/nice/tools/compiler/console.jar $(GCJTEMP) ! $(jar) umf src/mainClass $(GCJTEMP) -C classes nice/doc -C classes nice/getopt -C classes nice/lang -C classes nice/tools/ast -C classes nice/tools/code -C classes nice/tools/compiler -C classes nice/tools/util -C classes nice/tools/testsuite -C classes mlsub -C classes bossa -C classes gnu $(GCJ) -g --main=nice.tools.testsuite.TestNice -o bin/testsuite.bin $(GCJTEMP) |
From: <bo...@pr...> - 2004-01-25 01:25:36
|
Update of /cvsroot/nice/Nice/distrib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23448 Modified Files: Makefile Log Message: Correctly create the RPM package with files rooted in /usr, not /usr/nice-X.Y.Z now that the tar file contains the nice-X.Y.Z prefix. Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/distrib/Makefile,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Makefile 16 Dec 2003 12:49:02 -0000 1.11 --- Makefile 25 Jan 2004 01:24:48 -0000 1.12 *************** *** 53,59 **** ${clean-tmp} cp rpmmacros ~/.rpmmacros ! mkdir -p ${RPMTMP}/usr mkdir -p tmp/BUILD ! cd ${RPMTMP}/usr && tar xzf ${CURDIR}/${TARFILE} cd tmp && tar zcf ${CURDIR}/tmp/Nice-${VERSION}.tar.gz Nice-${VERSION} sed "s/VERSION/${VERSION}/" Nice.spec > tmp/Nice-${VERSION}.spec --- 53,59 ---- ${clean-tmp} cp rpmmacros ~/.rpmmacros ! mkdir -p ${RPMTMP} mkdir -p tmp/BUILD ! cd ${RPMTMP} && tar xzf ${CURDIR}/${TARFILE} && mv nice-$(VERSION) usr cd tmp && tar zcf ${CURDIR}/tmp/Nice-${VERSION}.tar.gz Nice-${VERSION} sed "s/VERSION/${VERSION}/" Nice.spec > tmp/Nice-${VERSION}.spec |
From: <lv...@pr...> - 2004-01-25 00:20:30
|
Update of /cvsroot/nice/swing/src/nice/ui/common/types/awt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10230 Modified Files: java.nice Log Message: void remove(java.awt.Container, Component) was retyped twice with exactly the same signature. remove the second, it confuses the compiler. Index: java.nice =================================================================== RCS file: /cvsroot/nice/swing/src/nice/ui/common/types/awt/java.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** java.nice 30 Apr 2003 14:02:24 -0000 1.5 --- java.nice 25 Jan 2004 00:19:54 -0000 1.6 *************** *** 769,774 **** void processContainerEvent(java.awt.Container, ContainerEvent) = native void java.awt.Container.processContainerEvent(ContainerEvent); - void remove(java.awt.Container, Component) - = native void java.awt.Container.remove(Component); void setLayout(java.awt.Container, LayoutManager) = native void java.awt.Container.setLayout(LayoutManager); --- 769,772 ---- |
From: <lv...@pr...> - 2004-01-24 21:51:00
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5749 Modified Files: install.xml language.html manual.xml safety.xml visitor.html Log Message: spelling fixes courtesy of ispell -H Index: install.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/install.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** install.xml 16 Dec 2003 12:49:02 -0000 1.10 --- install.xml 24 Jan 2004 21:50:23 -0000 1.11 *************** *** 157,161 **** <para> There are no specific instructions for other operating systems. ! Howevever &nice; can be used on any system that works with &java;. If you are in this situation, please <ulink url="mailto:bo...@us...">contact me</ulink> --- 157,161 ---- <para> There are no specific instructions for other operating systems. ! However &nice; can be used on any system that works with &java;. If you are in this situation, please <ulink url="mailto:bo...@us...">contact me</ulink> Index: language.html =================================================================== RCS file: /cvsroot/nice/Nice/web/language.html,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** language.html 23 Dec 2003 11:31:46 -0000 1.21 --- language.html 24 Jan 2004 21:50:23 -0000 1.22 *************** *** 17,21 **** Nice programming language. The goal is to help you write your first Nice programs. It does not describe every feature of the language, nor gives ! it a complete description of the powerfull type system. <br> --- 17,21 ---- Nice programming language. The goal is to help you write your first Nice programs. It does not describe every feature of the language, nor gives ! it a complete description of the powerful type system. <br> *************** *** 151,155 **** <a href="http://nice.sourceforge.net/cgi-bin/twiki/view/Doc/FunctionsAndMethods"> ! more detailed introduction to methods in Nice</a> on the wiki. <br> --- 151,155 ---- <a href="http://nice.sourceforge.net/cgi-bin/twiki/view/Doc/FunctionsAndMethods"> ! more detailed introduction to methods in Nice</a> on the Wiki. <br> *************** *** 160,164 **** Classes and interfaces can have type parameters. For example, the <tt>Collection</tt> ! interface is parametrized by the type of its elements: <p> <PRE> --- 160,164 ---- Classes and interfaces can have type parameters. For example, the <tt>Collection</tt> ! interface is parameterized by the type of its elements: <p> <PRE> *************** *** 198,202 **** of type <tt>Collection<int></tt> and <tt>LinkedList<int></tt>, while it is not with types <tt>Collection<String></tt> and <tt>String</tt>. ! <p>This approach is more sensible than Java's one, where the laters would be allowed and would always return false (not even raising a runtime error), while it is very likely a bug to compare a collection of strings to a string. --- 198,202 ---- of type <tt>Collection<int></tt> and <tt>LinkedList<int></tt>, while it is not with types <tt>Collection<String></tt> and <tt>String</tt>. ! <p>This approach is more sensible than Java's one, where the latter would be allowed and would always return false (not even raising a runtime error), while it is very likely a bug to compare a collection of strings to a string. *************** *** 208,217 **** <h2>Precise types</h2> ! Java's type system is too simple to express many usefull types. For instance, let's suppose we want to declare the method <tt>filter</tt> on collections. This method applies a function to each element of the collection, and returns a new collection containing the elements for which that function returns <tt>true</tt>. ! Futhermore, the new collection is an instance of the same class as the original collection: <tt>filter</tt> applied to a <tt>List</tt> return a new <tt>List</tt>, --- 208,217 ---- <h2>Precise types</h2> ! Java's type system is too simple to express many useful types. For instance, let's suppose we want to declare the method <tt>filter</tt> on collections. This method applies a function to each element of the collection, and returns a new collection containing the elements for which that function returns <tt>true</tt>. ! Furthermore, the new collection is an instance of the same class as the original collection: <tt>filter</tt> applied to a <tt>List</tt> return a new <tt>List</tt>, *************** *** 348,355 **** <ul> <li> ! <b>No casts</b>. We claim that our powerfull type system makes it possible to avoid nearly every cast used in other object-oriented languages (say 95% of them!). For the 5% remaining, it is possible to write methods that ! do the same job, except you have to explicitely write what happens if the "cast" fails, which is a nice property.</li> --- 348,355 ---- <ul> <li> ! <b>No casts</b>. We claim that our powerful type system makes it possible to avoid nearly every cast used in other object-oriented languages (say 95% of them!). For the 5% remaining, it is possible to write methods that ! do the same job, except you have to explicitly write what happens if the "cast" fails, which is a nice property.</li> *************** *** 381,385 **** <b>Functional arguments</b>. A function or a method can have functional arguments. The syntax for functional types is <tt>(T1, T2, ..., Tn) ! -> T</tt>. The parentheses can be ommited if there is only one argument type: <tt>int->int</tt>. </li> --- 381,385 ---- <b>Functional arguments</b>. A function or a method can have functional arguments. The syntax for functional types is <tt>(T1, T2, ..., Tn) ! -> T</tt>. The parentheses can be omitted if there is only one argument type: <tt>int->int</tt>. </li> *************** *** 438,446 **** It is possible to use java classes and methods from Nice programs. This ! is a great advantage, since it gives access to the gigantic and evergrowing set of Java libraries. <p>One can just use java classes in types, and call java methods in Nice ! code. It is not necessary to explicitely import classes or methods. An ! import statement can be used if one does not want to reapeat a package name. <p><tt>import java.io.*;</tt> --- 438,446 ---- It is possible to use java classes and methods from Nice programs. This ! is a great advantage, since it gives access to the gigantic and ever-growing set of Java libraries. <p>One can just use java classes in types, and call java methods in Nice ! code. It is not necessary to explicitly import classes or methods. An ! import statement can be used if one does not want to repeat a package name. <p><tt>import java.io.*;</tt> Index: manual.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/manual.xml,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** manual.xml 18 Dec 2003 00:58:20 -0000 1.32 --- manual.xml 24 Jan 2004 21:50:23 -0000 1.33 *************** *** 834,838 **** of the arguments are used to try to disambiguate which method must be called. If only one method is applicable, it is called. ! Moreoever, if several methods are applicable, but one has a more restricted domain than all the others, it is chosen <footnote> --- 834,838 ---- of the arguments are used to try to disambiguate which method must be called. If only one method is applicable, it is called. ! Moreover, if several methods are applicable, but one has a more restricted domain than all the others, it is chosen <footnote> *************** *** 986,990 **** </para> <example> ! <title>String concatentation</title> <programlisting lang="nice"><![CDATA[ String name = "Nice"; --- 986,990 ---- </para> <example> ! <title>String concatenation</title> <programlisting lang="nice"><![CDATA[ String name = "Nice"; *************** *** 1133,1137 **** </para> <para> ! In most cases, characters should be treatead as abstract entities and not as the numbers that happen to encode them. Therefore, the <literal>char</literal> type is not a numeric type in Nice. --- 1133,1137 ---- </para> <para> ! In most cases, characters should be treated as abstract entities and not as the numbers that happen to encode them. Therefore, the <literal>char</literal> type is not a numeric type in Nice. Index: safety.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/safety.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** safety.xml 23 Jan 2004 00:30:43 -0000 1.10 --- safety.xml 24 Jan 2004 21:50:23 -0000 1.11 *************** *** 26,30 **** Programming is a complex and error prone task. The most obvious consequence of this fact is the presence of bugs in programs. Every ! user can experience that, for most softwares, there are are ways to use it that lead to inappropriate results, internal error messages or even termination of the program, if not of the whole computer. A --- 26,30 ---- Programming is a complex and error prone task. The most obvious consequence of this fact is the presence of bugs in programs. Every ! user can experience that, for most software, there are are ways to use it that lead to inappropriate results, internal error messages or even termination of the program, if not of the whole computer. A *************** *** 232,236 **** In most object-oriented languages, methods are selected at run time depending on the class of the first argument. Because this first ! argument has such a distinct role, it is syntaxically separated from the others, and place before the name of the method, before a dot. However, it is sometimes necessary to select a method depending --- 232,236 ---- In most object-oriented languages, methods are selected at run time depending on the class of the first argument. Because this first ! argument has such a distinct role, it is syntactically separated from the others, and place before the name of the method, before a dot. However, it is sometimes necessary to select a method depending *************** *** 476,480 **** very useful in practice. Code using arrays contains a few idiomatic patterns that occur repeatedly: iterating through the elements of an ! array, finding an element matching a certain criterium, ... These are typically done using loops. Besides being a little tedious, these patterns open the opportunity for mistakes in the indexes, which leads --- 476,480 ---- very useful in practice. Code using arrays contains a few idiomatic patterns that occur repeatedly: iterating through the elements of an ! array, finding an element matching a certain criterion, ... These are typically done using loops. Besides being a little tedious, these patterns open the opportunity for mistakes in the indexes, which leads Index: visitor.html =================================================================== RCS file: /cvsroot/nice/Nice/web/visitor.html,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** visitor.html 16 Jan 2004 16:48:48 -0000 1.4 --- visitor.html 24 Jan 2004 21:50:23 -0000 1.5 *************** *** 91,95 **** would be added to each class. <p> ! Anothe possiblity would be to define a static method in the new package. But then it would be necessary to test the argument with <tt>instanceof</tt> and use downcasts. --- 91,95 ---- would be added to each class. <p> ! Another possibility would be to define a static method in the new package. But then it would be necessary to test the argument with <tt>instanceof</tt> and use downcasts. *************** *** 174,180 **** <h2> ! Comparison of the two approches</h2> Multi-methods allow to solve the situation at which the Visitor pattern ! aims, without carrying its disavantages: <ol> <li> --- 174,180 ---- <h2> ! Comparison of the two approaches</h2> Multi-methods allow to solve the situation at which the Visitor pattern ! aims, without carrying its disadvantages: <ol> <li> |
From: <bo...@pr...> - 2004-01-23 00:31:30
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19246 Modified Files: safety.xml Log Message: Typography. Index: safety.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/safety.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** safety.xml 22 Jan 2004 23:27:37 -0000 1.9 --- safety.xml 23 Jan 2004 00:30:43 -0000 1.10 *************** *** 136,140 **** <para> &java; allow casts of the form: <literal>(T) e</literal>. ! At compile time, this assumes that <literal>e</literal> has type <literal>T</literal>. At run time, if <literal>e</literal> does not evaluate to a value of type --- 136,140 ---- <para> &java; allow casts of the form: <literal>(T) e</literal>. ! At compile time, this assumes that the expression <literal>e</literal> has type <literal>T</literal>. At run time, if <literal>e</literal> does not evaluate to a value of type *************** *** 184,191 **** <listitem><para> there is no way to specify that the stack should only contain ! strings </para></listitem> <listitem><para> ! this forces to cast every element pop'ed out of the stack </para></listitem> <listitem><para> --- 184,191 ---- <listitem><para> there is no way to specify that the stack should only contain ! strings; </para></listitem> <listitem><para> ! this forces to cast every element pop'ed out of the stack; </para></listitem> <listitem><para> *************** *** 417,422 **** Here obviously comes our motto: all this checking should be done automatically. This is exactly what Nice does. One documents whether a ! type can hold the null value by simply prefixing it with the '?' ! symbol. Thus: <literal>?String name;</literal> is the declaration of String variable that might be null. To get its length, one must write --- 417,422 ---- Here obviously comes our motto: all this checking should be done automatically. This is exactly what Nice does. One documents whether a ! type can hold the null value by simply prefixing it with the ! <literal>?</literal> symbol. Thus: <literal>?String name;</literal> is the declaration of String variable that might be null. To get its length, one must write |
From: <bo...@pr...> - 2004-01-22 23:28:29
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9714 Modified Files: safety.xml Log Message: Make it easier to do automatic syntax highlighting by using CDATA instead of character entities. Fixed the foreach example, which was incorrect. Index: safety.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/safety.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** safety.xml 16 Jan 2004 16:48:55 -0000 1.8 --- safety.xml 22 Jan 2004 23:27:37 -0000 1.9 *************** *** 175,179 **** st.push(new Object()); // invalid code, but not detected ... ! String s = (String) st.pop(); // throws a <javaexn name="ClassCastException"/> </programlisting> </para> --- 175,179 ---- st.push(new Object()); // invalid code, but not detected ... ! String s = (String) st.pop(); // throws a ClassCastException </programlisting> </para> *************** *** 204,209 **** <para> ! <programlisting lang="nice"> ! interface Stack<T> { void push(T element); --- 204,209 ---- <para> ! <programlisting lang="nice"><![CDATA[ ! interface Stack<T> { void push(T element); *************** *** 211,220 **** } ! Stack<String> st = new StackImpl(); st.push("Element A"); //st.push(new Object()); // type error ... String s = st.pop(); // no cast needed ! </programlisting> </para> --- 211,220 ---- } ! Stack<String> st = new StackImpl(); st.push("Element A"); //st.push(new Object()); // type error ... String s = st.pop(); // no cast needed ! ]]></programlisting> </para> *************** *** 240,244 **** <para> ! <programlisting lang="java"> class Person { --- 240,244 ---- <para> ! <programlisting lang="java"><![CDATA[ class Person { *************** *** 248,259 **** boolean equals(Object that) { ! if(!(that instanceof Person)) return false; return name.equals(((Person) that).name) ! && age==((Person) that).age; } } ! </programlisting> </para> --- 248,260 ---- boolean equals(Object that) { ! if (!(that instanceof Person)) return false; + return name.equals(((Person) that).name) ! && age == ((Person) that).age; } } ! ]]></programlisting> </para> *************** *** 272,276 **** <para> ! <programlisting lang="nice"> class Person { --- 273,277 ---- <para> ! <programlisting lang="nice"><![CDATA[ class Person { *************** *** 281,289 **** { return ! this.name.equals(that.name) ! && this.age == that.age; } } ! </programlisting> </para> </section> --- 282,290 ---- { return ! name.equals(that.name) ! && age == that.age; } } ! ]]></programlisting> </para> </section> *************** *** 326,344 **** <para> ! <programlisting lang="nice"> ! private ?List<Component> children(Component); children(Component c) = null; children(ContainerComponent c) = c.getChildren(); ! </programlisting> </para> <para> We can now write our example with only: ! <programlisting lang="nice"> Component c = ...; ! ?List<Component> children = children(c); ! </programlisting> </para> --- 327,345 ---- <para> ! <programlisting lang="nice"><![CDATA[ ! private ?List<Component> children(Component); children(Component c) = null; children(ContainerComponent c) = c.getChildren(); ! ]]></programlisting> </para> <para> We can now write our example with only: ! <programlisting lang="nice"><![CDATA[ Component c = ...; ! ?List<Component> children = children(c); ! ]]></programlisting> </para> *************** *** 360,372 **** useless; there is no reason to ask the programmer to write it. Therefore, it is perfectly legal in &nice; to write: ! <programlisting lang="nice"> Component c = ...; ! ?List<Component> children; if (c instanceof ContainerComponent) children = c.getChildren(); else children = null; ! </programlisting> </para> --- 361,373 ---- useless; there is no reason to ask the programmer to write it. Therefore, it is perfectly legal in &nice; to write: ! <programlisting lang="nice"><![CDATA[ Component c = ...; ! ?List<Component> children; if (c instanceof ContainerComponent) children = c.getChildren(); else children = null; ! ]]></programlisting> </para> *************** *** 494,510 **** tasks on arrays, and more generally collections. For instance, a simple iteration on the elements ! <programlisting lang="java"> ! for (int i = 0; i < a.length; i++) ! doSomething; ! </programlisting> can also be written in &nice; <programlisting lang="nice"> ! a.foreach( int i => doSomething ); </programlisting> ! Using these functions makes the code somewhat clearer by avoiding the repetition of the loop code over and over. Moreover, it removes the risks of wrong indexes, forgetting to increment the index, ... ! Even if a custom looping function is needed, it only has to be checked only ! once and for all. </para> </section> --- 495,514 ---- tasks on arrays, and more generally collections. For instance, a simple iteration on the elements ! <programlisting lang="java"><![CDATA[ ! for (int i = 0; i < a.length; i++) ! doSomething(a[i]); ! ]]></programlisting> can also be written in &nice; <programlisting lang="nice"> ! a.foreach(doSomething); </programlisting> ! Using methods like <literal>foreach</literal> makes the code clearer by ! avoiding the repetition of the loop code over and over. Moreover, it removes the risks of wrong indexes, forgetting to increment the index, ... ! It is important to note that <literal>foreach</literal> is not a built-in ! operator but a normal method defined in the standard library. ! Therefore, given a user-defined data structure, a new looping function ! can be written and only has to be checked once. </para> </section> |
From: <ar...@us...> - 2004-01-21 13:16:42
|
Update of /cvsroot/nice/Nice/testsuite/compiler/null In directory sc8-pr-cvs1:/tmp/cvs-serv6008/F:/nice/testsuite/compiler/null Modified Files: inference.testsuite Log Message: Bug case for typechecking of a do while loop. Index: inference.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/null/inference.testsuite,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** inference.testsuite 30 Nov 2003 14:24:35 -0000 1.9 --- inference.testsuite 21 Jan 2004 13:16:39 -0000 1.10 *************** *** 378,380 **** ?String x = null; boolean b = x == null || (x = null) == "" || x.length() > 3; ! --- 378,391 ---- ?String x = null; boolean b = x == null || (x = null) == "" || x.length() > 3; ! ! /// FAIL bug ! ?String s = "xyz"; ! String t = "abc"; ! int x = 0; ! if ( s != null) ! { ! do { ! t = s; ! s = null; ! } while(x++ < 10); ! } |
From: <lv...@us...> - 2004-01-19 20:53:53
|
Update of /cvsroot/nice/swing/src/nice/ui/common/types/swing In directory sc8-pr-cvs1:/tmp/cvs-serv21649/src/nice/ui/common/types/swing Modified Files: java.nice Log Message: Add retypings for some of JMenu and JMenuItem Index: java.nice =================================================================== RCS file: /cvsroot/nice/swing/src/nice/ui/common/types/swing/java.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** java.nice 23 Apr 2003 20:01:36 -0000 1.4 --- java.nice 19 Jan 2004 20:53:45 -0000 1.5 *************** *** 561,562 **** --- 561,585 ---- <T> void showMessageDialog(Component parentComponent, T message, String title, int messageType, Icon icon) = native void JOptionPane.showMessageDialog(Component, Object, String, int, Icon); + + // class JMenu + JMenuItem add(JMenu, JMenuItem) + = native JMenuItem JMenu.add(JMenuItem); + JMenuItem add(JMenu, String) + = native JMenuItem JMenu.add(String); + JMenuItem getItem(JMenu, int) + = native JMenuItem JMenu.getItem(int); + JMenuItem insert(JMenu, JMenuItem, int) + = native JMenuItem JMenu.insert(JMenuItem, int); + void insert(JMenu, String, int) + = native void JMenu.insert(String, int); + void remove(JMenu, Component) + = native void JMenu.remove(Component); + void remove(JMenu, JMenuItem) + = native void JMenu.remove(JMenuItem); + + // class JMenuBar + JMenu add(JMenuBar, JMenu) + = native JMenu JMenuBar.add(JMenu); + void setHelpMenu(JMenuBar, JMenu) + = native void JMenuBar.setHelpMenu(JMenu); + |
From: <bo...@us...> - 2004-01-18 20:38:50
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv19382/src/bossa/syntax Modified Files: OverloadedSymbolExp.java Log Message: Support implicit 'this' for functional fields. Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** OverloadedSymbolExp.java 18 Jan 2004 18:33:41 -0000 1.64 --- OverloadedSymbolExp.java 18 Jan 2004 20:38:40 -0000 1.65 *************** *** 48,51 **** --- 48,58 ---- } + private OverloadedSymbolExp(List symbols, LocatedString ident, + boolean noImplicitThis) + { + this(symbols, ident); + this.noImplicitThis = noImplicitThis; + } + OverloadedSymbolExp(VarSymbol symbol, LocatedString ident) { *************** *** 90,93 **** --- 97,103 ---- LinkedList removed = new LinkedList(); + // Useful in case of failure, to try adding an implicit 'this'. + List fieldAccesses = filterFieldAccesses(); + for(Iterator i = symbols.iterator(); i.hasNext();) { *************** *** 119,123 **** if (symbols.size() == 0) ! User.error(this, noMatchError(removed, arguments)); // SECOND PASS: check argument types --- 129,142 ---- if (symbols.size() == 0) ! { ! if (! noImplicitThis) ! { ! Expression res = givePriorityToFields(fieldAccesses); ! if (res != null) ! return res; ! } ! ! User.error(this, noMatchError(removed, arguments)); ! } // SECOND PASS: check argument types *************** *** 156,169 **** if (symbols.size() == 0) ! if (removed.size() == 1) ! User.error(this, ! "Arguments " + arguments.printTypes() + ! " do not fit: \n" + removed.get(0)); ! else ! User.error(this, ! "No possible call for " + ident + ! ".\nArguments: " + arguments.printTypes() + ! "\nPossibilities:\n" + ! Util.map("", "\n", "", removed)); removeNonMinimal(symbols, arguments); --- 175,197 ---- if (symbols.size() == 0) ! { ! if (! noImplicitThis) ! { ! Expression res = givePriorityToFields(fieldAccesses); ! if (res != null) ! return res; ! } ! ! if (removed.size() == 1) ! User.error(this, ! "Arguments " + arguments.printTypes() + ! " do not fit: \n" + removed.get(0)); ! else ! User.error(this, ! "No possible call for " + ident + ! ".\nArguments: " + arguments.printTypes() + ! "\nPossibilities:\n" + ! Util.map("", "\n", "", removed)); ! } removeNonMinimal(symbols, arguments); *************** *** 308,312 **** try { CallExp res = new CallExp ! (new OverloadedSymbolExp(fieldAccesses, ident), //Arguments.noArguments()); new Arguments(new Arguments.Argument[]{new Arguments.Argument(Node.thisExp)})); --- 336,340 ---- try { CallExp res = new CallExp ! (new OverloadedSymbolExp(fieldAccesses, ident, true), //Arguments.noArguments()); new Arguments(new Arguments.Argument[]{new Arguments.Argument(Node.thisExp)})); *************** *** 532,535 **** --- 560,566 ---- LocatedString ident; + /** Do not try to add an implicit 'this' access. */ + private boolean noImplicitThis; + /**************************************************************** * Error messages |
From: <bo...@us...> - 2004-01-18 20:38:50
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1:/tmp/cvs-serv19382 Modified Files: NEWS Log Message: Support implicit 'this' for functional fields. Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NEWS 18 Jan 2004 03:33:37 -0000 1.16 --- NEWS 18 Jan 2004 20:38:40 -0000 1.17 *************** *** 13,17 **** to use new Object() and dispatch on Object again, code generation of integer constants, overloading of function symbols, printing of string ! literals with escaped chars, ... ) -- --- 13,17 ---- to use new Object() and dispatch on Object again, code generation of integer constants, overloading of function symbols, printing of string ! literals with escaped chars, implicit 'this' for functional fields, ... ) -- |
From: <bo...@us...> - 2004-01-18 20:38:50
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv19382/testsuite/compiler/classes Modified Files: this.testsuite Log Message: Support implicit 'this' for functional fields. Index: this.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/this.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** this.testsuite 15 Jan 2004 21:39:19 -0000 1.6 --- this.testsuite 18 Jan 2004 20:38:40 -0000 1.7 *************** *** 113,114 **** --- 113,130 ---- getX(this@A) = x; + + /// PASS + /// Toplevel + // Implicit this used on a functional field. + class A { + String->void avv; + void m(String s) = avv(s); + } + + /// PASS + /// Toplevel + // Implicit this used on a functional field. + class A { + (String,String)->void avv; + void m(String s) = avv(s,s); + } |
From: <ar...@us...> - 2004-01-18 18:33:45
|
Update of /cvsroot/nice/Nice/testsuite/compiler/overloading In directory sc8-pr-cvs1:/tmp/cvs-serv26320/F:/nice/testsuite/compiler/overloading Modified Files: ambiguity.testsuite Log Message: Give global vars priority over methods symbols in noOverloading(). Index: ambiguity.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/overloading/ambiguity.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ambiguity.testsuite 27 May 2003 12:40:08 -0000 1.1 --- ambiguity.testsuite 18 Jan 2004 18:33:42 -0000 1.2 *************** *** 1,4 **** ! /// FAIL let i = foo; /// Toplevel var int foo = 0; --- 1,5 ---- ! /// PASS let i = foo; + assert i == 0; /// Toplevel var int foo = 0; |
From: <ar...@us...> - 2004-01-18 18:33:45
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions In directory sc8-pr-cvs1:/tmp/cvs-serv26320/F:/nice/testsuite/compiler/expressions Modified Files: conditional.testsuite Log Message: Give global vars priority over methods symbols in noOverloading(). Index: conditional.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/conditional.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** conditional.testsuite 2 Apr 2003 16:52:40 -0000 1.3 --- conditional.testsuite 18 Jan 2004 18:33:42 -0000 1.4 *************** *** 9,13 **** /// Toplevel int nameX() = 0; ! var int nameX = 1; int dummy() = false ? 0 : nameX; --- 9,13 ---- /// Toplevel int nameX() = 0; ! byte nameX() = 1; int dummy() = false ? 0 : nameX; |
From: <ar...@us...> - 2004-01-18 18:33:44
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv26320/F:/nice/src/bossa/syntax Modified Files: OverloadedSymbolExp.java Log Message: Give global vars priority over methods symbols in noOverloading(). Index: OverloadedSymbolExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/OverloadedSymbolExp.java,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** OverloadedSymbolExp.java 17 Jan 2004 20:59:51 -0000 1.63 --- OverloadedSymbolExp.java 18 Jan 2004 18:33:41 -0000 1.64 *************** *** 280,283 **** --- 280,294 ---- return res; + LinkedList globalvars = new LinkedList(); + for(Iterator i = symbols.iterator(); i.hasNext();) + { + VarSymbol sym = (VarSymbol) i.next(); + if (sym instanceof GlobalVarDeclaration.GlobalVarSymbol) + globalvars.add(sym); + } + + if (globalvars.size() > 0) + return new OverloadedSymbolExp(globalvars, ident).noOverloading(); + if (symbols.size() != 0) throw new AmbiguityError(); |
From: <ar...@us...> - 2004-01-18 03:33:40
|
Update of /cvsroot/nice/Nice/testsuite/compiler/packages In directory sc8-pr-cvs1:/tmp/cvs-serv5036/F:/nice/testsuite/compiler/packages Modified Files: nicei.testsuite Log Message: Fix for bug #879027(printing of strings with escaped chars). Index: nicei.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/packages/nicei.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nicei.testsuite 30 Nov 2003 14:24:35 -0000 1.5 --- nicei.testsuite 18 Jan 2004 03:33:37 -0000 1.6 *************** *** 92,93 **** --- 92,104 ---- /// package b import a {} + + /// PASS + /// package a + /// toplevel + let String s = "abc\n"; + let String t = """abc + def"""; + + /// package b import a + assert s.equals("abc\n"); + assert t.equals("abc\ndef"); |
From: <ar...@us...> - 2004-01-18 03:33:40
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1:/tmp/cvs-serv5036/nice Modified Files: NEWS Log Message: Fix for bug #879027(printing of strings with escaped chars). Index: NEWS =================================================================== RCS file: /cvsroot/nice/Nice/NEWS,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** NEWS 17 Jan 2004 20:59:52 -0000 1.15 --- NEWS 18 Jan 2004 03:33:37 -0000 1.16 *************** *** 12,16 **** * Bug fixes (checking of local variables in a call position, make it possible to use new Object() and dispatch on Object again, code generation of ! integer constants, overloading of function symbols, ... ) -- --- 12,17 ---- * Bug fixes (checking of local variables in a call position, make it possible to use new Object() and dispatch on Object again, code generation of ! integer constants, overloading of function symbols, printing of string ! literals with escaped chars, ... ) -- |
From: <ar...@us...> - 2004-01-18 03:33:40
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv5036/F:/nice/src/bossa/syntax Modified Files: StringConstantExp.java Log Message: Fix for bug #879027(printing of strings with escaped chars). Index: StringConstantExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/StringConstantExp.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** StringConstantExp.java 1 Oct 2003 21:49:03 -0000 1.10 --- StringConstantExp.java 18 Jan 2004 03:33:37 -0000 1.11 *************** *** 31,38 **** { className = stringName; - this.escapedValue = value; if (multiline) value = escapeEOL(value); this.value=unescape(value); } --- 31,38 ---- { className = stringName; if (multiline) value = escapeEOL(value); + this.escapedValue = value; this.value=unescape(value); } *************** *** 118,122 **** public String toString() { ! return "\""+value+"\""; } --- 118,122 ---- public String toString() { ! return "\""+escapedValue+"\""; } |
From: <ar...@us...> - 2004-01-18 01:14:34
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1:/tmp/cvs-serv14672/F:/nice/src/bossa/modules Modified Files: Compilation.java Content.java Package.java Compilation.nice Log Message: DocStrings will be stored in Definitions when the field storeDocStrings in Compilation is set to true. Index: Compilation.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Compilation.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Compilation.java 11 Jun 2003 22:24:08 -0000 1.7 --- Compilation.java 18 Jan 2004 01:14:30 -0000 1.8 *************** *** 31,34 **** --- 31,35 ---- public boolean excludeRuntime; public boolean strictJavaTypes; + public boolean storeDocStrings; public Locator locator; Index: Content.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Content.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Content.java 15 Dec 2003 14:04:13 -0000 1.13 --- Content.java 18 Jan 2004 01:14:31 -0000 1.14 *************** *** 74,78 **** } ! void getDefinitions(List definitions, boolean shouldReload) { Content.Unit[] readers = getReaders(shouldReload); --- 74,78 ---- } ! void getDefinitions(List definitions, boolean shouldReload, boolean storeDocStrings) { Content.Unit[] readers = getReaders(shouldReload); *************** *** 80,84 **** for(int i = 0; i<readers.length; i++) try{ ! read(readers[i], definitions); } catch(UserError ex){ --- 80,84 ---- for(int i = 0; i<readers.length; i++) try{ ! read(readers[i], definitions, storeDocStrings); } catch(UserError ex){ *************** *** 101,108 **** } ! private void read(Content.Unit unit, List definitions) { bossa.util.Location.setCurrentFile(unit.file); ! bossa.parser.Loader.open(unit.reader, definitions); } --- 101,108 ---- } ! private void read(Content.Unit unit, List definitions, boolean storeDocStrings) { bossa.util.Location.setCurrentFile(unit.file); ! bossa.parser.Loader.open(unit.reader, definitions, storeDocStrings); } Index: Package.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Package.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** Package.java 16 Dec 2003 07:44:08 -0000 1.108 --- Package.java 18 Jan 2004 01:14:31 -0000 1.109 *************** *** 122,126 **** definitions = new ArrayList(); ! source.getDefinitions(definitions, shouldReload); this.ast = new AST(this, definitions); definitions = null; --- 122,126 ---- definitions = new ArrayList(); ! source.getDefinitions(definitions, shouldReload, compilation.storeDocStrings); this.ast = new AST(this, definitions); definitions = null; Index: Compilation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Compilation.nice,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** Compilation.nice 7 Aug 2003 09:53:39 -0000 1.26 --- Compilation.nice 18 Jan 2004 01:14:31 -0000 1.27 *************** *** 46,49 **** --- 46,51 ---- boolean strictJavaTypes = false; + boolean storeDocStrings = false; + /** Location of the nice.jar file. */ ?String runtimeFile = null; |
From: <ar...@us...> - 2004-01-18 01:14:33
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv14672/F:/nice/src/bossa/parser Modified Files: Loader.java Log Message: DocStrings will be stored in Definitions when the field storeDocStrings in Compilation is set to true. Index: Loader.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Loader.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** Loader.java 15 Dec 2003 14:23:21 -0000 1.24 --- Loader.java 18 Jan 2004 01:14:30 -0000 1.25 *************** *** 53,62 **** } ! public static void open(Reader r, List definitions) { chrono.start(); try { Parser parser = new Parser(r); - boolean storeDocStrings = false; try{ --- 53,61 ---- } ! public static void open(Reader r, List definitions, boolean storeDocStrings) { chrono.start(); try { Parser parser = new Parser(r); try{ |