nice-commit Mailing List for The Nice Programming Language (Page 121)
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-03-20 00:03:59
|
Update of /cvsroot/nice/Nice/src/bossa/link In directory sc8-pr-cvs1:/tmp/cvs-serv4469/F:/nice/src/bossa/link Modified Files: Dispatch.java Log Message: Handle null cases correctly in TagComparator. Index: Dispatch.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Dispatch.java,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** Dispatch.java 19 Mar 2003 21:14:30 -0000 1.51 --- Dispatch.java 20 Mar 2003 00:03:52 -0000 1.52 *************** *** 374,383 **** TypeConstructor[] tc1 = (TypeConstructor[])o1; TypeConstructor[] tc2 = (TypeConstructor[])o2; - if (tc1 == null) return -1; //these cases does happen - if (tc2 == null) return 1; //for some strange reason for(int i = 0; i<tc1.length; i++) { ! if (tc1[i] == null) return -1; if (tc2[i] == null) return 1; int a = tc1[i].getId(); --- 374,385 ---- TypeConstructor[] tc1 = (TypeConstructor[])o1; TypeConstructor[] tc2 = (TypeConstructor[])o2; for(int i = 0; i<tc1.length; i++) { ! if (tc1[i] == null) ! { ! if (tc2[i] == null) return 0; ! return -1; ! } if (tc2[i] == null) return 1; int a = tc1[i].getId(); |
From: <ar...@us...> - 2003-03-19 23:35:56
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv22539/F:/nice/debian Modified Files: changelog Log Message: Update changelog for my previous changes. Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.141 retrieving revision 1.142 diff -C2 -d -r1.141 -r1.142 *** changelog 14 Mar 2003 19:44:53 -0000 1.141 --- changelog 19 Mar 2003 23:35:52 -0000 1.142 *************** *** 1,4 **** --- 1,9 ---- nice (0.7.8) unstable; urgency=low + * Improved bytecode generation of pre\post-condition. + * Implemented the enhanced for loop(similar to java 1.5 proposal). + The loop works on arrays and collections, example: + int[] arr = [1,2,3,4,5]; + for (int i : arr) print(i); * Improved handling of nullness tests, as in: x != null && x.dereference() |
From: <ar...@us...> - 2003-03-19 21:19:52
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv25610/F:/nice/src/bossa/syntax Modified Files: Pattern.java Log Message: RFI Index: Pattern.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Pattern.java,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** Pattern.java 25 Feb 2003 19:52:35 -0000 1.41 --- Pattern.java 19 Mar 2003 21:19:47 -0000 1.42 *************** *** 382,385 **** --- 382,394 ---- } + //TODO: call this from methodbodydefition when the pattern has the same + //type as the the methoddeclaration + public void setAtAny() + { + // only set it to atAny if it's a @type pattern + if (atValue == null && !exactlyAt && !atIntValue) + tc = null; + } + /**************************************************************** * Printing |
From: <ar...@us...> - 2003-03-19 21:14:34
|
Update of /cvsroot/nice/Nice/src/bossa/link In directory sc8-pr-cvs1:/tmp/cvs-serv21415/F:/nice/src/bossa/link Modified Files: Alternative.java Dispatch.java Log Message: Don't dispatch-test duplicate tuples anymore. Index: Alternative.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Alternative.java,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** Alternative.java 25 Feb 2003 12:30:57 -0000 1.38 --- Alternative.java 19 Mar 2003 21:14:29 -0000 1.39 *************** *** 170,175 **** public Pattern[] getPatterns() { return patterns; } - boolean visiting; - /**************************************************************** * Regrouping alternatives per method --- 170,173 ---- Index: Dispatch.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/link/Dispatch.java,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** Dispatch.java 25 Feb 2003 12:30:58 -0000 1.50 --- Dispatch.java 19 Mar 2003 21:14:30 -0000 1.51 *************** *** 353,371 **** { LinkedList res = new LinkedList(); ! for (Iterator i = tuples.iterator(); i.hasNext();) ! add(res, flatten((TypeConstructor[]) i.next(), length)); ! return res; } ! private static void add(List tuples, TypeConstructor[] tags) { ! // FIXME ! // This implementation creates duplicate tuples ! tuples.add(tags); ! } /** Translates (nullTC, *) into nullTC and (sureTC, tc) into tc --- 353,398 ---- { LinkedList res = new LinkedList(); ! Set tupleSet = new TreeSet(tagComp); for (Iterator i = tuples.iterator(); i.hasNext();) ! { ! TypeConstructor[] tags = flatten((TypeConstructor[]) i.next(), length); ! //add only non duplicate tags ! if (tupleSet.add(tags)) ! res.add(tags); ! } return res; } ! private static Comparator tagComp = new TagComparator(); ! ! private static class TagComparator implements Comparator { ! public TagComparator(){} ! ! public int compare(Object o1, Object o2) ! { ! TypeConstructor[] tc1 = (TypeConstructor[])o1; ! TypeConstructor[] tc2 = (TypeConstructor[])o2; ! if (tc1 == null) return -1; //these cases does happen ! if (tc2 == null) return 1; //for some strange reason ! for(int i = 0; i<tc1.length; i++) ! { ! if (tc1[i] == null) return -1; ! if (tc2[i] == null) return 1; ! int a = tc1[i].getId(); ! int b = tc2[i].getId(); ! if (a<b) return -1; ! if (a>b) return 1; ! } ! return 0; ! } + public boolean equals(Object obj) + { + return false; + } + + } /** Translates (nullTC, *) into nullTC and (sureTC, tc) into tc *************** *** 378,382 **** { TypeConstructor[] res = new TypeConstructor[length]; - for (int i = length; --i >= 0 ;) if (tags[2 * i] == PrimitiveType.nullTC) --- 405,408 ---- |
From: <ar...@us...> - 2003-03-19 16:45:18
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1:/tmp/cvs-serv17953/F:/nice/stdlib/nice/lang/inline Modified Files: CompOp.java Log Message: Start of patches for generating better bytecode by reducing the number of branches. Index: CompOp.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/CompOp.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CompOp.java 1 Jun 2001 21:03:32 -0000 1.2 --- CompOp.java 19 Mar 2003 16:45:15 -0000 1.3 *************** *** 22,26 **** @author Daniel Bonniot */ ! public class CompOp extends Procedure2 implements Inlineable { private final static int --- 22,26 ---- @author Daniel Bonniot */ ! public class CompOp extends Procedure2 implements Inlineable,Branchable { private final static int *************** *** 108,111 **** --- 108,169 ---- } } + + /** + Jump to label <code>to</code> if the comparison is false. + */ + public void compileJumpNot (Compilation comp, Expression[] args, Label to) + { + CodeAttr code = comp.getCode(); + Target stack = new StackTarget(argType); + + args[0].compile(comp, stack); + args[1].compile(comp, stack); + + switch(kind){ + case Eq: code.emitGotoIfNE(to); break; + case Le: code.emitGotoIfGt(to); break; + case Ge: code.emitGotoIfLt(to); break; + case Lt: code.emitGotoIfGe(to); break; + case Gt: code.emitGotoIfLe(to); break; + case Ne: code.emitGotoIfEq(to); break; + } + } + + public void compileIf (Compilation comp, Expression[] args) + { + CodeAttr code = comp.getCode(); + Target stack = new StackTarget(argType); + + args[0].compile(comp, stack); + args[1].compile(comp, stack); + + switch(kind){ + case Eq: code.emitIfEq(); break; + case Le: code.emitIfLe(); break; + case Ge: code.emitIfGe(); break; + case Lt: code.emitIfLt(); break; + case Gt: code.emitIfGt(); break; + case Ne: code.emitIfNEq(); break; + } + } + + public void compileIfNot (Compilation comp, Expression[] args) + { + CodeAttr code = comp.getCode(); + Target stack = new StackTarget(argType); + + args[0].compile(comp, stack); + args[1].compile(comp, stack); + + switch(kind){ + case Eq: code.emitIfNEq(); break; + case Le: code.emitIfGt(); break; + case Ge: code.emitIfLt(); break; + case Lt: code.emitIfGe(); break; + case Gt: code.emitIfLe(); break; + case Ne: code.emitIfEq(); break; + } + } + private final PrimType argType; |
From: <ar...@us...> - 2003-03-19 16:45:18
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv17953/F:/nice/src/gnu/expr Modified Files: ApplyExp.java LoopExp.java Added Files: Branchable.java Log Message: Start of patches for generating better bytecode by reducing the number of branches. --- NEW FILE: Branchable.java --- package gnu.expr; import gnu.bytecode.Label; public interface Branchable extends Inlineable { /** Jump to label if the expression yields true. */ public void compileJump (Compilation comp, Expression[] args, Label to); /** Jump to label if the expression yields false. */ public void compileJumpNot (Compilation comp, Expression[] args, Label to); /** Creates an 'if' of the expression */ public void compileIf (Compilation comp, Expression[] args); /** Creates an 'if not' of the expression */ public void compileIfNot (Compilation comp, Expression[] args); } Index: ApplyExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/ApplyExp.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ApplyExp.java 10 Feb 2003 10:53:25 -0000 1.6 --- ApplyExp.java 19 Mar 2003 16:45:14 -0000 1.7 *************** *** 515,517 **** --- 515,529 ---- } } + + public Branchable getBranchable() + { + if (func instanceof QuoteExp) + { + Object proc = ((QuoteExp) func).getValue(); + if (proc instanceof Branchable) + return (Branchable)proc; + } + return null; + } + } Index: LoopExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/LoopExp.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** LoopExp.java 28 Jan 2002 20:36:54 -0000 1.6 --- LoopExp.java 19 Mar 2003 16:45:14 -0000 1.7 *************** *** 97,110 **** { ApplyExp app = (ApplyExp) ifExp; ! if (app.func instanceof QuoteExp) ! { ! Object proc = ((QuoteExp) app.func).getValue(); ! if (proc instanceof nice.lang.inline.CompOp) ! { ! nice.lang.inline.CompOp op = (nice.lang.inline.CompOp) proc; ! op.compileJump(comp, app.args, to); ! return; ! } ! } } --- 97,106 ---- { ApplyExp app = (ApplyExp) ifExp; ! Branchable branchOp = app.getBranchable(); ! if (branchOp != null) ! { ! branchOp.compileJump(comp, app.args, to); ! return; ! } } |
From: <ar...@us...> - 2003-03-19 13:48:59
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv20220/F:/nice/src/bossa/syntax Modified Files: Contract.java Log Message: rename contractAssert to alwaysAssert. Index: Contract.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Contract.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Contract.java 19 Mar 2003 00:45:16 -0000 1.2 --- Contract.java 19 Mar 2003 13:48:56 -0000 1.3 *************** *** 27,46 **** public void addRequire(Expression condition) { ! pre.add(CallExp.create(symbol("contractAssert", condition), condition)); } public void addRequire(Expression condition, Expression name) { ! pre.add(CallExp.create(symbol("contractAssert", condition), condition, name)); } public void addEnsure(Expression condition) { ! post.add(CallExp.create(symbol("contractAssert", condition), condition)); } public void addEnsure(Expression condition, Expression name) { ! post.add(CallExp.create(symbol("contractAssert", condition), condition, name)); } --- 27,46 ---- public void addRequire(Expression condition) { ! pre.add(CallExp.create(symbol("alwaysAssert", condition), condition)); } public void addRequire(Expression condition, Expression name) { ! pre.add(CallExp.create(symbol("alwaysAssert", condition), condition, name)); } public void addEnsure(Expression condition) { ! post.add(CallExp.create(symbol("alwaysAssert", condition), condition)); } public void addEnsure(Expression condition, Expression name) { ! post.add(CallExp.create(symbol("alwaysAssert", condition), condition, name)); } |
From: <ar...@us...> - 2003-03-19 13:48:59
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv20220/F:/nice/stdlib/nice/lang Modified Files: assertions.nice Log Message: rename contractAssert to alwaysAssert. Index: assertions.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/assertions.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** assertions.nice 19 Mar 2003 00:45:17 -0000 1.3 --- assertions.nice 19 Mar 2003 13:48:56 -0000 1.4 *************** *** 13,19 **** inline nice.lang.inline.Assert(); ! void `contractAssert`(boolean condition) = inline nice.lang.inline.Assert("contract"); ! void `contractAssert`(boolean condition, String message) = inline nice.lang.inline.Assert("contract"); --- 13,19 ---- inline nice.lang.inline.Assert(); ! void `alwaysAssert`(boolean condition) = inline nice.lang.inline.Assert("contract"); ! void `alwaysAssert`(boolean condition, String message) = inline nice.lang.inline.Assert("contract"); |
From: <ar...@us...> - 2003-03-19 00:45:20
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv18292/F:/nice/src/bossa/syntax Modified Files: Contract.java Log Message: Generating better bytecode for pre/post-conditions i.e. no duplicate checks whether assertions are turned on or not. Index: Contract.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Contract.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Contract.java 25 Oct 2002 13:06:07 -0000 1.1 --- Contract.java 19 Mar 2003 00:45:16 -0000 1.2 *************** *** 27,46 **** public void addRequire(Expression condition) { ! pre.add(CallExp.create(symbol("assert", condition), condition)); } public void addRequire(Expression condition, Expression name) { ! pre.add(CallExp.create(symbol("assert", condition), condition, name)); } public void addEnsure(Expression condition) { ! post.add(CallExp.create(symbol("assert", condition), condition)); } public void addEnsure(Expression condition, Expression name) { ! post.add(CallExp.create(symbol("assert", condition), condition, name)); } --- 27,46 ---- public void addRequire(Expression condition) { ! pre.add(CallExp.create(symbol("contractAssert", condition), condition)); } public void addRequire(Expression condition, Expression name) { ! pre.add(CallExp.create(symbol("contractAssert", condition), condition, name)); } public void addEnsure(Expression condition) { ! post.add(CallExp.create(symbol("contractAssert", condition), condition)); } public void addEnsure(Expression condition, Expression name) { ! post.add(CallExp.create(symbol("contractAssert", condition), condition, name)); } |
From: <ar...@us...> - 2003-03-19 00:45:20
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1:/tmp/cvs-serv18292/F:/nice/stdlib/nice/lang/inline Modified Files: Assert.java Log Message: Generating better bytecode for pre/post-conditions i.e. no duplicate checks whether assertions are turned on or not. Index: Assert.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/Assert.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Assert.java 25 Oct 2002 13:06:06 -0000 1.2 --- Assert.java 19 Mar 2003 00:45:17 -0000 1.3 *************** *** 29,38 **** public class Assert extends ProcedureN implements Inlineable { public static Assert create(String param) { ! return instance; } ! private static Assert instance = new Assert(); public void compile (ApplyExp exp, Compilation comp, Target target) --- 29,48 ---- public class Assert extends ProcedureN implements Inlineable { + public Assert(boolean assertEnableCheck) + { + this.assertEnableCheck = assertEnableCheck; + } + public static Assert create(String param) { ! if (param == null) ! return instance; ! return contractInstance; } + + private boolean assertEnableCheck; ! private static Assert instance = new Assert(true); ! private static Assert contractInstance = new Assert(false); public void compile (ApplyExp exp, Compilation comp, Target target) *************** *** 42,47 **** Label end = new Label(code); ! code.ifAssertionsDisabledGoto ! (((ClassExp)comp.topLambda).getAssertionEnabledField(), end); args[0].compile(comp, Type.boolean_type); --- 52,58 ---- Label end = new Label(code); ! if (this.assertEnableCheck) ! code.ifAssertionsDisabledGoto ! (((ClassExp)comp.topLambda).getAssertionEnabledField(), end); args[0].compile(comp, Type.boolean_type); |
From: <ar...@us...> - 2003-03-19 00:45:20
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang In directory sc8-pr-cvs1:/tmp/cvs-serv18292/F:/nice/stdlib/nice/lang Modified Files: assertions.nice Log Message: Generating better bytecode for pre/post-conditions i.e. no duplicate checks whether assertions are turned on or not. Index: assertions.nice =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/assertions.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** assertions.nice 11 Oct 2002 12:09:41 -0000 1.2 --- assertions.nice 19 Mar 2003 00:45:17 -0000 1.3 *************** *** 12,13 **** --- 12,19 ---- void `assert`(boolean condition, String message) = inline nice.lang.inline.Assert(); + + void `contractAssert`(boolean condition) = + inline nice.lang.inline.Assert("contract"); + + void `contractAssert`(boolean condition, String message) = + inline nice.lang.inline.Assert("contract"); |
From: <ar...@us...> - 2003-03-19 00:45:20
|
Update of /cvsroot/nice/Nice/src/gnu/bytecode In directory sc8-pr-cvs1:/tmp/cvs-serv18292/F:/nice/src/gnu/bytecode Modified Files: CodeAttr.java Log Message: Generating better bytecode for pre/post-conditions i.e. no duplicate checks whether assertions are turned on or not. Index: CodeAttr.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/bytecode/CodeAttr.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CodeAttr.java 19 Nov 2002 15:54:11 -0000 1.12 --- CodeAttr.java 19 Mar 2003 00:45:16 -0000 1.13 *************** *** 1630,1635 **** { callFinallyBlocks(); ! checkPostcondition(); ! emitRealReturn(); } --- 1630,1635 ---- { callFinallyBlocks(); ! if (!checkPostcondition()) ! emitRealReturn(); } *************** *** 2366,2392 **** ****************************************************************/ ! public void preparePostcondition(Field assertionEnabled) { this.assertionEnabled = assertionEnabled; ! postconditionStart = new Label(this); } public void startPostcondition() { postconditionStart.define(this); Type type = getMethod().getReturnType(); if (! type.isVoid()) ! { ! // We expect the returned value on the stack. ! pushType(type); ! resultVar = addLocal(type); ! emitStore(resultVar); ! } } public void endPostcondition() { if (resultVar != null) loadResult(); emitRealReturn(); } --- 2366,2416 ---- ****************************************************************/ ! public void preparePostcondition(Field assertionEnabled, boolean hasPostCond) { this.assertionEnabled = assertionEnabled; ! if (hasPostCond) ! postconditionStart = new Label(this); ! } ! ! public void startPrecondition() ! { ! preconditionEnd = new Label(this); ! ifAssertionsDisabledGoto(assertionEnabled, preconditionEnd); ! } ! ! public void endPrecondition() ! { ! preconditionEnd.define(this); } public void startPostcondition() { + postconditionEnd = new Label(this); postconditionStart.define(this); Type type = getMethod().getReturnType(); if (! type.isVoid()) ! { ! // We expect the returned value on the stack. ! pushType(type); ! ifAssertionsDisabledGoto(assertionEnabled, postconditionEnd); ! resultVar = addLocal(type); ! emitStore(resultVar); ! } ! else ! ifAssertionsDisabledGoto(assertionEnabled, postconditionEnd); ! } ! ! public void pushRetType(){ ! Type type = getMethod().getReturnType(); ! if (! type.isVoid()) ! pushType(type); } + public void endPostcondition() { if (resultVar != null) loadResult(); + postconditionEnd.define(this); emitRealReturn(); } *************** *** 2397,2409 **** } ! void checkPostcondition() { if (postconditionStart == null) ! return; ! ! Label end = new Label(this); ! ifAssertionsDisabledGoto(assertionEnabled, end); emitGoto(postconditionStart); ! end.define(this); } --- 2421,2430 ---- } ! boolean checkPostcondition() { if (postconditionStart == null) ! return false; emitGoto(postconditionStart); ! return true; } *************** *** 2414,2418 **** } ! private Label postconditionStart, postCondtionEnd; private Variable resultVar; private Field assertionEnabled; --- 2435,2439 ---- } ! private Label postconditionStart, postconditionEnd, preconditionEnd; private Variable resultVar; private Field assertionEnabled; |
From: <ar...@us...> - 2003-03-19 00:45:19
|
Update of /cvsroot/nice/Nice/src/gnu/expr In directory sc8-pr-cvs1:/tmp/cvs-serv18292/F:/nice/src/gnu/expr Modified Files: CheckContract.java Log Message: Generating better bytecode for pre/post-conditions i.e. no duplicate checks whether assertions are turned on or not. Index: CheckContract.java =================================================================== RCS file: /cvsroot/nice/Nice/src/gnu/expr/CheckContract.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CheckContract.java 24 Jan 2003 12:26:50 -0000 1.2 --- CheckContract.java 19 Mar 2003 00:45:16 -0000 1.3 *************** *** 41,56 **** CodeAttr code = comp.getCode(); ClassExp currentClass = (ClassExp)comp.topLambda; ! code.preparePostcondition(currentClass.getAssertionEnabledField()); ! for (int i = 0; i < pre.length; i++) ! pre[i].compileWithPosition(comp, Target.Ignore); body.compileWithPosition(comp, target); ! code.startPostcondition(); ! for (int i = 0; i < post.length; i++) ! post[i].compileWithPosition(comp, Target.Ignore); ! ! code.endPostcondition(); } --- 41,67 ---- CodeAttr code = comp.getCode(); ClassExp currentClass = (ClassExp)comp.topLambda; ! code.preparePostcondition(currentClass.getAssertionEnabledField(), post.length>0); ! if (pre.length > 0) ! { ! code.startPrecondition(); ! for (int i = 0; i < pre.length; i++) ! pre[i].compileWithPosition(comp, Target.Ignore); ! code.endPrecondition(); ! } body.compileWithPosition(comp, target); + + if (post.length > 0) + { + code.startPostcondition(); + for (int i = 0; i < post.length; i++) + post[i].compileWithPosition(comp, Target.Ignore); ! code.endPostcondition(); ! } ! else ! code.pushRetType(); ! } |
From: <bo...@us...> - 2003-03-18 09:40:56
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1:/tmp/cvs-serv31492/src/nice/tools/testsuite Modified Files: TestNice.java Log Message: Save each non-fixed known bug in a separate failure directory. Index: TestNice.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestNice.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** TestNice.java 16 Mar 2003 19:21:44 -0000 1.21 --- TestNice.java 18 Mar 2003 09:40:50 -0000 1.22 *************** *** 273,277 **** */ static void moveFilesToFailFolder() { ! File folder = new File(_failFolder, "" + _testCasesFailed); _tempFolder.renameTo(folder); --- 273,278 ---- */ static void moveFilesToFailFolder() { ! File folder = new File(_failFolder, "" + ! (_testCasesFailed + _testCasesKnownBug)); _tempFolder.renameTo(folder); |
From: <ar...@us...> - 2003-03-17 22:48:59
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1:/tmp/cvs-serv23646/F:/nice/src/nice/tools/testsuite Modified Files: TestCase.java Log Message: fix printing in bug case. Index: TestCase.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestCase.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** TestCase.java 16 Mar 2003 19:21:45 -0000 1.19 --- TestCase.java 17 Mar 2003 22:48:56 -0000 1.20 *************** *** 396,402 **** */ public void fail() { ! if (isKnownBug) TestNice.increaseKnownBug(); ! else { TestNice.increaseFailed(); --- 396,403 ---- */ public void fail() { ! if (isKnownBug) { TestNice.increaseKnownBug(); ! TestNice.getOutput().endTestCase(true); ! } else { TestNice.increaseFailed(); |
From: <bo...@us...> - 2003-03-17 20:12:18
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv9380/src/bossa/syntax Modified Files: TupleExp.java Log Message: Correctly handle nested tuples involving primitive subtyping. Index: TupleExp.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/TupleExp.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TupleExp.java 7 Oct 2002 14:00:37 -0000 1.15 --- TupleExp.java 17 Mar 2003 20:11:43 -0000 1.16 *************** *** 82,85 **** --- 82,86 ---- } + private Monotype[] components; private Monotype[] expectedComponents; *************** *** 90,104 **** Constraint cst = Constraint.and(Polytype.getConstraint(types), null, null); ! Monotype[] components = Polytype.getMonotype(types); TupleType tupleType = new TupleType(components); Types.setBytecodeType(components); ! this.componentType = Types.lowestCommonSupertype ! (expectedComponents != null ? expectedComponents : components); type = new Polytype(cst, bossa.syntax.Monotype.sure(tupleType)); } - private Type componentType; - /**************************************************************** * Code generation --- 91,103 ---- Constraint cst = Constraint.and(Polytype.getConstraint(types), null, null); ! components = Polytype.getMonotype(types); TupleType tupleType = new TupleType(components); Types.setBytecodeType(components); ! if (expectedComponents == null) ! expectedComponents = components; type = new Polytype(cst, bossa.syntax.Monotype.sure(tupleType)); } /**************************************************************** * Code generation *************** *** 107,117 **** protected gnu.expr.Expression compile() { ! // force computation of componentType getType(); int len = expressions.length; ! return new gnu.expr.ApplyExp ! (new nice.tools.code.LiteralArrayProc(new ArrayType(componentType), len), bossa.syntax.Expression.compile(expressions)); } --- 106,121 ---- protected gnu.expr.Expression compile() { ! // Force computation of the component types. getType(); int len = expressions.length; ! /* ! We base the array type on the expected type, but we record the ! real type of the components. ! */ ! return nice.tools.code.TupleType.createExp ! (Types.lowestCommonSupertype(expectedComponents), ! Types.javaType(components), bossa.syntax.Expression.compile(expressions)); } *************** *** 119,125 **** gnu.expr.Expression compileAssign(gnu.expr.Expression array) { - // force computation of componentType - getType(); - int len = expressions.length; --- 123,126 ---- *************** *** 127,130 **** --- 128,136 ---- Expression tupleExp; + Type arrayType = array.getType(); + nice.tools.code.TupleType tupleType = null; + if (arrayType instanceof nice.tools.code.TupleType) + tupleType = (nice.tools.code.TupleType) arrayType; + // if array is a complex expression, // we have to evaluate it and store the result *************** *** 134,138 **** let = new LetExp(new Expression[]{array}); Declaration tupleDecl = let.addDeclaration ! ("tupleRef", ArrayType.make(componentType)); //FIXME: CanRead should be set automatically. --- 140,144 ---- let = new LetExp(new Expression[]{array}); Declaration tupleDecl = let.addDeclaration ! ("tupleRef", arrayType); //FIXME: CanRead should be set automatically. *************** *** 145,153 **** Expression[] stmts = new Expression[len]; for (int i=0; i<len; i++) ! stmts[i] = expressions[i].compileAssign ! (new ApplyExp(new nice.lang.inline.ArrayGetOp(componentType), ! new Expression[]{ ! tupleExp, ! intExp(i)})); if (let != null) --- 151,163 ---- Expression[] stmts = new Expression[len]; for (int i=0; i<len; i++) ! { ! Expression value = new ApplyExp ! (new nice.lang.inline.ArrayGetOp(null), ! new Expression[]{ tupleExp, intExp(i)}); ! if (tupleType != null) ! value = nice.tools.code.EnsureTypeProc.ensure(value, tupleType.componentTypes[i]); ! ! stmts[i] = expressions[i].compileAssign(value); ! } if (let != null) |
From: <bo...@us...> - 2003-03-17 20:12:15
|
Update of /cvsroot/nice/Nice/stdlib/nice/lang/inline In directory sc8-pr-cvs1:/tmp/cvs-serv9380/stdlib/nice/lang/inline Modified Files: ArrayGetOp.java Log Message: Correctly handle nested tuples involving primitive subtyping. Index: ArrayGetOp.java =================================================================== RCS file: /cvsroot/nice/Nice/stdlib/nice/lang/inline/ArrayGetOp.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ArrayGetOp.java 27 Nov 2001 17:57:36 -0000 1.3 --- ArrayGetOp.java 17 Mar 2003 20:11:40 -0000 1.4 *************** *** 36,47 **** } public ArrayGetOp(Type type) { this.type = type; ! arrayTarget = new StackTarget(nice.tools.code.SpecialTypes.array(type)); } private final Type type; ! private final StackTarget arrayTarget; public void compile (ApplyExp exp, Compilation comp, Target target) --- 36,54 ---- } + /** + @param type The expected component type of the array, or null to keep + it unconstrained. + */ public ArrayGetOp(Type type) { this.type = type; ! if (type != null) ! arrayTarget = new StackTarget(nice.tools.code.SpecialTypes.array(type)); ! else ! arrayTarget = StackTarget.pushObject; } private final Type type; ! private final Target arrayTarget; public void compile (ApplyExp exp, Compilation comp, Target target) *************** *** 74,78 **** // If not (possible with polymorphism) the base type is a safe bet ! return type; } --- 81,88 ---- // If not (possible with polymorphism) the base type is a safe bet ! if (type != null) ! return type; ! ! return Type.pointer_type; } |
From: <bo...@us...> - 2003-03-17 20:12:14
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/tuples In directory sc8-pr-cvs1:/tmp/cvs-serv9380/testsuite/compiler/expressions/tuples Modified Files: compilation.testsuite Log Message: Correctly handle nested tuples involving primitive subtyping. Index: compilation.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/tuples/compilation.testsuite,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** compilation.testsuite 16 Mar 2003 19:26:45 -0000 1.5 --- compilation.testsuite 17 Mar 2003 20:11:40 -0000 1.6 *************** *** 25,29 **** ?(int,int) res = mapTest.get("test"); ! /// PASS bug ! (int,int) ints; ! (String s, ints) = ("A", (1,2)); --- 25,45 ---- ?(int,int) res = mapTest.get("test"); ! /// PASS ! (long,long) longs; ! (byte,byte) bytes = (1,2); ! (longs, longs) = (bytes, bytes); ! (long i, long j) = longs; ! i += j; ! ! /// PASS ! (long,long) longs; ! (byte,byte) bytes = (1,2); ! (String s, longs) = ("A", bytes); ! (long i, long j) = longs; ! i += j; ! ! /// PASS ! (long,long) longs; ! (String s, longs) = ("A", (1,2)); ! (long i, long j) = longs; ! i += j; |
From: <bo...@us...> - 2003-03-17 20:11:50
|
Update of /cvsroot/nice/Nice/src/nice/tools/code In directory sc8-pr-cvs1:/tmp/cvs-serv9380/src/nice/tools/code Modified Files: Types.java Added Files: TupleType.java Log Message: Correctly handle nested tuples involving primitive subtyping. --- NEW FILE: TupleType.java --- /**************************************************************************/ /* N I C E */ /* A high-level object-oriented research language */ /* (c) Daniel Bonniot 2002 */ /* */ /* This program is free software; you can redistribute it and/or modify */ /* it under the terms of the GNU General Public License as published by */ /* the Free Software Foundation; either version 2 of the License, or */ /* (at your option) any later version. */ /* */ /**************************************************************************/ package nice.tools.code; /** The bytecode type of a tuple. @version $Date: 2003/03/17 20:11:42 $ @author Daniel Bonniot (bo...@us...) */ import gnu.bytecode.*; public class TupleType extends ArrayType { TupleType (Type arrayType, Type[] componentTypes) { super (arrayType); this.componentTypes = componentTypes; } TupleType (Type[] componentTypes) { this(Types.lowestCommonSupertype(componentTypes), componentTypes); } public Type[] componentTypes; public static gnu.expr.Expression createExp (Type arrayType, Type[] componentTypes, gnu.expr.Expression[] components) { return new gnu.expr.ApplyExp (new nice.tools.code.LiteralArrayProc (new TupleType(arrayType, componentTypes), components.length), components); } } Index: Types.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/code/Types.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** Types.java 13 Mar 2003 23:33:45 -0000 1.47 --- Types.java 17 Mar 2003 20:11:41 -0000 1.48 *************** *** 78,83 **** m = equivalent(m); ! if (m instanceof TupleType) ! setBytecodeType(((TupleType) m).getComponents()); TypeConstructor tc = m.head(); --- 78,83 ---- m = equivalent(m); ! if (m instanceof mlsub.typing.TupleType) ! setBytecodeType(((mlsub.typing.TupleType) m).getComponents()); TypeConstructor tc = m.head(); *************** *** 176,182 **** return res; ! if (m instanceof TupleType) ! // not SpecialArray ! return ArrayType.make(componentType((TupleType) m)); if (m instanceof FunType) --- 176,181 ---- return res; ! if (m instanceof mlsub.typing.TupleType) ! return new TupleType(javaType(((mlsub.typing.TupleType) m).getComponents())); if (m instanceof FunType) *************** *** 211,220 **** } - /** Returns the common bytecode type used for elements of this tuple. */ - public static Type componentType(TupleType t) - { - return lowestCommonSupertype(t.getComponents()); - } - /** @return the most precise bytecode type able to store values of the given --- 210,213 ---- *************** *** 226,229 **** --- 219,234 ---- for (int i = 1; res!=null && i<types.length; i++) res = Type.lowestCommonSuperType(res, javaType(types[i])); + + if (res == null) + return Type.pointer_type; + else + return res; + } + + static Type lowestCommonSupertype(Type[] types) + { + Type res = types[0]; + for (int i = 1; res != null && i < types.length; i++) + res = Type.lowestCommonSuperType(res, types[i]); if (res == null) |
From: <bo...@us...> - 2003-03-16 19:26:48
|
Update of /cvsroot/nice/Nice/testsuite/compiler/expressions/tuples In directory sc8-pr-cvs1:/tmp/cvs-serv8324/testsuite/compiler/expressions/tuples Modified Files: compilation.testsuite Log Message: Literal tuple with primitive values, used in an assignment to a nested tuple, involving primitive subtyping. Index: compilation.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/expressions/tuples/compilation.testsuite,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** compilation.testsuite 1 Mar 2003 00:58:27 -0000 1.4 --- compilation.testsuite 16 Mar 2003 19:26:45 -0000 1.5 *************** *** 24,25 **** --- 24,29 ---- mapTest.put("test", (1,2)); ?(int,int) res = mapTest.get("test"); + + /// PASS bug + (int,int) ints; + (String s, ints) = ("A", (1,2)); |
From: <bo...@us...> - 2003-03-16 19:21:47
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite In directory sc8-pr-cvs1:/tmp/cvs-serv5999/src/nice/tools/testsuite Modified Files: TestSuite.java TestNice.java TestCase.java Log Message: Allow test cases to be marked as known bugs with /// PASS bug and /// FAIL bug. When they fail, their source code is not written, and they are not counted as regressions. This allows to commit test cases for known bugs before a fix is made, while still easily spotting regressions. Index: TestSuite.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestSuite.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TestSuite.java 19 Feb 2003 18:30:20 -0000 1.13 --- TestSuite.java 16 Mar 2003 19:21:44 -0000 1.14 *************** *** 166,176 **** private TestCase createTestCase(String line) throws TestSuiteException { String type = line.substring(TestNice.KEYWORD_SIGN.length()).trim(); ! if (TESTCASE_TYPE_PASS.equalsIgnoreCase(type)) ! return new PassTestCase(this); else if (TESTCASE_TYPE_FAIL.equalsIgnoreCase(type)) ! return new FailTestCase(this); ! throw new TestSuiteException("Unknown testcase type: " + type); } --- 166,187 ---- private TestCase createTestCase(String line) throws TestSuiteException { String type = line.substring(TestNice.KEYWORD_SIGN.length()).trim(); ! ! boolean isKnownBug = false; ! if (type.endsWith("bug")) ! { ! isKnownBug = true; ! type = type.substring(0, type.length() - "bug".length()).trim(); ! } ! ! TestCase res; if (TESTCASE_TYPE_PASS.equalsIgnoreCase(type)) ! res = new PassTestCase(this); else if (TESTCASE_TYPE_FAIL.equalsIgnoreCase(type)) ! res = new FailTestCase(this); ! else ! throw new TestSuiteException("Unknown testcase type: " + type); ! res.isKnownBug = isKnownBug; ! return res; } Index: TestNice.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestNice.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** TestNice.java 19 Feb 2003 18:30:25 -0000 1.20 --- TestNice.java 16 Mar 2003 19:21:44 -0000 1.21 *************** *** 121,124 **** --- 121,128 ---- private static int _testCasesWarning = 0; + private static int _testCasesKnownBug = 0; + + private static int _testCasesFixed = 0; + /** * The Output where log statements should be written. *************** *** 394,397 **** --- 398,409 ---- } + public static void increaseKnownBug() { + ++_testCasesKnownBug; + } + + public static void increaseFixed() { + ++_testCasesFixed; + } + *************** *** 416,419 **** --- 428,441 ---- /** + * Returns the total number of testcases. + * + */ + static public int getTotalTestCases() { + return _testCasesSucceeded + _testCasesFailed + _testCasesWarning + + _testCasesKnownBug + _testCasesFixed; + } + + + /** * Returns the number of succeded testcases. * *************** *** 438,441 **** --- 460,471 ---- static public int getTestCasesWarning() { return _testCasesWarning; + } + + static public int getTestCasesKnownBug() { + return _testCasesKnownBug; + } + + static public int getTestCasesFixed() { + return _testCasesFixed; } Index: TestCase.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/TestCase.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** TestCase.java 21 Feb 2003 15:17:52 -0000 1.18 --- TestCase.java 16 Mar 2003 19:21:45 -0000 1.19 *************** *** 31,35 **** * @version $Id$ */ ! public class TestCase { /** * Compiler message --- 31,35 ---- * @version $Id$ */ ! public abstract class TestCase { /** * Compiler message *************** *** 100,103 **** --- 100,104 ---- + boolean isKnownBug; *************** *** 383,387 **** */ public void pass() { ! TestNice.increaseSucceeded(); TestNice.getOutput().endTestCase(true); } --- 384,391 ---- */ public void pass() { ! if (isKnownBug) ! TestNice.increaseFixed(); ! else ! TestNice.increaseSucceeded(); TestNice.getOutput().endTestCase(true); } *************** *** 392,404 **** */ public void fail() { ! TestNice.increaseFailed(); ! ! // log the sources ! printSources(); ! ! // compiler messages ! TestNice.getOutput().log("nicec", getCompilerMessages()); ! TestNice.getOutput().endTestCase(false); ! // move contents of temp folder to a new folder in the fail folder TestNice.moveFilesToFailFolder(); --- 396,412 ---- */ public void fail() { ! if (isKnownBug) ! TestNice.increaseKnownBug(); ! else { ! TestNice.increaseFailed(); ! ! // log the sources ! printSources(); ! ! // compiler messages ! TestNice.getOutput().log("nicec", getCompilerMessages()); ! TestNice.getOutput().endTestCase(false); ! } ! // move contents of temp folder to a new folder in the fail folder TestNice.moveFilesToFailFolder(); |
From: <bo...@us...> - 2003-03-16 19:21:47
|
Update of /cvsroot/nice/Nice/src/nice/tools/testsuite/output In directory sc8-pr-cvs1:/tmp/cvs-serv5999/src/nice/tools/testsuite/output Modified Files: TextOutput.java Log Message: Allow test cases to be marked as known bugs with /// PASS bug and /// FAIL bug. When they fail, their source code is not written, and they are not counted as regressions. This allows to commit test cases for known bugs before a fix is made, while still easily spotting regressions. Index: TextOutput.java =================================================================== RCS file: /cvsroot/nice/Nice/src/nice/tools/testsuite/output/TextOutput.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** TextOutput.java 7 Sep 2002 21:05:04 -0000 1.4 --- TextOutput.java 16 Mar 2003 19:21:44 -0000 1.5 *************** *** 84,91 **** log("test engine finished"); log(""); ! log("number of testcases: " + (TestNice.getTestCasesSucceeded() + TestNice.getTestCasesFailed())); ! log(" succeeded: " + TestNice.getTestCasesSucceeded()); ! log(" failed : " + TestNice.getTestCasesFailed()); ! log(" warnings : " + TestNice.getTestCasesWarning()); logAndFlush(""); } --- 84,95 ---- log("test engine finished"); log(""); ! log("number of testcases: " + (TestNice.getTotalTestCases())); ! log(" successes : " + TestNice.getTestCasesSucceeded()); ! log(" regressions: " + TestNice.getTestCasesFailed()); ! log(" warnings : " + TestNice.getTestCasesWarning()); ! log(" known bugs : " + TestNice.getTestCasesKnownBug()); ! if (TestNice.getTestCasesFixed() > 0) ! log(" FIXES :-)) : " + TestNice.getTestCasesFixed()); ! logAndFlush(""); } |
From: <bo...@us...> - 2003-03-14 19:45:24
|
Update of /cvsroot/nice/Nice/testsuite/compiler/typing In directory sc8-pr-cvs1:/tmp/cvs-serv27461/testsuite/compiler/typing Modified Files: polymorphism.testsuite Log Message: When computing the type depends on the context (null tests), only force it to be computed if it has not already been (typecheck computes types in some cases, especially function calls). Index: polymorphism.testsuite =================================================================== RCS file: /cvsroot/nice/Nice/testsuite/compiler/typing/polymorphism.testsuite,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** polymorphism.testsuite 1 Aug 2002 00:25:29 -0000 1.3 --- polymorphism.testsuite 14 Mar 2003 19:44:50 -0000 1.4 *************** *** 21,22 **** --- 21,44 ---- m(x) = 0; m(c@Collection) = c.size(); + + /// PASS + /// Toplevel + class A{} + + A[?] foo() + { + return (true) ? null : fill(new A[0], int i => new A()); + } + + /// PASS + /// Toplevel + + // Variation on the previous case. + class A{} + + <T, U | T <: U, U <: T> U[] poly(T[] x) = x; + + A[?] foo() + { + return (true) ? null : poly(new A[0]); + } |
From: <bo...@us...> - 2003-03-14 19:44:59
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv27461/src/bossa/syntax Modified Files: typecheck.nice Log Message: When computing the type depends on the context (null tests), only force it to be computed if it has not already been (typecheck computes types in some cases, especially function calls). Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** typecheck.nice 13 Mar 2003 23:19:41 -0000 1.55 --- typecheck.nice 14 Mar 2003 19:44:51 -0000 1.56 *************** *** 117,121 **** typecheck(args.getExp(1)); ! args.getExp(1).computeType(); } finally { --- 117,121 ---- typecheck(args.getExp(1)); ! args.getExp(1).getType(); } finally { *************** *** 148,152 **** typecheck(args.getExp(1)); ! args.getExp(1).computeType(); } finally { --- 148,152 ---- typecheck(args.getExp(1)); ! args.getExp(1).getType(); } finally { *************** *** 381,385 **** // since the type of the variable is destructively changed, // it is important to compute the branch's type and to store it now. ! thenExp.computeType(); enterElse(); --- 381,385 ---- // since the type of the variable is destructively changed, // it is important to compute the branch's type and to store it now. ! thenExp.getType(); enterElse(); *************** *** 396,400 **** // since the type of the variable is destructively changed, // it is important to compute the branch's type and to store it now. ! elseExp.computeType(); } --- 396,400 ---- // since the type of the variable is destructively changed, // it is important to compute the branch's type and to store it now. ! elseExp.getType(); } |
From: <bo...@us...> - 2003-03-14 19:44:59
|
Update of /cvsroot/nice/Nice/debian In directory sc8-pr-cvs1:/tmp/cvs-serv27461/debian Modified Files: changelog Log Message: When computing the type depends on the context (null tests), only force it to be computed if it has not already been (typecheck computes types in some cases, especially function calls). Index: changelog =================================================================== RCS file: /cvsroot/nice/Nice/debian/changelog,v retrieving revision 1.140 retrieving revision 1.141 diff -C2 -d -r1.140 -r1.141 *** changelog 14 Mar 2003 14:10:48 -0000 1.140 --- changelog 14 Mar 2003 19:44:53 -0000 1.141 *************** *** 12,15 **** --- 12,16 ---- * Allow nested tuples on the left side of a tuple assignment: (String a, (String b, String c)) = ("a", ("b", "c")); + * Bugfixes. -- |