Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1:/tmp/cvs-serv10304/F:/nice/src/bossa/syntax
Modified Files:
LoopStmt.java
Log Message:
Type declaration in enhanced for loop is now optional.
Index: LoopStmt.java
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/LoopStmt.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** LoopStmt.java 24 Jun 2003 15:28:19 -0000 1.16
--- LoopStmt.java 8 Aug 2003 21:47:57 -0000 1.17
***************
*** 44,57 ****
public static Statement forInLoop(Monotype vartype, LocatedString var, Location loc, Expression container, Statement body)
{
! Monotype itertype;
LocatedString iter;
Expression getiter,iterexp,cond,getvar;
Statement loop,init,assign;
! List tparams = new ArrayList(1);
! tparams.add(vartype);
! itertype = new MonotypeConstructor(new TypeIdent(new LocatedString("Iterator", loc)),
new TypeParameters(tparams), loc);
! itertype.nullness = Monotype.sure;
getiter = CallExp.create(new IdentExp(new LocatedString("forIterator", loc)), container);
iter = new LocatedString(loc.uniqueIdentifier("for_in_iter_"), loc);
--- 44,61 ----
public static Statement forInLoop(Monotype vartype, LocatedString var, Location loc, Expression container, Statement body)
{
! Monotype itertype = null;
LocatedString iter;
Expression getiter,iterexp,cond,getvar;
Statement loop,init,assign;
! if (vartype != null)
! {
! List tparams = new ArrayList(1);
! tparams.add(vartype);
! itertype = new MonotypeConstructor(new TypeIdent(new LocatedString("Iterator", loc)),
new TypeParameters(tparams), loc);
! itertype.nullness = Monotype.sure;
! }
!
getiter = CallExp.create(new IdentExp(new LocatedString("forIterator", loc)), container);
iter = new LocatedString(loc.uniqueIdentifier("for_in_iter_"), loc);
|