[Nice-commit] Nice/src/bossa/syntax constraint.nice,1.3,1.4
Brought to you by:
bonniot
|
From: Daniel B. <bo...@us...> - 2005-04-09 09:24:52
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27541/src/bossa/syntax Modified Files: constraint.nice Log Message: Whitespace cleanup and reindent. Index: constraint.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constraint.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** constraint.nice 16 Jan 2005 00:28:21 -0000 1.3 --- constraint.nice 9 Apr 2005 09:24:43 -0000 1.4 *************** *** 17,21 **** /** A list of binders + atomic constraints. ! @see AtomicConstraint --- 17,21 ---- /** A list of binders + atomic constraints. ! @see AtomicConstraint *************** *** 34,40 **** return createConstraint(new ArrayList(binders), new ArrayList(atomics)); } ! mlsub.typing.Constraint resolveToLowlevel() ! { return mlsub.typing.Constraint.create( binders.isEmpty() ? null : binders.toArray(), --- 34,40 ---- return createConstraint(new ArrayList(binders), new ArrayList(atomics)); } ! mlsub.typing.Constraint resolveToLowlevel() ! { return mlsub.typing.Constraint.create( binders.isEmpty() ? null : binders.toArray(), *************** *** 54,58 **** StringBuffer res = new StringBuffer("<"); boolean first = true; ! Constraint c = this.shallowClone(); --- 54,58 ---- StringBuffer res = new StringBuffer("<"); boolean first = true; ! Constraint c = this.shallowClone(); *************** *** 81,112 **** } } ! continue; } let tc = s; ! boolean ok = false; ! let j = c.atomics.iterator(); ! while (j.hasNext()) ! { ! AtomicConstraint atom = j.next(); ! let parent = atom.getParentFor(tc); ! if (parent!=null) ! { ! if (first) ! first = false; ! else ! res.append(','); ! res.append(parent).append(' ').append(tc); ! j.remove(); ! i.remove(); ! ok = true; ! break; ! } ! } ! if (!ok) ! Internal.error("Unable to print the constraint in a parsable form because of "+tc); } ! res.append(Util.map((res.length()>1 ? ", " : ""),", ","", c.binders)); res.append(Util.map(" | ",", ","",c.atomics)).append("> "); --- 81,112 ---- } } ! continue; } let tc = s; ! boolean ok = false; ! let j = c.atomics.iterator(); ! while (j.hasNext()) ! { ! AtomicConstraint atom = j.next(); ! let parent = atom.getParentFor(tc); ! if (parent!=null) ! { ! if (first) ! first = false; ! else ! res.append(','); ! res.append(parent).append(' ').append(tc); ! j.remove(); ! i.remove(); ! ok = true; ! break; ! } ! } ! if (!ok) ! Internal.error("Unable to print the constraint in a parsable form because of "+tc); } ! res.append(Util.map((res.length()>1 ? ", " : ""),", ","", c.binders)); res.append(Util.map(" | ",", ","",c.atomics)).append("> "); *************** *** 144,148 **** if (bs==null) return; ! for (int i = 0; i<bs.length; i++) this.addBinder(bs[i]); --- 144,148 ---- if (bs==null) return; ! for (int i = 0; i<bs.length; i++) this.addBinder(bs[i]); *************** *** 188,192 **** * The trivial constraint. * ! * This field is final, so pointer equality can be used * to test whether a constraint is True. * --- 188,192 ---- * The trivial constraint. * ! * This field is final, so pointer equality can be used * to test whether a constraint is True. * *************** *** 197,201 **** /** An abstract constraint atom. See children. ! @see Constraint */ --- 197,201 ---- /** An abstract constraint atom. See children. ! @see Constraint */ *************** *** 239,243 **** { private final mlsub.typing.AtomicConstraint atom; ! resolve(scope) = atom; --- 239,243 ---- { private final mlsub.typing.AtomicConstraint atom; ! resolve(scope) = atom; *************** *** 261,265 **** return null; } ! return null; } --- 261,265 ---- return null; } ! return null; } *************** *** 314,318 **** if (s instanceof mlsub.typing.Interface) return new mlsub.typing.ImplementsCst(t1, s); ! if (!(s instanceof mlsub.typing.TypeConstructor)) throw User.error(t2, t2 + " is not a class"); --- 314,318 ---- if (s instanceof mlsub.typing.Interface) return new mlsub.typing.ImplementsCst(t1, s); ! if (!(s instanceof mlsub.typing.TypeConstructor)) throw User.error(t2, t2 + " is not a class"); *************** *** 324,328 **** let associatedInterface = c2.getAssociatedInterface(); ! if (associatedInterface!=null) return new mlsub.typing.ImplementsCst(t1, associatedInterface); --- 324,328 ---- let associatedInterface = c2.getAssociatedInterface(); ! if (associatedInterface!=null) return new mlsub.typing.ImplementsCst(t1, associatedInterface); *************** *** 345,349 **** /** A type constructor implements an interface. ! */ public class ImplementsCst extends AtomicConstraint --- 345,349 ---- /** A type constructor implements an interface. ! */ public class ImplementsCst extends AtomicConstraint *************** *** 358,365 **** if (! (sitf instanceof mlsub.typing.Interface)) throw User.error(itf, itf+" should be an interface"); ! return new mlsub.typing.ImplementsCst(stc, sitf); } toString() = tc + ":" + itf; ! } \ No newline at end of file --- 358,365 ---- if (! (sitf instanceof mlsub.typing.Interface)) throw User.error(itf, itf+" should be an interface"); ! return new mlsub.typing.ImplementsCst(stc, sitf); } toString() = tc + ":" + itf; ! } |