nice-commit Mailing List for The Nice Programming Language (Page 126)
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-02-20 01:27:59
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods
In directory sc8-pr-cvs1:/tmp/cvs-serv14046/F:/nice/testsuite/compiler/methods
Modified Files:
implementations.testsuite
Log Message:
Give an error when #interface patterns are used they make no sense and don't work
Index: implementations.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/implementations.testsuite,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** implementations.testsuite 16 Jan 2003 01:52:25 -0000 1.6
--- implementations.testsuite 20 Feb 2003 01:27:53 -0000 1.7
***************
*** 67,68 ****
--- 67,75 ----
(notNull (g)).drawString("I love java", 20, 20);
}
+
+ /// FAIL
+ /// Toplevel
+ interface I{}
+
+ void foo(I);
+ foo(#I){}
|
|
From: <bo...@us...> - 2003-02-20 00:21:48
|
Update of /cvsroot/nice/Nice/src/nice/tools/code
In directory sc8-pr-cvs1:/tmp/cvs-serv18340/src/nice/tools/code
Modified Files:
MultiArrayNewProc.java
Log Message:
Give better bytecode types to nested arrays.
Index: MultiArrayNewProc.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/nice/tools/code/MultiArrayNewProc.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** MultiArrayNewProc.java 15 Jan 2003 10:16:41 -0000 1.4
--- MultiArrayNewProc.java 20 Feb 2003 00:21:44 -0000 1.5
***************
*** 83,90 ****
private static boolean hasPrimitiveComponents(ArrayType array)
{
! while (array.getComponentType() instanceof ArrayType)
! array = (ArrayType) array.getComponentType();
! return array.getComponentType() instanceof PrimType;
}
--- 83,90 ----
private static boolean hasPrimitiveComponents(ArrayType array)
{
! Type componentType = array.getComponentType();
! return componentType instanceof ArrayType
! || componentType instanceof PrimType;
}
|
|
From: <bo...@us...> - 2003-02-20 00:21:47
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays
In directory sc8-pr-cvs1:/tmp/cvs-serv18340/testsuite/compiler/expressions/arrays
Modified Files:
literal.testsuite
Log Message:
Give better bytecode types to nested arrays.
Index: literal.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays/literal.testsuite,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** literal.testsuite 18 Feb 2003 17:57:55 -0000 1.7
--- literal.testsuite 20 Feb 2003 00:21:44 -0000 1.8
***************
*** 33,34 ****
--- 33,38 ----
String[] a() = [name];
}
+
+ /// PASS
+ /// Toplevel
+ var String[][][] s = [[["A"]]];
|
|
From: <ar...@us...> - 2003-02-20 00:02:23
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv8961/F:/nice/testsuite/compiler/syntax
Modified Files:
anonymousFunctions.testsuite expressions.testsuite
Log Message:
Testcases for previous commits
Index: anonymousFunctions.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/anonymousFunctions.testsuite,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** anonymousFunctions.testsuite 17 Feb 2003 14:08:36 -0000 1.4
--- anonymousFunctions.testsuite 20 Feb 2003 00:02:19 -0000 1.5
***************
*** 25,26 ****
--- 25,29 ----
/// PASS
void->int f = () => 1;
+
+ /// PASS
+ String s = (<Any T>(T x)=>x)("ABC");
Index: expressions.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/expressions.testsuite,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** expressions.testsuite 11 Jun 2002 12:30:17 -0000 1.1
--- expressions.testsuite 20 Feb 2003 00:02:19 -0000 1.2
***************
*** 22,23 ****
--- 22,28 ----
String->String->void f4(String x) = fun(String y)=> fun(String z)=> {};
+ /// FAIL
+ final int i;
+
+ /// PASS
+ final int i = 0;
|
|
From: <ar...@us...> - 2003-02-19 21:56:38
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv17572/F:/nice/src/bossa/syntax
Modified Files:
Block.java
Log Message:
bug: A final local variable that is uninitialized causes a CCE in the compiler.
fix: Give error message when the final variable is not initialized.
Index: Block.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Block.java,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** Block.java 20 Jan 2003 19:21:00 -0000 1.51
--- Block.java 19 Feb 2003 21:56:30 -0000 1.52
***************
*** 118,124 ****
this.value = value;
if (constant)
! this.left = new MonoSymbol(name,type) {
! boolean isAssignable() { return false; }
! };
else
this.left = new LocalVariable.Symbol(name,type);
--- 118,127 ----
this.value = value;
if (constant)
! if (value == null)
! throw User.error(name, "A final variable cannot be uninitialized.");
! else
! this.left = new MonoSymbol(name,type) {
! boolean isAssignable() { return false; }
! };
else
this.left = new LocalVariable.Symbol(name,type);
|
|
From: <ar...@us...> - 2003-02-19 21:16:35
|
Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1:/tmp/cvs-serv27922/F:/nice/src/bossa/parser
Modified Files:
Parser.jj
Log Message:
make 'fun' optional in combination with constraint so <Any T>(T x)=>x is a valid alternative for fun<Any T>(T x)=>x .
Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.138
retrieving revision 1.139
diff -C2 -d -r1.138 -r1.139
*** Parser.jj 19 Feb 2003 09:59:50 -0000 1.138
--- Parser.jj 19 Feb 2003 21:16:30 -0000 1.139
***************
*** 1544,1568 ****
List formals;
Constraint cst;
- Statement body;
- Expression exp;
Token f = null;
}
{
! f = "fun"
cst=constraint()
"(" formals=monoSymbols() ")"
! "=>"
! (
! body=Block()
! |
! exp=Expression()
! {
! body=new ReturnStmt(exp);
! }
! )
{
if (f != null)
bossa.util.User.warning(new Location(f), "The 'fun(...) =>' syntax is deprecated, just leave 'fun' away.");
! return new FunExp(cst,formals,body);
}
}
--- 1544,1559 ----
List formals;
Constraint cst;
Token f = null;
+ FunExp res;
}
{
! [f = "fun"]
cst=constraint()
"(" formals=monoSymbols() ")"
! res=endFunExp(formals, cst)
{
if (f != null)
bossa.util.User.warning(new Location(f), "The 'fun(...) =>' syntax is deprecated, just leave 'fun' away.");
! return res;
}
}
***************
*** 1577,1596 ****
sym=monoSymbol()
{ formals = new LinkedList(); formals.add(sym); }
! res=endFunExp(formals)
! { return res; }
! }
!
! FunExp multipleVarsFunExp():
! {
! List formals;
! FunExp res;
! }
! {
! "(" formals=monoSymbols() ")"
! res=endFunExp(formals)
{ return res; }
}
! FunExp endFunExp(List formals):
{
Statement body;
--- 1568,1576 ----
sym=monoSymbol()
{ formals = new LinkedList(); formals.add(sym); }
! res=endFunExp(formals, Constraint.True)
{ return res; }
}
! FunExp endFunExp(List formals, Constraint cst):
{
Statement body;
***************
*** 1610,1614 ****
}
)
! { return new FunExp(Constraint.True,formals,body); }
}
--- 1590,1594 ----
}
)
! { return new FunExp(cst,formals,body); }
}
***************
*** 1765,1771 ****
(
! e1=funExp()
| LOOKAHEAD(monoSymbol() "=>") e1=simpleVarFunExp()
- | LOOKAHEAD("(" monoSymbols() ")" "=>") e1=multipleVarsFunExp()
| e1=ClassicExpression()
)
--- 1745,1750 ----
(
! LOOKAHEAD(funExp()) e1=funExp()
| LOOKAHEAD(monoSymbol() "=>") e1=simpleVarFunExp()
| e1=ClassicExpression()
)
|
|
From: <bo...@us...> - 2003-02-19 18:33:59
|
Update of /cvsroot/nice/Nice/testsuite/compiler/classes
In directory sc8-pr-cvs1:/tmp/cvs-serv10092/testsuite/compiler/classes
Modified Files:
extends.testsuite
Log Message:
When an error occurs during resolution of a class (like extending an
unknown clas), the status flag preventing cycles must still be reset.
Otherwise, spurious cycles are reported.
Index: extends.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/classes/extends.testsuite,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** extends.testsuite 10 Sep 2002 16:18:08 -0000 1.4
--- extends.testsuite 19 Feb 2003 18:33:53 -0000 1.5
***************
*** 38,39 ****
--- 38,44 ----
class A extends B {}
class B extends A {}
+
+ /// FAIL
+ /// Toplevel
+ class A extends /* /// FAIL HERE */ Undeclared {}
+ class B extends A {}
|
|
From: <bo...@us...> - 2003-02-19 18:33:59
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv10092/src/bossa/syntax
Modified Files:
ClassDefinition.java
Log Message:
When an error occurs during resolution of a class (like extending an
unknown clas), the status flag preventing cycles must still be reset.
Otherwise, spurious cycles are reported.
Index: ClassDefinition.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ClassDefinition.java,v
retrieving revision 1.86
retrieving revision 1.87
diff -C2 -d -r1.86 -r1.87
*** ClassDefinition.java 12 Feb 2003 12:48:34 -0000 1.86
--- ClassDefinition.java 19 Feb 2003 18:33:54 -0000 1.87
***************
*** 494,501 ****
status = RESOLVING;
! super.resolve();
! resolveClass();
!
! status = RESOLVED;
}
--- 494,506 ----
status = RESOLVING;
! try
! {
! super.resolve();
! resolveClass();
! }
! finally
! {
! status = RESOLVED;
! }
}
|
|
From: <bo...@us...> - 2003-02-19 18:30:46
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1:/tmp/cvs-serv8785/src/nice/tools/testsuite Modified Files: TestSuiteException.java TestSuiteClassLoader.java TestSuite.java TestNice.java TestCase.java PassTestCase.java NiceSourceFile.java GlobalSourceFile.java FailTestCase.java CompilerBugException.java Log Message: Typos. Set tab-width to 2 for Emacs, to get a more reasonable indenting. Index: TestSuiteException.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestSuiteException.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestSuiteException.java 7 Sep 2002 21:04:53 -0000 1.4 --- TestSuiteException.java 19 Feb 2003 18:30:18 -0000 1.5 *************** *** 48,53 **** } ! ! ! ! --- 48,52 ---- } ! // Local Variables: ! // tab-width: 2 ! // End: Index: TestSuiteClassLoader.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestSuiteClassLoader.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TestSuiteClassLoader.java 7 Sep 2002 21:04:53 -0000 1.4 --- TestSuiteClassLoader.java 19 Feb 2003 18:30:19 -0000 1.5 *************** *** 63,64 **** --- 63,67 ---- } + // Local Variables: + // tab-width: 2 + // End: Index: TestSuite.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestSuite.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** TestSuite.java 7 Sep 2002 21:04:53 -0000 1.12 --- TestSuite.java 19 Feb 2003 18:30:20 -0000 1.13 *************** *** 20,24 **** /** ! * Class represents a testsuite file with its testcases. * * @author Alex Greif <a href="mailto:ale...@we...">ale...@we...</a> --- 20,24 ---- /** ! * A testsuite file with its testcases. * * @author Alex Greif <a href="mailto:ale...@we...">ale...@we...</a> *************** *** 224,226 **** } ! --- 224,228 ---- } ! // Local Variables: ! // tab-width: 2 ! // End: Index: TestNice.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestNice.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TestNice.java 7 Sep 2002 21:04:53 -0000 1.19 --- TestNice.java 19 Feb 2003 18:30:25 -0000 1.20 *************** *** 440,460 **** } - - - - - - - - - - - - - - - - } ! --- 440,446 ---- } } ! // Local Variables: ! // tab-width: 2 ! // End: Index: TestCase.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestCase.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** TestCase.java 16 Oct 2002 11:43:45 -0000 1.16 --- TestCase.java 19 Feb 2003 18:30:25 -0000 1.17 *************** *** 498,501 **** } ! ! --- 498,502 ---- } ! // Local Variables: ! // tab-width: 2 ! // End: Index: PassTestCase.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/PassTestCase.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PassTestCase.java 7 Sep 2002 21:04:53 -0000 1.8 --- PassTestCase.java 19 Feb 2003 18:30:27 -0000 1.9 *************** *** 58,59 **** --- 58,62 ---- } + // Local Variables: + // tab-width: 2 + // End: Index: NiceSourceFile.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/NiceSourceFile.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** NiceSourceFile.java 18 Sep 2002 19:36:59 -0000 1.14 --- NiceSourceFile.java 19 Feb 2003 18:30:28 -0000 1.15 *************** *** 368,370 **** } ! --- 368,372 ---- } ! // Local Variables: ! // tab-width: 2 ! // End: Index: GlobalSourceFile.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/GlobalSourceFile.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** GlobalSourceFile.java 7 Sep 2002 21:04:53 -0000 1.6 --- GlobalSourceFile.java 19 Feb 2003 18:30:28 -0000 1.7 *************** *** 50,51 **** --- 50,55 ---- } + + // Local Variables: + // tab-width: 2 + // End: Index: FailTestCase.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/FailTestCase.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** FailTestCase.java 7 Sep 2002 21:04:53 -0000 1.11 --- FailTestCase.java 19 Feb 2003 18:30:29 -0000 1.12 *************** *** 16,20 **** /** ! * TestCase class fot the case that the test should fail * * @author Alex Greif <a href="mailto:ale...@we...">ale...@we...</a> --- 16,20 ---- /** ! * TestCase class for test cases that should fail. * * @author Alex Greif <a href="mailto:ale...@we...">ale...@we...</a> *************** *** 62,67 **** /** * Parses the compiler messages for line, column, filename and compares them with the ! * Expected failure positions that the user defined. If the user definied more expected ! * failure positions than the compiler recognized than a warning is shown. * A warning is also shown when the user expected a failure at another position than the * compiler recognized. --- 62,67 ---- /** * Parses the compiler messages for line, column, filename and compares them with the ! * expected failure positions that the user defined. If the user defined more expected ! * failure positions than the compiler recognized then a warning is shown. * A warning is also shown when the user expected a failure at another position than the * compiler recognized. *************** *** 127,128 **** --- 127,131 ---- } + // Local Variables: + // tab-width: 2 + // End: Index: CompilerBugException.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/CompilerBugException.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** CompilerBugException.java 7 Sep 2002 21:04:53 -0000 1.3 --- CompilerBugException.java 19 Feb 2003 18:30:30 -0000 1.4 *************** *** 17,21 **** /** ! * This exception is thrown when a bug occures in the compiler.. * * @author Alex Greif <a href="mailto:ale...@we...">ale...@we...</a> --- 17,21 ---- /** ! * This exception is thrown when a bug occurs in the compiler. * * @author Alex Greif <a href="mailto:ale...@we...">ale...@we...</a> *************** *** 30,35 **** } ! ! ! ! --- 30,34 ---- } ! // Local Variables: ! // tab-width: 2 ! // End: |
|
From: <bo...@us...> - 2003-02-19 14:19:44
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline
In directory sc8-pr-cvs1:/tmp/cvs-serv18871/stdlib/nice/lang/inline
Modified Files:
OptionOr.java
Log Message:
Takes into account the context for bytecode generation of || on option types.
(partly fixes #686142).
Index: OptionOr.java
===================================================================
RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/OptionOr.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** OptionOr.java 7 Oct 2002 10:57:33 -0000 1.1
--- OptionOr.java 19 Feb 2003 14:19:40 -0000 1.2
***************
*** 37,50 ****
Expression[] args = exp.getArgs();
CodeAttr code = comp.getCode();
- Target stack = Target.pushObject;
! args[0].compile(comp, stack);
code.emitDup();
code.emitIfNull();
code.emitPop(1);
! args[1].compile(comp, stack);
code.emitElse();
code.emitFi();
- target.compileFromStack(comp, Type.pointer_type);
}
--- 37,48 ----
Expression[] args = exp.getArgs();
CodeAttr code = comp.getCode();
! args[0].compile(comp, target);
code.emitDup();
code.emitIfNull();
code.emitPop(1);
! args[1].compile(comp, target);
code.emitElse();
code.emitFi();
}
|
|
From: <bo...@us...> - 2003-02-19 14:19:44
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/operators
In directory sc8-pr-cvs1:/tmp/cvs-serv18871/testsuite/compiler/expressions/operators
Modified Files:
null.testsuite
Log Message:
Takes into account the context for bytecode generation of || on option types.
(partly fixes #686142).
Index: null.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/operators/null.testsuite,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** null.testsuite 7 Oct 2002 10:57:11 -0000 1.1
--- null.testsuite 19 Feb 2003 14:19:40 -0000 1.2
***************
*** 24,25 ****
--- 24,32 ----
} catch (Error e) {}
assert(ok);
+
+ /// PASS
+ /// Toplevel
+ (int,int) foo() {
+ Map<String,(int,int)> map = new HashMap();
+ return map.get("") || (1,1);
+ }
|
|
From: <bo...@us...> - 2003-02-19 14:16:19
|
Update of /cvsroot/nice/Nice/src/gnu/expr
In directory sc8-pr-cvs1:/tmp/cvs-serv17402/src/gnu/expr
Modified Files:
ClassExp.java
Log Message:
Check global variable initialization value for captured variables
(partly fixes #686142).
Index: ClassExp.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/gnu/expr/ClassExp.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ClassExp.java 11 Oct 2002 12:09:41 -0000 1.10
--- ClassExp.java 19 Feb 2003 14:16:13 -0000 1.11
***************
*** 553,556 ****
--- 553,564 ----
child = child.nextSibling)
walker.walkLambdaExp(child);
+
+ // Walk static fields. This is particularly important for
+ // those initialized to some value, since that value might
+ // include closures that need to be walked.
+ for (Declaration decl = firstDecl(); decl != null;
+ decl = decl.nextDecl())
+ if (decl.isStatic() && decl.value != null)
+ walker.walkExpression(decl.value);
}
finally
|
|
From: <bo...@us...> - 2003-02-19 14:16:19
|
Update of /cvsroot/nice/Nice/testsuite/compiler
In directory sc8-pr-cvs1:/tmp/cvs-serv17402/testsuite/compiler
Modified Files:
globalVariables.testsuite
Log Message:
Check global variable initialization value for captured variables
(partly fixes #686142).
Index: globalVariables.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/globalVariables.testsuite,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** globalVariables.testsuite 10 Feb 2003 10:53:04 -0000 1.6
--- globalVariables.testsuite 19 Feb 2003 14:16:11 -0000 1.7
***************
*** 42,45 ****
--- 42,58 ----
/// PASS
+ /// Toplevel
+ // Checks proper closures inside initialization expressions.
+ var Map<String,String> classMap = (()=> {
+ Map<String,String> classMap' = new HashMap();
+ [("int", "java.lang.Integer")].foreach((String,String) pair => {
+ (String key, String value) = pair;
+ classMap'.put(key, value);
+ });
+ return classMap';
+ })();
+
+
+ /// PASS
/* Modifying a global var. */
x = 1;
|
|
From: <ar...@us...> - 2003-02-19 09:59:55
|
Update of /cvsroot/nice/Nice/src/bossa/parser
In directory sc8-pr-cvs1:/tmp/cvs-serv11845/F:/nice/src/bossa/parser
Modified Files:
Parser.jj
Log Message:
give warning if the deprecated fun(...)=> syntax is used.
Index: Parser.jj
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v
retrieving revision 1.137
retrieving revision 1.138
diff -C2 -d -r1.137 -r1.138
*** Parser.jj 17 Feb 2003 15:42:03 -0000 1.137
--- Parser.jj 19 Feb 2003 09:59:50 -0000 1.138
***************
*** 1546,1552 ****
Statement body;
Expression exp;
}
{
! "fun"
cst=constraint()
"(" formals=monoSymbols() ")"
--- 1546,1553 ----
Statement body;
Expression exp;
+ Token f = null;
}
{
! f = "fun"
cst=constraint()
"(" formals=monoSymbols() ")"
***************
*** 1560,1564 ****
}
)
! { return new FunExp(cst,formals,body); }
}
--- 1561,1569 ----
}
)
! {
! if (f != null)
! bossa.util.User.warning(new Location(f), "The 'fun(...) =>' syntax is deprecated, just leave 'fun' away.");
! return new FunExp(cst,formals,body);
! }
}
|
|
From: <ar...@us...> - 2003-02-18 23:39:48
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv5769/F:/nice/src/bossa/syntax
Modified Files:
analyse.nice typecheck.nice
Log Message:
replace iter with foreach and removed the last 'fun' of fun(...)=> in the compiler source
Index: analyse.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** analyse.nice 24 Jan 2003 19:09:24 -0000 1.55
--- analyse.nice 18 Feb 2003 23:39:43 -0000 1.56
***************
*** 179,186 ****
void addVars(Array<?MonoSymbol> symbols) =
! symbols.iter(?MonoSymbol s => this.addVar(notNull(s)));
void addTypeVars(Array<TypeSymbol> symbols) =
! symbols.iter(TypeSymbol s => this.typeVars[s.toString()] = s);
}
--- 179,186 ----
void addVars(Array<?MonoSymbol> symbols) =
! symbols.foreach(?MonoSymbol s => this.addVar(notNull(s)));
void addTypeVars(Array<TypeSymbol> symbols) =
! symbols.foreach(TypeSymbol s => this.typeVars[s.toString()] = s);
}
***************
*** 555,559 ****
{
info.begin();
! notNull(b.locals).iter(Block.LocalDeclaration l => analyse(l, info));
analyse(b.statements, info);
info.end();
--- 555,559 ----
{
info.begin();
! notNull(b.locals).foreach(Block.LocalDeclaration l => analyse(l, info));
analyse(b.statements, info);
info.end();
***************
*** 623,627 ****
private LabeledStmt findLabel(LocatedString label, Info info)
{
! return info.labels.findLast(fun(LabeledStmt l)=> l.name.equals(label.toString()));
}
--- 623,627 ----
private LabeledStmt findLabel(LocatedString label, Info info)
{
! return info.labels.findLast(LabeledStmt l => l.name.equals(label.toString()));
}
***************
*** 679,683 ****
analyse(t.body, info);
! t.catches.iter(TryStmt.Catch c =>{
info.otherCase();
info.begin();
--- 679,683 ----
analyse(t.body, info);
! t.catches.foreach(TryStmt.Catch c =>{
info.otherCase();
info.begin();
Index: typecheck.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -d -r1.49 -r1.50
*** typecheck.nice 8 Feb 2003 16:07:57 -0000 1.49
--- typecheck.nice 18 Feb 2003 23:39:44 -0000 1.50
***************
*** 301,305 ****
if (notNullInElse != null)
! notNullInElse.iter(MonoSymbol variable => {
mlsub.typing.Monotype type = notNull(variable.type);
mlsub.typing.Monotype sureType = makeSure(type);
--- 301,305 ----
if (notNullInElse != null)
! notNullInElse.foreach(MonoSymbol variable => {
mlsub.typing.Monotype type = notNull(variable.type);
mlsub.typing.Monotype sureType = makeSure(type);
***************
*** 428,432 ****
b.statements = rewrite(b.statements);
! b.locals.iter(?Block.LocalDeclaration d => typecheck(d));
b.statements.foreach
(?Statement s => {
--- 428,432 ----
b.statements = rewrite(b.statements);
! b.locals.foreach(?Block.LocalDeclaration d => typecheck(d));
b.statements.foreach
(?Statement s => {
***************
*** 552,556 ****
{
typecheck(t.body);
! t.catches.iter(TryStmt.Catch c => typecheck(c.body));
typecheck(t.finallyBody);
}
--- 552,556 ----
{
typecheck(t.body);
! t.catches.foreach(TryStmt.Catch c => typecheck(c.body));
typecheck(t.finallyBody);
}
|
|
From: <ar...@us...> - 2003-02-18 23:33:12
|
Update of /cvsroot/nice/Nice/src/mlsub/compilation
In directory sc8-pr-cvs1:/tmp/cvs-serv1316/F:/nice/src/mlsub/compilation
Modified Files:
make.nice
Log Message:
replace iter with foreach (and this is a commit test)
Index: make.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/mlsub/compilation/make.nice,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** make.nice 9 Sep 2002 12:59:26 -0000 1.18
--- make.nice 18 Feb 2003 23:33:09 -0000 1.19
***************
*** 25,41 ****
{
print("Compiling");
! modules.iter(Module m => print(" "+m));
println("");
! modules.iter(Module m => m.scope());
! modules.iter(Module m => m.load());
notNull(compilation.root).freezeGlobalContext();
try {
! modules.iter(Module m => m.compile());
if (doLink)
! modules.iter(Module m => m.link());
}
finally {
--- 25,41 ----
{
print("Compiling");
! modules.foreach(Module m => print(" "+m));
println("");
! modules.foreach(Module m => m.scope());
! modules.foreach(Module m => m.load());
notNull(compilation.root).freezeGlobalContext();
try {
! modules.foreach(Module m => m.compile());
if (doLink)
! modules.foreach(Module m => m.link());
}
finally {
***************
*** 50,54 ****
(notNull(compilation.root), Module m => m.getRequirements());
try{
! sccs.iter(List<Module> scc =>
{ compileComponent(compilation, scc,
!compilation.skipLink); });
--- 50,54 ----
(notNull(compilation.root), Module m => m.getRequirements());
try{
! sccs.foreach(List<Module> scc =>
{ compileComponent(compilation, scc,
!compilation.skipLink); });
|
|
From: <bo...@us...> - 2003-02-18 17:58:10
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv32117/src/bossa/syntax
Modified Files:
Expression.java
Log Message:
Check that values inside literal arrays are not ambiguous (fixes #670084).
Index: Expression.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Expression.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** Expression.java 20 Jan 2003 19:21:00 -0000 1.43
--- Expression.java 18 Feb 2003 17:57:56 -0000 1.44
***************
*** 169,174 ****
Polytype[] res = new Polytype[expressions.length];
! for(int i = 0; i< expressions.length; i++)
! res[i] = expressions[i].getType();
return res;
--- 169,177 ----
Polytype[] res = new Polytype[expressions.length];
! for (int i = 0; i< expressions.length; i++)
! {
! expressions[i] = expressions[i].noOverloading();
! res[i] = expressions[i].getType();
! }
return res;
|
|
From: <bo...@us...> - 2003-02-18 17:58:10
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays
In directory sc8-pr-cvs1:/tmp/cvs-serv32117/testsuite/compiler/expressions/arrays
Modified Files:
literal.testsuite
Log Message:
Check that values inside literal arrays are not ambiguous (fixes #670084).
Index: literal.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/arrays/literal.testsuite,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** literal.testsuite 15 Jan 2003 10:16:36 -0000 1.6
--- literal.testsuite 18 Feb 2003 17:57:55 -0000 1.7
***************
*** 25,26 ****
--- 25,34 ----
/// PASS
int[][] array2 = [[11,12],[21,22]];
+
+ /// PASS
+ // Use an implicit this inside a literal expression.
+ /// Toplevel
+ class A {
+ String name;
+ String[] a() = [name];
+ }
|
|
From: <bo...@us...> - 2003-02-18 14:21:25
|
Update of /cvsroot/nice/Nice/src/bossa/link
In directory sc8-pr-cvs1:/tmp/cvs-serv7825/src/bossa/link
Modified Files:
Dispatch.java
Log Message:
Dispatch on boolean values: @true and @false (by Arjan).
Index: Dispatch.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/link/Dispatch.java,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** Dispatch.java 10 Dec 2002 18:46:33 -0000 1.48
--- Dispatch.java 18 Feb 2003 14:21:20 -0000 1.49
***************
*** 186,194 ****
if(sortedAlternatives.size()==0)
User.error
! (method, "Method " + method + " is declared but never defined:\n" +
"no alternative matches " + toString(tags));
else
User.warning(method,
! "Method " + method + " is not exhaustive:\n" +
"no alternative matches " +
toString(tags));
--- 186,194 ----
if(sortedAlternatives.size()==0)
User.error
! (method, "Method " + method + " is declared but never implemented:\n" +
"no alternative matches " + toString(tags));
else
User.warning(method,
! "Method " + method + " is not completely covered:\n" +
"no alternative matches " +
toString(tags));
***************
*** 259,263 ****
List res = mlsub.typing.Enumeration.enumerate(cst, types, used);
! return mergeNullCases(res, domains.length);
}
--- 259,264 ----
List res = mlsub.typing.Enumeration.enumerate(cst, types, used);
! res = mergeNullCases(res, domains.length);
! return enumerateBooleans(res, domains.length);
}
***************
*** 305,308 ****
--- 306,339 ----
return res;
+ }
+
+ /** Expand the 'boolean' case into 'true' and 'false'.
+ */
+ private static List enumerateBooleans(List tags, int length)
+ {
+ if (tags.size() < 1) return tags;
+
+ List res;
+ for (int pos = 0; pos < length; pos++)
+ {
+ res = new ArrayList();
+ for (Iterator i = tags.iterator(); i.hasNext(); )
+ {
+ TypeConstructor[] tc = (TypeConstructor[]) i.next();
+ if (tc[pos] == PrimitiveType.boolTC)
+ {
+ // Create two copies of this case, one for true and one for false.
+ TypeConstructor[] tc2 = new TypeConstructor[tc.length];
+ System.arraycopy(tc, 0, tc2, 0, tc.length);
+ tc[pos] = PrimitiveType.trueBoolTC;
+ res.add(tc);
+ tc2[pos] = PrimitiveType.falseBoolTC;
+ res.add(tc2);
+ }
+ else res.add(tc);
+ }
+ tags = res;
+ }
+ return tags;
}
}
|
|
From: <bo...@us...> - 2003-02-18 14:21:25
|
Update of /cvsroot/nice/Nice/debian
In directory sc8-pr-cvs1:/tmp/cvs-serv7825/debian
Modified Files:
changelog
Log Message:
Dispatch on boolean values: @true and @false (by Arjan).
Index: changelog
===================================================================
RCS file: /cvsroot/nice/Nice/debian/changelog,v
retrieving revision 1.130
retrieving revision 1.131
diff -C2 -d -r1.130 -r1.131
*** changelog 17 Feb 2003 14:09:58 -0000 1.130
--- changelog 18 Feb 2003 14:21:21 -0000 1.131
***************
*** 1,4 ****
--- 1,9 ----
nice (0.7.7) unstable; urgency=low
+ * Methods taking a boolean parameter can now dispatch on the cases
+ 'true' and 'false':
+ boolean not(boolean);
+ not(@true) = false;
+ not(@false) = true;
* New policy for typing calls to Java methods. By default, the typing
is more convenient, considering arguments as possibly null, and
|
|
From: <bo...@us...> - 2003-02-18 14:21:24
|
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv7825/src/bossa/syntax
Modified Files:
PrimitiveType.java Pattern.java
Log Message:
Dispatch on boolean values: @true and @false (by Arjan).
Index: PrimitiveType.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/PrimitiveType.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** PrimitiveType.java 7 Oct 2002 13:58:25 -0000 1.3
--- PrimitiveType.java 18 Feb 2003 14:21:20 -0000 1.4
***************
*** 94,97 ****
--- 94,99 ----
{
boolTC = tc;
+ trueBoolTC = new TypeConstructor("true");
+ falseBoolTC = new TypeConstructor("false");
boolType = Monotype.sure(new MonotypeConstructor(tc, null));
boolPolytype = new mlsub.typing.Polytype(boolType);
***************
*** 161,164 ****
--- 163,169 ----
public static TypeConstructor byteTC, charTC, intTC, longTC, boolTC, shortTC, doubleTC, floatTC, arrayTC;
+ //these two only for dispatch testing booleans
+ public static TypeConstructor trueBoolTC, falseBoolTC;
+
public static mlsub.typing.Monotype byteType, charType, intType, longType, boolType, shortType, doubleType, floatType, voidType;
static mlsub.typing.Polytype voidPolytype, boolPolytype, bytePolytype, shortPolytype, intPolytype, longPolytype;
Index: Pattern.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** Pattern.java 14 Oct 2002 15:03:30 -0000 1.36
--- Pattern.java 18 Feb 2003 14:21:20 -0000 1.37
***************
*** 67,70 ****
--- 67,86 ----
this.exactlyAt = exactlyAt;
this.location = location;
+ if (tc != null)
+ {
+ String ident = tc.getName().toString();
+ if (ident.equals("true"))
+ {
+ this.atValue = new IdentExp(tc.getName());
+ this.typeConstructor =
+ new TypeIdent(new LocatedString("boolean",location));
+ }
+ else if (ident.equals("false"))
+ {
+ this.atValue = new IdentExp(tc.getName());
+ this.typeConstructor =
+ new TypeIdent(new LocatedString("boolean",location));
+ }
+ }
}
***************
*** 229,233 ****
Order on pattern that is compatible with the specificity of patterns.
! If that mathes all values that this matches, the result is true.
Additionally, if this matches values that are more specific than
the values that matches, the result is also true.
--- 245,249 ----
Order on pattern that is compatible with the specificity of patterns.
! If that matches all values that this matches, the result is true.
Additionally, if this matches values that are more specific than
the values that matches, the result is also true.
***************
*** 256,259 ****
--- 272,281 ----
return false;
+ if (that.atBool())
+ return this.atBool() && (this.atTrue() == that.atTrue());
+
+ if (this.atBool())
+ return that.tc == PrimitiveType.boolTC;
+
if (this.tc == that.tc)
return this.exactlyAt || ! that.exactlyAt;
***************
*** 274,277 ****
--- 296,313 ----
return false;
+ if (tag == PrimitiveType.trueBoolTC)
+ {
+ if (atBool())
+ return atTrue();
+ return tc == PrimitiveType.boolTC;
+ }
+
+ if (tag == PrimitiveType.falseBoolTC)
+ {
+ if (atBool())
+ return atFalse();
+ return tc == PrimitiveType.boolTC;
+ }
+
if (exactlyAt)
return Typing.testRigidLeq(tag, tc) && Typing.testRigidLeq(tc, tag);
***************
*** 290,294 ****
if (atAny())
return "@_";
!
StringBuffer res = new StringBuffer();
if (name != null)
--- 326,331 ----
if (atAny())
return "@_";
! if (atBool())
! return "@" + atValue.toString();
StringBuffer res = new StringBuffer();
if (name != null)
***************
*** 323,327 ****
if (atAny())
return "@_";
!
return
(exactlyAt ? "#" : "@")
--- 360,367 ----
if (atAny())
return "@_";
!
! if (atBool())
! return "@" + atValue.toString();
!
return
(exactlyAt ? "#" : "@")
***************
*** 365,368 ****
--- 405,413 ----
else if (name.equals("NULL"))
atValue = NullExp.instance;
+ else if (name.equals("true") || name.equals("false") )
+ {
+ atValue = new IdentExp(new LocatedString(name, Location.nowhere()));
+ tc = PrimitiveType.boolTC;
+ }
else
{
***************
*** 393,396 ****
--- 438,448 ----
if (atAny())
return QuoteExp.trueExp;
+
+ if (atBool())
+ {
+ if (atFalse())
+ return Inline.inline(nice.lang.inline.BoolNotOp.instance, parameter);
+ return parameter;
+ }
gnu.bytecode.Type ct = nice.tools.code.Types.javaType(tc);
***************
*** 427,431 ****
private boolean exactlyAt;
! private Expression atValue;
private Location location;
--- 479,483 ----
private boolean exactlyAt;
! public Expression atValue;
private Location location;
***************
*** 433,435 ****
--- 485,496 ----
public boolean atNull() { return atValue == NullExp.instance; }
public boolean atAny() { return atValue == null && tc == null; }
+ public boolean atBool() {
+ return atValue != null && tc == PrimitiveType.boolTC;
+ }
+ public boolean atTrue() {
+ return atBool() && atValue.toString().equals("true");
+ }
+ public boolean atFalse() {
+ return atBool() && atValue.toString().equals("false");
+ }
}
|
|
From: <bo...@us...> - 2003-02-18 14:21:23
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv7825/testsuite/compiler/methods Added Files: boolean.testsuite Log Message: Dispatch on boolean values: @true and @false (by Arjan). --- NEW FILE: boolean.testsuite --- /// PASS assert not(true) == false; assert not(false) == true; /// Toplevel boolean not(boolean); not(b@boolean) = !b; /// PASS assert and(false, false) == false; assert and(false, true ) == false; assert and(true , false) == false; assert and(true , true ) == true; /// Toplevel boolean and(boolean, boolean); and(@boolean, @boolean) = false; and(@true, @true) = true; /// PASS /// Toplevel boolean xor(boolean, boolean); xor(@true, @true) = false; xor(@true, @false) = true; xor(@false, @true) = true; xor(@false, @false) = false; /// FAIL /// Toplevel boolean or(boolean, boolean); // Ambiguity for the case (@true, @true) or(@true, @boolean) = true; or(@boolean, @true) = true; or(@false, @false) = false; /// FAIL /// Toplevel boolean nor(boolean, boolean); nor(@true, @true) = false; nor(@true, @false) = false; //nor(@false, @true) = false; // This case is missing. nor(@false, @false) = true; |