nice-commit Mailing List for The Nice Programming Language (Page 113)
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-04-30 17:40:51
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv30015/F:/nice/src/bossa/syntax Modified Files: typecheck.nice Log Message: Make compiling the compiler work again. Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** typecheck.nice 30 Apr 2003 14:06:24 -0000 1.62 --- typecheck.nice 30 Apr 2003 17:40:46 -0000 1.63 *************** *** 62,66 **** } ! ?FieldAccess field = to.getField(); String toName; if (field == null) --- 62,67 ---- } ! CallExp callto = cast(to); ! ?FieldAccess field = callto.getField(); String toName; if (field == null) |
From: <xo...@us...> - 2003-04-30 17:26:56
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv24877a/src/bossa/syntax Modified Files: Arguments.java Constructor.java FormalParameters.java Log Message: Improved error message when a required argument is omitted from a constructor call. Now the message explains which arguments were missing, and if no arguments at all were provided it gives an example of the syntax. Index: Arguments.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Arguments.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** Arguments.java 26 Mar 2003 17:23:46 -0000 1.16 --- Arguments.java 30 Apr 2003 17:26:48 -0000 1.17 *************** *** 261,264 **** --- 261,290 ---- } + List missingNamedArgs(FormalParameters parameters, boolean includeDefaultedArgs) + { + List missing = new LinkedList(); + Iterator namedParams = parameters.getNamedParameters().iterator(); + while(namedParams.hasNext()) + { + FormalParameters.NamedParameter param = (FormalParameters.NamedParameter)namedParams.next(); + if (param.value() != null && !includeDefaultedArgs) + continue; + boolean found = false; + for (int i = 0; i < arguments.length; i++) + if (arguments[i].name != null) + { + String s = arguments[i].name.toString(); + if (param.match(s)) + { + found = true; + break; + } + } + if (!found) + missing.add(param); + } + return missing; + } + Argument[] arguments; } Index: Constructor.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Constructor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Constructor.java 23 Mar 2003 23:03:02 -0000 1.2 --- Constructor.java 30 Apr 2003 17:26:49 -0000 1.3 *************** *** 102,126 **** StringBuffer res = new StringBuffer(); res.append("Class ").append(name); if (parameters.size == 0) ! { ! res.append(" has no fields. Therefore its constructor takes no arguments."); ! return res.toString(); ! } List nonmatching = arguments.noMatchByName(parameters); if (!nonmatching.isEmpty()) ! { ! res.append(" has no field named "+nonmatching.get(0)); ! return res.toString(); ! } ! res.append(" has the following fields:\n") ! .append(parameters) ! .append('\n') ! .append("Please provide values for the fields, ") ! .append("at least for those with no default value.\n") ! .append("The syntax is:\n") ! .append("new " + name + "(field1: value1, ..., fieldN: valueN)"); return res.toString(); } --- 102,178 ---- StringBuffer res = new StringBuffer(); res.append("Class ").append(name); + + + //Arguments where none expected if (parameters.size == 0) ! { ! res.append(" has no fields. Therefore its constructor takes no arguments."); ! return res.toString(); ! } + //No such field List nonmatching = arguments.noMatchByName(parameters); if (!nonmatching.isEmpty()) ! { ! res.append(" has no field named "+nonmatching.get(0)); ! return res.toString(); ! } ! //Required fields missing - two different messages depending on whether ! //an explanation of the syntax is necessary ! res = new StringBuffer(); ! res.append("Fields of class ").append(name).append(" require initial values.\n"); ! ! Iterator missingFields = null; ! ! if (arguments.size() == 0) ! { ! res.append(syntaxExample()) ! .append("Class ").append(name).append(" has the following fields:\n"); ! missingFields = parameters.iterator(); ! } ! else ! { ! res.append("These fields are missing:\n"); ! missingFields = arguments.missingNamedArgs(parameters, false).iterator(); ! } + while(missingFields.hasNext()) + { + res.append(" ") + .append(missingFields.next()) + .append("\n"); + } + + return res.toString(); + } + + private String syntaxExample() + { + String name = classe.getName(); + StringBuffer res = new StringBuffer(); + res.append("Use the following syntax:\n") + .append(" new ").append(name).append("("); + + Iterator params = parameters.getRequiredNamedParameters().iterator(); + int paramCount = 0; + int len = name.length(); + while(params.hasNext()) + { + FormalParameters.NamedParameter param = + (FormalParameters.NamedParameter)params.next(); + if (paramCount != 0) + res.append(", "); + if (paramCount == 3 && params.hasNext()) + { + res.append('\n'); + for(int i = 0; i < len; i++) {res.append(' ');} + res.append(" "); + paramCount = 0; + } + res.append(param.getName()).append(": value"); + paramCount++; + } + res.append(")\n\n"); return res.toString(); } Index: FormalParameters.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/FormalParameters.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** FormalParameters.java 23 Mar 2003 23:03:03 -0000 1.21 --- FormalParameters.java 30 Apr 2003 17:26:49 -0000 1.22 *************** *** 14,17 **** --- 14,21 ---- import bossa.util.*; + import java.util.Arrays; + import java.util.Iterator; + import java.util.LinkedList; + import java.util.List; /** *************** *** 448,451 **** --- 452,488 ---- { return Util.map("", ", ", "", parameters); + } + + public Iterator iterator() + { + return Arrays.asList(parameters).iterator(); + } + + public List getNamedParameters() + { + LinkedList res = new LinkedList(); + for(int i = 0; i < parameters.length; i++) + { + Parameter param = parameters[i]; + if (param instanceof NamedParameter) + { + res.add(parameters[i]); + } + } + return res; + } + + public List getRequiredNamedParameters() + { + LinkedList res = new LinkedList(); + for(int i = 0; i < parameters.length; i++) + { + Parameter param = parameters[i]; + if (param instanceof NamedParameter && ! (param instanceof OptionalParameter)) + { + res.add(parameters[i]); + } + } + return res; } |
From: <bo...@us...> - 2003-04-30 17:20:49
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv22707a/src/bossa/syntax Modified Files: CallExp.java Log Message: Improved error messages for possibly null values in assignments. Index: CallExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/CallExp.java,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -d -r1.74 -r1.75 *** CallExp.java 2 Apr 2003 21:29:40 -0000 1.74 --- CallExp.java 30 Apr 2003 17:20:43 -0000 1.75 *************** *** 293,296 **** --- 293,307 ---- } + /** + @return the FieldAccess if this expression resolves to a field, + which is true if it is the application a of FieldAccess to an object + value. Returns null otherwise. + */ + FieldAccess getField() + { + resolveOverloading(); + return function.getFieldAccessMethod(); + } + /**************************************************************** * Code generation |
From: <bo...@us...> - 2003-04-30 14:06:32
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv1673/debian Modified Files: changelog Log Message: Improved error messages for possibly null values in assignments. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -d -r1.152 -r1.153 *** changelog 28 Apr 2003 20:57:55 -0000 1.152 --- changelog 30 Apr 2003 14:06:25 -0000 1.153 *************** *** 30,33 **** --- 30,34 ---- return res; } + * Improved error messages for possibly null values in assignments. * Bugfix (overloaded symbols used inside && or || expressions). |
From: <bo...@us...> - 2003-04-30 14:06:31
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv1673/src/bossa/syntax Modified Files: typecheck.nice exceptions.nice Log Message: Improved error messages for possibly null values in assignments. Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** typecheck.nice 29 Apr 2003 10:17:07 -0000 1.61 --- typecheck.nice 30 Apr 2003 14:06:24 -0000 1.62 *************** *** 62,69 **** } ! if (notNullError(t, e, notNull(e.value).toString())) ! throw assignmentError(e, to.toString(), ! to.getType().toString(), ! notNull(e.value)); } } --- 62,78 ---- } ! ?FieldAccess field = to.getField(); ! String toName; ! if (field == null) ! toName = to.toString(); ! else ! toName = field.getName().toString(); ! ! reportNullAssignmentError(e, t, value: notNull(e.value), ! toName, ! to.getType().getMonotype(), ! field != null); ! throw assignmentError(e, to.toString(), ! to.getType().toString(), notNull(e.value)); } } *************** *** 562,569 **** } catch(TypingEx t){ ! if (notNullError(t, target, value.toString())) ! throw assignmentError(target, target.name.toString(), ! String.valueOf(target.getMonotype), ! value); } } --- 571,580 ---- } catch(TypingEx t){ ! reportNullAssignmentError(decl, t, value: value, ! target.name.toString(), ! target.getMonotype()); ! throw assignmentError(target, target.name.toString(), ! String.valueOf(target.getMonotype), ! value); } } *************** *** 691,695 **** } catch(TypingEx ex) { ! throw new bossa.util.UserError(s.object, "" + s.object + " might be null"); } --- 702,706 ---- } catch(TypingEx ex) { ! bossa.util.User.error(s.object, "Synchonization must be done on a non-null object.\n" + s.object + " might be null."); } Index: exceptions.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/exceptions.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** exceptions.nice 19 Jun 2002 23:43:00 -0000 1.9 --- exceptions.nice 30 Apr 2003 14:06:25 -0000 1.10 *************** *** 35,38 **** --- 35,62 ---- } + /** Reports an error if an assignment failed because the value assigned + might be null. + + In that case, an exception is thrown and the call does not return. + Otherwise, does nothing. + */ + void reportNullAssignmentError(bossa.util.Located responsible, + TypingEx t, Expression value, + String toName, mlsub.typing.Monotype toType, + boolean toField = false) + { + if (! isNullError(t)) + return; + + bossa.util.User.error + (responsible, + "The value " + value.toString() + + " cannot be assigned to " + + (toField ? "field " : "") + toName + + " because it might be null.\n\n" + + "To allow " + toName + " to contain the null value, it should be declared as:\n" + + makeUnsure(toType) + " " + toName); + } + // Local Variables: // nice-xprogram: "nicec -d \"$HOME/Nice/classes\" --sourcepath=\"$HOME/Nice/src\" --classpath=\"$HOME/Nice/classes\"" |
From: <ar...@us...> - 2003-04-30 14:02:30
|
Update of /cvsroot/nice/swing/src/nice/ui/common/types/awt In directory sc8-pr-cvs1:/tmp/cvs-serv32701/D:/nice/nice/ui/common/types/awt Modified Files: java.nice Log Message: commented jdk1.4 stuff Index: java.nice =================================================================== RCS file: /cvsroot/nice/swing/src/nice/ui/common/types/awt/java.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** java.nice 20 Nov 2002 22:44:56 -0000 1.4 --- java.nice 30 Apr 2003 14:02:24 -0000 1.5 *************** *** 66,73 **** String BEFORE_FIRST_LINE() = native BorderLayout.BEFORE_FIRST_LINE; String BEFORE_LINE_BEGINS() = native BorderLayout.BEFORE_LINE_BEGINS; ! String LINE_END() = native BorderLayout.LINE_END; ! String LINE_START() = native BorderLayout.LINE_START; ! String PAGE_END() = native BorderLayout.PAGE_END; ! String PAGE_START() = native BorderLayout.PAGE_START; --- 66,73 ---- String BEFORE_FIRST_LINE() = native BorderLayout.BEFORE_FIRST_LINE; String BEFORE_LINE_BEGINS() = native BorderLayout.BEFORE_LINE_BEGINS; ! //JDK1.4 String LINE_END() = native BorderLayout.LINE_END; ! //JDK1.4 String LINE_START() = native BorderLayout.LINE_START; ! //JDK1.4 String PAGE_END() = native BorderLayout.PAGE_END; ! //JDK1.4 String PAGE_START() = native BorderLayout.PAGE_START; |
From: <ar...@us...> - 2003-04-30 11:31:04
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1:/tmp/cvs-serv815/F:/nice/stdlib/nice/lang/inline Modified Files: BoolNotOp.java Log Message: Minor cleanups. Index: BoolNotOp.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/BoolNotOp.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** BoolNotOp.java 23 Mar 2003 00:05:49 -0000 1.4 --- BoolNotOp.java 30 Apr 2003 11:30:57 -0000 1.5 *************** *** 28,32 **** } ! public static BoolNotOp instance = new BoolNotOp(); public static BoolNotOp create(String param) --- 28,32 ---- } ! public final static BoolNotOp instance = new BoolNotOp(); public static BoolNotOp create(String param) |
From: <ar...@us...> - 2003-04-30 11:31:04
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv815/F:/nice/src/bossa/syntax Modified Files: BreakStmt.java JavaClasses.java MethodBodyDefinition.java Log Message: Minor cleanups. Index: BreakStmt.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/BreakStmt.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** BreakStmt.java 25 Jul 2002 13:33:12 -0000 1.3 --- BreakStmt.java 30 Apr 2003 11:30:51 -0000 1.4 *************** *** 22,26 **** public class BreakStmt extends Statement { ! public static BreakStmt instance = new BreakStmt(); private BreakStmt() {} --- 22,26 ---- public class BreakStmt extends Statement { ! public final static BreakStmt instance = new BreakStmt(); private BreakStmt() {} Index: JavaClasses.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/JavaClasses.java,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** JavaClasses.java 15 Apr 2003 16:05:27 -0000 1.33 --- JavaClasses.java 30 Apr 2003 11:30:52 -0000 1.34 *************** *** 65,70 **** } - private gnu.bytecode.Type javaType; - private static final gnu.bytecode.Type[] blackListClass = new gnu.bytecode.Type[] { --- 65,68 ---- Index: MethodBodyDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodBodyDefinition.java,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** MethodBodyDefinition.java 28 Apr 2003 18:28:54 -0000 1.120 --- MethodBodyDefinition.java 30 Apr 2003 11:30:52 -0000 1.121 *************** *** 428,433 **** } - private boolean entered = false; - /**************************************************************** * Module interface --- 428,431 ---- |
From: <ar...@us...> - 2003-04-29 21:06:53
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv6605/F:/nice/testsuite/compiler/syntax Added Files: loops.testsuite Log Message: The init part of a for loop is now a localdeclarationlist or a statementexpression instead of a statementexpressionlist or a localdeclaration. see testsuite for a bug with assigning to a final variable in a loop. And this was a very nasty bug to find: Statement StatementExpressionList() : { Statement s; List statements=new LinkedList(); } { s=StatementExpression() { statements.add(s); } - ( "," StatementExpression() { statements.add(s); } + ( "," s=StatementExpression() { statements.add(s); } )* { return new Block(statements); } } --- NEW FILE: loops.testsuite --- /// PASS List<String> list = new LinkedList(); for (let iter = list.iterator(); iter.hasNext;){} /// PASS for (int x = 0, boolean ok = false; false;){} /// PASS int i; for (i = 0; i < 10; i++){} /// FAIL bug let int x; for (int i = 0; i < 5; i++) x = 7; /// PASS for (int i = 0, int x = 1; i < 5; i++){} /// PASS for (var int i = 0; i < 5; i++) {} /// PASS /// COMMENT: this was broken in all versions before 29-4-03 boolean update = false; for (int i = 0; i < 5; i++,update=true){} assert(update); |
From: <ar...@us...> - 2003-04-29 21:06:53
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv6605/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: The init part of a for loop is now a localdeclarationlist or a statementexpression instead of a statementexpressionlist or a localdeclaration. see testsuite for a bug with assigning to a final variable in a loop. And this was a very nasty bug to find: Statement StatementExpressionList() : { Statement s; List statements=new LinkedList(); } { s=StatementExpression() { statements.add(s); } - ( "," StatementExpression() { statements.add(s); } + ( "," s=StatementExpression() { statements.add(s); } )* { return new Block(statements); } } Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.162 retrieving revision 1.163 diff -C2 -d -r1.162 -r1.163 *** Parser.jj 29 Apr 2003 09:59:15 -0000 1.162 --- Parser.jj 29 Apr 2003 21:06:47 -0000 1.163 *************** *** 2337,2343 **** { Statement res; } { ! ( LOOKAHEAD( "final" | "const" | "var" | "let" | monotype() <IDENT>) ! res = LocalDeclaration() | // There are two cases for tuples (declaring a variable or not). --- 2337,2348 ---- { Statement res; } { ! ( LOOKAHEAD( "final" | "const" | "var" | "let" | monotype() <IDENT>) ! ( ! LOOKAHEAD( [ "final" | "const" | "var" | "let" ] monotype() <IDENT> "(" ) ! res = LocalFunctionDeclaration() ! | ! res = LocalDeclaration() ";" ! ) | // There are two cases for tuples (declaring a variable or not). *************** *** 2364,2417 **** Monotype type = null; LocatedString id; ! FormalParameters parameters; ! Statement body; ! Expression e=null; boolean constant = true; Token t = null; } { ! ( LOOKAHEAD( [ ("final"|"const"|"let"|"var") ] monotype() ident() ) ( ! (t="final" | t="const") {User.warning(new Location(t), "'"+t.toString()+"' is deprecated. Use 'let' instead."); ! } | "let" | "var" {constant = false;} - | {constant = false;} ) ! type = monotype() ! id=ident() ! ( ! "(" parameters=formalParameters(false) ")" body=code() ! { return Block.LocalFunction.make(id, type, parameters, body); } ! | [ "=" e=Expression() ] ! { Block.LocalVariable res = new Block.LocalVariable(id,type,constant,e); } ! ( "," id=ident() {e=null;} [ "=" e=Expression() ] { res.addNext(id,e); } )* ! ";" ! { return res; } ) ! | ( ! (t="final" | t="const") {User.warning(new Location(t), "'"+t.toString()+"' is deprecated. Use 'let' instead."); ! } | "let" | "var" {constant = false;} ) id=ident() ! "=" e=Expression() ! { Block.LocalValue res; ! if (constant) { res = new Block.LocalConstant(id,e);} ! else { res = new Block.LocalVariable(id, null, constant, e);} ! } ! ( "," id=ident() "=" e=Expression() { res.addNext(id,e); } )* ! ";" ! { return res; } ) } Statement LocalTupleDeclaration(List statements) : { --- 2369,2442 ---- Monotype type = null; LocatedString id; ! Expression e = null; boolean constant = true; Token t = null; + Block.LocalValue res; } { ! ( LOOKAHEAD ( monotype() ident() ) ! type=monotype() ! id=ident() ! [ "=" e=Expression() ] ! { res = new Block.LocalVariable(id,type,false,e); } ! ( LOOKAHEAD( "," <IDENT> ( "=" | ";" ) ) ! "," id=ident() {e=null;} [ "=" e=Expression() ] { res.addNext(id,e); } )* ! | ( ! (t="final" | t="const") {User.warning(new Location(t), "'"+t.toString()+"' is deprecated. Use 'let' instead."); ! } | "let" | "var" {constant = false;} ) ! ( LOOKAHEAD ( <IDENT> "=" ) ! id=ident() ! "=" e=Expression() ! { if (constant) { res = new Block.LocalConstant(id,e);} ! else { res = new Block.LocalVariable(id, null, constant, e);} ! } ! ( LOOKAHEAD( "," <IDENT> "=" ) ! "," id=ident() "=" e=Expression() { res.addNext(id,e); } )* ! | ! type=monotype() ! id=ident() [ "=" e=Expression() ] ! { res = new Block.LocalVariable(id,type,constant,e); } ! ( LOOKAHEAD( "," <IDENT> ( "=" | ";") ) ! "," id=ident() {e=null;} [ "=" e=Expression() ] { res.addNext(id,e); } )* ) ! ) ! { return res; } ! } ! ! Statement LocalFunctionDeclaration() : ! { ! Monotype type = null; ! LocatedString id; ! FormalParameters parameters; ! Statement body; ! boolean constant = true; ! Token t = null; ! } ! { ! ( ( ! (t="final" | t="const") {User.warning(new Location(t), "'"+t.toString()+"' is deprecated. Use 'let' instead."); ! } | "let" | "var" {constant = false;} + | {constant = false;} ) + type = monotype() id=ident() ! "(" parameters=formalParameters(false) ")" body=code() ! { return Block.LocalFunction.make(id, type, parameters, body); } ) } + Statement LocalTupleDeclaration(List statements) : { *************** *** 2560,2584 **** Statement ForStatement() : ! { Statement init=null,update=null,body,loop,block; Expression cond=null; } { "for" "(" ( ! LOOKAHEAD( monotype() <IDENT> ":" ) block=ForInStatement() ! | ! ( init=ForInit() | ";" ) [ cond=Expression() ] ";" [ update=StatementExpressionList() ] ")" body=Statement() { loop=LoopStmt.forLoop(cond,update,body); - if(init==null) - return loop; - List l = new LinkedList(); ! l.add(init); l.add(loop); ! block = new Block(l); } ) ! { return block; } } --- 2585,2613 ---- Statement ForStatement() : ! { Statement update = null, loop = null, body, statexp; ! Expression cond = null; ! List init = new ArrayList(); ! } { "for" "(" ( ! LOOKAHEAD( monotype() <IDENT> ":" ) loop=ForInStatement() ! | ( ! LOOKAHEAD( "final" | "const" | "var" | "let" | monotype() <IDENT>) ! init=LocalDeclarationList() ! | statexp=StatementExpression() ";" {init.add(statexp);} ! | ";" ! ) [ cond=Expression() ] ";" [ update=StatementExpressionList() ] ")" body=Statement() { loop=LoopStmt.forLoop(cond,update,body); List l = new LinkedList(); ! l.addAll(init); l.add(loop); ! loop = new Block(l); } ) ! { return loop; } } *************** *** 2591,2604 **** } ! Statement ForInit() : ! { Statement res; } { ! ( ! LOOKAHEAD( [ "final" | "const" ] monotype() <IDENT> ) ! res=LocalDeclaration() ! | ! res=StatementExpressionList() ";" ! ) ! { return res; } } --- 2620,2630 ---- } ! List LocalDeclarationList() : ! { Statement d; List declarations = new ArrayList(); } { ! d=LocalDeclaration() {declarations.add(d);} ! ( "," d=LocalDeclaration() {declarations.add(d);} )* ! ";" ! { return declarations; } } *************** *** 2607,2611 **** { s=StatementExpression() { statements.add(s); } ! ( "," StatementExpression() { statements.add(s); } )* { return new Block(statements); } --- 2633,2637 ---- { s=StatementExpression() { statements.add(s); } ! ( "," s=StatementExpression() { statements.add(s); } )* { return new Block(statements); } |
From: <bo...@us...> - 2003-04-29 16:45:55
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1:/tmp/cvs-serv2787/src/mlsub/typing Modified Files: Enumeration.java Log Message: Fixed handling of a special case. Index: Enumeration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Enumeration.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Enumeration.java 29 Apr 2003 16:00:57 -0000 1.8 --- Enumeration.java 29 Apr 2003 16:45:50 -0000 1.9 *************** *** 330,341 **** Constraint constraint = def.getResolvedConstraint(); ! if (constraint == null) return true; if (! (var instanceof Monotype)) ! { ! System.out.println("Warning: possibly abnormal condition during dispatch tests.\nThis involves class " + sol); ! return true; ! } Monotype m = (Monotype) var; --- 330,338 ---- Constraint constraint = def.getResolvedConstraint(); ! if (constraint == mlsub.typing.Constraint.True) return true; if (! (var instanceof Monotype)) ! return true; Monotype m = (Monotype) var; |
From: <bo...@us...> - 2003-04-29 16:01:33
|
Update of /cvsroot/nice/Nice/src/mlsub/typing In directory sc8-pr-cvs1:/tmp/cvs-serv14166/src/mlsub/typing Modified Files: Enumeration.java Log Message: Made dispatch tests take class type parameter constraints into account. Index: Enumeration.java =================================================================== RCS file: /cvsroot/nice/Nice/src/mlsub/typing/Enumeration.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Enumeration.java 10 Dec 2002 18:46:33 -0000 1.7 --- Enumeration.java 29 Apr 2003 16:00:57 -0000 1.8 *************** *** 245,249 **** observers.toArray(new BitVector[observers.size()]); ! if (enumerateInConstraints(pKinds,pObs,tuples)) return emptyList; } --- 245,249 ---- observers.toArray(new BitVector[observers.size()]); ! if (enumerateInConstraints(pKinds, pObs, tuples, tags)) return emptyList; } *************** *** 261,265 **** (Engine.Constraint[] kinds, BitVector[] observers, ! final TagsList tuples) { for(int act = 0; act<kinds.length;act++) --- 261,266 ---- (Engine.Constraint[] kinds, BitVector[] observers, ! final TagsList tuples, ! final Element[] tags) { for(int act = 0; act<kinds.length;act++) *************** *** 276,279 **** --- 277,295 ---- public void handle() { + // Check if this is really a solution, because of + // class constraints. + for (int x = obs.getLowestSetBit(); + x != BitVector.UNDEFINED_INDEX; + x = obs.getNextBit(x)) + { + TypeConstructor var,sol; + var=(TypeConstructor) kind.getElement(x); + sol=(TypeConstructor) kind.getElement(getSolutionOf(x)); + int index = var.enumerateTagIndex; + if (! checkClassConstraint(tags[index], sol)) + return; + } + + // It is a solution, let's add it to the list. tuples.startEntry(); for (int x = obs.getLowestSetBit(); *************** *** 297,300 **** --- 313,359 ---- } return false; + } + + /** + Return true if and only if sol can be the runtime tag of a + subtype of var. This especially involves checking the eventual + constraints on the type parameters of the class sol. + */ + private static boolean checkClassConstraint(Element var, + TypeConstructor sol) + { + bossa.syntax.ClassDefinition def = bossa.syntax.ClassDefinition.get(sol); + + if (def == null) + return true; + + Constraint constraint = def.getResolvedConstraint(); + + if (constraint == null) + return true; + + if (! (var instanceof Monotype)) + { + System.out.println("Warning: possibly abnormal condition during dispatch tests.\nThis involves class " + sol); + return true; + } + + Monotype m = (Monotype) var; + + MonotypeConstructor type = + new MonotypeConstructor(sol, def.getTypeParameters()); + + try { + constraint.enter(); + Engine.leq(type, var); + + return true; + } + catch (TypingEx ex) { + return false; + } + catch (Unsatisfiable ex) { + return false; + } } |
From: <bo...@us...> - 2003-04-29 16:01:30
|
Update of /cvsroot/nice/Nice/testsuite/compiler/methods In directory sc8-pr-cvs1:/tmp/cvs-serv14166/testsuite/compiler/methods Modified Files: constrained.testsuite Log Message: Made dispatch tests take class type parameter constraints into account. Index: constrained.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/methods/constrained.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** constrained.testsuite 28 Apr 2003 11:39:38 -0000 1.1 --- constrained.testsuite 29 Apr 2003 16:00:55 -0000 1.2 *************** *** 1,3 **** ! ///PASS bug ///Toplevel class A{} --- 1,3 ---- ! /// PASS ///Toplevel class A{} *************** *** 9,10 **** --- 9,64 ---- void foo(I<B>); + /* + A type X<T> can only exist for T >: A, so there cannot be X<T> <: I<B>. + Therefore foo does not need to be implemented @X. + */ + + /// PASS + ///Toplevel + class A{} + class B extends A{} + + interface I<A T>{} + + class X<T | A <: T> implements I<T>{} + + void foo(I<A>, I<B>); + + /// FAIL + ///Toplevel + class A{} + class B extends A{} + + interface I<A T>{} + + class X<T | A <: T> implements I<T>{} + + void foo(I<A>); + + /// FAIL + ///Toplevel + class A{} + class B extends A{} + + interface I<A T>{} + + class X<T | A <: T> implements I<T>{} + class Y<T> implements I<T> {} + + void foo(I<A>, I<B>); + foo(@Y,@Y) {} + // @X,@Y is missing + + /// PASS + ///Toplevel + class A{} + class B extends A{} + + interface I<A T>{} + + class X<T | A <: T> implements I<T>{} + class Y<T> implements I<T> {} + + void foo(I<A>, I<B>); + foo(@Y,@Y) {} + foo(@X,@Y) {} |
From: <bo...@us...> - 2003-04-29 16:01:05
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv14166/src/bossa/syntax Modified Files: MethodContainer.java Log Message: Made dispatch tests take class type parameter constraints into account. Index: MethodContainer.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MethodContainer.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** MethodContainer.java 23 Dec 2002 19:55:54 -0000 1.10 --- MethodContainer.java 29 Apr 2003 16:00:59 -0000 1.11 *************** *** 96,100 **** } ! mlsub.typing.MonotypeVar[] getTypeParameters () { if (classConstraint == null) --- 96,100 ---- } ! public mlsub.typing.MonotypeVar[] getTypeParameters () { if (classConstraint == null) *************** *** 104,113 **** } ! mlsub.typing.Constraint getResolvedConstraint() { if (classConstraint == null) return mlsub.typing.Constraint.True; else ! return new mlsub.typing.Constraint (classConstraint.typeParameters, resolvedConstraints); } --- 104,113 ---- } ! public mlsub.typing.Constraint getResolvedConstraint() { if (classConstraint == null) return mlsub.typing.Constraint.True; else ! return new mlsub.typing.Constraint (classConstraint.typeParameters, resolvedConstraints); } |
From: <ar...@us...> - 2003-04-29 13:25:20
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv4831/F:/nice/src/bossa/syntax Modified Files: ClassDefinition.java Log Message: Don't allow co/contra-variant fields. Index: ClassDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ClassDefinition.java,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** ClassDefinition.java 22 Apr 2003 17:56:09 -0000 1.89 --- ClassDefinition.java 29 Apr 2003 13:25:14 -0000 1.90 *************** *** 430,434 **** try{ localScope = new TypeScope(localScope); ! localScope.addSymbols(classConstraint.typeParameters); } catch(TypeScope.DuplicateName e){ --- 430,438 ---- try{ localScope = new TypeScope(localScope); ! mlsub.typing.MonotypeVar[] typeParams = classConstraint.typeParameters; ! //add only nonvariant type parameter so no possibly unsafe co/contra-variant fields can exist. ! for (int i = 0; i < typeParams.length; i++) ! if (variance.getVariance(i) == mlsub.typing.Variance.INVARIANT) ! localScope.addSymbol(typeParams[i]); } catch(TypeScope.DuplicateName e){ |
From: <bo...@us...> - 2003-04-29 11:17:10
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1:/tmp/cvs-serv27440/stdlib/nice/lang/inline Modified Files: Return.java Log Message: Fixed code generation for function in short style when the value is ignored. Index: Return.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/Return.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Return.java 1 Feb 2002 14:36:05 -0000 1.4 --- Return.java 29 Apr 2003 11:17:07 -0000 1.5 *************** *** 41,45 **** if (args != null && args.length != 0) ! args[0].compile(comp, new StackTarget(code.getMethod().getReturnType())); code.emitReturn(); --- 41,46 ---- if (args != null && args.length != 0) ! args[0].compile(comp, ! Target.pushValue(code.getMethod().getReturnType())); code.emitReturn(); |
From: <bo...@us...> - 2003-04-29 11:17:10
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv27440/testsuite/compiler/typing Modified Files: void.testsuite Log Message: Fixed code generation for function in short style when the value is ignored. Index: void.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/void.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** void.testsuite 13 Mar 2003 23:19:39 -0000 1.1 --- void.testsuite 29 Apr 2003 11:17:06 -0000 1.2 *************** *** 35,36 **** --- 35,50 ---- /// Toplevel void f(void) {} + + /// PASS + /// Toplevel + void f() = 1; + + /// PASS + /// Toplevel + void f() = true; + + /// PASS + /// Toplevel + boolean doSomethingAndReturnAStatusBoolean() = false; + + void f() = doSomethingAndReturnAStatusBoolean(); |
From: <bo...@us...> - 2003-04-29 11:14:33
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv25630/src/bossa/syntax Modified Files: analyse.nice Log Message: Minor: made an the source simpler, by moving the simpler branch of an if in front. Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** analyse.nice 29 Apr 2003 10:17:07 -0000 1.62 --- analyse.nice 29 Apr 2003 11:14:27 -0000 1.63 *************** *** 389,394 **** { ?VarSymbol sym = info.lookup(notNull(e.ident).toString()); if (sym != null) ! if (!e.alwaysOverloadedSymbol) { if (sym instanceof Block.LocalVariable.Symbol) --- 389,397 ---- { ?VarSymbol sym = info.lookup(notNull(e.ident).toString()); + if (sym != null) ! if (e.alwaysOverloadedSymbol) ! return new OverloadedSymbolExp(sym, e.ident); ! else { if (sym instanceof Block.LocalVariable.Symbol) *************** *** 402,407 **** return new SymbolExp(sym, e.location()); } - else - return new OverloadedSymbolExp(sym, e.ident); } --- 405,408 ---- |
From: <bo...@us...> - 2003-04-29 10:17:40
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv12743/testsuite/compiler/syntax Modified Files: localvariable.testsuite Log Message: Implemented let variables whose initial value is not given immediately. Index: localvariable.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/localvariable.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** localvariable.testsuite 29 Apr 2003 08:52:03 -0000 1.3 --- localvariable.testsuite 29 Apr 2003 10:17:05 -0000 1.4 *************** *** 1,4 **** ! /// PASS bug let int i; i = 0; --- 1,18 ---- ! /// PASS ! let int i; ! i = 0; ! int j = i; ! ! /// PASS ! let int i; ! if (0 == 1) ! i = 0; ! else ! i = 2; ! int j = i; ! ! /// FAIL let int i; + int j = /* /// FAIL HERE */ i; i = 0; |
From: <bo...@us...> - 2003-04-29 10:17:11
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv12743/src/bossa/syntax Modified Files: typecheck.nice analyse.nice Block.java Log Message: Implemented let variables whose initial value is not given immediately. Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** typecheck.nice 29 Apr 2003 01:01:59 -0000 1.60 --- typecheck.nice 29 Apr 2003 10:17:07 -0000 1.61 *************** *** 35,39 **** e.to = to; typecheck(to); ! if(!to.isAssignable()) bossa.util.User.error(e, "" + to + " cannot be assigned a value"); --- 35,42 ---- e.to = to; typecheck(to); ! ! // This needs to be check during typechecking, since this might involve ! // overloading resolution (when assigning to a field). ! if (! to.isAssignable()) bossa.util.User.error(e, "" + to + " cannot be assigned a value"); Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** analyse.nice 29 Apr 2003 01:02:01 -0000 1.61 --- analyse.nice 29 Apr 2003 10:17:07 -0000 1.62 *************** *** 212,219 **** analyse(null(Expression), info) = null; ! void setInitialized (Block.LocalVariable.Symbol v, Info info) { if (v.index != -1) ! info.flags |= 1 << v.index; } --- 212,226 ---- analyse(null(Expression), info) = null; ! void setInitialized (Block.LocalVariable.Symbol v, Info info, ! bossa.util.Location loc) { if (v.index != -1) ! { ! if (v.constant && info.flags[v.index]) ! bossa.util.User.error(loc, ! "" + v + " cannot be assigned a value twice"); ! ! info.flags |= 1 << v.index; ! } } *************** *** 389,393 **** Block.LocalVariable.Symbol s = cast(sym); if (assigned) ! setInitialized(s, info); else checkInitialized(s, info, e.location()); --- 396,400 ---- Block.LocalVariable.Symbol s = cast(sym); if (assigned) ! setInitialized(s, info, e.location()); else checkInitialized(s, info, e.location()); Index: Block.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Block.java,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** Block.java 29 Apr 2003 01:02:02 -0000 1.55 --- Block.java 29 Apr 2003 10:17:07 -0000 1.56 *************** *** 105,113 **** static class Symbol extends MonoSymbol { ! Symbol(LocatedString name, Monotype type) { super(name, type); } /* Index to make the initialization analysis or -1 if --- 105,123 ---- static class Symbol extends MonoSymbol { ! Symbol(LocatedString name, Monotype type, boolean constant) { super(name, type); + this.constant = constant; } + boolean isAssignable() + { + /* For a constant symbol with no initial value, index != -1. + We allow assignments, but check with dataflow in analyse.nice + that assignment occurs only in the uninitialized state. + */ + return ! constant || index != -1; + } + /* Index to make the initialization analysis or -1 if *************** *** 115,118 **** --- 125,130 ---- */ int index = -1; + + boolean constant; } *************** *** 121,133 **** { 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); this.last = this; } --- 133,137 ---- { this.value = value; ! this.left = new LocalVariable.Symbol(name, type, constant); this.last = this; } *************** *** 145,158 **** } ! MonoSymbol left; int getIndex() { ! return ((LocalVariable.Symbol) left).index; } void setIndex(int i) { ! ((LocalVariable.Symbol) left).index = i; } --- 149,162 ---- } ! LocalVariable.Symbol left; int getIndex() { ! return left.index; } void setIndex(int i) { ! left.index = i; } |
From: <bo...@us...> - 2003-04-29 09:59:18
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv31844/src/bossa/parser Modified Files: Parser.jj Log Message: Removed unused asignment. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.161 retrieving revision 1.162 diff -C2 -d -r1.161 -r1.162 *** Parser.jj 29 Apr 2003 08:52:00 -0000 1.161 --- Parser.jj 29 Apr 2003 09:59:15 -0000 1.162 *************** *** 2400,2404 **** } | "let" ! | t="var" {constant = false;} ) id=ident() --- 2400,2404 ---- } | "let" ! | "var" {constant = false;} ) id=ident() |
From: <ar...@us...> - 2003-04-29 08:52:07
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv11060/F:/nice/testsuite/compiler/syntax Modified Files: localvariable.testsuite Log Message: Don't allow "var" and "let" without type nor value. Index: localvariable.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/localvariable.testsuite,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** localvariable.testsuite 29 Apr 2003 01:10:24 -0000 1.2 --- localvariable.testsuite 29 Apr 2003 08:52:03 -0000 1.3 *************** *** 36,43 **** i = 1; - /// PASS bug - let i; - i = 0; - /// PASS let i = 0; --- 36,39 ---- *************** *** 48,72 **** assert j == 3; - /// PASS bug - /// COMMENT: not implemented yet - var i; - i = 0; - /// PASS var i = 0; - /// FAIL bug - let i; - i = 0; - i = 1; - /// FAIL let i = 0; - i = 1; - - /// PASS bug - /// COMMENT: not implemented yet - var i; - i = 0; i = 1; --- 44,52 ---- |
From: <ar...@us...> - 2003-04-29 08:52:06
|
Update of /cvsroot/nice/Nice/src/bossa/parser In directory sc8-pr-cvs1:/tmp/cvs-serv11060/F:/nice/src/bossa/parser Modified Files: Parser.jj Log Message: Don't allow "var" and "let" without type nor value. Index: Parser.jj =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/parser/Parser.jj,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** Parser.jj 29 Apr 2003 01:02:03 -0000 1.160 --- Parser.jj 29 Apr 2003 08:52:00 -0000 1.161 *************** *** 2403,2412 **** ) id=ident() ! [ "=" e=Expression() ] { Block.LocalValue res; ! if (constant) {res = new Block.LocalConstant(id,e);} ! else if (e != null) ! res = new Block.LocalVariable(id, null, constant, e); ! else {throw new UserError(new Location(t), "'var' without type nor value is not implemented (yet)");} } ( "," id=ident() "=" e=Expression() { res.addNext(id,e); } )* --- 2403,2410 ---- ) id=ident() ! "=" e=Expression() { Block.LocalValue res; ! if (constant) { res = new Block.LocalConstant(id,e);} ! else { res = new Block.LocalVariable(id, null, constant, e);} } ( "," id=ident() "=" e=Expression() { res.addNext(id,e); } )* |
From: <bo...@us...> - 2003-04-29 08:38:16
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv454/stdlib/nice/lang Modified Files: graph.nice Log Message: Use || now that the stable compiler can handle it. Index: graph.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/graph.nice,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** graph.nice 2 Apr 2003 21:41:23 -0000 1.17 --- graph.nice 29 Apr 2003 08:38:08 -0000 1.18 *************** *** 33,44 **** int min = id.value; successors(node).foreach(T child=>{ ! int m; ! if (mark.get(child)==null)// optionOr crashes the compiler here so we fake ! m = visit(child, successors, id, stack, mark, res); ! else ! m = cast(mark.get(child)); ! /* XXX Use this instead after 0.7.8 is released ! m = mark.get(child) || visit(child, successors, id, stack, mark, res); ! */ if (m < min) --- 33,37 ---- int min = id.value; successors(node).foreach(T child=>{ ! int m = mark.get(child) || visit(child, successors, id, stack, mark, res); if (m < min) |
From: <bo...@us...> - 2003-04-29 01:10:27
|
Update of /cvsroot/nice/Nice/testsuite/compiler/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv18728/testsuite/compiler/syntax Modified Files: localvariable.testsuite Log Message: Implemented 'var name = value'. It takes the type of value as the type for name (provided it is not polymorphic). Added cases for 'let' introducing multiple bindings. Index: localvariable.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/syntax/localvariable.testsuite,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** localvariable.testsuite 28 Apr 2003 23:28:46 -0000 1.1 --- localvariable.testsuite 29 Apr 2003 01:10:24 -0000 1.2 *************** *** 7,10 **** --- 7,15 ---- /// PASS + let int i = 2, j = 3; + assert i == 2; + assert j == 3; + + /// PASS var int i; i = 0; *************** *** 38,41 **** --- 43,51 ---- let i = 0; + /// PASS + let i = 2, j = 3; + assert i == 2; + assert j == 3; + /// PASS bug /// COMMENT: not implemented yet *************** *** 43,48 **** i = 0; ! /// PASS bug ! /// COMMENT: not implemented yet var i = 0; --- 53,57 ---- i = 0; ! /// PASS var i = 0; *************** *** 62,67 **** i = 1; ! /// PASS bug ! /// COMMENT: not implemented yet var i = 0; i = 1; --- 71,75 ---- i = 1; ! /// PASS var i = 0; i = 1; |