nice-commit Mailing List for The Nice Programming Language (Page 122)
Brought to you by:
bonniot
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
(60) |
Mar
(125) |
Apr
(183) |
May
(140) |
Jun
(227) |
Jul
(141) |
Aug
(181) |
Sep
(75) |
Oct
(89) |
Nov
(187) |
Dec
(162) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(69) |
Feb
(197) |
Mar
(98) |
Apr
(26) |
May
(10) |
Jun
(85) |
Jul
(88) |
Aug
(79) |
Sep
(80) |
Oct
(81) |
Nov
(53) |
Dec
(109) |
| 2005 |
Jan
(68) |
Feb
(77) |
Mar
(232) |
Apr
(79) |
May
(37) |
Jun
(37) |
Jul
(3) |
Aug
(18) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
(10) |
Feb
|
Mar
(4) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(9) |
| 2007 |
Jan
(2) |
Feb
(8) |
Mar
(2) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(17) |
Dec
(6) |
| 2008 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <bo...@us...> - 2003-03-14 14:10:51
|
Update of /cvsroot/nice/Nice/debian
In directory sc8-pr-cvs1:/tmp/cvs-serv15699/debian
Modified Files:
changelog
Log Message:
Allow nested tuples on the left side of a tuple assignment.
Index: changelog
===================================================================
RCS file: /cvsroot/nice/Nice/debian/changelog,v
retrieving revision 1.139
retrieving revision 1.140
diff -C2 -d -r1.139 -r1.140
*** changelog 13 Mar 2003 23:19:46 -0000 1.139
--- changelog 14 Mar 2003 14:10:48 -0000 1.140
***************
*** 10,13 ****
--- 10,15 ----
* Allow // comments at then end of a file, without a trailing newline.
Also report more nicely /* comments that are not closed.
+ * Allow nested tuples on the left side of a tuple assignment:
+ (String a, (String b, String c)) = ("a", ("b", "c"));
--
|
|
From: <bo...@us...> - 2003-03-14 14:10:51
|
Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1:/tmp/cvs-serv15699/src/bossa/parser
Modified Files:
Parser.jj
Log Message:
Allow nested tuples on the left side of a tuple assignment.
Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.150
retrieving revision 1.151
diff -C2 -d -r1.150 -r1.151
*** Parser.jj 13 Mar 2003 23:19:43 -0000 1.150
--- Parser.jj 14 Mar 2003 14:10:48 -0000 1.151
***************
*** 2391,2419 ****
Statement LocalTupleDeclaration(List statements) :
{
- Monotype t = null;
- LocatedString id;
Expression e;
- LinkedList variables;
}
{
! "(" { variables = new LinkedList(); }
! [ LOOKAHEAD(monotype() ident()) t=monotype() ] id=ident()
! { variables.add(new IdentExp(id));
! if (t != null) {
! statements.add(new Block.LocalVariable(id,t,false,null));
! t = null;
! }
! }
! ( "," [ LOOKAHEAD(monotype() ident()) t=monotype() ] id=ident()
! { variables.add(new IdentExp(id));
! if (t != null) {
! statements.add(new Block.LocalVariable(id,t,false,null));
! t = null;
! }
! }
! )+
")"
"=" e=Expression() ";"
! { return new ExpressionStmt(AssignExp.create(new TupleExp(variables), e)); }
}
--- 2391,2422 ----
Statement LocalTupleDeclaration(List statements) :
{
Expression e;
}
{
! "(" { List parts = new LinkedList(); Expression part; }
! part = LocalTuplePart(statements) { parts.add(part); }
! ( "," part = LocalTuplePart(statements) { parts.add(part); } )+
")"
"=" e=Expression() ";"
! { return new ExpressionStmt(AssignExp.create(new TupleExp(parts), e)); }
! }
!
! Expression LocalTuplePart(List statements) :
! {}
! {
! LOOKAHEAD( "(" LocalTuplePart() "," )
! "(" { List parts = new LinkedList(); Expression part; }
! part = LocalTuplePart(statements) { parts.add(part); }
! ( "," part = LocalTuplePart(statements) { parts.add(part); } )+
! ")"
! { return new TupleExp(parts); }
! |
! { LocatedString id; Monotype type = null; }
! [ LOOKAHEAD(monotype() ident()) type = monotype() ] id = ident()
! {
! if (type != null)
! statements.add(new Block.LocalVariable(id, type, false, null));
! return new IdentExp(id);
! }
}
|
|
From: <bo...@us...> - 2003-03-14 14:10:50
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv15699/testsuite/compiler/syntax
Added Files:
tuples.testsuite
Log Message:
Allow nested tuples on the left side of a tuple assignment.
--- NEW FILE: tuples.testsuite ---
/// PASS
(String name, (String a, String b)) = ("name", ("1","2"));
assert name == "name";
assert a == "1" && b == "2";
/// 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);
|
|
From: <ag...@us...> - 2003-03-14 12:37:45
|
Update of /cvsroot/nice/Nice/src/nice/tools/ant
In directory sc8-pr-cvs1:/tmp/cvs-serv11568/src/nice/tools/ant
Modified Files:
Nicec.java
Log Message:
Added comment and example on nested classpath usage
Index: Nicec.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/Nicec.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** Nicec.java 13 Mar 2003 16:38:21 -0000 1.16
--- Nicec.java 14 Mar 2003 12:37:42 -0000 1.17
***************
*** 86,94 ****
</tr>
</table>
<h3>Examples</h3>
! <pre><taskdef name="nicec" classname="nice.tools.ant.Nicec"/><br>
! <target name="nice-compiler"><br>
! <nicec package="test" runtime="../share/java/nice.jar"/><br>
! </target></pre>
--- 86,115 ----
</tr>
</table>
+
+ <h4>classpath</h4>
+ <p><code>Nicec</code>'s <i>classpath</i> attribute is a PATH like structure and can also be set via a nested
+ <i>classpath</i> element. This is very reasonable if you want to make your build script's pathes platform
+ independent. </p>
+ <h5>Example</h5>
+ <pre>
+ <nicec package="test" >
+ <classpath>
+ <pathelement location="\test.jar"/>
+ <pathelement path="${java.class.path}"/>
+ </classpath>
+ </java>
+ </pre>
+ <p>It is possible to use the <i>classpath</i> attribute together with the
+ <i>classpath<i> nested tag. In this case the result is a concatenated path.</p>
+ <p>It is highly recommended to use the nested version!<p>
+
+
<h3>Examples</h3>
! <pre>
! <taskdef name="nicec" classname="nice.tools.ant.Nicec"/>
! <target name="nice-compiler">
! <nicec package="test" runtime="../share/java/nice.jar"/>
! </target>
! </pre>
|
|
From: <bo...@us...> - 2003-03-14 00:55:29
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv19461/src/bossa/syntax
Modified Files:
MethodBodyDefinition.java
Log Message:
Always check that the patterns of a method implementation are in the domain
of the method.
Index: MethodBodyDefinition.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -d -r1.113 -r1.114
*** MethodBodyDefinition.java 4 Mar 2003 16:50:18 -0000 1.113
--- MethodBodyDefinition.java 14 Mar 2003 00:55:26 -0000 1.114
***************
*** 170,176 ****
if(symbols.size() == 0) return null;
- if(symbols.size() == 1)
- return (VarSymbol) symbols.get(0);
-
TypeConstructor[] tags = Pattern.getTC(formals);
TypeConstructor[] additionalTags = Pattern.getAdditionalTC(formals);
--- 170,173 ----
***************
*** 226,230 ****
if(symbols.size()==0)
User.error(this,
! "No definition of \""+name+"\" is compatible with the patterns");
String methods = "";
--- 223,228 ----
if(symbols.size()==0)
User.error(this,
! "No method called " + name +
! " is compatible with these patterns");
String methods = "";
|
|
From: <bo...@us...> - 2003-03-14 00:55:29
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods
In directory sc8-pr-cvs1:/tmp/cvs-serv19461/testsuite/compiler/methods
Modified Files:
implementations.testsuite
Log Message:
Always check that the patterns of a method implementation are in the domain
of the method.
Index: implementations.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/implementations.testsuite,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** implementations.testsuite 20 Feb 2003 01:27:53 -0000 1.7
--- implementations.testsuite 14 Mar 2003 00:55:24 -0000 1.8
***************
*** 74,75 ****
--- 74,83 ----
void foo(I);
foo(#I){}
+
+ /// FAIL
+ /// Toplevel
+ class A {}
+ class B extends A{}
+
+ void foo(B);
+ foo(@A){}
|
|
From: <bo...@us...> - 2003-03-13 23:33:52
|
Update of /cvsroot/nice/Nice/src/nice/tools/code
In directory sc8-pr-cvs1:/tmp/cvs-serv23422/src/nice/tools/code
Modified Files:
Types.java
Log Message:
Higher-level and faster test for void types.
Index: Types.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Types.java,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -d -r1.46 -r1.47
*** Types.java 1 Mar 2003 00:58:28 -0000 1.46
--- Types.java 13 Mar 2003 23:33:45 -0000 1.47
***************
*** 586,592 ****
public static boolean isVoid(mlsub.typing.Monotype m)
{
! // The test to void should be more high-level than string comparison
! String rep = m.toString();
! return rep.equals("nice.lang.void");
}
--- 586,590 ----
public static boolean isVoid(mlsub.typing.Monotype m)
{
! return equivalent(m).head() == PrimitiveType.voidTC;
}
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv18669/src/bossa/syntax
Modified Files:
typecheck.nice analyse.nice UserOperator.java ReturnStmt.java
PrimitiveType.java MonoSymbol.java
Log Message:
Allow functions returning a value to be used as arguments where
functions returning void are expected.
Index: typecheck.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -d -r1.54 -r1.55
*** typecheck.nice 12 Mar 2003 12:07:38 -0000 1.54
--- typecheck.nice 13 Mar 2003 23:19:41 -0000 1.55
***************
*** 626,631 ****
r.value = notNull(r.value).noOverloading();
else
! r.value = notNull(r.value).resolveOverloading
! (new mlsub.typing.Polytype(expectedType));
try { typecheck(r.value); }
--- 626,636 ----
r.value = notNull(r.value).noOverloading();
else
! {
! if (! r.fake && nice.tools.code.Types.isVoid(expectedType))
! throw bossa.util.User.error(r, "Cannot return a value here");
!
! r.value = notNull(r.value).resolveOverloading
! (new mlsub.typing.Polytype(expectedType));
! }
try { typecheck(r.value); }
Index: analyse.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -d -r1.56 -r1.57
*** analyse.nice 18 Feb 2003 23:39:43 -0000 1.56
--- analyse.nice 13 Mar 2003 23:19:41 -0000 1.57
***************
*** 175,178 ****
--- 175,181 ----
{
symbol.type = notNull(notNull(symbol.syntacticType).resolve(this.typeMap));
+ if (nice.tools.code.Types.isVoid(symbol.type))
+ throw error(symbol, "A variable cannot have a void type");
+
this.vars[symbol.name.toString()] = symbol;
}
Index: UserOperator.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/UserOperator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** UserOperator.java 27 Nov 2002 17:56:08 -0000 1.2
--- UserOperator.java 13 Mar 2003 23:19:42 -0000 1.3
***************
*** 53,57 ****
{
mlsub.typing.Monotype[] paramTypes = getArgTypes();
! for (int i = 0; i < symbols.length; i++)
if (symbols[i].name != null)
{
--- 53,60 ----
{
mlsub.typing.Monotype[] paramTypes = getArgTypes();
! for (int i = 0; i < symbols.length; i++) {
! if (Types.isVoid(paramTypes[i]))
! throw bossa.util.User.error(symbols[i].syntacticType,
! "A parameter cannot have a void type");
if (symbols[i].name != null)
{
***************
*** 59,62 ****
--- 62,66 ----
scope.addSymbol(symbols[i]);
}
+ }
}
Index: ReturnStmt.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ReturnStmt.java,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** ReturnStmt.java 20 Jan 2003 19:20:59 -0000 1.27
--- ReturnStmt.java 13 Mar 2003 23:19:42 -0000 1.28
***************
*** 31,37 ****
--- 31,47 ----
public ReturnStmt(Expression value)
{
+ this(value, false);
+ }
+
+ /**
+ @param fake This return was not explicitely written, but is the result
+ of syntactic sugar.
+ */
+ public ReturnStmt(Expression value, boolean fake)
+ {
this.value = value;
if (value != null)
this.setLocation(value.location());
+ this.fake = fake;
}
***************
*** 66,68 ****
--- 76,79 ----
Expression value;
+ boolean fake;
}
Index: PrimitiveType.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/PrimitiveType.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** PrimitiveType.java 18 Feb 2003 14:21:20 -0000 1.4
--- PrimitiveType.java 13 Mar 2003 23:19:42 -0000 1.5
***************
*** 117,120 ****
--- 117,122 ----
if(name.equals("nice.lang.void"))
{
+ voidTC = tc;
+ mlsub.typing.lowlevel.Engine.setTop(tc);
voidType = Monotype.sure(new MonotypeConstructor(tc, null));
voidPolytype = new mlsub.typing.Polytype
***************
*** 162,166 ****
}
! public static TypeConstructor byteTC, charTC, intTC, longTC, boolTC, shortTC, doubleTC, floatTC, arrayTC;
//these two only for dispatch testing booleans
public static TypeConstructor trueBoolTC, falseBoolTC;
--- 164,168 ----
}
! public static TypeConstructor byteTC, charTC, intTC, longTC, boolTC, shortTC, doubleTC, floatTC, arrayTC, voidTC;
//these two only for dispatch testing booleans
public static TypeConstructor trueBoolTC, falseBoolTC;
Index: MonoSymbol.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MonoSymbol.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** MonoSymbol.java 25 Sep 2002 16:40:26 -0000 1.19
--- MonoSymbol.java 13 Mar 2003 23:19:42 -0000 1.20
***************
*** 91,94 ****
--- 91,97 ----
type = syntacticType.resolve(typeScope);
syntacticType = null;
+
+ if (Types.isVoid(type))
+ throw User.error(name, "A variable cannot have a void type");
}
|
|
From: <bo...@us...> - 2003-03-13 23:20:14
|
Update of /cvsroot/nice/Nice/src/mlsub/typing/lowlevel
In directory sc8-pr-cvs1:/tmp/cvs-serv18669/src/mlsub/typing/lowlevel
Modified Files:
Engine.java
Log Message:
Allow functions returning a value to be used as arguments where
functions returning void are expected.
Index: Engine.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/mlsub/typing/lowlevel/Engine.java,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** Engine.java 18 Nov 2002 16:40:30 -0000 1.24
--- Engine.java 13 Mar 2003 23:19:40 -0000 1.25
***************
*** 183,186 ****
--- 183,193 ----
}
+ public static void setTop(Element top)
+ {
+ Engine.top = top;
+ }
+
+ private static Element top;
+
/**
Asserts that elements have some ordering relation.
***************
*** 194,197 ****
--- 201,206 ----
throws Unsatisfiable
{
+ if (e2 == top) return;
+
Kind k1 = e1.getKind(), k2 = e2.getKind();
|
|
From: <bo...@us...> - 2003-03-13 23:19:49
|
Update of /cvsroot/nice/Nice/debian
In directory sc8-pr-cvs1:/tmp/cvs-serv18669/debian
Modified Files:
changelog
Log Message:
Allow functions returning a value to be used as arguments where
functions returning void are expected.
Index: changelog
===================================================================
RCS file: /cvsroot/nice/Nice/debian/changelog,v
retrieving revision 1.138
retrieving revision 1.139
diff -C2 -d -r1.138 -r1.139
*** changelog 12 Mar 2003 03:26:39 -0000 1.138
--- changelog 13 Mar 2003 23:19:46 -0000 1.139
***************
*** 5,8 ****
--- 5,10 ----
and
x == null || x.dereference()
+ * Allow functions returning a value to be used as arguments where
+ functions returning void are expected.
* Allow ?(T[]) syntax for optional arrays, as an alternative to T[?].
* Allow // comments at then end of a file, without a trailing newline.
|
|
From: <bo...@us...> - 2003-03-13 23:19:49
|
Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1:/tmp/cvs-serv18669/src/bossa/parser
Modified Files:
Parser.jj
Log Message:
Allow functions returning a value to be used as arguments where
functions returning void are expected.
Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.149
retrieving revision 1.150
diff -C2 -d -r1.149 -r1.150
*** Parser.jj 12 Mar 2003 03:26:38 -0000 1.149
--- Parser.jj 13 Mar 2003 23:19:43 -0000 1.150
***************
*** 1257,1261 ****
exp=Expression() ";"
{
! code = new ReturnStmt(exp);
}
)
--- 1257,1261 ----
exp=Expression() ";"
{
! code = new ReturnStmt(exp, /* fake */ true);
}
)
|
|
From: <bo...@us...> - 2003-03-13 23:19:43
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing
In directory sc8-pr-cvs1:/tmp/cvs-serv18669/testsuite/compiler/typing
Added Files:
void.testsuite
Log Message:
Allow functions returning a value to be used as arguments where
functions returning void are expected.
--- NEW FILE: void.testsuite ---
/// PASS
// A fonction A->B can be used where A->void is expected.
List<String> l = new LinkedList();
StringBuffer buffer = new StringBuffer( );
l.add( "foo" );
l.add( "bar" );
l.foreach( (String s) => buffer.append( s ) );
assert buffer.toString().equals("foobar");
/// FAIL
/// Toplevel
void goo() {
/* /// FAIL HERE */ return 1;
}
/// PASS
/// Toplevel
void foo(int i) {}
void goo() = foo(3);
/// FAIL
void x;
/// FAIL
/// Toplevel
var void x;
/// FAIL
/// Toplevel
void f(void x) {}
/// FAIL
/// Toplevel
void f(void) {}
|
|
From: <ag...@us...> - 2003-03-13 16:38:26
|
Update of /cvsroot/nice/Nice/src/nice/tools/ant
In directory sc8-pr-cvs1:/tmp/cvs-serv32223/src/nice/tools/ant
Modified Files:
Nicec.java
Log Message:
added nested classpath support as in javac
Index: Nicec.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/ant/Nicec.java,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** Nicec.java 23 Dec 2002 18:47:19 -0000 1.15
--- Nicec.java 13 Mar 2003 16:38:21 -0000 1.16
***************
*** 2,5 ****
--- 2,6 ----
import org.apache.tools.ant.*;
+ import org.apache.tools.ant.types.*;
import java.io.File;
import java.util.Vector;
***************
*** 131,135 ****
/** Search path for compiled packages and libraries
*/
! private String classpath;
public void setClasspath(String classpath)
--- 132,136 ----
/** Search path for compiled packages and libraries
*/
! private String classpath = "";
public void setClasspath(String classpath)
***************
*** 238,241 ****
--- 239,257 ----
+ private Path nestedClasspath = null;
+
+ /**
+ * Creates a nested classpath element
+ */
+ public Path createClasspath() {
+ nestedClasspath = new Path(project);
+ return nestedClasspath.createPath();
+ }
+
+
+
+
+
+
***************
*** 252,256 ****
if (destination != null)
compilation.destinationDir = destination.getAbsolutePath();
! compilation.packagePath = classpath;
compilation.output = jar;
compilation.recompileCommandLine = recompile;
--- 268,272 ----
if (destination != null)
compilation.destinationDir = destination.getAbsolutePath();
! compilation.packagePath = classpath + (nestedClasspath != null ? File.pathSeparator+nestedClasspath : "");
compilation.output = jar;
compilation.recompileCommandLine = recompile;
|
|
From: <bo...@us...> - 2003-03-12 15:50:38
|
Update of /cvsroot/nice/Nice/src/nice/tools/compiler In directory sc8-pr-cvs1:/tmp/cvs-serv27451/src/nice/tools/compiler Modified Files: setBuildDate Log Message: Include "prerelease" in the version string of unofficial builds. Index: setBuildDate =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/compiler/setBuildDate,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** setBuildDate 19 Apr 2002 08:04:20 -0000 1.6 --- setBuildDate 12 Mar 2003 15:50:04 -0000 1.7 *************** *** 1,6 **** #! /bin/sh echo > dateBuild.nice echo "package nice.tools.compiler;" >> dateBuild.nice ! echo "var String versionNumber = \"$1\";" >> dateBuild.nice echo "var String buildDate = \""`date -u +"%Y.%m.%d, %T %Z"`"\";" >> dateBuild.nice --- 1,12 ---- #! /bin/sh + if [ -z "$2" ]; then + version="$1" + else + version="$1 $2" + fi + echo > dateBuild.nice echo "package nice.tools.compiler;" >> dateBuild.nice ! echo "var String versionNumber = \"$version\";" >> dateBuild.nice echo "var String buildDate = \""`date -u +"%Y.%m.%d, %T %Z"`"\";" >> dateBuild.nice |
|
From: <bo...@us...> - 2003-03-12 15:50:11
|
Update of /cvsroot/nice/Nice
In directory sc8-pr-cvs1:/tmp/cvs-serv27451
Modified Files:
Makefile
Log Message:
Include "prerelease" in the version string of unofficial builds.
Index: Makefile
===================================================================
RCS file: /cvsroot/nice/Nice/Makefile,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** Makefile 26 Feb 2003 14:40:07 -0000 1.110
--- Makefile 12 Mar 2003 15:50:05 -0000 1.111
***************
*** 9,12 ****
--- 9,13 ----
# Get the version from the debian changelog.
VERSION = ${shell expr "`head -1 debian/changelog`" : '.*(\(.*\))'}
+ TAG = ${shell if [ `grep '^ --' debian/changelog |head -1|wc -c` -le 10 ]; then echo prerelease; fi }
SHELL = /bin/sh
***************
*** 70,74 ****
setDate:
! cd src/nice/tools/compiler; ./setBuildDate ${VERSION}
test:
--- 71,75 ----
setDate:
! cd src/nice/tools/compiler; ./setBuildDate ${VERSION} ${TAG}
test:
***************
*** 201,203 ****
tags:
jtags
-
--- 202,203 ----
|
|
From: <bo...@us...> - 2003-03-12 12:07:41
|
Update of /cvsroot/nice/Nice/testsuite/compiler/null
In directory sc8-pr-cvs1:/tmp/cvs-serv17433/testsuite/compiler/null
Modified Files:
inference.testsuite
Log Message:
Fix assignment to possibly null in a nested context of non-null tests.
Index: inference.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/null/inference.testsuite,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** inference.testsuite 12 Mar 2003 03:26:35 -0000 1.7
--- inference.testsuite 12 Mar 2003 12:07:38 -0000 1.8
***************
*** 154,157 ****
--- 154,175 ----
x++;
+ /// FAIL
+ ?int x = 0;
+ if (x != null)
+ {
+ if (x != null)
+ x = null;
+ /* /// FAIL HERE */ x++;
+ }
+
+ /// FAIL
+ ?int x = 0;
+ if (x != null)
+ {
+ while (x != null)
+ x = null;
+ /* /// FAIL HERE */ x++;
+ }
+
/// COMMENT Check several variables at the same time
|
|
From: <bo...@us...> - 2003-03-12 12:07:41
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv17433/src/bossa/syntax
Modified Files:
typecheck.nice
Log Message:
Fix assignment to possibly null in a nested context of non-null tests.
Index: typecheck.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** typecheck.nice 12 Mar 2003 03:26:36 -0000 1.53
--- typecheck.nice 12 Mar 2003 12:07:38 -0000 1.54
***************
*** 53,57 ****
variable.setVarType(now: unsureType,
otherBranch: variable.type,
! out: unsureType);
return;
}
--- 53,57 ----
variable.setVarType(now: unsureType,
otherBranch: variable.type,
! overrideOut: unsureType);
return;
}
***************
*** 335,338 ****
--- 335,349 ----
}
+ void overrideOuterType(MonoSymbol variable, mlsub.typing.Monotype newType)
+ {
+ for (int i = 0; i < levels.size(); i++)
+ if (levels.get(i) % 2 == 1)
+ {
+ (MonoSymbol v, mlsub.typing.Monotype t) = conditionalTypes.get(i);
+ if (variable == v)
+ conditionalTypes.set(i, (variable, newType));
+ }
+ }
+
typecheck(e@IfExp)
{
***************
*** 405,415 ****
@param otherBranch type to be used in the other branches
@param out type to be used after returning to the outer block
*/
private void setVarType(MonoSymbol variable,
mlsub.typing.Monotype now,
?mlsub.typing.Monotype otherBranch = null,
! ?mlsub.typing.Monotype out = null)
{
variable.type = now;
if (out != null)
pushOuterType(variable, out);
--- 416,435 ----
@param otherBranch type to be used in the other branches
@param out type to be used after returning to the outer block
+ @param overrideOut use that type when exiting all englobing blocks
*/
private void setVarType(MonoSymbol variable,
mlsub.typing.Monotype now,
?mlsub.typing.Monotype otherBranch = null,
! ?mlsub.typing.Monotype out = null,
! ?mlsub.typing.Monotype overrideOut = null)
{
variable.type = now;
+ if (overrideOut != null)
+ {
+ overrideOuterType(variable, overrideOut);
+ // We also set it for the current block, in case there was no previous
+ // type set.
+ pushOuterType(variable, overrideOut);
+ }
if (out != null)
pushOuterType(variable, out);
|
|
From: <bo...@us...> - 2003-03-12 03:32:06
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv20548/src/bossa/syntax
Modified Files:
SymbolExp.java
Log Message:
Removed debug command.
Index: SymbolExp.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/SymbolExp.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** SymbolExp.java 21 Feb 2003 13:04:36 -0000 1.30
--- SymbolExp.java 12 Mar 2003 03:32:01 -0000 1.31
***************
*** 43,48 ****
void computeType()
{
- //Internal.printStackTrace();
-
// Very important: each SymbolExp gets a copy of the type of the symbol.
// Thus it has fresh binders.
--- 43,46 ----
|
|
From: <bo...@us...> - 2003-03-12 03:27:12
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv18990/src/bossa/syntax
Modified Files:
typecheck.nice tools.nice
Log Message:
Handle nullness tests on the right side of && and || expressions.
Index: typecheck.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -d -r1.52 -r1.53
*** typecheck.nice 11 Mar 2003 20:14:26 -0000 1.52
--- typecheck.nice 12 Mar 2003 03:26:36 -0000 1.53
***************
*** 53,57 ****
variable.setVarType(now: unsureType,
otherBranch: variable.type,
! brothers: unsureType);
return;
}
--- 53,57 ----
variable.setVarType(now: unsureType,
otherBranch: variable.type,
! out: unsureType);
return;
}
***************
*** 96,103 ****
}
typecheck(e@CallExp)
{
typecheck(e.function);
! e.arguments.typecheckArgs();
// forces computation of the type if not done.
--- 96,170 ----
}
+ void typecheckAndArgs(Arguments args)
+ {
+ if (args.size() != 2)
+ {
+ typecheckArgs(args);
+ return;
+ }
+
+ enterIf();
+ try {
+ typecheck(args.getExp(0));
+
+ ?List<MonoSymbol> l = variablesNotNullIfTestSucceeds(args.getExp(0));
+ if (l != null)
+ l.foreach(MonoSymbol variable => {
+ mlsub.typing.Monotype type = notNull(variable.type);
+ mlsub.typing.Monotype sureType = makeSure(type);
+ setVarType(variable, now: sureType, out: type);
+ });
+
+ typecheck(args.getExp(1));
+ args.getExp(1).computeType();
+ }
+ finally {
+ // There is no else part, but this call is necessary to pop off
+ // conditional type information (from assignments) from the stack.
+ enterElse();
+ exitIf();
+ }
+ }
+
+ void typecheckOrArgs(Arguments args)
+ {
+ if (args.size() != 2)
+ {
+ typecheckArgs(args);
+ return;
+ }
+
+ enterIf();
+ try {
+ typecheck(args.getExp(0));
+
+ ?List<MonoSymbol> l = variablesNotNullIfTestFails(args.getExp(0));
+ if (l != null)
+ l.foreach(MonoSymbol variable => {
+ mlsub.typing.Monotype type = notNull(variable.type);
+ mlsub.typing.Monotype sureType = makeSure(type);
+ setVarType(variable, now: sureType, out: type);
+ });
+
+ typecheck(args.getExp(1));
+ args.getExp(1).computeType();
+ }
+ finally {
+ // There is no else part, but this call is necessary to pop off
+ // conditional type information (from assignments) from the stack.
+ enterElse();
+ exitIf();
+ }
+ }
+
typecheck(e@CallExp)
{
typecheck(e.function);
! if (e.isCallTo("&&"))
! e.arguments.typecheckAndArgs();
! else if (e.isCallTo("||"))
! e.arguments.typecheckOrArgs();
! else
! e.arguments.typecheckArgs();
// forces computation of the type if not done.
***************
*** 215,218 ****
--- 282,292 ----
}
+ ?List<MonoSymbol> variablesNotNullIfTestFails(Expression test)
+ {
+ (?List<MonoSymbol> notNullIfTrue, ?List<MonoSymbol> notNullIfFalse) =
+ nullnessInfo(test);
+ return notNullIfFalse;
+ }
+
/**
Collects knowledge about more precise type in branches of conditionals.
***************
*** 255,259 ****
}
! void pushBrotherType(MonoSymbol variable, mlsub.typing.Monotype baseType)
{
levels.push(2 * ifLevel + 1);
--- 329,333 ----
}
! void pushOuterType(MonoSymbol variable, mlsub.typing.Monotype baseType)
{
levels.push(2 * ifLevel + 1);
***************
*** 289,293 ****
mlsub.typing.Monotype type = notNull(variable.type);
mlsub.typing.Monotype sureType = makeSure(type);
! setVarType(variable, now: sureType, brothers: type);
});
--- 363,367 ----
mlsub.typing.Monotype type = notNull(variable.type);
mlsub.typing.Monotype sureType = makeSure(type);
! setVarType(variable, now: sureType, otherBranch: type);
});
***************
*** 304,308 ****
mlsub.typing.Monotype type = notNull(variable.type);
mlsub.typing.Monotype sureType = makeSure(type);
! setVarType(variable, now: sureType, brothers: type);
});
--- 378,382 ----
mlsub.typing.Monotype type = notNull(variable.type);
mlsub.typing.Monotype sureType = makeSure(type);
! setVarType(variable, now: sureType, out: type);
});
***************
*** 330,343 ****
@param now type to be used in the next branch.
@param otherBranch type to be used in the other branches
! @param brothers type to be used in the block containing the conditional
! @param later type to be used when returning to the parent block
*/
private void setVarType(MonoSymbol variable,
mlsub.typing.Monotype now,
?mlsub.typing.Monotype otherBranch = null,
! mlsub.typing.Monotype brothers)
{
variable.type = now;
! pushBrotherType(variable, brothers);
if (otherBranch != null)
pushBranchType(variable, otherBranch);
--- 404,417 ----
@param now type to be used in the next branch.
@param otherBranch type to be used in the other branches
! @param out type to be used after returning to the outer block
*/
private void setVarType(MonoSymbol variable,
mlsub.typing.Monotype now,
?mlsub.typing.Monotype otherBranch = null,
! ?mlsub.typing.Monotype out = null)
{
variable.type = now;
! if (out != null)
! pushOuterType(variable, out);
if (otherBranch != null)
pushBranchType(variable, otherBranch);
***************
*** 499,503 ****
setVarType(variable,
now: makeSure(variable.type),
! brothers: variable.type));
}
--- 573,577 ----
setVarType(variable,
now: makeSure(variable.type),
! out: variable.type));
}
Index: tools.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** tools.nice 20 Feb 2003 14:58:39 -0000 1.18
--- tools.nice 12 Mar 2003 03:26:37 -0000 1.19
***************
*** 24,27 ****
--- 24,28 ----
identString(e@IdentExp) = e.ident;
identString(e@SymbolExp) = e.getName();
+ identString(e@OverloadedSymbolExp) = e.ident;
boolean isCallTo(CallExp e, String name)
|
|
From: <bo...@us...> - 2003-03-12 03:27:11
|
Update of /cvsroot/nice/Nice/testsuite/compiler/null
In directory sc8-pr-cvs1:/tmp/cvs-serv18990/testsuite/compiler/null
Modified Files:
inference.testsuite
Log Message:
Handle nullness tests on the right side of && and || expressions.
Index: inference.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/null/inference.testsuite,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** inference.testsuite 17 Feb 2003 14:40:07 -0000 1.6
--- inference.testsuite 12 Mar 2003 03:26:35 -0000 1.7
***************
*** 13,16 ****
--- 13,23 ----
+ /// FAIL
+ ?int x = null;
+ if (x != null)
+ x++;
+ else
+ /* /// FAIL HERE */ x++;
+
/// PASS
?int x = null;
***************
*** 301,302 ****
--- 308,362 ----
while ( (x1 = null) == null)
x1 = x1 + "";
+
+
+ /// COMMENT && expressions
+
+ /// PASS
+ ?String x = null;
+ boolean b = x != null && x.length() > 3 && x.length() > 4;
+
+ /// FAIL
+ ?String x = null;
+ boolean b = x != null && x.length() > 3;
+ b = x.length() > 3;
+
+ /// PASS
+ ?String x = null;
+ if (x != null && x.length() > 3 && x.length() > 4)
+ x.length();
+
+ /// PASS
+ ?String x = null;
+ boolean b = x != null && x.length() > 3 && (x = null) == null;
+
+ /// FAIL
+ ?String x = null;
+ boolean b = x != null && (x = null) == null && x.length() > 3;
+
+
+ /// COMMENT || expressions
+
+ /// PASS
+ ?String x = null;
+ boolean b = x == null || x.length() > 3 || x.length() > 4;
+
+ /// FAIL
+ ?String x = null;
+ boolean b = x == null || x.length() > 3;
+ b = x.length() > 3;
+
+ /// PASS
+ ?String x = null;
+ if (x == null || x.length() > 3 || x.length() > 4)
+ ;
+ else
+ x.length();
+
+ /// PASS
+ ?String x = null;
+ boolean b = x == null || x.length() > 3 || (x = null) == null;
+
+ /// FAIL
+ ?String x = null;
+ boolean b = x == null || (x = null) == "" || x.length() > 3;
+
|
|
From: <bo...@us...> - 2003-03-12 03:26:43
|
Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1:/tmp/cvs-serv18990/src/bossa/parser
Modified Files:
Parser.jj
Log Message:
Handle nullness tests on the right side of && and || expressions.
Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.148
retrieving revision 1.149
diff -C2 -d -r1.148 -r1.149
*** Parser.jj 11 Mar 2003 17:14:38 -0000 1.148
--- Parser.jj 12 Mar 2003 03:26:38 -0000 1.149
***************
*** 1838,1843 ****
{
e1=ConditionalAndExpression()
! ( t="||" e2=ConditionalAndExpression()
! { e1=CallExp.create(symb(t), e1, e2); } )*
{ return e1; }
}
--- 1838,1843 ----
{
e1=ConditionalAndExpression()
! ( t="||" e2=ConditionalOrExpression()
! { e1=CallExp.create(symb(t), e1, e2); } )?
{ return e1; }
}
***************
*** 1847,1852 ****
{
e1=InclusiveOrExpression()
! ( t="&&" e2=InclusiveOrExpression()
! { e1=CallExp.create(symb(t), e1, e2); } )*
{ return e1; }
}
--- 1847,1852 ----
{
e1=InclusiveOrExpression()
! ( t="&&" e2=ConditionalAndExpression()
! { e1=CallExp.create(symb(t), e1, e2); } )?
{ return e1; }
}
|
|
From: <bo...@us...> - 2003-03-12 03:26:42
|
Update of /cvsroot/nice/Nice/debian
In directory sc8-pr-cvs1:/tmp/cvs-serv18990/debian
Modified Files:
changelog
Log Message:
Handle nullness tests on the right side of && and || expressions.
Index: changelog
===================================================================
RCS file: /cvsroot/nice/Nice/debian/changelog,v
retrieving revision 1.137
retrieving revision 1.138
diff -C2 -d -r1.137 -r1.138
*** changelog 12 Mar 2003 01:20:32 -0000 1.137
--- changelog 12 Mar 2003 03:26:39 -0000 1.138
***************
*** 1,4 ****
--- 1,8 ----
nice (0.7.8) unstable; urgency=low
+ * Improved handling of nullness tests, as in:
+ x != null && x.dereference()
+ and
+ x == null || x.dereference()
* Allow ?(T[]) syntax for optional arrays, as an alternative to T[?].
* Allow // comments at then end of a file, without a trailing newline.
|
|
From: <bo...@us...> - 2003-03-12 01:20:37
|
Update of /cvsroot/nice/Nice/debian
In directory sc8-pr-cvs1:/tmp/cvs-serv7946/debian
Modified Files:
changelog
Log Message:
Allow // comments at then end of a file, without a trailing newline.
Also report more nicely /* comments that are not closed.
Index: changelog
===================================================================
RCS file: /cvsroot/nice/Nice/debian/changelog,v
retrieving revision 1.136
retrieving revision 1.137
diff -C2 -d -r1.136 -r1.137
*** changelog 6 Mar 2003 12:29:07 -0000 1.136
--- changelog 12 Mar 2003 01:20:32 -0000 1.137
***************
*** 2,5 ****
--- 2,7 ----
* Allow ?(T[]) syntax for optional arrays, as an alternative to T[?].
+ * Allow // comments at then end of a file, without a trailing newline.
+ Also report more nicely /* comments that are not closed.
--
|
|
From: <bo...@us...> - 2003-03-11 23:26:20
|
Update of /cvsroot/nice/Nice/web
In directory sc8-pr-cvs1:/tmp/cvs-serv31518/web
Modified Files:
new.xsl
Log Message:
This actually looks nicer when the logo cannot be displayed (sf is down).
Index: new.xsl
===================================================================
RCS file: /cvsroot/nice/Nice/web/new.xsl,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** new.xsl 7 Mar 2003 15:29:02 -0000 1.5
--- new.xsl 11 Mar 2003 23:26:16 -0000 1.6
***************
*** 209,213 ****
<img
src="http://sourceforge.net/sflogo.php?group_id=12788&type=1"
! width="88" height="31" border="0" alt="SourceForge Logo"/>
</a>
</div>
--- 209,213 ----
<img
src="http://sourceforge.net/sflogo.php?group_id=12788&type=1"
! width="88" height="31" border="0" alt="SourceForge"/>
</a>
</div>
|
|
From: <bo...@us...> - 2003-03-11 20:14:36
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv13462/src/bossa/syntax
Modified Files:
typecheck.nice
Log Message:
Typos.
Index: typecheck.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** typecheck.nice 26 Feb 2003 17:09:24 -0000 1.51
--- typecheck.nice 11 Mar 2003 20:14:26 -0000 1.52
***************
*** 154,158 ****
nullnessInfo(notNull(test.arguments.getExp(1)));
! // If this test is fase, it is because both subtests are.
return (null, combine(notNullIfFalse0, notNullIfFalse1));
}
--- 154,158 ----
nullnessInfo(notNull(test.arguments.getExp(1)));
! // If this test is false, it is because both subtests are.
return (null, combine(notNullIfFalse0, notNullIfFalse1));
}
***************
*** 165,169 ****
nullnessInfo(notNull(test.arguments.getExp(1)));
! // If this test is fase, it is because both subtests are.
return (combine(notNullIfTrue0, notNullIfTrue1), null);
}
--- 165,169 ----
nullnessInfo(notNull(test.arguments.getExp(1)));
! // If this test is true, it is because both subtests are.
return (combine(notNullIfTrue0, notNullIfTrue1), null);
}
***************
*** 174,178 ****
else if (test.isCallTo("!="))
isAlwaysNull = false;
! else /// give up
return (null, null);
--- 174,178 ----
else if (test.isCallTo("!="))
isAlwaysNull = false;
! else // Give up.
return (null, null);
|