nice-commit Mailing List for The Nice Programming Language (Page 110)
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: <ar...@us...> - 2003-05-12 12:40:48
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv13631/F:/nice/testsuite/compiler/syntax Modified Files: localvariable.testsuite Log Message: Fix: make it possible again to declare more than two local variables in one declaration. (broken since syntax change of local vars) Index: localvariable.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/localvariable.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** localvariable.testsuite 29 Apr 2003 10:17:05 -0000 1.4 --- localvariable.testsuite 12 May 2003 12:40:45 -0000 1.5 *************** *** 68,69 **** --- 68,72 ---- var i = 0; i = 1; + + /// PASS + int i,j,k; |
From: <ar...@us...> - 2003-05-12 11:22:56
|
Update of /cvsroot/nice/Nice/bin In directory sc8-pr-cvs1:/tmp/cvs-serv18684/F:/nice/bin Modified Files: nicec.bat Log Message: When running nicec in windows force the user to set the NICE environement variable first so that nicec.bat works the first time. Index: nicec.bat =================================================================== RCS file: /cvsroot/nice/Nice/bin/nicec.bat,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** nicec.bat 17 Jun 2002 22:18:34 -0000 1.6 --- nicec.bat 12 May 2003 11:22:53 -0000 1.7 *************** *** 1,39 **** ! @echo off ! rem --------------------------------------------------------------------------- ! rem nicec.bat - a nice compiler batch file ! rem ! rem Environment Variariable Prerequisites: ! rem ! rem NICE - the root directory where nice is installed ! rem ! rem thanks to the catalina team for some batch file inspiration ! rem ! rem questions to ja...@th... ! rem ! rem --------------------------------------------------------------------------- ! ! rem -- do we have a nice environment variable? ! if not "%NICE%" == "" goto gotNice ! ! rem -- try some standard places ! ! set NICE=c:\nice ! if exists %NICE%\nice.jar goto gotNice ! ! set NICE="c:\Program Files\nice" ! if exists %NICE%\nice.jar goto gotNice ! ! echo You must set NICE to point to the directory you've installed nice in e.g. ! echo set NICE=c:\java\nice ! echo You can do it by modifying this script (nicec.bat) or in Autoexec.bat ! goto cleanup ! :gotNice ! ! rem -- set up the reference to the nice jar file ! set NICEJAR=%NICE%\nice.jar ! java -classpath %NICEJAR%;%CLASSPATH% nice.tools.compiler.fun --runtime=%NICEJAR% %1 %2 %3 %4 %5 %6 %7 %8 %9 ! ! rem -- cleanup environment variables ! :cleanup ! set NICEJAR= ! :finish --- 1,21 ---- ! @echo off ! rem --------------------------------------------------------------------------- ! rem nicec.bat - a nice compiler batch file ! rem ! rem Environment Variariable Prerequisites: ! rem ! rem NICE - the root directory where nice is installed ! rem --------------------------------------------------------------------------- ! ! rem -- do we have a nice environment variable? ! if not "%NICE%" == "" goto gotNice ! ! echo You must set the NICE environment variable to point to the directory you've installed nice in e.g. ! echo set NICE=C:\programs\nice (note: do not add a ';' at the end) ! echo You can do it by modifying Autoexec.bat or in the system settings. ! goto end ! ! :gotNice ! java -classpath %NICE%\nice.jar;%CLASSPATH% nice.tools.compiler.fun --runtime=%NICE%\nice.jar %1 %2 %3 %4 %5 %6 %7 %8 %9 ! ! :end |
From: <bo...@us...> - 2003-05-12 11:11:47
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv14943/debian Modified Files: changelog Log Message: Made sure that the default value of optional parameters is typechecked and desambiguated before typechecking code using them with a forward reference (closes: #736280). Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.159 retrieving revision 1.160 diff -C2 -d -r1.159 -r1.160 *** changelog 5 May 2003 16:39:45 -0000 1.159 --- changelog 12 May 2003 11:11:44 -0000 1.160 *************** *** 1,2 **** --- 1,10 ---- + nice (0.8.0) unstable; urgency=low + + * Stable version, based on 0.7.9 + * Bugfixes (some cases of optional parameters, allowing arbitrarily nested + tuples on the left side of an assignment, recursion for local functions). + + -- + nice (0.7.9) unstable; urgency=low |
From: <bo...@us...> - 2003-05-12 11:11:47
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14943/src/bossa/syntax Modified Files: MethodDeclaration.java AST.java Log Message: Made sure that the default value of optional parameters is typechecked and desambiguated before typechecking code using them with a forward reference (closes: #736280). Index: MethodDeclaration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodDeclaration.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** MethodDeclaration.java 30 Apr 2003 18:55:31 -0000 1.39 --- MethodDeclaration.java 12 May 2003 11:11:44 -0000 1.40 *************** *** 124,127 **** --- 124,160 ---- ****************************************************************/ + /** + This is called in a pass before typechecking itself. + This is important, to typecheck and disambiguate the default values + of optional parameters, that will be used to typecheck code. + */ + void typedResolve() + { + Polytype type = getType(); + + if (!Constraint.hasBinders(type.getConstraint())) + { + parameters.typecheck(type.domain()); + return; + } + + try{ + Typing.enter(); + + try{ + type.getConstraint().enter(); + parameters.typecheck(type.domain()); + } + finally{ + Typing.leave(); + } + } + catch(TypingEx e){ + User.error(this, + "The type of method " + symbol.name + + " is not well formed: " + type + "\n" + e); + } + } + /** Do further typechecking, once the context of the method is entered. *************** *** 143,147 **** if (!Constraint.hasBinders(type.getConstraint())) { - parameters.typecheck(type.domain()); try{ innerTypecheck(); --- 176,179 ---- *************** *** 158,162 **** try{ type.getConstraint().enter(); - parameters.typecheck(type.domain()); innerTypecheck(); } --- 190,193 ---- Index: AST.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/AST.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** AST.java 22 Apr 2003 17:56:10 -0000 1.41 --- AST.java 12 May 2003 11:11:44 -0000 1.42 *************** *** 34,50 **** this.module = module; ! findClasses(); } ! private void findClasses() { ! ArrayList c = new ArrayList(children.size()); for(Iterator i = children.iterator(); i.hasNext();) { Object node = i.next(); if (node instanceof ClassDefinition) ! c.add((ClassDefinition) node); } ! classes = (ClassDefinition[]) c.toArray(new ClassDefinition[c.size()]); } --- 34,60 ---- this.module = module; ! ! findElements(); } ! private void findElements() { ! ArrayList classes = new ArrayList(children.size()); ! ArrayList methods = new ArrayList(children.size()); ! for(Iterator i = children.iterator(); i.hasNext();) { Object node = i.next(); if (node instanceof ClassDefinition) ! classes.add(node); ! else if (node instanceof MethodDeclaration) ! methods.add(node); } ! ! this.classes = (ClassDefinition[]) ! classes.toArray(new ClassDefinition[classes.size()]); ! ! this.methods = (MethodDeclaration[]) ! methods.toArray(new MethodDeclaration[methods.size()]); } *************** *** 99,102 **** --- 109,121 ---- } } + + for (int i = 0; i < methods.length; i++) + try{ + methods[i].typedResolve(); + } + catch(UserError ex){ + nice.tools.compiler.OutputMessages.error(ex.getMessage()); + } + nice.tools.compiler.OutputMessages.exitIfErrors(); } *************** *** 165,168 **** --- 184,188 ---- private Module module; private ClassDefinition[] classes; + private MethodDeclaration[] methods; } |
From: <bo...@us...> - 2003-05-12 11:11:47
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv14943/testsuite/compiler/methods Modified Files: optionalParameters.testsuite Log Message: Made sure that the default value of optional parameters is typechecked and desambiguated before typechecking code using them with a forward reference (closes: #736280). Index: optionalParameters.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/optionalParameters.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** optionalParameters.testsuite 28 Nov 2002 12:14:19 -0000 1.3 --- optionalParameters.testsuite 12 May 2003 11:11:44 -0000 1.4 *************** *** 58,59 **** --- 58,122 ---- // Bytecode has to be emited to convert the copied argument to what Java expects. void foo(int[] x, int y = x.size()) {} + + /// PASS + /// Toplevel + class A { + int aint; + alike f() { + return this.adjust(); + } + } + + <A T> T adjust(T this, int aint = this.aint) = this; + + /// PASS + /// Toplevel + class A { + int aint; + alike f() { + return this.adjust(); + } + } + + <A T> T adjust(T this, int aint = this.aint); + adjust(this, aint) = this; + + /// PASS + /// Toplevel + <A T> T adjust(T this, int aint = this.aint); + adjust(this, aint) = this; + + class A { + int aint; + alike f() { + return this.adjust(); + } + } + + /// PASS + /// package a import b + /// Toplevel + class A { + int aint; + alike f() { + return this.adjust(); + } + } + + /// package b import a + /// Toplevel + <A T> T adjust(T this, int aint = this.aint) = this; + + /// PASS + /// package b import a + /// Toplevel + <A T> T adjust(T this, int aint = this.aint) = this; + + /// package a import b + /// Toplevel + class A { + int aint; + alike f() { + return this.adjust(); + } + } |
From: <bo...@us...> - 2003-05-10 14:03:24
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1:/tmp/cvs-serv31720/web Modified Files: roadmap.xml Log Message: Updated the roadmap after 0.7.9 Index: roadmap.xml =================================================================== RCS file: /cvsroot/nice/Nice/web/roadmap.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** roadmap.xml 9 Dec 2002 19:48:57 -0000 1.4 --- roadmap.xml 10 May 2003 14:03:21 -0000 1.5 *************** *** 26,50 **** <para> <!-- The current stable version is 0.6, released July 11th, 2002. --> ! The latest version is 0.7.5, released November 20th, 2002. It includes all the planned features for version 0.8, which should be ! released soon. </para> <para> <variablelist> - <varlistentry><term>0.8</term> - <listitem> - <para> - Add various missing Java constructs: super, synchronized statements - and Java 1.4 style assertions. - Also consider more Design By Contract features: pre- and post-conditions, - class invariants. These might be part of a later release. - </para> - </listitem> - </varlistentry> <varlistentry><term>1.0</term> <listitem> <para> Implement visibility modifiers (private, default, public). Finish a first version of the User's manual. </para> --- 26,43 ---- <para> <!-- The current stable version is 0.6, released July 11th, 2002. --> ! The latest version is 0.7.9, released May 6th, 2003. It includes all the planned features for version 0.8, which should be ! released real soon now! </para> <para> <variablelist> <varlistentry><term>1.0</term> <listitem> <para> Implement visibility modifiers (private, default, public). + Improve the support for object creation, besides automatic constructors. + A plugin to write Nice programs in <ulink url="http://www.eclipse.org">Eclipse + </ulink> will likely be included. Finish a first version of the User's manual. </para> *************** *** 57,60 **** --- 50,65 ---- <ulink url="mailto:bo...@us...">What are the best places to announce Nice ? Tell me !</ulink> + </para> + </listitem> + </varlistentry> + + <varlistentry><term>0.8 (done)</term> + <listitem> + <para> + Added various missing Java constructs: super, synchronized statements, + Java 1.4 style assertions, and Java 1.5-compatible generic classes. + Also implemented Design By Contract features: pre- and post-conditions for + methods. + Method dispatch can be done on boolean and integer values. </para> </listitem> |
From: <bo...@us...> - 2003-05-10 14:02:40
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1:/tmp/cvs-serv31472/web Modified Files: new.xsl Log Message: Added link to the automated tests page. Index: new.xsl =================================================================== RCS file: /cvsroot/nice/Nice/web/new.xsl,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** new.xsl 26 Apr 2003 13:44:23 -0000 1.7 --- new.xsl 10 May 2003 14:02:37 -0000 1.8 *************** *** 180,183 **** --- 180,186 ---- <br /> <span class="small">o</span><xsl:text> </xsl:text> + <a class="nav" href="tests.html">Tests</a> + <br /> + <span class="small">o</span><xsl:text> </xsl:text> <a class="nav" href="http://sourceforge.net/cvs/?group_id=12788">CVS</a> <br /> |
From: <bo...@us...> - 2003-05-10 14:02:09
|
Update of /cvsroot/nice/Nice/web In directory sc8-pr-cvs1:/tmp/cvs-serv31327/web Modified Files: .htaccess Log Message: Release 0.7.9 Index: .htaccess =================================================================== RCS file: /cvsroot/nice/Nice/web/.htaccess,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** .htaccess 15 Apr 2003 15:49:36 -0000 1.7 --- .htaccess 10 May 2003 14:02:04 -0000 1.8 *************** *** 1,5 **** Redirect /Wiki http://nice.sourceforge.net/cgi-bin/twiki/view ! Redirect /Nice.tar http://prdownloads.sourceforge.net/nice/Nice-0.7.8.tar ! Redirect /Nice.zip http://prdownloads.sourceforge.net/nice/Nice-0.7.8-windows.zip ! Redirect /nice.deb http://prdownloads.sourceforge.net/nice/nice_0.7.8_all.deb ! Redirect /nice.rpm http://prdownloads.sourceforge.net/nice/Nice-0.7.8-1.noarch.rpm --- 1,5 ---- Redirect /Wiki http://nice.sourceforge.net/cgi-bin/twiki/view ! Redirect /Nice.tar http://prdownloads.sourceforge.net/nice/Nice-0.7.9-unix.tar.gz ! Redirect /Nice.zip http://prdownloads.sourceforge.net/nice/Nice-0.7.9-windows.zip ! Redirect /nice.deb http://prdownloads.sourceforge.net/nice/nice_0.7.9_all.deb ! Redirect /nice.rpm http://prdownloads.sourceforge.net/nice/Nice-0.7.9-1.noarch.rpm |
From: <bo...@us...> - 2003-05-09 15:28:31
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv12083/src/bossa/parser Modified Files: Parser.jj Log Message: Accept arbitrarily nested tuple assignments. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.170 retrieving revision 1.171 diff -C2 -d -r1.170 -r1.171 *** Parser.jj 9 May 2003 13:17:03 -0000 1.170 --- Parser.jj 9 May 2003 15:28:29 -0000 1.171 *************** *** 2354,2365 **** ) | ! // There are two cases for tuples (declaring a variable or not). ! // Since it seems we cannot have a lookahead inside another we ! // repeat two instances with different lookaheads. ! LOOKAHEAD( "(" monotype() ident() "," ) ! res=LocalTupleDeclaration(statements) ! | ! // Second case (see above). ! LOOKAHEAD( "(" ident() "," ) res=LocalTupleDeclaration(statements) | --- 2354,2359 ---- ) | ! ! LOOKAHEAD( LocalTupleDeclarationLookahead() ) res=LocalTupleDeclaration(statements) | *************** *** 2477,2480 **** --- 2471,2502 ---- return new IdentExp(id); } + } + + void LocalTupleDeclarationLookahead() : {} + { + /* + It is impossible to match exactly the actual syntax of + tuple declarations, because it would require nested lookaheads. + However, since this is the only piece of syntax of the form + ( ... ) = ... + we just do an approximation in LocalTupleDeclarationContent. + The important part is to accept all legal tokens, and to + correctly parse "(" and ")", so we know the end of the tuple. + */ + + "(" LocalTupleDeclarationContent() ")" "=" + } + + void LocalTupleDeclarationContent() : { } + { + ( + "(" LocalTupleDeclarationContent() ")" + // Identifiers, either in types, or as a variable to assign to. + | <IDENT> + // All tokens that can be part of a monotype + // (exception "(" and ")" which are already handled, since they are + // be balanced in a monotype too). + | "<" | ">" | "," | "->" | "." | "?" | "!" | "[]" | "[?]" | "alike" + )+ } |
From: <bo...@us...> - 2003-05-09 15:01:49
|
Update of /cvsroot/nice/Nice/regtest/basic In directory sc8-pr-cvs1:/tmp/cvs-serv31999/regtest/basic Modified Files: syntax.nice Log Message: Modified a for loop, since the existing one was infinite, followed by a statement, which should be illegal. Index: syntax.nice =================================================================== RCS file: /cvsroot/nice/Nice/regtest/basic/syntax.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** syntax.nice 8 Mar 2003 13:32:14 -0000 1.7 --- syntax.nice 9 May 2003 15:01:46 -0000 1.8 *************** *** 10,14 **** // For with empty body ! for (;;) ; --- 10,14 ---- // For with empty body ! for (;false;) ; |
From: <bo...@us...> - 2003-05-09 13:37:14
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv7528/src/bossa/syntax Modified Files: typecheck.nice analyse.nice Statement.java LoopStmt.java Added Files: EmptyStmt.java Log Message: Handle for loops, when the test expression is optional and defaults to true. Empty statements are now represented, together with their location in the source. --- NEW FILE: EmptyStmt.java --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2003 */ /* */ /* 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 bossa.syntax; /** The empty statement. @author Daniel Bonniot (bo...@us...) */ import bossa.util.*; public class EmptyStmt extends Statement { public EmptyStmt (Location location) { super(location); } gnu.expr.Expression generateCode() { return gnu.expr.QuoteExp.voidExp; } } Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** typecheck.nice 4 May 2003 16:51:27 -0000 1.65 --- typecheck.nice 9 May 2003 13:17:03 -0000 1.66 *************** *** 537,540 **** --- 537,543 ---- typecheck(null(Statement)) {} + //XXX: Now that there is an EmptyStmt class, it _might_ be possible + //XXX: (post 0.8) to remove the null case. + typecheck(@EmptyStmt) {} typecheck(b@Block) Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** analyse.nice 9 May 2003 11:31:40 -0000 1.66 --- analyse.nice 9 May 2003 13:17:03 -0000 1.67 *************** *** 599,603 **** info.beginInner(); ! if (l.isTestFirst()) { l.whileExp = analyse(l.whileExp, info); --- 599,603 ---- info.beginInner(); ! if (l.isTestFirst() && l.whileExp != null) { l.whileExp = analyse(l.whileExp, info); *************** *** 625,629 **** info.endInner(); ! if (notNull(l.whileExp).isTrue() && ! l.isBreakTarget()) info.setUnreachable(); } --- 625,629 ---- info.endInner(); ! if (l.isInfinite()) info.setUnreachable(); } Index: Statement.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Statement.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Statement.java 20 Feb 2003 14:58:39 -0000 1.17 --- Statement.java 9 May 2003 13:17:03 -0000 1.18 *************** *** 26,29 **** --- 26,36 ---- implements Located { + Statement () {} + + Statement (Location location) + { + setLocation(location); + } + /**************************************************************** * Code generation Index: LoopStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/LoopStmt.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** LoopStmt.java 9 May 2003 11:31:41 -0000 1.11 --- LoopStmt.java 9 May 2003 13:17:03 -0000 1.12 *************** *** 115,118 **** --- 115,127 ---- boolean isBreakTarget() { return mustCreateBlock; } + /** + Returns true iff this loop never completes normally. + */ + boolean isInfinite() + { + return (whileExp == null || whileExp.isTrue()) + && ! isBreakTarget(); + } + private boolean mustCreateBlock = false; |
From: <bo...@us...> - 2003-05-09 13:37:14
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv7528/src/bossa/parser Modified Files: Parser.jj Log Message: Handle for loops, when the test expression is optional and defaults to true. Empty statements are now represented, together with their location in the source. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** Parser.jj 6 May 2003 08:18:56 -0000 1.169 --- Parser.jj 9 May 2003 13:17:03 -0000 1.170 *************** *** 2480,2486 **** Statement EmptyStatement() : ! {} { ! ";" { return null; } } --- 2480,2486 ---- Statement EmptyStatement() : ! { Token t; } { ! t=";" { return new EmptyStmt(new Location(t)); } } |
From: <bo...@us...> - 2003-05-09 13:37:05
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/flow In directory sc8-pr-cvs1:/tmp/cvs-serv7528/testsuite/compiler/statements/flow Modified Files: reachability.testsuite Log Message: Handle for loops, when the test expression is optional and defaults to true. Empty statements are now represented, together with their location in the source. Index: reachability.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/statements/flow/reachability.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** reachability.testsuite 9 May 2003 11:31:39 -0000 1.1 --- reachability.testsuite 9 May 2003 13:17:02 -0000 1.2 *************** *** 1,12 **** /// FAIL bug while (false) { ! ; // Unreachable } /// FAIL bug while (true) ; ! ; // Unreachable /// PASS while (true) break; ; // Reachable --- 1,25 ---- /// FAIL bug while (false) { ! /*/// FAIL HERE */ ; // Unreachable } /// FAIL bug while (true) ; ! /*/// FAIL HERE */ ; // Unreachable /// PASS while (true) break; + ; // Reachable + + /// FAIL bug + for (;false;) { + /*/// FAIL HERE */ ; // Unreachable + } + + /// FAIL + for (;;) ; + /*/// FAIL HERE */ ; // Unreachable + + /// PASS + for (;;) break; ; // Reachable |
From: <bo...@us...> - 2003-05-09 11:57:41
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv11195/src/bossa/syntax Modified Files: Expression.java ConstantExp.java Log Message: Cleaner and faster implementation of Expression.isZero(). Index: Expression.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Expression.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Expression.java 9 May 2003 11:31:41 -0000 1.47 --- Expression.java 9 May 2003 11:57:38 -0000 1.48 *************** *** 84,89 **** boolean isZero() { ! return this instanceof ConstantExp && ! ((Number) ((ConstantExp) this).value).intValue() == 0; } --- 84,88 ---- boolean isZero() { ! return false; } Index: ConstantExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ConstantExp.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** ConstantExp.java 24 Dec 2002 12:42:30 -0000 1.38 --- ConstantExp.java 9 May 2003 11:57:38 -0000 1.39 *************** *** 47,50 **** --- 47,55 ---- } + boolean isZero() + { + return ((Number) this.value).intValue() == 0; + } + void computeType() { |
From: <bo...@us...> - 2003-05-09 11:57:41
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays In directory sc8-pr-cvs1:/tmp/cvs-serv11195/testsuite/compiler/expressions/arrays Modified Files: typing.testsuite Log Message: Cleaner and faster implementation of Expression.isZero(). Index: typing.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays/typing.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** typing.testsuite 9 Dec 2002 19:56:01 -0000 1.1 --- typing.testsuite 9 May 2003 11:57:37 -0000 1.2 *************** *** 9,10 **** --- 9,13 ---- /// PASS ?String[][][?][?] s = new String[1][1][][]; + + /// FAIL + new int[""]; |
From: <bo...@us...> - 2003-05-09 11:31:44
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv1948/src/bossa/syntax Modified Files: analyse.nice LoopStmt.java Expression.java Log Message: Started support for flow analysis of loops with constant test. For this to really work, the booleans true and false will need to be considered as true constants, instead of the current global variables. This will be done after 0.8 is released. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -d -r1.65 -r1.66 *** analyse.nice 8 May 2003 23:25:14 -0000 1.65 --- analyse.nice 9 May 2003 11:31:40 -0000 1.66 *************** *** 598,606 **** { info.beginInner(); if (l.isTestFirst()) ! l.whileExp = analyse(l.whileExp, info); ?LoopStmt save = info.currentLoop; info.currentLoop = l; analyse(l.loopBody, info); info.currentLoop = save; --- 598,614 ---- { info.beginInner(); + if (l.isTestFirst()) ! { ! l.whileExp = analyse(l.whileExp, info); ! if (notNull(l.whileExp).isFalse()) ! info.setUnreachable(); ! } ! ?LoopStmt save = info.currentLoop; info.currentLoop = l; + analyse(l.loopBody, info); + info.currentLoop = save; *************** *** 616,619 **** --- 624,630 ---- info.endInner(); + + if (notNull(l.whileExp).isTrue() && ! l.isBreakTarget()) + info.setUnreachable(); } *************** *** 622,626 **** ?LoopStmt loop = info.currentLoop; if (loop == null) ! throw error(b, "continue must only occur inside loops"); loop.createBlock(); --- 633,637 ---- ?LoopStmt loop = info.currentLoop; if (loop == null) ! throw error(b, "break must only occur inside loops"); loop.createBlock(); Index: LoopStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/LoopStmt.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** LoopStmt.java 11 Mar 2003 17:14:38 -0000 1.10 --- LoopStmt.java 9 May 2003 11:31:41 -0000 1.11 *************** *** 109,112 **** --- 109,118 ---- } + /** + Returns true iff there exists a break statement that target this loop. + This means that the loop can complete abruptly because of that break. + */ + boolean isBreakTarget() { return mustCreateBlock; } + private boolean mustCreateBlock = false; Index: Expression.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Expression.java,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** Expression.java 30 Apr 2003 18:55:31 -0000 1.46 --- Expression.java 9 May 2003 11:31:41 -0000 1.47 *************** *** 88,91 **** --- 88,101 ---- } + boolean isFalse() + { + return false; + } + + boolean isTrue() + { + return false; + } + /** * Resolves overloading, taking into account the parameters |
From: <bo...@us...> - 2003-05-09 11:31:43
|
Update of /cvsroot/nice/Nice/testsuite/compiler/functions In directory sc8-pr-cvs1:/tmp/cvs-serv1948/testsuite/compiler/functions Modified Files: return.testsuite Log Message: Started support for flow analysis of loops with constant test. For this to really work, the booleans true and false will need to be considered as true constants, instead of the current global variables. This will be done after 0.8 is released. Index: return.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/functions/return.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** return.testsuite 9 May 2003 08:59:11 -0000 1.1 --- return.testsuite 9 May 2003 11:31:40 -0000 1.2 *************** *** 13,16 **** --- 13,32 ---- /// FAIL + ///Toplevel + String f(String b) { + while (true) { + try { + if (b == "") + break; + return "f2(b)"; + } catch(Exception e) { + // modify and try again + b = "adjust(b)"; + } + } + // No return in this case. + } + + /// FAIL int x = 0; // local function |
From: <bo...@us...> - 2003-05-09 11:31:43
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/flow In directory sc8-pr-cvs1:/tmp/cvs-serv1948/testsuite/compiler/statements/flow Added Files: reachability.testsuite Log Message: Started support for flow analysis of loops with constant test. For this to really work, the booleans true and false will need to be considered as true constants, instead of the current global variables. This will be done after 0.8 is released. --- NEW FILE: reachability.testsuite --- /// FAIL bug while (false) { ; // Unreachable } /// FAIL bug while (true) ; ; // Unreachable /// PASS while (true) break; ; // Reachable |
From: <bo...@us...> - 2003-05-09 10:59:36
|
Update of /cvsroot/nice/Nice/testsuite/compiler/statements/flow In directory sc8-pr-cvs1:/tmp/cvs-serv20792/testsuite/compiler/statements/flow Log Message: Directory /cvsroot/nice/Nice/testsuite/compiler/statements/flow added to the repository |
From: <bo...@us...> - 2003-05-09 08:59:14
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv11924/src/bossa/syntax Modified Files: FunExp.java Log Message: Add location to local functions. Added testcase for functions made of an endless loop: they don't need a trailing return. Index: FunExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FunExp.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** FunExp.java 26 Feb 2003 17:09:25 -0000 1.39 --- FunExp.java 9 May 2003 08:59:11 -0000 1.40 *************** *** 47,50 **** --- 47,51 ---- this.constraint = cst; this.body = body; + setLocation(body.location()); } |
From: <bo...@us...> - 2003-05-09 08:59:14
|
Update of /cvsroot/nice/Nice/testsuite/compiler/functions In directory sc8-pr-cvs1:/tmp/cvs-serv11924/testsuite/compiler/functions Added Files: return.testsuite Log Message: Add location to local functions. Added testcase for functions made of an endless loop: they don't need a trailing return. --- NEW FILE: return.testsuite --- /// PASS bug ///Toplevel String f(String b) { while (true) { try { return "f2(b)"; } catch(Exception e) { // modify and try again b = "adjust(b)"; } } } /// FAIL int x = 0; // local function int f() /* /// FAIL HERE */ { if (x > 0) return x; } |
From: <ar...@us...> - 2003-05-09 02:03:55
|
Update of /cvsroot/nice/Nice/testsuite/compiler/functions In directory sc8-pr-cvs1:/tmp/cvs-serv9359/F:/nice/testsuite/compiler/functions Modified Files: local.testsuite Log Message: Allow recursive local functions. Index: local.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/functions/local.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** local.testsuite 26 Jul 2002 14:24:33 -0000 1.1 --- local.testsuite 8 May 2003 23:25:15 -0000 1.2 *************** *** 4,5 **** --- 4,13 ---- void f(int x) { if (true) return; } + /// PASS + int x = 0; + void f2(int i) { + x++; + if (i>0) f2(i-1); + } + f2(4); + assert x==5; |
From: <ar...@us...> - 2003-05-09 02:00:51
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv9359/F:/nice/src/bossa/syntax Modified Files: analyse.nice Log Message: Allow recursive local functions. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** analyse.nice 4 May 2003 16:51:27 -0000 1.64 --- analyse.nice 8 May 2003 23:25:14 -0000 1.65 *************** *** 563,568 **** notNull(decl.parameters).resolveCalledFromAnalyse(cast(info)); - decl.value = analyse(decl.value, info); info.addVar(notNull(decl.left)); } --- 563,568 ---- notNull(decl.parameters).resolveCalledFromAnalyse(cast(info)); info.addVar(notNull(decl.left)); + decl.value = analyse(decl.value, info); } |
From: <bo...@us...> - 2003-05-08 11:01:32
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv5694/syntax Modified Files: tuples.testsuite Log Message: Some cases that were not covered yet. Index: tuples.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/tuples.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tuples.testsuite 14 Mar 2003 14:10:47 -0000 1.1 --- tuples.testsuite 8 May 2003 11:01:29 -0000 1.2 *************** *** 5,8 **** --- 5,26 ---- /// PASS + ((String a, String b), String name) = (("1","2"), "name"); + assert name == "name"; + assert a == "1" && b == "2"; + + /// PASS + // Checks that we do not confuse the type with a tuple. + (String, String) -> String s = (String s1, String s2)=>s1; + + /// PASS // Checks that we do not confuse the first element with a nested tuple. ((String, String) -> String s, int i) = ((String s1, String s2)=>s1, 0); + + /// PASS + let x = 1, y = 2; + (x,y).println(); + + /// PASS + var String x, y; + (x,y) = ("1","2"); + assert x.equals("1") && y.equals("2"); |
From: <bo...@us...> - 2003-05-07 15:29:15
|
Update of /cvsroot/nice/tester In directory sc8-pr-cvs1:/tmp/cvs-serv30672 Modified Files: run Log Message: Generate html log files, so it is possible to link to an anchor inside the log. Index: run =================================================================== RCS file: /cvsroot/nice/tester/run,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** run 27 Apr 2003 14:56:34 -0000 1.6 --- run 7 May 2003 15:29:12 -0000 1.7 *************** *** 55,61 **** # Redirect output ! exec > $config.log exec 2>&1 ! if ../Project; then echo "Bootstrap OK" > $config.res --- 55,63 ---- # Redirect output ! exec > $config.log.html exec 2>&1 ! ! echo '<html><body><pre>' ! if ../Project; then echo "Bootstrap OK" > $config.res *************** *** 67,70 **** --- 69,73 ---- for test in ../*.test; do testname="`expr match $test '../\(.*\)\.test'`" + echo "<a name='$testname'>" echo "" echo "======================" *************** *** 78,81 **** --- 81,87 ---- fi done + + echo '</pre></body></html>' + done *************** *** 87,93 **** if [ -r $results_dir ]; then # We are on sourceforge! ! cp ./*.id ./*.res ./*.log $results_dir else ! scp -p ./*.id ./*.res ./*.log $us...@sh...:$results_dir fi --- 93,99 ---- if [ -r $results_dir ]; then # We are on sourceforge! ! cp ./*.id ./*.res ./*.html $results_dir else ! scp -p ./*.id ./*.res ./*.html $us...@sh...:$results_dir fi |