[Nice-commit] Nice/src/bossa/syntax MonoSymbol.java,1.24,1.25 tools.nice,1.27,1.28 typecheck.nice,1.
Brought to you by:
bonniot
From: <ar...@us...> - 2003-11-20 00:33:20
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1:/tmp/cvs-serv23539/F:/nice/src/bossa/syntax Modified Files: MonoSymbol.java tools.nice typecheck.nice Log Message: No type inference on captured variables. Index: MonoSymbol.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/MonoSymbol.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** MonoSymbol.java 28 Aug 2003 08:46:32 -0000 1.24 --- MonoSymbol.java 20 Nov 2003 00:32:41 -0000 1.25 *************** *** 32,35 **** --- 32,36 ---- super(name); this.syntacticType=type; + this.captured = false; } *************** *** 38,41 **** --- 39,43 ---- super(name); this.type = type; + this.captured = false; } *************** *** 158,161 **** --- 160,165 ---- return type+" "+name; } + + boolean captured; Monotype syntacticType; Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** tools.nice 28 Oct 2003 14:04:50 -0000 1.27 --- tools.nice 20 Nov 2003 00:32:41 -0000 1.28 *************** *** 50,54 **** return null; ! return cast(e.getSymbol()); } return null; --- 50,58 ---- return null; ! // no type inference on captured varibles ! if (sym.captured) ! return null; ! ! return sym; } return null; *************** *** 98,110 **** return null; ! Expression arg1 = condition.arguments.getExp(0); ! if (! (arg1 instanceof SymbolExp)) ! return null; ! SymbolExp symExp = cast(arg1); ! if (! (symExp.getSymbol() instanceof MonoSymbol)) return null; - - MonoSymbol sym = cast(symExp.getSymbol()); Expression arg2 = condition.arguments.getExp(1); --- 102,109 ---- return null; ! ?MonoSymbol sym = localVariable(condition.arguments.getExp(0)); ! if (sym == null) return null; Expression arg2 = condition.arguments.getExp(1); Index: typecheck.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/typecheck.nice,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** typecheck.nice 8 Nov 2003 14:59:48 -0000 1.83 --- typecheck.nice 20 Nov 2003 00:32:41 -0000 1.84 *************** *** 42,45 **** --- 42,47 ---- let variable = localVariable(to); + if (variable != null && Node.getCurrentFunction() instanceof FunExp) + variable.captured = true; try{ |