nice-commit Mailing List for The Nice Programming Language (Page 81)
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-10-06 18:22:30
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv22778/F:/nice/debian Modified Files: changelog Log Message: Improved type inference for instanceof it can handle the same cases as nullness inference now. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.212 retrieving revision 1.213 diff -C2 -d -r1.212 -r1.213 *** changelog 1 Oct 2003 21:49:03 -0000 1.212 --- changelog 6 Oct 2003 18:22:22 -0000 1.213 *************** *** 1,4 **** --- 1,5 ---- nice (0.9.3) unstable; urgency=low + * Improved type inference by instanceof tests. * Added multi line string literals. String that start and end with """ may take multiple lines and will include the linebreaks. |
From: <ar...@us...> - 2003-10-06 18:22:27
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv22778/F:/nice/src/bossa/syntax Modified Files: tools.nice typecheck.nice Log Message: Improved type inference for instanceof it can handle the same cases as nullness inference now. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** tools.nice 28 Sep 2003 17:16:33 -0000 1.24 --- tools.nice 6 Oct 2003 18:22:22 -0000 1.25 *************** *** 93,102 **** } ! ?(MonoSymbol, mlsub.typing.Monotype) getInstanceof(Expression cond) { - if (! (cond instanceof CallExp)) - return null; - - CallExp condition = cast(cond); if (! condition.isCallTo("instanceof") || condition.arguments.size() != 2) return null; --- 93,98 ---- } ! ?(MonoSymbol, mlsub.typing.Monotype) getInstanceof(CallExp condition) { if (! condition.isCallTo("instanceof") || condition.arguments.size() != 2) return null; *************** *** 119,123 **** if (type.representedType == null) return null; - TypeConstructor tc = notNull(type.representedType); --- 115,118 ---- Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** typecheck.nice 28 Sep 2003 17:16:33 -0000 1.79 --- typecheck.nice 6 Oct 2003 18:22:22 -0000 1.80 *************** *** 120,125 **** }); typecheck(args.getExp(1)); ! if (l != null) { Expression e = args.getExp(1).noOverloading(); args.setExp(1, e); --- 120,132 ---- }); + ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfSucceeds = + first_(instanceofInfo(args.getExp(0))); + + if (instanceofIfSucceeds != null) + instanceofIfSucceeds.foreach(((MonoSymbol variable, mlsub.typing.Monotype type)) => + setVarType(variable, now: type, out: variable.type)); + typecheck(args.getExp(1)); ! if (l != null || instanceofIfSucceeds != null) { Expression e = args.getExp(1).noOverloading(); args.setExp(1, e); *************** *** 155,160 **** }); typecheck(args.getExp(1)); ! if (l != null) { Expression e = args.getExp(1).noOverloading(); args.setExp(1, e); --- 162,175 ---- }); + ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfFails = + second_(instanceofInfo(args.getExp(0))); + + if (instanceofIfFails != null) + instanceofIfFails.foreach(((MonoSymbol variable, mlsub.typing.Monotype type)) => + setVarType(variable, now: type, out: variable.type)); + typecheck(args.getExp(1)); ! ! if (l != null || instanceofIfFails != null) { Expression e = args.getExp(1).noOverloading(); args.setExp(1, e); *************** *** 228,235 **** if (test.isCallTo("||")) { ! (?List<MonoSymbol> notNullIfTrue0, ?List<MonoSymbol> notNullIfFalse0) = ! nullnessInfo(notNull(test.arguments.getExp(0))); ! (?List<MonoSymbol> notNullIfTrue1, ?List<MonoSymbol> notNullIfFalse1) = ! nullnessInfo(notNull(test.arguments.getExp(1))); // If this test is false, it is because both subtests are. --- 243,250 ---- if (test.isCallTo("||")) { ! ?List<MonoSymbol> notNullIfFalse0 = ! second_(nullnessInfo(notNull(test.arguments.getExp(0)))); ! ?List<MonoSymbol> notNullIfFalse1 = ! second_(nullnessInfo(notNull(test.arguments.getExp(1)))); // If this test is false, it is because both subtests are. *************** *** 239,246 **** if (test.isCallTo("&&")) { ! (?List<MonoSymbol> notNullIfTrue0, ?List<MonoSymbol> notNullIfFalse0) = ! nullnessInfo(notNull(test.arguments.getExp(0))); ! (?List<MonoSymbol> notNullIfTrue1, ?List<MonoSymbol> notNullIfFalse1) = ! nullnessInfo(notNull(test.arguments.getExp(1))); // If this test is true, it is because both subtests are. --- 254,261 ---- if (test.isCallTo("&&")) { ! ?List<MonoSymbol> notNullIfTrue0 = ! first_(nullnessInfo(notNull(test.arguments.getExp(0)))); ! ?List<MonoSymbol> notNullIfTrue1 = ! first_(nullnessInfo(notNull(test.arguments.getExp(1)))); // If this test is true, it is because both subtests are. *************** *** 276,281 **** } // Returns a list combining l1 and l2, possibly modifying l1. ! private ?List<MonoSymbol> combine(?List<MonoSymbol> l1, ?List<MonoSymbol> l2) { if (l1 == null) --- 291,297 ---- } + // Returns a list combining l1 and l2, possibly modifying l1. ! private <T> ?List<T> combine(?List<T> l1, ?List<T> l2) { if (l1 == null) *************** *** 287,290 **** --- 303,309 ---- } + private <T> T first_((T t1, T t2)) = t1; + private <T> T second_((T t1, T t2)) = t2; + ?List<MonoSymbol> variablesNotNullIfTestSucceeds(Expression test) { *************** *** 301,304 **** --- 320,367 ---- } + + (?List<(MonoSymbol, mlsub.typing.Monotype)>, ?List<(MonoSymbol, mlsub.typing.Monotype)>) instanceofInfo(Expression test); + instanceofInfo(test) = (null, null); + instanceofInfo(test@CallExp) + { + if (test.isCallTo("||")) + { + ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfFalse0 = + second_(instanceofInfo(notNull(test.arguments.getExp(0)))); + ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfFalse1 = + second_(instanceofInfo(notNull(test.arguments.getExp(1)))); + + return (null, combine(instanceofIfFalse0, instanceofIfFalse1)); + } + + if (test.isCallTo("&&")) + { + ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue0 = + first_(instanceofInfo(notNull(test.arguments.getExp(0)))); + ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue1 = + first_(instanceofInfo(notNull(test.arguments.getExp(1)))); + + return (combine(instanceofIfTrue0, instanceofIfTrue1), null); + } + + if (test.isCallTo("!")) + { + (?List<(MonoSymbol, mlsub.typing.Monotype)> ifTrue, + ?List<(MonoSymbol, mlsub.typing.Monotype)> ifFalse) = + instanceofInfo(notNull(test.arguments.getExp(0))); + return (ifFalse, ifTrue); + } + + ?(MonoSymbol, mlsub.typing.Monotype) info = getInstanceof(test); + + if (info == null) + return (null, null); + + List<(MonoSymbol, mlsub.typing.Monotype)> list = new LinkedList(); + list.add(info); + + return (list, null); + } + /** Collects knowledge about more precise type in branches of conditionals. *************** *** 392,403 **** }); ! ?(MonoSymbol, mlsub.typing.Monotype) test = getInstanceof(notNull(e.condition)); ! if (test != null) ! { ! (MonoSymbol variable, mlsub.typing.Monotype type) = test; ! setVarType(variable, now: type, otherBranch: variable.type); ! } ! e.thenExp = thenExp = notNull(thenExp.noOverloading()); typecheck(thenExp); --- 455,466 ---- }); ! (?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofInThen, ! ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofInElse) = ! instanceofInfo(condition); + if (instanceofInThen != null) + instanceofInThen.foreach( ((MonoSymbol variable, mlsub.typing.Monotype type)) => + setVarType(variable, now: type, otherBranch: variable.type)); + e.thenExp = thenExp = notNull(thenExp.noOverloading()); typecheck(thenExp); *************** *** 415,418 **** --- 478,485 ---- }); + if (instanceofInElse != null) + instanceofInElse.foreach( ((MonoSymbol variable, mlsub.typing.Monotype type)) => + setVarType(variable, now: type, out: variable.type)); + e.elseExp = elseExp = notNull(elseExp.noOverloading()); typecheck(elseExp); *************** *** 643,652 **** out: variable.type)); ! ?(MonoSymbol, mlsub.typing.Monotype) test = getInstanceof(notNull(whileExp)); ! if (test != null) ! { ! (MonoSymbol variable, mlsub.typing.Monotype type) = test; ! setVarType(variable, now: type, otherBranch: variable.type); ! } } --- 710,719 ---- out: variable.type)); ! ?List<(MonoSymbol, mlsub.typing.Monotype)> instanceofIfTrue = ! first_(instanceofInfo(notNull(whileExp))); ! ! if (instanceofIfTrue != null) ! instanceofIfTrue.foreach( ((MonoSymbol variable, mlsub.typing.Monotype type)) => ! setVarType(variable, now: type, out: variable.type)); } |
From: <ar...@us...> - 2003-10-06 18:22:26
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv22778/F:/nice/testsuite/compiler/typing Modified Files: instanceof.testsuite Log Message: Improved type inference for instanceof it can handle the same cases as nullness inference now. Index: instanceof.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/instanceof.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** instanceof.testsuite 5 Oct 2003 23:23:13 -0000 1.4 --- instanceof.testsuite 6 Oct 2003 18:22:22 -0000 1.5 *************** *** 106,107 **** --- 106,182 ---- class C implements X {} class D implements X,Y {} + + /// PASS + A x = new B(); + if (!( x instanceof B)) + assert false; + else + assert x.life == 42; + + /// PASS + assert foo(new B()) == 42; + /// Toplevel + int foo(A x) { + if (!( x instanceof B)) + return 0; + + return x.life; + } + + /// FAIL + A x = new B(); + int i = 0; + if (x instanceof B) + i = x.life; + else + i = x./* /// FAIL HERE */life; + + /// FAIL + A x = new B(); + int i = 0; + if (x instanceof B) + i = x.life; + + i = x./* /// FAIL HERE */life; + + /// PASS + A x = new B(); + A y = new B(); + int i = 0; + if (x instanceof B && y instanceof B) + i = x.life + y.life; + else + assert false; + + /// PASS + A x = new B(); + A y = new B(); + int i = 0; + if (!(x instanceof B) || !(y instanceof B)) + assert false; + else + i = x.life + y.life; + + /// PASS + A x = new B(); + if (x instanceof B && x.life == 42) + assert true; + else + assert false; + + /// FAIL + A x = new B(); + if ((!(x instanceof B)) && x./* /// FAIL HERE */life == 42) + assert true; + + /// PASS + A x = new B(); + if ((!(x instanceof B)) || x.life == 42) + assert true; + else + assert false; + + /// FAIL + A x = new B(); + if (x instanceof B || x./* /// FAIL HERE */life == 42) + assert true; |
From: <ar...@us...> - 2003-10-05 23:23:19
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv16560/F:/nice/testsuite/compiler/typing Modified Files: instanceof.testsuite Log Message: Testcases where an assignment in a instanceof branch should fail at compile time. Index: instanceof.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/instanceof.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** instanceof.testsuite 28 Sep 2003 17:16:33 -0000 1.3 --- instanceof.testsuite 5 Oct 2003 23:23:13 -0000 1.4 *************** *** 91,92 **** --- 91,107 ---- break; } + + /// FAIL bug + B b = new B(); + if (b instanceof A) + b = new A(); + + /// FAIL bug + Y y = new D(); + if (y instanceof X) + y = new C(); + /// Toplevel + interface X {} + interface Y {} + class C implements X {} + class D implements X,Y {} |
From: <ar...@us...> - 2003-10-05 19:49:01
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv13815/F:/nice/testsuite/compiler/classes Modified Files: fields.testsuite Log Message: Testcase for bug in accessing final static field of an interface. Index: fields.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/fields.testsuite,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** fields.testsuite 31 Jul 2003 18:45:35 -0000 1.11 --- fields.testsuite 5 Oct 2003 19:48:55 -0000 1.12 *************** *** 116,117 **** --- 116,123 ---- class A { final int x = 1; } int f(A a) = a.x++; + + /// PASS bug + // accessing a final static field of an interface implemented by ObjectInputStream + int x = ObjectInputStream.TC_NULL; + /// Toplevel + import java.io.*; |
From: <ar...@us...> - 2003-10-05 14:21:39
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14541/F:/nice/src/bossa/syntax Modified Files: NewArrayExp.java Log Message: Fix printing of NewArrayExp. Index: NewArrayExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/NewArrayExp.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NewArrayExp.java 7 Oct 2002 13:02:38 -0000 1.16 --- NewArrayExp.java 5 Oct 2003 14:21:33 -0000 1.17 *************** *** 173,177 **** { StringBuffer res = new StringBuffer ! ("new " + ident + Util.map("[", "]", "]", knownDimensions)); for(int i=0; i<unknownDimensions; i++) --- 173,177 ---- { StringBuffer res = new StringBuffer ! ("new " + ident + Util.map("[", "][", "]", knownDimensions)); for(int i=0; i<unknownDimensions; i++) |
From: <ar...@us...> - 2003-10-05 14:21:39
|
Update of /cvsroot/nice/Nice/testsuite/compiler/packages In directory sc8-pr-cvs1:/tmp/cvs-serv14541/F:/nice/testsuite/compiler/packages Modified Files: nicei.testsuite Log Message: Fix printing of NewArrayExp. Index: nicei.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/packages/nicei.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nicei.testsuite 24 Jul 2003 21:26:19 -0000 1.3 --- nicei.testsuite 5 Oct 2003 14:21:33 -0000 1.4 *************** *** 85,86 **** --- 85,93 ---- /// package b import a ; + + /// PASS + /// package a + /// toplevel + var int[][] arr = new int[10][10]; + /// package b import a + ; |
From: <bo...@us...> - 2003-10-03 13:57:19
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv20836/testsuite/compiler/methods Modified Files: primitive.testsuite Log Message: Test when the function is in the same package. Index: primitive.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/primitive.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** primitive.testsuite 15 Jul 2003 11:11:23 -0000 1.2 --- primitive.testsuite 3 Oct 2003 13:57:15 -0000 1.3 *************** *** 5,8 **** --- 5,13 ---- /// FAIL ///Toplevel + <T> void foo(!T) {} + foo(/*/// FAIL HERE */ i@int) {} + + /// FAIL + ///Toplevel <T> void foo(T t); foo(t) {} |
From: <bo...@us...> - 2003-10-03 13:50:54
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv19213/testsuite/compiler/methods Modified Files: super.testsuite Log Message: Super call from an implementation that comes before the super implementation, when another argument has an dispatch that can be optimized away. Index: super.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/super.testsuite,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** super.testsuite 31 Aug 2003 00:54:14 -0000 1.9 --- super.testsuite 3 Oct 2003 13:50:50 -0000 1.10 *************** *** 228,229 **** --- 228,240 ---- get(i) = cast(null); } + + /// PASS + /// Toplevel + abstract class A {} + class B extends A {} + + class M { + int f(A); + f(b@B) = super; + f(a) = 1; + } |
From: <ar...@us...> - 2003-10-01 21:49:07
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv23138/F:/nice/src/bossa/Parser Modified Files: Parser.jj Log Message: Changelog and cleanup multi line string literals. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.209 retrieving revision 1.210 diff -C2 -d -r1.209 -r1.210 *** Parser.jj 1 Oct 2003 18:11:39 -0000 1.209 --- Parser.jj 1 Oct 2003 21:49:03 -0000 1.210 *************** *** 28,32 **** import bossa.util.*; ! import bossa.syntax.*; import mlsub.typing.TypeSymbol; --- 28,32 ---- import bossa.util.*; ! import bossa.syntax.*; import mlsub.typing.TypeSymbol; |
From: <ar...@us...> - 2003-10-01 21:49:07
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv23138/F:/nice/debian Modified Files: changelog Log Message: Changelog and cleanup multi line string literals. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.211 retrieving revision 1.212 diff -C2 -d -r1.211 -r1.212 *** changelog 29 Sep 2003 17:03:08 -0000 1.211 --- changelog 1 Oct 2003 21:49:03 -0000 1.212 *************** *** 1,4 **** --- 1,6 ---- nice (0.9.3) unstable; urgency=low + * Added multi line string literals. String that start and end with """ + may take multiple lines and will include the linebreaks. * Existing interfaces can (like classes) implement abstract interfaces: interface packagename.SomeInterface implements AbstractInterface; |
From: <ar...@us...> - 2003-10-01 21:49:07
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv23138/F:/nice/src/bossa/syntax Modified Files: StringConstantExp.java Log Message: Changelog and cleanup multi line string literals. Index: StringConstantExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/StringConstantExp.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** StringConstantExp.java 1 Oct 2003 18:11:39 -0000 1.9 --- StringConstantExp.java 1 Oct 2003 21:49:03 -0000 1.10 *************** *** 32,36 **** className = stringName; this.escapedValue = value; - this.multiline = multiline; if (multiline) value = escapeEOL(value); --- 32,35 ---- *************** *** 123,126 **** String escapedValue; - boolean multiline; } --- 122,124 ---- |
From: <ar...@us...> - 2003-10-01 18:11:44
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv8204/F:/nice/testsuite/compiler/syntax Modified Files: expressions.testsuite Log Message: Implemented muli line string literals. Index: expressions.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/expressions.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** expressions.testsuite 28 May 2003 09:04:58 -0000 1.4 --- expressions.testsuite 1 Oct 2003 18:11:39 -0000 1.5 *************** *** 21,22 **** --- 21,27 ---- /// TOPLEVEL String->String->void f4(String x) = String y => String z => {}; + + /// PASS + assert """abc + def\nghi + xyz""".equals("abc\n def\nghi\n xyz"); |
From: <ar...@us...> - 2003-10-01 18:11:44
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv8204/F:/nice/src/bossa/syntax Modified Files: StringConstantExp.java Log Message: Implemented muli line string literals. Index: StringConstantExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/StringConstantExp.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** StringConstantExp.java 24 Jul 2003 17:52:09 -0000 1.8 --- StringConstantExp.java 1 Oct 2003 18:11:39 -0000 1.9 *************** *** 25,30 **** --- 25,39 ---- public StringConstantExp(String value) { + this(value, false); + } + + public StringConstantExp(String value, boolean multiline) + { className = stringName; this.escapedValue = value; + this.multiline = multiline; + if (multiline) + value = escapeEOL(value); + this.value=unescape(value); } *************** *** 88,91 **** --- 97,120 ---- } + static String escapeEOL(String s) + { + StringBuffer sb = new StringBuffer(); + int n = s.length(); + for (int i = 0; i < n; i++) { + char c = s.charAt(i); + if (c == '\n') + sb.append("\\n"); + else if (c == '\r') + { + sb.append("\\n"); + if (s.charAt(i+1) == '\n') + i++; + } + else + sb.append(c); + } + return sb.toString(); + } + public String toString() { *************** *** 94,96 **** --- 123,126 ---- String escapedValue; + boolean multiline; } |
From: <ar...@us...> - 2003-10-01 18:11:44
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv8204/F:/nice/src/bossa/Parser Modified Files: Parser.jj Log Message: Implemented muli line string literals. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.208 retrieving revision 1.209 diff -C2 -d -r1.208 -r1.209 *** Parser.jj 15 Sep 2003 22:29:21 -0000 1.208 --- Parser.jj 1 Oct 2003 18:11:39 -0000 1.209 *************** *** 28,32 **** import bossa.util.*; ! import bossa.syntax.*; import mlsub.typing.TypeSymbol; --- 28,32 ---- import bossa.util.*; ! import bossa.syntax.*; import mlsub.typing.TypeSymbol; *************** *** 268,271 **** --- 268,285 ---- TOKEN: /* String literals */ { + < MULTILINESTRING: + "\"" "\"" "\"" + ( (~["\"","\\"]) + | ("\\" + ( ["n","t","b","r","f","\\","'","\""] + | ["0"-"7"] ( ["0"-"7"] )? + | ["0"-"3"] ["0"-"7"] ["0"-"7"] + ) + ) + | ( ["\n","\r"] ) + )* + "\"" "\"" "\"" + > + | < LSTRING: "\"" *************** *** 1512,1515 **** --- 1526,1538 ---- } + StringConstantExp multiLineStringExp(): + { Token t; String s; } + { + t = <MULTILINESTRING> + { s = t.image.substring(3, t.image.length() - 3); + return new StringConstantExp(s, true); + } + } + IdentExp identExp(): { LocatedString i; } *************** *** 2079,2082 **** --- 2102,2106 ---- | res=charConstantExp() | res=stringConstantExp() + | res=multiLineStringExp() ) { return res; } |
From: <bo...@us...> - 2003-09-30 17:42:18
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv16785/testsuite/compiler/methods Modified Files: nativeOverride.testsuite Log Message: Check that a super call is rejected if the target is an abstract method. Index: nativeOverride.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/nativeOverride.testsuite,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nativeOverride.testsuite 30 Aug 2003 21:24:42 -0000 1.7 --- nativeOverride.testsuite 30 Sep 2003 17:42:14 -0000 1.8 *************** *** 212,213 **** --- 212,223 ---- get(i) = cast(null); } + + /// FAIL + /// Toplevel + abstract class A<T> extends AbstractList<T> { + size() = 10; + } + class B<T> extends A<T> { + get(index) = /*/// FAIL HERE*/ super; + get(0) = cast(null); + } |
From: <bo...@us...> - 2003-09-30 13:20:00
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1:/tmp/cvs-serv21237/src/gnu/bytecode Modified Files: ClassType.java Log Message: Do not generate a calls to an abstract method. Index: ClassType.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/ClassType.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** ClassType.java 28 Aug 2003 12:46:37 -0000 1.17 --- ClassType.java 30 Sep 2003 13:19:54 -0000 1.18 *************** *** 605,609 **** { Method method = cl.getDeclaredMethod(name, arg_types); ! if (method != null) return method; --- 605,609 ---- { Method method = cl.getDeclaredMethod(name, arg_types); ! if (method != null && (! (concrete && method.isAbstract()))) return method; |
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv11167/F:/nice/src/bossa/syntax Modified Files: Block.java BreakLabelStmt.java BreakStmt.java ContinueStmt.java LoopStmt.java ReturnStmt.java Log Message: Fix printing to .nicei of looping constructs. Index: Block.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Block.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Block.java 11 Sep 2003 15:44:20 -0000 1.62 --- Block.java 29 Sep 2003 23:22:44 -0000 1.63 *************** *** 411,415 **** return "{\n" + Util.map("",";\n",";\n",locals) ! + Util.map("",";\n",";\n",statements) + "}\n"; } --- 411,415 ---- return "{\n" + Util.map("",";\n",";\n",locals) ! + Util.map("","\n","\n",statements) + "}\n"; } Index: BreakLabelStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/BreakLabelStmt.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BreakLabelStmt.java 28 Jan 2002 20:28:39 -0000 1.1 --- BreakLabelStmt.java 29 Sep 2003 23:22:44 -0000 1.2 *************** *** 36,39 **** --- 36,41 ---- } + public String toString() { return "break " + label + ";"; } + LocatedString label; LabeledStmt statement; Index: BreakStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/BreakStmt.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** BreakStmt.java 28 May 2003 12:57:26 -0000 1.5 --- BreakStmt.java 29 Sep 2003 23:22:44 -0000 1.6 *************** *** 34,36 **** --- 34,38 ---- return new gnu.expr.ExitExp(LoopStmt.currentLoopBlock); } + + public String toString() { return "break;"; } } Index: ContinueStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ContinueStmt.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ContinueStmt.java 29 May 2003 14:17:17 -0000 1.3 --- ContinueStmt.java 29 Sep 2003 23:22:44 -0000 1.4 *************** *** 41,44 **** --- 41,48 ---- } + public String toString() + { + return "continue " + (label != null ? label.toString() : "") + ";"; } + LocatedString label; LoopStmt loop; Index: LoopStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/LoopStmt.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** LoopStmt.java 8 Aug 2003 21:47:57 -0000 1.17 --- LoopStmt.java 29 Sep 2003 23:22:44 -0000 1.18 *************** *** 165,171 **** public String toString() { ! return ! "for(;" + whileExp + "; " + iterationStatements+ ")\n" + ! (loopBody == null ? ";" : loopBody.toString()); } --- 165,187 ---- public String toString() { ! if (!testFirst) ! return "do {\n" + (loopBody == null ? " " : loopBody.toString()) + ! "}\n while (" + whileExp + ");"; ! ! if (iterationStatements == null) ! return "while (" + whileExp + ")" + ! (loopBody == null ? ";" : loopBody.toString()); ! ! Statement[] itStatements = ((Block)iterationStatements).statements; ! String itStats = ""; ! for(int i = 0; i<itStatements.length; i++) ! { ! String tmp = itStatements[i].toString(); ! itStats += tmp.substring(0, tmp.lastIndexOf(';')); ! if (i<itStatements.length-1) itStats += ", "; ! } ! ! return "for(; " + whileExp + " ;" + itStats + ")\n " + ! (loopBody == null ? "" : loopBody.toString()); } Index: ReturnStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ReturnStmt.java,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ReturnStmt.java 28 May 2003 12:57:26 -0000 1.29 --- ReturnStmt.java 29 Sep 2003 23:22:44 -0000 1.30 *************** *** 71,75 **** public String toString() { ! return "return" + (value!=null ? " " + value : ""); } --- 71,75 ---- public String toString() { ! return "return" + (value!=null ? " " + value : "") + ";"; } |
From: <ar...@us...> - 2003-09-29 23:22:48
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv11167/F:/nice/testsuite/compiler/classes Modified Files: initializer.testsuite Log Message: Fix printing to .nicei of looping constructs. Index: initializer.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/initializer.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** initializer.testsuite 29 Sep 2003 16:39:43 -0000 1.5 --- initializer.testsuite 29 Sep 2003 23:22:44 -0000 1.6 *************** *** 122,126 **** assert new A().initialised; ! /// PASS bug /// package a /// Toplevel --- 122,126 ---- assert new A().initialised; ! /// PASS /// package a /// Toplevel *************** *** 129,135 **** boolean[] x = [false, false]; ! { ! for(int i = 0; i<x.length; i++) x[i] = true; } } --- 129,142 ---- boolean[] x = [false, false]; ! { //test correct printing of looping constructs ! ! for(int i = 0, boolean q = false; i<x.length; i++, q=true) x[i] = true; + + while(true) {break;} + + int k = 0; + do k++; + while (k<5); } } |
From: <ar...@us...> - 2003-09-29 17:40:31
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv25836/F:/nice/testsuite/compiler/methods Modified Files: integer.testsuite Log Message: Testcase that was broken before the fix for bug #803972 Index: integer.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/integer.testsuite,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** integer.testsuite 3 Sep 2003 22:32:10 -0000 1.12 --- integer.testsuite 29 Sep 2003 17:40:17 -0000 1.13 *************** *** 213,214 **** --- 213,220 ---- g(m<0, n) = 1; g(m>=0, n) = 1; + + /// FAIL + /// Toplevel + void foo(int n); + foo(n<=1) {} + foo(n>=0) {} |
From: <bo...@us...> - 2003-09-29 17:03:21
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv17207/debian Modified Files: changelog Log Message: Clarify message. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.210 retrieving revision 1.211 diff -C2 -d -r1.210 -r1.211 *** changelog 15 Sep 2003 22:29:21 -0000 1.210 --- changelog 29 Sep 2003 17:03:08 -0000 1.211 *************** *** 1,5 **** nice (0.9.3) unstable; urgency=low ! * Existing interfaces can like classes implement abstract interfaces: interface packagename.SomeInterface implements AbstractInterface; --- 1,5 ---- nice (0.9.3) unstable; urgency=low ! * Existing interfaces can (like classes) implement abstract interfaces: interface packagename.SomeInterface implements AbstractInterface; |
From: <ar...@us...> - 2003-09-29 16:39:58
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes In directory sc8-pr-cvs1:/tmp/cvs-serv12903/F:/nice/testsuite/compiler/classes Modified Files: initializer.testsuite Log Message: Another bug case for initializers. Index: initializer.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/initializer.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** initializer.testsuite 11 Sep 2003 15:44:20 -0000 1.4 --- initializer.testsuite 29 Sep 2003 16:39:43 -0000 1.5 *************** *** 122,123 **** --- 122,137 ---- assert new A().initialised; + /// PASS bug + /// package a + /// Toplevel + class A + { + boolean[] x = [false, false]; + + { + for(int i = 0; i<x.length; i++) + x[i] = true; + } + } + /// package b import a + assert new A().x[0]; |
From: <ar...@us...> - 2003-09-28 17:16:46
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv18438/F:/nice/src/bossa/syntax Modified Files: tools.nice typecheck.nice Log Message: Type inference for instanceof in a while loop. Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** tools.nice 27 Aug 2003 09:33:45 -0000 1.23 --- tools.nice 28 Sep 2003 17:16:33 -0000 1.24 *************** *** 93,102 **** } ! ?(MonoSymbol, TypeConstructor) getInstanceof(IfExp ifExp) { ! if (! (ifExp.condition instanceof CallExp)) return null; ! CallExp condition = cast(ifExp.condition); if (! condition.isCallTo("instanceof") || condition.arguments.size() != 2) return null; --- 93,102 ---- } ! ?(MonoSymbol, mlsub.typing.Monotype) getInstanceof(Expression cond) { ! if (! (cond instanceof CallExp)) return null; ! CallExp condition = cast(cond); if (! condition.isCallTo("instanceof") || condition.arguments.size() != 2) return null; *************** *** 120,124 **** return null; ! return (sym, notNull(type.representedType)); } --- 120,138 ---- return null; ! ! TypeConstructor tc = notNull(type.representedType); ! mlsub.typing.Monotype[?] parameters; ! ! if (tc.arity() == 0) ! parameters = null; ! else if (sym.getMonotype() instanceof mlsub.typing.MonotypeConstructor) ! { ! mlsub.typing.MonotypeConstructor mc = cast(sym.getMonotype()); ! parameters = mc.getTP(); ! } ! else ! return null; ! ! return (sym, Monotype.sure(new mlsub.typing.MonotypeConstructor(tc, parameters))); } Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** typecheck.nice 17 Sep 2003 00:14:06 -0000 1.78 --- typecheck.nice 28 Sep 2003 17:16:33 -0000 1.79 *************** *** 392,415 **** }); ! ?(MonoSymbol, TypeConstructor) test = getInstanceof(e); if (test != null) { ! (MonoSymbol variable, TypeConstructor tc) = test; ! mlsub.typing.Monotype[?] parameters = null; ! if (tc.arity() == 0) ! parameters = null; ! else if (variable.getMonotype() instanceof mlsub.typing.MonotypeConstructor) ! { ! mlsub.typing.MonotypeConstructor mc = cast(variable.getMonotype()); ! parameters = mc.getTP(); ! } ! else ! test = null; ! ! if (test != null) ! { ! mlsub.typing.Monotype type = Monotype.sure(new mlsub.typing.MonotypeConstructor(tc, parameters)); ! setVarType(variable, now: type, otherBranch: variable.type); ! } } --- 392,400 ---- }); ! ?(MonoSymbol, mlsub.typing.Monotype) test = getInstanceof(notNull(e.condition)); if (test != null) { ! (MonoSymbol variable, mlsub.typing.Monotype type) = test; ! setVarType(variable, now: type, otherBranch: variable.type); } *************** *** 657,660 **** --- 642,652 ---- now: makeSure(variable.type), out: variable.type)); + + ?(MonoSymbol, mlsub.typing.Monotype) test = getInstanceof(notNull(whileExp)); + if (test != null) + { + (MonoSymbol variable, mlsub.typing.Monotype type) = test; + setVarType(variable, now: type, otherBranch: variable.type); + } } |
From: <ar...@us...> - 2003-09-28 17:16:46
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv18438/F:/nice/testsuite/compiler/typing Modified Files: instanceof.testsuite Log Message: Type inference for instanceof in a while loop. Index: instanceof.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/instanceof.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** instanceof.testsuite 28 Aug 2003 08:46:32 -0000 1.2 --- instanceof.testsuite 28 Sep 2003 17:16:33 -0000 1.3 *************** *** 56,57 **** --- 56,92 ---- i = a.life; } + + /// PASS + A a; + a = new B(); + var test = false; + while (a instanceof B) + { + assert a.life == 42; + test = true; + break; + } + assert test; + + /// PASS + A a = new B(); + while (a instanceof B) + { + int i = a.life; + if (i == 42) + a = new A(); + else + i = a.life + 1; + break; + } + + /// FAIL + A a = new B(); + while (a instanceof B) + { + int i = a.life; + if (i == 42) + a = new A(); + i = a.life; + break; + } |
From: <ar...@us...> - 2003-09-27 21:07:35
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv25485/F:/nice/stdlib/nice/lang Modified Files: java.nice Log Message: Removed duplicate retypings. Index: java.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/java.nice,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** java.nice 12 Sep 2003 22:27:13 -0000 1.38 --- java.nice 27 Sep 2003 21:07:21 -0000 1.39 *************** *** 162,166 **** <T> T pop(Stack<T>) = native Object Stack.pop(); <T> T push(Stack<T>, T) = native Object Stack.push(Object); - <T,U | T <: U> int search(Stack<T>, U) = native int Stack.search(Object); <T> void addElement(Vector<T>, T) = native void Vector.addElement(Object); <T> int capacity(Vector<T>) = native int Vector.capacity(); --- 162,165 ---- *************** *** 169,173 **** <T> T firstElement(Vector<T>) = native Object Vector.firstElement(); <T> T lastElement(Vector<T>) = native Object Vector.lastElement(); - <T> boolean removeElement(Vector<T>, T) = native boolean Vector.removeElement(Object); <T> void removeElementAt(Vector<T>, int) = native void Vector.removeElementAt(int); <T> void setElementAt(Vector<T>, T, int) = native void Vector.setElementAt(Object, int); --- 168,171 ---- |