nice-commit Mailing List for The Nice Programming Language (Page 7)
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: Artem Gr K. <ar...@us...> - 2005-04-18 10:37:52
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20602 Modified Files: build.xml Log Message: New testengine has been separated into the "check_advanced" target. Index: build.xml =================================================================== RCS file: /cvsroot/nice/Nice/build.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** build.xml 16 Apr 2005 17:57:24 -0000 1.10 --- build.xml 18 Apr 2005 10:37:42 -0000 1.11 *************** *** 272,287 **** <target name="testengine"> <mac-javac-single includes="nice/tools/testsuite/*.java" /> - <mac-nicec-new package="nice.tools.testsuite" /> </target> <target name="check_compiler" depends="archive,testengine"> <java classpathref="freshNice" - classname="nice.tools.testsuite.dispatch" - fork="yes" - failonerror="${checkFail}" - > - <jvmarg line="${jvmArgs}" /> - <arg value="testsuite/compiler" /> - </java> - <java classpathref="freshNice" classname="nice.tools.testsuite.TestNice" fork="yes" --- 272,278 ---- *************** *** 294,318 **** <target name="check_lib" depends="archive,testengine"> <java classpathref="freshNice" ! classname="nice.tools.testsuite.dispatch" fork="yes" failonerror="${checkFail}" > <jvmarg line="${jvmArgs}" /> ! <arg value="testsuite/compiler" /> </java> <java classpathref="freshNice" ! classname="nice.tools.testsuite.TestNice" fork="yes" failonerror="${checkFail}" > <jvmarg line="${jvmArgs}" /> - <arg value="testsuite/lib" /> </java> </target> ! <target name="check" depends="check_compiler,check_lib" description="run testsuite" /> <!-- The end of testing targets. --> <target name="clean" description="remove all generated files"> <delete dir="${build}" /> <delete dir="temp-testcase" /> <delete dir="testsuite-fail-folder" /> --- 285,312 ---- <target name="check_lib" depends="archive,testengine"> <java classpathref="freshNice" ! classname="nice.tools.testsuite.TestNice" fork="yes" failonerror="${checkFail}" > <jvmarg line="${jvmArgs}" /> ! <arg value="testsuite/lib" /> </java> + </target> + <target name="check_advanced" depends="archive,testengine"> + <mac-nicec-new package="nice.tools.testsuite" /> <java classpathref="freshNice" ! classname="nice.tools.testsuite.dispatch" fork="yes" failonerror="${checkFail}" > <jvmarg line="${jvmArgs}" /> </java> </target> ! <target name="check" depends="check_compiler,check_lib,check_advanced" description="run testsuite" /> <!-- The end of testing targets. --> <target name="clean" description="remove all generated files"> <delete dir="${build}" /> + <delete dir="nice" /> <delete dir="temp-testcase" /> <delete dir="testsuite-fail-folder" /> |
From: Artem Gr K. <ar...@us...> - 2005-04-16 17:58:05
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24092 Modified Files: build.xml Log Message: Separate "compiler" target. share/java/nice.jar generated instead of classes/nice.jar. Index: build.xml =================================================================== RCS file: /cvsroot/nice/Nice/build.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** build.xml 12 Apr 2005 15:54:15 -0000 1.9 --- build.xml 16 Apr 2005 17:57:24 -0000 1.10 *************** *** 102,106 **** </target> ! <!-- Bootstrap is split into a sequence of targets, combined in the "bootstrap" target. --> <target name="core-bootstrap" depends="initialize"> <mkdir dir="${build}" /> --- 102,106 ---- </target> ! <!-- Bootstrap is split into a sequence of targets, combined in the "compiler1" target. --> <target name="core-bootstrap" depends="initialize"> <mkdir dir="${build}" /> *************** *** 198,205 **** </manifest> </target> ! <target name="compiler1" ! depends="core-bootstrap,javacc,parser,recompile,setDate,initialize" ! description="build intermediate compiler" ! > <mac-nicec-old package="bossa.syntax" args="-r" /> <mac-nicec-old package="nice.tools.compiler.console" args="-R" /> --- 198,203 ---- </manifest> </target> ! <target name="compiler" depends="initialize"> ! <!-- The last part of the bootstrapping. --> <mac-nicec-old package="bossa.syntax" args="-r" /> <mac-nicec-old package="nice.tools.compiler.console" args="-R" /> *************** *** 211,215 **** <antcall target="makeArchive" /> </target> ! <target name="compiler2"> <mac-nicec-new package="bossa.syntax" args="-R" /> <mac-nicec-new package="nice.tools.compiler.console" args="-R" /> --- 209,218 ---- <antcall target="makeArchive" /> </target> ! <target name="compiler1" ! depends="core-bootstrap,javacc,parser,recompile,setDate,compiler" ! description="build intermediate compiler" ! /> ! <target name="compiler2" depends="initialize"> ! <!-- Rebuild the compiler with itself. --> <mac-nicec-new package="bossa.syntax" args="-R" /> <mac-nicec-new package="nice.tools.compiler.console" args="-R" /> *************** *** 245,250 **** <target name="makeArchive"> ! <delete file="${build}/nice.jar" /> ! <jar destfile="${build}/nice.jar" duplicate="preserve" manifest="src/nice/tools/compiler/Manifest"> <fileset dir="${build}"> <include name="nice/**" /> --- 248,254 ---- <target name="makeArchive"> ! <delete file="share/java/nice.jar" /> ! <mkdir dir="share/java" /> ! <jar destfile="share/java/nice.jar" duplicate="preserve" manifest="src/nice/tools/compiler/Manifest"> <fileset dir="${build}"> <include name="nice/**" /> *************** *** 255,259 **** </jar> </target> ! <available file="${build}/nice.jar" property="haveArchive" /> <target name="archive" unless="haveArchive"> <antcall target="bootstrap" /> --- 259,263 ---- </jar> </target> ! <available file="share/java/nice.jar" property="haveArchive" /> <target name="archive" unless="haveArchive"> <antcall target="bootstrap" /> *************** *** 262,266 **** <target name="jar" depends="archive" description="compile and put Nice compiler into share/java/nice.jar"> - <copy file="${build}/nice.jar" todir="share/java" /> </target> --- 266,269 ---- |
From: Artem Gr K. <ar...@us...> - 2005-04-12 15:54:42
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13753 Modified Files: build.xml Log Message: New test engine integrated. Index: build.xml =================================================================== RCS file: /cvsroot/nice/Nice/build.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** build.xml 15 Mar 2005 09:58:33 -0000 1.8 --- build.xml 12 Apr 2005 15:54:15 -0000 1.9 *************** *** 269,275 **** --- 269,284 ---- <target name="testengine"> <mac-javac-single includes="nice/tools/testsuite/*.java" /> + <mac-nicec-new package="nice.tools.testsuite" /> </target> <target name="check_compiler" depends="archive,testengine"> <java classpathref="freshNice" + classname="nice.tools.testsuite.dispatch" + fork="yes" + failonerror="${checkFail}" + > + <jvmarg line="${jvmArgs}" /> + <arg value="testsuite/compiler" /> + </java> + <java classpathref="freshNice" classname="nice.tools.testsuite.TestNice" fork="yes" *************** *** 282,285 **** --- 291,302 ---- <target name="check_lib" depends="archive,testengine"> <java classpathref="freshNice" + classname="nice.tools.testsuite.dispatch" + fork="yes" + failonerror="${checkFail}" + > + <jvmarg line="${jvmArgs}" /> + <arg value="testsuite/compiler" /> + </java> + <java classpathref="freshNice" classname="nice.tools.testsuite.TestNice" fork="yes" *************** *** 295,298 **** --- 312,316 ---- <target name="clean" description="remove all generated files"> <delete dir="${build}" /> + <delete dir="temp-testcase" /> <delete dir="testsuite-fail-folder" /> <delete dir="testsuite-temp-folder" /> *************** *** 310,313 **** --- 328,336 ---- <include name="niceunit.lnk" /> </fileset> + <fileset dir="testsuite"> + <include name="**/*.class" /> + <include name="**/*.nicei" /> + <include name="**/*.jar" /> + </fileset> </delete> <delete dir="share/java" /> |
From: Artem Gr K. <ar...@us...> - 2005-04-12 15:53:24
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13295/src/nice/tools/testsuite Modified Files: runner.nice Log Message: Keep root directory clean: compile into temporary folder. Index: runner.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/runner.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** runner.nice 11 Apr 2005 12:45:35 -0000 1.1 --- runner.nice 12 Apr 2005 15:52:54 -0000 1.2 *************** *** 52,56 **** let output = consoleOutput(); let compilation = new bossa.modules.Compilation ! (listener: output, parser: new bossa.parser.JavaccParser()); compilation.runtimeFile = "share/java/nice.jar"; compilation.output = new File(tmp, "test.jar").toString(); --- 52,56 ---- let output = consoleOutput(); let compilation = new bossa.modules.Compilation ! (listener: output, parser: new bossa.parser.JavaccParser(), destinationDir: tmp.getPath()); compilation.runtimeFile = "share/java/nice.jar"; compilation.output = new File(tmp, "test.jar").toString(); |
From: Daniel B. <bo...@us...> - 2005-04-12 13:57:42
|
Update of /cvsroot/nice/Nice/src/nice/tools/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10113/src/nice/tools/util Added Files: SelfContainedClassLoader.java Log Message: Run generated jars in a self-contained classloader, so that missing classes in the jar lead to errors, instead of being loaded from the parent. Use "classes" instead of nice.jar so that recent changes immediately affect testcases. Rethrow the cause exception when a testcase fails. --- NEW FILE: SelfContainedClassLoader.java --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2005 */ /* */ /* 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; /** A class loader that does not delegate to any parent, except java* classes to the system classloader. @author Daniel Bonniot (bo...@us...) */ public class SelfContainedClassLoader extends java.net.URLClassLoader { public SelfContainedClassLoader(java.net.URL[] urls) { super(urls); } protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException { Class res = this.findLoadedClass(name); if (res == null) try { res = this.findClass(name); } catch (ClassNotFoundException e) {} if (res == null && name.startsWith("java")) { res = ClassLoader.getSystemClassLoader().loadClass(name); } if (res == null) throw new ClassNotFoundException(name); if (resolve) this.resolveClass(res); return res; } } |
From: Daniel B. <bo...@us...> - 2005-04-12 13:57:41
|
Update of /cvsroot/nice/Nice/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10113/testsuite Modified Files: helpers.nice Log Message: Run generated jars in a self-contained classloader, so that missing classes in the jar lead to errors, instead of being loaded from the parent. Use "classes" instead of nice.jar so that recent changes immediately affect testcases. Rethrow the cause exception when a testcase fails. Index: helpers.nice =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/helpers.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** helpers.nice 11 Apr 2005 12:45:35 -0000 1.1 --- helpers.nice 12 Apr 2005 13:57:32 -0000 1.2 *************** *** 34,38 **** void compile (String pkg, ! ?String toplevel, ?String imp = null, ?String main = null, --- 34,38 ---- void compile (String pkg, ! ?String toplevel = null, ?String imp = null, ?String main = null, *************** *** 51,55 **** if (imp != null) compilation.packagePath = new File(tmp, imp + ".jar").toString(); ! compilation.runtimeFile = "share/java/nice.jar"; compilation.output = new File(tmp, pkg + ".jar").toString(); --- 51,55 ---- if (imp != null) compilation.packagePath = new File(tmp, imp + ".jar").toString(); ! compilation.runtimeFile = "classes"; compilation.output = new File(tmp, pkg + ".jar").toString(); *************** *** 93,101 **** let mainClassName = jarFile.getManifest().getMainAttributes().getValue("Main-Class"); ! let loader = new java.net.URLClassLoader ! ([jar.toURL(), new java.io.File("share/java/nice.jar").toURL()]); nice.tools.util.JDK.setDefaultAssertionStatus(loader, true); let mainClass = loader.loadClass(mainClassName); let main = mainClass.getMethod("main", [String[].class]); ! main.invoke(null, [cast(null)]); } --- 93,104 ---- let mainClassName = jarFile.getManifest().getMainAttributes().getValue("Main-Class"); ! let loader = new nice.tools.util.SelfContainedClassLoader([jar.toURL()]); nice.tools.util.JDK.setDefaultAssertionStatus(loader, true); let mainClass = loader.loadClass(mainClassName); let main = mainClass.getMethod("main", [String[].class]); ! try { ! main.invoke(null, [cast(null)]); ! } catch (java.lang.reflect.InvocationTargetException e) { ! throw e.getTargetException(); ! } } |
From: Daniel B. <bo...@us...> - 2005-04-12 12:38:21
|
Update of /cvsroot/nice/Nice/src/bossa/modules In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29311/src/bossa/modules Modified Files: CompiledContent.java Content.java DirectoryCompiledContent.java JarCompiledContent.java Log Message: Fix archive creation so that the most recent version of each class file is included in it (regenerated has priority over any previous version). Index: DirectoryCompiledContent.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/DirectoryCompiledContent.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** DirectoryCompiledContent.java 8 Mar 2005 20:11:36 -0000 1.10 --- DirectoryCompiledContent.java 12 Apr 2005 12:38:11 -0000 1.11 *************** *** 106,126 **** } } ! ! Content.Stream[] getClasses(boolean wantDispatch) { ! return getClasses(directory, wantDispatch); } ! ! static Content.Stream[] getClasses(File directory, ! final boolean wantDispatch) { ! /* ! To list out the "dispatch.class" file, ! we use the method File.compareTo(File) since it is correct ! both on case-sensitive and case-insensitive platforms. ! */ ! final File dispatchFile = ! wantDispatch ? null : new File(directory, "dispatch.class"); ! File[] classes = directory.listFiles (new FileFilter() { --- 106,118 ---- } } ! ! void addClasses(java.util.Set/*<Content.Stream>*/ classes) { ! addClasses(classes, directory); } ! ! static void addClasses(java.util.Set/*<Content.Stream>*/ classes, File directory) { ! File[] files = directory.listFiles (new FileFilter() { *************** *** 132,154 **** return true; ! return name.endsWith(".class") ! && (wantDispatch || dispatchFile.compareTo(f) != 0) ! && f.isFile(); } } ); ! Content.Stream[] res = ! new Content.Stream[classes.length + (wantDispatch ? 0 : 1)]; ! for (int i = 0; i < classes.length; i++) try{ ! res[i] = new Content.Stream ! (new BufferedInputStream(new FileInputStream(classes[i])), ! classes[i].getName()); } catch(FileNotFoundException e) {} - - return res; } ! private InputStream getFileStream(String name) { --- 124,140 ---- return true; ! return name.endsWith(".class") && f.isFile(); } } ); ! for (int i = 0; i < files.length; i++) try{ ! classes.add(new Content.Stream ! (new BufferedInputStream(new FileInputStream(files[i])), ! files[i].getName())); } catch(FileNotFoundException e) {} } ! private InputStream getFileStream(String name) { Index: CompiledContent.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/CompiledContent.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** CompiledContent.java 2 Jul 2004 19:31:03 -0000 1.4 --- CompiledContent.java 12 Apr 2005 12:38:10 -0000 1.5 *************** *** 34,50 **** gnu.bytecode.ClassType dispatch; ! /** ! Returns the compiled classes of this source. ! ! This method is valid for sources that were not compiled ! because they were up-to-date. ! It returns the classes generated by the compilation of the ! package denoted by this source. ! ! @param wantDispatch wether the dispatch.class file must be included in the ! result. If false, an extra null element must be added at then end of ! the array. ! */ ! abstract Content.Stream[] getClasses(boolean wantDispatch); /** --- 34,38 ---- gnu.bytecode.ClassType dispatch; ! abstract void addClasses(java.util.Set/*<Content.Stream>*/ classes); /** Index: JarCompiledContent.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/JarCompiledContent.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** JarCompiledContent.java 17 Sep 2004 16:31:36 -0000 1.8 --- JarCompiledContent.java 12 Apr 2005 12:38:11 -0000 1.9 *************** *** 20,24 **** /** A compiled package located in a jar file. ! @author Daniel Bonniot (Dan...@in...) */ --- 20,24 ---- /** A compiled package located in a jar file. ! @author Daniel Bonniot (Dan...@in...) */ *************** *** 34,43 **** if (itfEntry == null) return null; ! JarEntry bytecodeEntry = jar.getJarEntry (pkgName + "/" + Package.packageClassName + ".class"); if (bytecodeEntry == null) return null; ! JarEntry dispatchEntry = jar.getJarEntry(pkgName + "/dispatch.class"); if (dispatchEntry == null) --- 34,43 ---- if (itfEntry == null) return null; ! JarEntry bytecodeEntry = jar.getJarEntry (pkgName + "/" + Package.packageClassName + ".class"); if (bytecodeEntry == null) return null; ! JarEntry dispatchEntry = jar.getJarEntry(pkgName + "/dispatch.class"); if (dispatchEntry == null) *************** *** 107,113 **** } ! Content.Stream[] getClasses(boolean wantDispatch) { - java.util.List res = new java.util.LinkedList(); String pkgPrefix = pkg.getName().replace('.', '/') + "/"; --- 107,112 ---- } ! void addClasses(java.util.Set/*<Content.Stream>*/ classes) { String pkgPrefix = pkg.getName().replace('.', '/') + "/"; *************** *** 115,142 **** while(en.hasMoreElements()) { ! JarEntry e = (JarEntry) en.nextElement(); ! String fullname = e.getName(); ! if (fullname.startsWith(pkgPrefix) ! && fullname.indexOf('/', pkgPrefix.length()) == -1 ! && fullname.endsWith(".class")) ! { ! String name = fullname.substring(pkgPrefix.length()); ! if (wantDispatch || !name.equals("dispatch.class")) ! try{ ! res.add(new Content.Stream(jar.getInputStream(e), name)); ! } ! catch(IOException ex){ ! User.error(pkg.name, ! "Error reading archive " + getName()); ! } ! } } - - int len = res.size(); - if (! wantDispatch) - len++; - return (Content.Stream[]) res.toArray(new Content.Stream[len]); } ! InputStream getBytecodeStream() { --- 114,135 ---- while(en.hasMoreElements()) { ! JarEntry e = (JarEntry) en.nextElement(); ! String fullname = e.getName(); ! if (fullname.startsWith(pkgPrefix) ! && fullname.indexOf('/', pkgPrefix.length()) == -1 ! && fullname.endsWith(".class")) ! { ! String name = fullname.substring(pkgPrefix.length()); ! try{ ! classes.add(new Content.Stream(jar.getInputStream(e), name)); ! } ! catch(IOException ex){ ! User.error(pkg.name, ! "Error reading archive " + getName()); ! } ! } } } ! InputStream getBytecodeStream() { *************** *** 149,158 **** } } ! public String getName() { return nice.tools.util.System.prettyPrint(jar); } ! public String toString() { --- 142,151 ---- } } ! public String getName() { return nice.tools.util.System.prettyPrint(jar); } ! public String toString() { Index: Content.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/modules/Content.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** Content.java 12 Mar 2005 10:12:56 -0000 1.20 --- Content.java 12 Apr 2005 12:38:11 -0000 1.21 *************** *** 295,298 **** --- 295,306 ---- this.name = name; } + + public boolean equals(Object o) + { + return o instanceof Stream && name.equals(((Stream) o).name); + } + + public int hashCode() { return name.hashCode(); } + InputStream stream; String name; *************** *** 300,336 **** /** ! Returns the compiled classes of this source. ! ! This method is valid for sources that were not compiled ! because they were up-to-date. ! It returns the classes generated by the compilation of the ! package denoted by this source. */ Stream[] getClasses(boolean linkPerformed) { ! Stream[] res; if (!sourceRead) ! { ! res = compiled.getClasses(! linkPerformed); ! if (linkPerformed) ! { ! File dispatchFile = new File(getOutputDirectory(), ! "dispatch.class"); ! try{ ! res[res.length - 1] = new Stream ! (new FileInputStream(dispatchFile), "dispatch.class"); ! } ! catch(FileNotFoundException e) { ! Internal.error(pkg + ! ": dispatch class could not be added to archive" + ! "\nI expected it to be in " + dispatchFile); ! } ! } ! } ! else ! res = DirectoryCompiledContent.getClasses(getOutputDirectory(), true); ! return res; } } --- 308,327 ---- /** ! Returns the compiled classes of this source. */ Stream[] getClasses(boolean linkPerformed) { ! /* We first add the generated classes, then all those compiled classes ! that were not regenerated. The Set ensures that the previous version of ! regenerated classes is not included. ! */ ! Set res = new HashSet(); ! ! DirectoryCompiledContent.addClasses(res, getOutputDirectory()); if (!sourceRead) ! compiled.addClasses(res); ! return (Stream[]) res.toArray(new Stream[res.size()]); } } |
From: Artem Gr K. <ar...@us...> - 2005-04-11 13:56:22
|
Update of /cvsroot/nice/Nice/testsuite/compiler/designByContract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31056/testsuite/compiler/designByContract Modified Files: assert.testsuite Log Message: Made assertions Object message to be JDK1.3 compatible. Index: assert.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/designByContract/assert.testsuite,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** assert.testsuite 9 Apr 2005 20:59:12 -0000 1.6 --- assert.testsuite 11 Apr 2005 13:56:12 -0000 1.7 *************** *** 108,119 **** toString() = "bar"; } - - /// PASS - // if the message is Throwable, it should become a "cause" (as in java.lang.AssertionError). - let cause = new Exception("bar"); - try{ - !assert 0 == 1 : cause; - throw new Exception( "AssertionFailed not thrown." ); - }catch(AssertionFailed ok){ - !assert ok.getCause() == cause; - } --- 108,109 ---- |
From: Artem Gr K. <ar...@us...> - 2005-04-11 13:56:22
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31056/stdlib/nice/lang/inline Modified Files: Assert.java Log Message: Made assertions Object message to be JDK1.3 compatible. Index: Assert.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/Assert.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Assert.java 9 Apr 2005 20:59:12 -0000 1.9 --- Assert.java 11 Apr 2005 13:56:13 -0000 1.10 *************** *** 82,88 **** { args[1].compile(comp, Target.pushObject); ! Method init = args[1].getType().getName().equals(Type.string_type.getName()) ! ? errorInitString : errorInitObject; ! code.emitInvokeSpecial(init); } --- 82,91 ---- { args[1].compile(comp, Target.pushObject); ! if(args[1].getType().getName().equals(Type.string_type.getName())){ ! code.emitInvokeSpecial(errorInitString); ! }else{ ! code.emitInvokeVirtual(errorToString); ! code.emitInvokeSpecial(errorInitString); ! } } *************** *** 96,100 **** errorClass = ClassType.make("nice.lang.AssertionFailed"); ! private static Method errorInit, errorInitString, errorInitObject; private static void prepare() --- 99,103 ---- errorClass = ClassType.make("nice.lang.AssertionFailed"); ! private static Method errorInit, errorInitString, errorToString; private static void prepare() *************** *** 107,112 **** errorInitString = errorClass.addMethod ("<init>", Access.PUBLIC, new Type[]{Type.string_type}, Type.void_type); ! errorInitObject = errorClass.addMethod ! ("<init>", Access.PUBLIC, new Type[]{Type.pointer_type}, Type.void_type); } --- 110,115 ---- errorInitString = errorClass.addMethod ("<init>", Access.PUBLIC, new Type[]{Type.string_type}, Type.void_type); ! errorToString = Type.pointer_type.addMethod ! ("toString", Access.PUBLIC, new Type[]{}, Type.string_type); } |
From: Artem Gr K. <ar...@us...> - 2005-04-11 13:56:21
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31056/stdlib/nice/lang Modified Files: assertions.nice Log Message: Made assertions Object message to be JDK1.3 compatible. Index: assertions.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/assertions.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** assertions.nice 9 Apr 2005 20:59:11 -0000 1.9 --- assertions.nice 11 Apr 2005 13:56:11 -0000 1.10 *************** *** 23,28 **** */ class AssertionFailed extends Error {} public new AssertionFailed(Object message) = ! this( message.toString(), message instanceof Throwable ? message : null ); void `?assert`(boolean condition) = --- 23,29 ---- */ class AssertionFailed extends Error {} + // To be removed later. Left here for bootstrap compatibility. public new AssertionFailed(Object message) = ! this(); void `?assert`(boolean condition) = |
From: Daniel B. <bo...@us...> - 2005-04-11 12:45:55
|
Update of /cvsroot/nice/Nice/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24733/testsuite Added Files: helpers.nice Log Message: Embedded DSL to write testcases as nice programs calling the compiler. --- NEW FILE: helpers.nice --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2005 */ /* */ /* 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. */ /* */ /**************************************************************************/ /** Helper methods for the testsuite Embedded-DSL. The tests are written as nice programs with _test methods. The test methods exercise some aspect of compilation by calling the compiler on certain input, with certain arguments, and in a certain order. These helper methods provide a convenient way to make those calls to the compiler. @author Daniel Bonniot (bo...@us...) */ import nice.tools.compiler.console; import nice.tools.compiler; import bossa.modules; import java.io.*; import java.util.jar.*; let File tmp = new File("temp-testcase"); void compile (String pkg, ?String toplevel, ?String imp = null, ?String main = null, ?String check = null) { let dirname = pkg.replace('.', File.separatorChar); let dir = new File(tmp, dirname); dir.mkdirs(); writeProgram(new File(dir, "main.nice"), imp, toplevel, main, check); let output = consoleOutput(); let compilation = new bossa.modules.Compilation (listener: output, parser: new bossa.parser.JavaccParser()); compilation.sourcePath = tmp.getPath(); if (imp != null) compilation.packagePath = new File(tmp, imp + ".jar").toString(); compilation.runtimeFile = "share/java/nice.jar"; compilation.output = new File(tmp, pkg + ".jar").toString(); compile(compilation, pkg); assert output.errorCount == 0; } private void writeProgram (File to, ?String imp, ?String toplevel, ?String main, ?String check) { using(let w = new BufferedWriter(new FileWriter(to))) { if (imp != null) w.write("import "imp";"); if (toplevel != null) w.write(toplevel); if (main != null || check != null) { w.write("public void main(String[] args) {\n"); if (main != null) w.write(main); if (check != null) w.write("\nassert "check";"); w.write("\n}\n"); } } } void run(String jar) { run(new java.io.File(tmp, jar + ".jar")); } void run(java.io.File jar) { let jarFile = new JarFile(jar); let mainClassName = jarFile.getManifest().getMainAttributes().getValue("Main-Class"); let loader = new java.net.URLClassLoader ([jar.toURL(), new java.io.File("share/java/nice.jar").toURL()]); nice.tools.util.JDK.setDefaultAssertionStatus(loader, true); let mainClass = loader.loadClass(mainClassName); let main = mainClass.getMethod("main", [String[].class]); main.invoke(null, [cast(null)]); } |
From: Daniel B. <bo...@us...> - 2005-04-11 12:45:55
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24733/src/nice/tools/testsuite Added Files: runner.nice Log Message: Embedded DSL to write testcases as nice programs calling the compiler. --- NEW FILE: runner.nice --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2005 */ /* */ /* 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.testsuite; /** Runner for the testsuite Embedded-DSL. @author Daniel Bonniot (bo...@us...) */ import nice.io; import nice.functional; import nice.tools.compiler.console; import nice.tools.compiler; import bossa.modules; import nice.tools.unit.console; import nice.tools.unit; import java.io.*; let File tmp = new File("temp-testcase"); public void main(String[] args) { let dir = new File(args.length == 0 ? "testsuite" : args[0]); dir.traverse().foreach(File f => if (f.isDirectory() && f.hasNiceFile()) test(f)); } boolean hasNiceFile(File dir) = dir.listDir(File f => f.getPath().endsWith(".nice")).length > 0; void test(File f) { let pkg = f.getPath().replace(File.separatorChar, '.'); println("\nCompiling "pkg); let output = consoleOutput(); let compilation = new bossa.modules.Compilation (listener: output, parser: new bossa.parser.JavaccParser()); compilation.runtimeFile = "share/java/nice.jar"; compilation.output = new File(tmp, "test.jar").toString(); compile(compilation, pkg); if (output.errorCount > 0) return; println("\nTesting "pkg); let testListener = new nice.tools.unit.console.Listener(); runTests(pkg, testListener, new File(tmp, "test.jar") + File.pathSeparator + "classes"); } |
From: Daniel B. <bo...@us...> - 2005-04-11 12:45:53
|
Update of /cvsroot/nice/Nice In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24733 Modified Files: Makefile Log Message: Embedded DSL to write testcases as nice programs calling the compiler. Index: Makefile =================================================================== RCS file: /cvsroot/nice/Nice/Makefile,v retrieving revision 1.163 retrieving revision 1.164 diff -C2 -d -r1.163 -r1.164 *** Makefile 31 Mar 2005 19:21:43 -0000 1.163 --- Makefile 11 Apr 2005 12:45:36 -0000 1.164 *************** *** 52,56 **** world: fixpoint check test ! tools: nicedoc unit ant publish # The bootstrap at the end of the universe ;-) --- 52,56 ---- world: fixpoint check test ! tools: nicedoc unit ant publish nicetestengine # The bootstrap at the end of the universe ;-) *************** *** 221,224 **** --- 221,227 ---- echo "Compilation of the testsuite engine failed." + nicetestengine: + $(NICEC1) nice.tools.testsuite + visibility: $(NICEC1) -a visibility.jar nice.tools.visibility |
From: Daniel B. <bo...@us...> - 2005-04-11 08:53:37
|
Update of /cvsroot/nice/Nice/stdlib/nice/io In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29171/stdlib/nice/io Modified Files: file.nice Log Message: Avoid using a class retyping for importing the class, since that create problems with the class fully qualified name. Using Java package import for now. Index: file.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/io/file.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** file.nice 28 Mar 2005 11:35:14 -0000 1.4 --- file.nice 11 Apr 2005 08:53:11 -0000 1.5 *************** *** 26,30 **** import nice.functional; ! class File = native java.io.File; /** Path concatenation */ --- 26,30 ---- import nice.functional; ! import java.io.*; /** Path concatenation */ |
From: Arjan B. <ar...@us...> - 2005-04-10 14:57:51
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24986/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Constants for nullness tags. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.328 retrieving revision 1.329 diff -C2 -d -r1.328 -r1.329 *** Parser.jj 9 Apr 2005 10:58:17 -0000 1.328 --- Parser.jj 10 Apr 2005 14:57:02 -0000 1.329 *************** *** 730,736 **** FunType res = bossa.syntax.dispatch.createFunType(domain, codomain); if (maybe) ! res.nullness = /*maybe*/1; else ! res.nullness = /*absent*/3; return res; } --- 730,736 ---- FunType res = bossa.syntax.dispatch.createFunType(domain, codomain); if (maybe) ! res.nullness = bossa.syntax.fun.nullness_maybe; else ! res.nullness = bossa.syntax.fun.nullness_absent; return res; } *************** *** 748,752 **** res = new TypeIdent(new LocatedString("void",makeLocation(start, end))); ! res.nullness = /*absent*/3; return res; } --- 748,752 ---- res = new TypeIdent(new LocatedString("void",makeLocation(start, end))); ! res.nullness = bossa.syntax.fun.nullness_absent; return res; } *************** *** 773,779 **** res = bossa.syntax.dispatch.createFunType_(domain, codomain); if (maybe) ! res.nullness = /*maybe*/1; else ! res.nullness = /*absent*/3; } ] { return res; } --- 773,779 ---- res = bossa.syntax.dispatch.createFunType_(domain, codomain); if (maybe) ! res.nullness = bossa.syntax.fun.nullness_maybe; else ! res.nullness = bossa.syntax.fun.nullness_absent; } ] { return res; } *************** *** 807,813 **** loc); if (maybe) ! res.nullness = /*maybe*/1; else ! res.nullness = /*absent*/3; } ] --- 807,813 ---- loc); if (maybe) ! res.nullness = bossa.syntax.fun.nullness_maybe; else ! res.nullness = bossa.syntax.fun.nullness_absent; } ] *************** *** 835,856 **** start="alike" [ "<" p=monotypes() ">" ] { res=bossa.syntax.dispatch.createAlike(p, makeLocation(start)); } ! { res.nullness = /*absent*/3; } | LOOKAHEAD( typeConstructorIdent() "<" ) res=monotypeConstructor() ! { res.nullness = /*absent*/3; } | res=typeIdent() ! { res.nullness = /*absent*/3; } ) { if ((maybe || sure) && ! (res.nullness != /*absent*/3)) throw bossa.util.User.error (makeLocation(start), "Nullness is specified in two ways for " + res); if (maybe) ! res.nullness = /*maybe*/1; else if (sure) ! res.nullness = /*sure*/2; } { return res; } --- 835,856 ---- start="alike" [ "<" p=monotypes() ">" ] { res=bossa.syntax.dispatch.createAlike(p, makeLocation(start)); } ! { res.nullness = bossa.syntax.fun.nullness_absent; } | LOOKAHEAD( typeConstructorIdent() "<" ) res=monotypeConstructor() ! { res.nullness = bossa.syntax.fun.nullness_absent; } | res=typeIdent() ! { res.nullness = bossa.syntax.fun.nullness_absent; } ) { if ((maybe || sure) && ! (res.nullness != bossa.syntax.fun.nullness_absent)) throw bossa.util.User.error (makeLocation(start), "Nullness is specified in two ways for " + res); if (maybe) ! res.nullness = bossa.syntax.fun.nullness_maybe; else if (sure) ! res.nullness = bossa.syntax.fun.nullness_sure; } { return res; } *************** *** 903,907 **** last=")" { Monotype t = new TupleType(types, makeLocation(first, last)); ! t.nullness = /*absent*/3; monotypes.add(t); return new TupleExp(parts); } --- 903,907 ---- last=")" { Monotype t = new TupleType(types, makeLocation(first, last)); ! t.nullness = bossa.syntax.fun.nullness_absent; monotypes.add(t); return new TupleExp(parts); } *************** *** 935,939 **** statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); t = new TupleType(types, makeLocation(first, last)); ! t.nullness = /*absent*/3; return t.createParameter(ident ,val); --- 935,939 ---- statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); t = new TupleType(types, makeLocation(first, last)); ! t.nullness = bossa.syntax.fun.nullness_absent; return t.createParameter(ident ,val); *************** *** 1276,1280 **** if (bound != null) { ! bound.nullness = /*absent*/3; atoms.add(new MonotypeLeqCst(new MonotypeVarWrapper(mv), bound)); } --- 1276,1280 ---- if (bound != null) { ! bound.nullness = bossa.syntax.fun.nullness_absent; atoms.add(new MonotypeLeqCst(new MonotypeVarWrapper(mv), bound)); } *************** *** 1818,1822 **** statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); type = new TupleType(types, makeLocation(first, last)); ! type.nullness = /*absent*/3; return bossa.syntax.dispatch.createMonoSymbol(name, type); } --- 1818,1822 ---- statements.add(bossa.syntax.dispatch.createExpressionStmt(exp)); type = new TupleType(types, makeLocation(first, last)); ! type.nullness = bossa.syntax.fun.nullness_absent; return bossa.syntax.dispatch.createMonoSymbol(name, type); } |
From: Arjan B. <ar...@us...> - 2005-04-10 14:57:17
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24986/F:/nice/src/bossa/syntax Modified Files: customConstructor.nice enum.nice locals.nice loop.nice monotype.nice try.nice Log Message: Constants for nullness tags. Index: customConstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/customConstructor.nice,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** customConstructor.nice 26 Mar 2005 00:48:09 -0000 1.25 --- customConstructor.nice 10 Apr 2005 14:57:05 -0000 1.26 *************** *** 162,166 **** { let classe = new TypeIdent(name: className); ! classe.nullness = /*sure*/2; if (cst == trueConstraint) --- 162,166 ---- { let classe = new TypeIdent(name: className); ! classe.nullness = nullness_sure; if (cst == trueConstraint) *************** *** 179,183 **** let res = createMonotypeConstructor (classe, new TypeParameters(content: params), classe.location()); ! res.nullness = /*sure*/2; return res; } --- 179,183 ---- let res = createMonotypeConstructor (classe, new TypeParameters(content: params), classe.location()); ! res.nullness = nullness_sure; return res; } Index: loop.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/loop.nice,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** loop.nice 22 Feb 2005 13:00:20 -0000 1.13 --- loop.nice 10 Apr 2005 14:57:07 -0000 1.14 *************** *** 131,135 **** tc: new TypeIdent(name: new LocatedString("Iterator", loc)), parameters: new TypeParameters(content: [vartype]), ! loc: loc, nullness: /*sure*/2); let getiter = createCallExp(createIdentExp(new LocatedString("forIterator", loc)), container); --- 131,135 ---- tc: new TypeIdent(name: new LocatedString("Iterator", loc)), parameters: new TypeParameters(content: [vartype]), ! loc: loc, nullness: nullness_sure); let getiter = createCallExp(createIdentExp(new LocatedString("forIterator", loc)), container); Index: monotype.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/monotype.nice,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** monotype.nice 25 Mar 2005 16:40:00 -0000 1.13 --- monotype.nice 10 Apr 2005 14:57:07 -0000 1.14 *************** *** 15,18 **** --- 15,23 ---- import bossa.util.*; + public let byte nullness_none = 0; + public let byte nullness_maybe = 1; + public let byte nullness_sure = 2; + public let byte nullness_absent = 3; + /** Syntactic monomorphic type. *************** *** 22,33 **** { /** Set by the parser. */ ! public byte nullness = 0; ! /* ! public static final byte ! none = 0, ! maybe = 1, ! sure = 2, ! absent = 3; ! */ /** @return true if "alike" appears inside this monotype. */ --- 27,31 ---- { /** Set by the parser. */ ! public byte nullness = nullness_none; /** @return true if "alike" appears inside this monotype. */ *************** *** 42,48 **** String nullnessString() { ! if (nullness == /*maybe*/1) return "?"; ! else if (nullness == /*sure*/2) return "!"; else --- 40,46 ---- String nullnessString() { ! if (nullness == nullness_maybe) return "?"; ! else if (nullness == nullness_sure) return "!"; else *************** *** 54,64 **** mlsub.typing.Monotype raw = this.rawResolve(tm); ! if (nullness == /*none*/0) return raw; ! else if (nullness == /*maybe*/1) return maybeMonotype(nice.tools.typing.Types.rawType(raw)); ! else if (nullness == /*sure*/2) return sureMonotype(nice.tools.typing.Types.rawType(raw)); ! else if (nullness == /*absent*/3) { if (raw instanceof mlsub.typing.MonotypeVar) --- 52,62 ---- mlsub.typing.Monotype raw = this.rawResolve(tm); ! if (nullness == nullness_none) return raw; ! else if (nullness == nullness_maybe) return maybeMonotype(nice.tools.typing.Types.rawType(raw)); ! else if (nullness == nullness_sure) return sureMonotype(nice.tools.typing.Types.rawType(raw)); ! else if (nullness == nullness_absent) { if (raw instanceof mlsub.typing.MonotypeVar) *************** *** 291,295 **** { return "(" + Util.map("", ", ", "", in) + ! (nullness == /*maybe*/1 ? ")?->" : ")->") + out; } --- 289,293 ---- { return "(" + Util.map("", ", ", "", in) + ! (nullness == nullness_maybe ? ")?->" : ")->") + out; } Index: enum.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/enum.nice,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** enum.nice 26 Mar 2005 02:11:34 -0000 1.22 --- enum.nice 10 Apr 2005 14:57:06 -0000 1.23 *************** *** 176,180 **** { Monotype type = new TypeIdent(name: enumName); ! type.nullness = /*absent*/3; List<Argument> args = new ArrayList(2 + fields.size()); args.add(new Argument(value: createStringConstantExp(name.toString()), --- 176,180 ---- { Monotype type = new TypeIdent(name: enumName); ! type.nullness = nullness_absent; List<Argument> args = new ArrayList(2 + fields.size()); args.add(new Argument(value: createStringConstantExp(name.toString()), Index: try.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/try.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** try.nice 16 Jan 2005 00:28:21 -0000 1.6 --- try.nice 10 Apr 2005 14:57:07 -0000 1.7 *************** *** 100,104 **** { Monotype type = createMonotypeConstructor(tc, null, tc.location()); ! type.nullness = /*sure*/2; this(exnVar: new MonoSymbol(varName, syntacticType: type), tc: tc, --- 100,104 ---- { Monotype type = createMonotypeConstructor(tc, null, tc.location()); ! type.nullness = nullness_sure; this(exnVar: new MonoSymbol(varName, syntacticType: type), tc: tc, Index: locals.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/locals.nice,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** locals.nice 22 Feb 2005 10:27:07 -0000 1.11 --- locals.nice 10 Apr 2005 14:57:07 -0000 1.12 *************** *** 214,218 **** let value = createFunExp(trueConstraint, parameters.getMonoSymbols(), body); let symbol = new FunSymbol(name, trueConstraint, parameters, returnType); ! notNull(symbol.syntacticType).monotype.nullness = /*sure*/2; return new LocalFunction(left: symbol, value: value, parameters: parameters); } --- 214,218 ---- let value = createFunExp(trueConstraint, parameters.getMonoSymbols(), body); let symbol = new FunSymbol(name, trueConstraint, parameters, returnType); ! notNull(symbol.syntacticType).monotype.nullness = nullness_sure; return new LocalFunction(left: symbol, value: value, parameters: parameters); } |
From: Daniel B. <bo...@us...> - 2005-04-09 22:02:37
|
Update of /cvsroot/nice/Nice/testsuite/compiler/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13636/testsuite/compiler/native Modified Files: visibility.testsuite Log Message: Change the testcase to the same situation with a constructor present in JDK 1.3 Index: visibility.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/native/visibility.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** visibility.testsuite 8 Apr 2005 16:59:03 -0000 1.1 --- visibility.testsuite 9 Apr 2005 22:02:28 -0000 1.2 *************** *** 1,2 **** /// FAIL ! java.net.Inet4Address /*/// FAIL HERE*/ ip = new java.net.Inet4Address(); --- 1,2 ---- /// FAIL ! let x = /*/// FAIL HERE*/ new javax.swing.tree.TreePath(); |
From: Daniel B. <bo...@us...> - 2005-04-09 21:26:41
|
Update of /cvsroot/nice/Nice/regtest/basic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26846/regtest/basic Modified Files: null.nice Log Message: Accept assertion error on notNull(null), since assertions can be enabled. Index: null.nice =================================================================== RCS file: /cvsroot/nice/Nice/regtest/basic/null.nice,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** null.nice 14 Oct 2004 20:50:09 -0000 1.13 --- null.nice 9 Apr 2005 21:26:16 -0000 1.14 *************** *** 15,18 **** --- 15,21 ---- println("OK"); } + catch(AssertionFailed e){ + println("OK"); + } f(); |
From: Artem Gr K. <ar...@us...> - 2005-04-09 20:59:49
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12826/stdlib/nice/lang/inline Modified Files: Assert.java Log Message: Allow Object to be used for assertion message. Index: Assert.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/Assert.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Assert.java 1 Feb 2005 23:01:35 -0000 1.8 --- Assert.java 9 Apr 2005 20:59:12 -0000 1.9 *************** *** 82,86 **** { args[1].compile(comp, Target.pushObject); ! code.emitInvokeSpecial(errorInitString); } --- 82,88 ---- { args[1].compile(comp, Target.pushObject); ! Method init = args[1].getType().getName().equals(Type.string_type.getName()) ! ? errorInitString : errorInitObject; ! code.emitInvokeSpecial(init); } *************** *** 94,98 **** errorClass = ClassType.make("nice.lang.AssertionFailed"); ! private static Method errorInit, errorInitString; private static void prepare() --- 96,100 ---- errorClass = ClassType.make("nice.lang.AssertionFailed"); ! private static Method errorInit, errorInitString, errorInitObject; private static void prepare() *************** *** 105,108 **** --- 107,112 ---- errorInitString = errorClass.addMethod ("<init>", Access.PUBLIC, new Type[]{Type.string_type}, Type.void_type); + errorInitObject = errorClass.addMethod + ("<init>", Access.PUBLIC, new Type[]{Type.pointer_type}, Type.void_type); } |
From: Artem Gr K. <ar...@us...> - 2005-04-09 20:59:49
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12826/stdlib/nice/lang Modified Files: assertions.nice Log Message: Allow Object to be used for assertion message. Index: assertions.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/assertions.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** assertions.nice 2 Apr 2005 11:47:02 -0000 1.8 --- assertions.nice 9 Apr 2005 20:59:11 -0000 1.9 *************** *** 23,31 **** */ class AssertionFailed extends Error {} void `?assert`(boolean condition) = inline nice.lang.inline.Assert(); ! void `?assert`(boolean condition, String message) = inline nice.lang.inline.Assert(); --- 23,33 ---- */ class AssertionFailed extends Error {} + public new AssertionFailed(Object message) = + this( message.toString(), message instanceof Throwable ? message : null ); void `?assert`(boolean condition) = inline nice.lang.inline.Assert(); ! void `?assert`(boolean condition, Object message) = inline nice.lang.inline.Assert(); *************** *** 35,39 **** /** Always checked assertion. */ ! void `!assert`(boolean condition, String message) = inline nice.lang.inline.Assert("contract"); --- 37,41 ---- /** Always checked assertion. */ ! void `!assert`(boolean condition, Object message) = inline nice.lang.inline.Assert("contract"); *************** *** 41,48 **** void `assert`(boolean condition) = inline nice.lang.inline.Assert(); ! void `assert`(boolean condition, String message) = inline nice.lang.inline.Assert(); void `alwaysAssert`(boolean condition) = inline nice.lang.inline.Assert("contract"); ! void `alwaysAssert`(boolean condition, String message) = inline nice.lang.inline.Assert("contract"); --- 43,50 ---- void `assert`(boolean condition) = inline nice.lang.inline.Assert(); ! void `assert`(boolean condition, Object message) = inline nice.lang.inline.Assert(); void `alwaysAssert`(boolean condition) = inline nice.lang.inline.Assert("contract"); ! void `alwaysAssert`(boolean condition, Object message) = inline nice.lang.inline.Assert("contract"); |
From: Artem Gr K. <ar...@us...> - 2005-04-09 20:59:48
|
Update of /cvsroot/nice/Nice/testsuite/compiler/designByContract In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12826/testsuite/compiler/designByContract Modified Files: assert.testsuite Log Message: Allow Object to be used for assertion message. Index: assert.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/designByContract/assert.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** assert.testsuite 2 Apr 2005 09:14:24 -0000 1.5 --- assert.testsuite 9 Apr 2005 20:59:12 -0000 1.6 *************** *** 74,77 **** --- 74,78 ---- try{ assert 0 == 1; + throw new Exception( "AssertionFailed not thrown." ); }catch(AssertionFailed afe){ let message = afe.getMessage(); assert message != null; *************** *** 93,94 **** --- 94,119 ---- throw new Exception( "AssertionFailed not thrown." ); }catch(AssertionFailed ok){} + + /// PASS + // support Object message + try{ + !assert 0 == 1 : new Foo(); + throw new Exception( "AssertionFailed not thrown." ); + }catch(AssertionFailed ok){ + !assert ok.getMessage().equals("bar"); + !assert ok.getCause() == null; + } + /// Toplevel + class Foo { + toString() = "bar"; + } + + /// PASS + // if the message is Throwable, it should become a "cause" (as in java.lang.AssertionError). + let cause = new Exception("bar"); + try{ + !assert 0 == 1 : cause; + throw new Exception( "AssertionFailed not thrown." ); + }catch(AssertionFailed ok){ + !assert ok.getCause() == cause; + } |
From: Daniel B. <bo...@us...> - 2005-04-09 17:46:12
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31658/src/gnu/bytecode Modified Files: Field.java Log Message: Only omit ConstantValue attribute for non-final fields. Index: Field.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/Field.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Field.java 8 Apr 2005 13:31:09 -0000 1.7 --- Field.java 9 Apr 2005 17:45:32 -0000 1.8 *************** *** 160,164 **** private CpoolEntry addIfNotDefault(ConstantPool cpool, int value) { ! if (value == 0) // 0 is the default value, no need to specify it. return null; --- 160,164 ---- private CpoolEntry addIfNotDefault(ConstantPool cpool, int value) { ! if (value == 0 && ! isFinal()) // 0 is the default value, no need to specify it. return null; |
From: Daniel B. <bo...@us...> - 2005-04-09 10:58:26
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10391/src/bossa/parser Modified Files: Parser.jj Log Message: Fix generics syntax with constructed monotypes. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.327 retrieving revision 1.328 diff -C2 -d -r1.327 -r1.328 *** Parser.jj 3 Apr 2005 03:05:14 -0000 1.327 --- Parser.jj 9 Apr 2005 10:58:17 -0000 1.328 *************** *** 592,613 **** TypeSymbol binder(Collection atomics): ! { TypeIdent ti; ! TypeConstructor typevar; ! } { ! ( LOOKAHEAD( typeConstructor() "extends" ) ! { TypeIdent typevarid; Monotype m2; } ! typevarid=typeIdent() "extends" ! { typevar = new TypeConstructor(typevarid.getName().toString()); } ( LOOKAHEAD(typeIdent() ( "," | "|" | ">")) ti=typeIdent() { ! atomics.add(new TypeConstructorLeqCst(typevar, ti)); ! return typevar; } | m2=monotype() { ! atomics.add(new MonotypeLeqCst(typevarid, m2)); return typevar; } --- 592,613 ---- TypeSymbol binder(Collection atomics): ! { TypeIdent ti; } { ! ( LOOKAHEAD( unlocIdent() "extends" ) ! { String ident; } ! ident=unlocIdent() "extends" ( LOOKAHEAD(typeIdent() ( "," | "|" | ">")) ti=typeIdent() { ! TypeConstructor tc = new TypeConstructor(ident); ! atomics.add(new TypeConstructorLeqCst(tc, ti)); ! return tc; } | + { Monotype m2; } m2=monotype() { ! MonotypeVar typevar = new MonotypeVar(ident); ! atomics.add(new MonotypeLeqCst(new MonotypeWrapper(typevar), m2)); return typevar; } *************** *** 615,618 **** --- 615,619 ---- | LOOKAHEAD( typeIdent() typeConstructor() ) + { TypeConstructor typevar; } ti=typeIdent() typevar=typeConstructor() |
From: Daniel B. <bo...@us...> - 2005-04-09 10:58:26
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10391/testsuite/compiler/syntax Modified Files: generics.testsuite Log Message: Fix generics syntax with constructed monotypes. Index: generics.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/generics.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** generics.testsuite 8 Mar 2005 23:08:18 -0000 1.1 --- generics.testsuite 9 Apr 2005 10:58:15 -0000 1.2 *************** *** 8,13 **** <T extends Collection> void foo(T<String> x) {} ! /// PASS bug foo(["abc"]); /// Toplevel <T extends Collection<String>> void foo(T x) {} --- 8,18 ---- <T extends Collection> void foo(T<String> x) {} ! /// PASS foo(["abc"]); /// Toplevel <T extends Collection<String>> void foo(T x) {} + + /// FAIL + /*/// FAIL HERE*/ foo([0]); + /// Toplevel + <T extends Collection<String>> void foo(T x) {} |
From: Daniel B. <bo...@us...> - 2005-04-09 09:24:52
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27541/src/bossa/syntax Modified Files: constraint.nice Log Message: Whitespace cleanup and reindent. Index: constraint.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constraint.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** constraint.nice 16 Jan 2005 00:28:21 -0000 1.3 --- constraint.nice 9 Apr 2005 09:24:43 -0000 1.4 *************** *** 17,21 **** /** A list of binders + atomic constraints. ! @see AtomicConstraint --- 17,21 ---- /** A list of binders + atomic constraints. ! @see AtomicConstraint *************** *** 34,40 **** return createConstraint(new ArrayList(binders), new ArrayList(atomics)); } ! mlsub.typing.Constraint resolveToLowlevel() ! { return mlsub.typing.Constraint.create( binders.isEmpty() ? null : binders.toArray(), --- 34,40 ---- return createConstraint(new ArrayList(binders), new ArrayList(atomics)); } ! mlsub.typing.Constraint resolveToLowlevel() ! { return mlsub.typing.Constraint.create( binders.isEmpty() ? null : binders.toArray(), *************** *** 54,58 **** StringBuffer res = new StringBuffer("<"); boolean first = true; ! Constraint c = this.shallowClone(); --- 54,58 ---- StringBuffer res = new StringBuffer("<"); boolean first = true; ! Constraint c = this.shallowClone(); *************** *** 81,112 **** } } ! continue; } let tc = s; ! boolean ok = false; ! let j = c.atomics.iterator(); ! while (j.hasNext()) ! { ! AtomicConstraint atom = j.next(); ! let parent = atom.getParentFor(tc); ! if (parent!=null) ! { ! if (first) ! first = false; ! else ! res.append(','); ! res.append(parent).append(' ').append(tc); ! j.remove(); ! i.remove(); ! ok = true; ! break; ! } ! } ! if (!ok) ! Internal.error("Unable to print the constraint in a parsable form because of "+tc); } ! res.append(Util.map((res.length()>1 ? ", " : ""),", ","", c.binders)); res.append(Util.map(" | ",", ","",c.atomics)).append("> "); --- 81,112 ---- } } ! continue; } let tc = s; ! boolean ok = false; ! let j = c.atomics.iterator(); ! while (j.hasNext()) ! { ! AtomicConstraint atom = j.next(); ! let parent = atom.getParentFor(tc); ! if (parent!=null) ! { ! if (first) ! first = false; ! else ! res.append(','); ! res.append(parent).append(' ').append(tc); ! j.remove(); ! i.remove(); ! ok = true; ! break; ! } ! } ! if (!ok) ! Internal.error("Unable to print the constraint in a parsable form because of "+tc); } ! res.append(Util.map((res.length()>1 ? ", " : ""),", ","", c.binders)); res.append(Util.map(" | ",", ","",c.atomics)).append("> "); *************** *** 144,148 **** if (bs==null) return; ! for (int i = 0; i<bs.length; i++) this.addBinder(bs[i]); --- 144,148 ---- if (bs==null) return; ! for (int i = 0; i<bs.length; i++) this.addBinder(bs[i]); *************** *** 188,192 **** * The trivial constraint. * ! * This field is final, so pointer equality can be used * to test whether a constraint is True. * --- 188,192 ---- * The trivial constraint. * ! * This field is final, so pointer equality can be used * to test whether a constraint is True. * *************** *** 197,201 **** /** An abstract constraint atom. See children. ! @see Constraint */ --- 197,201 ---- /** An abstract constraint atom. See children. ! @see Constraint */ *************** *** 239,243 **** { private final mlsub.typing.AtomicConstraint atom; ! resolve(scope) = atom; --- 239,243 ---- { private final mlsub.typing.AtomicConstraint atom; ! resolve(scope) = atom; *************** *** 261,265 **** return null; } ! return null; } --- 261,265 ---- return null; } ! return null; } *************** *** 314,318 **** if (s instanceof mlsub.typing.Interface) return new mlsub.typing.ImplementsCst(t1, s); ! if (!(s instanceof mlsub.typing.TypeConstructor)) throw User.error(t2, t2 + " is not a class"); --- 314,318 ---- if (s instanceof mlsub.typing.Interface) return new mlsub.typing.ImplementsCst(t1, s); ! if (!(s instanceof mlsub.typing.TypeConstructor)) throw User.error(t2, t2 + " is not a class"); *************** *** 324,328 **** let associatedInterface = c2.getAssociatedInterface(); ! if (associatedInterface!=null) return new mlsub.typing.ImplementsCst(t1, associatedInterface); --- 324,328 ---- let associatedInterface = c2.getAssociatedInterface(); ! if (associatedInterface!=null) return new mlsub.typing.ImplementsCst(t1, associatedInterface); *************** *** 345,349 **** /** A type constructor implements an interface. ! */ public class ImplementsCst extends AtomicConstraint --- 345,349 ---- /** A type constructor implements an interface. ! */ public class ImplementsCst extends AtomicConstraint *************** *** 358,365 **** if (! (sitf instanceof mlsub.typing.Interface)) throw User.error(itf, itf+" should be an interface"); ! return new mlsub.typing.ImplementsCst(stc, sitf); } toString() = tc + ":" + itf; ! } \ No newline at end of file --- 358,365 ---- if (! (sitf instanceof mlsub.typing.Interface)) throw User.error(itf, itf+" should be an interface"); ! return new mlsub.typing.ImplementsCst(stc, sitf); } toString() = tc + ":" + itf; ! } |