[Nice-commit] Nice/src/bossa/syntax Monotype.java,1.39,1.40 analyse.nice,1.123,1.124 constant.nice,1
Brought to you by:
bonniot
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31378/F:/nice/src/bossa/syntax Modified Files: Monotype.java analyse.nice constant.nice customConstructor.nice dispatch.java.bootstrap enum.nice formalParameters.nice funexp.nice importedconstructor.nice literalarray.nice locals.nice loop.nice methodDeclaration.nice methodImplementation.nice monotype.nice newarray.nice niceMethod.nice niceclass.nice nicefieldaccess.nice super.nice tools.nice try.nice tuple.nice Log Message: Cleanup and preparation for Monotype conversion. Index: newarray.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/newarray.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** newarray.nice 1 Dec 2004 02:00:32 -0000 1.2 --- newarray.nice 12 Jan 2005 18:50:37 -0000 1.3 *************** *** 87,93 **** // Add the nullness marker to the element type. if (sure) ! monotype = bossa.syntax.Monotype.sure(monotype); else if (nullVars == null) ! monotype = bossa.syntax.Monotype.maybe(monotype); else { --- 87,93 ---- // Add the nullness marker to the element type. if (sure) ! monotype = sureMonotype(monotype); else if (nullVars == null) ! monotype = maybeMonotype(monotype); else { *************** *** 119,128 **** else // Unknown dimensions are not initialized: give an option type. ! monotype = bossa.syntax.Monotype.maybe(monotype); } // Known dimensions are initialized: give a sure type. for (int i = 0; i < knownDimensions.length; i++) ! monotype = bossa.syntax.Monotype.sure (mlsub.typing.MonotypeConstructor.apply(nice.tools.typing.PrimitiveType.arrayTC, monotype)); --- 119,128 ---- else // Unknown dimensions are not initialized: give an option type. ! monotype = maybeMonotype(monotype); } // Known dimensions are initialized: give a sure type. for (int i = 0; i < knownDimensions.length; i++) ! monotype = sureMonotype (mlsub.typing.MonotypeConstructor.apply(nice.tools.typing.PrimitiveType.arrayTC, monotype)); Index: literalarray.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/literalarray.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** literalarray.nice 1 Dec 2004 02:00:32 -0000 1.4 --- literalarray.nice 12 Jan 2005 18:50:37 -0000 1.5 *************** *** 43,47 **** let res = new mlsub.typing.Polytype (elementType.getConstraint(), ! bossa.syntax.Monotype.sure(new mlsub.typing.MonotypeConstructor (nice.tools.typing.PrimitiveType.arrayTC, [elementType.getMonotype()]))); res.setNotSimplified(); --- 43,47 ---- let res = new mlsub.typing.Polytype (elementType.getConstraint(), ! sureMonotype(new mlsub.typing.MonotypeConstructor (nice.tools.typing.PrimitiveType.arrayTC, [elementType.getMonotype()]))); res.setNotSimplified(); Index: funexp.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/funexp.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** funexp.nice 11 Jan 2005 21:45:46 -0000 1.5 --- funexp.nice 12 Jan 2005 18:50:37 -0000 1.6 *************** *** 101,105 **** type = new mlsub.typing.Polytype (mlsub.typing.Constraint.and(cst, notNull(_inferredReturnType).getConstraint()), ! bossa.syntax.Monotype.sure(t)); } --- 101,105 ---- type = new mlsub.typing.Polytype (mlsub.typing.Constraint.and(cst, notNull(_inferredReturnType).getConstraint()), ! sureMonotype(t)); } Index: tuple.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tuple.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tuple.nice 14 Dec 2004 18:58:08 -0000 1.2 --- tuple.nice 12 Jan 2005 18:50:38 -0000 1.3 *************** *** 24,38 **** rawResolve(typeMap) = new mlsub.typing.TupleType ! (bossa.syntax.Monotype.rawResolve(notNull(typeMap), types)); substitute(map) { bossa.syntax.Monotype res = new bossa.syntax.TupleType ! ( types : bossa.syntax.Monotype.substitute(map, types), location : location); res.nullness = this.nullness; return res; } ! containsAlike() = bossa.syntax.Monotype.containsAlike(types); location() = location; --- 24,38 ---- rawResolve(typeMap) = new mlsub.typing.TupleType ! (bossa.syntax.Monotype.resolve(notNull(typeMap), types.toArray())); substitute(map) { bossa.syntax.Monotype res = new bossa.syntax.TupleType ! ( types : types.mapToArray(Monotype t => t.substitute(map)), location : location); res.nullness = this.nullness; return res; } ! containsAlike() = types.any(Monotype t => t.containsAlike()); location() = location; *************** *** 113,117 **** expectedComponents = components; ! type = new mlsub.typing.Polytype(cst, bossa.syntax.Monotype.sure(tupleType)); } --- 113,117 ---- expectedComponents = components; ! type = new mlsub.typing.Polytype(cst, sureMonotype(tupleType)); } Index: niceclass.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceclass.nice,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** niceclass.nice 11 Jan 2005 21:45:46 -0000 1.15 --- niceclass.nice 12 Jan 2005 18:50:38 -0000 1.16 *************** *** 235,239 **** VarScope scope = notNull(definition.scope); mlsub.typing.Monotype thisType = ! Monotype.sure(new mlsub.typing.MonotypeConstructor(definition.getTC(), definition.getTypeParameters())); thisSymbol = new ThisSymbol(thisName, type: thisType, declaringClass: this); --- 235,239 ---- VarScope scope = notNull(definition.scope); mlsub.typing.Monotype thisType = ! sureMonotype(new mlsub.typing.MonotypeConstructor(definition.getTC(), definition.getTypeParameters())); thisSymbol = new ThisSymbol(thisName, type: thisType, declaringClass: this); *************** *** 566,570 **** let cname = new LocatedString("<init>",definition.location()); ! let ctype = new mlsub.typing.Polytype(specificCst, new mlsub.typing.FunType(Monotype.resolve(definition.getLocalScope(), values.types()),Monotype.sure(new mlsub.typing.MonotypeConstructor(definition.getTC(), definition.getTypeParameters())))); notNull(constructorMethod)[i] = new DefaultConstructor (cname, Node.global, parameters: values, arity: values.size, --- 566,570 ---- let cname = new LocatedString("<init>",definition.location()); ! let ctype = new mlsub.typing.Polytype(specificCst, new mlsub.typing.FunType(Monotype.resolve(definition.getLocalScope(), values.types()),sureMonotype(new mlsub.typing.MonotypeConstructor(definition.getTC(), definition.getTypeParameters())))); notNull(constructorMethod)[i] = new DefaultConstructor (cname, Node.global, parameters: values, arity: values.size, Index: formalParameters.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/formalParameters.nice,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** formalParameters.nice 11 Jan 2005 21:45:46 -0000 1.2 --- formalParameters.nice 12 Jan 2005 18:50:37 -0000 1.3 *************** *** 274,289 **** size: parameters.size()); } - /* - FormalParameters(Parameter[] parameters) - { - super(Node.none); - if (parameters == null) - return; - - this.parameters = parameters; - this.size = parameters.length; - } - */ let LocatedString thisName = new LocatedString("this", Location.nowhere()); --- 274,278 ---- Index: super.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/super.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** super.nice 4 Jan 2005 21:20:39 -0000 1.8 --- super.nice 12 Jan 2005 18:50:38 -0000 1.9 *************** *** 145,149 **** else // Our safe bet is to assert that the argument is Object. ! newAtoms.add(new mlsub.typing.MonotypeLeqCst(bossa.syntax.Monotype.sure(mlsub.typing.TopMonotype.instance), m[0])); } --- 145,149 ---- else // Our safe bet is to assert that the argument is Object. ! newAtoms.add(new mlsub.typing.MonotypeLeqCst(sureMonotype(mlsub.typing.TopMonotype.instance), m[0])); } Index: locals.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/locals.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** locals.nice 11 Jan 2005 21:45:46 -0000 1.6 --- locals.nice 12 Jan 2005 18:50:37 -0000 1.7 *************** *** 210,214 **** let value = createFunExp(trueConstraint, parameters.getMonoSymbols() || new MonoSymbol[0], body); let symbol = new FunSymbol(name, trueConstraint, parameters, returnType); ! notNull(symbol.syntacticType).monotype.nullness = Monotype.sure; return new LocalFunction(left: symbol, value: value, parameters: parameters); } --- 210,214 ---- let value = createFunExp(trueConstraint, parameters.getMonoSymbols() || new MonoSymbol[0], body); let symbol = new FunSymbol(name, trueConstraint, parameters, returnType); ! notNull(symbol.syntacticType).monotype.nullness = /*sure*/2; return new LocalFunction(left: symbol, value: value, parameters: parameters); } Index: Monotype.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/Monotype.java,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** Monotype.java 18 Dec 2004 19:40:59 -0000 1.39 --- Monotype.java 12 Jan 2005 18:50:37 -0000 1.40 *************** *** 29,81 **** implements Located { - static final Monotype[] toArray(List monotypes) - { - if (monotypes == null) - return array0; - - return (Monotype[]) monotypes.toArray(new Monotype[monotypes.size()]); - } - - static final Monotype[] array0 = new Monotype[0]; - - /**************************************************************** - * Syntactic fresh monotype variables - ****************************************************************/ - - static Monotype fresh(LocatedString associatedVariable) - { - return dispatch.createTypeIdent(associatedVariable); - } - - static Monotype[] freshs(int arity, LocatedString associatedVariable) - { - Monotype[] res = new Monotype[arity]; - for(int i = 0; i < arity; i++) - res[i] = fresh(new LocatedString(associatedVariable.content + i, - associatedVariable.location())); - return res; - } /** @return true if "alike" appears inside this monotype. */ abstract boolean containsAlike(); - static final boolean containsAlike(List monotypes) - { - for(Iterator i = monotypes.iterator(); i.hasNext();) - if(((Monotype) i.next()).containsAlike()) - return true; - - return false; - } - - static final boolean containsAlike(Monotype[] monotypes) - { - for(int i = monotypes.length; --i >= 0;) - if (monotypes[i].containsAlike()) - return true; - - return false; - } - public boolean isVoid() { return false; } --- 29,36 ---- *************** *** 86,90 **** /** Set by the parser. */ public byte nullness; ! public static final byte none = 0, --- 41,45 ---- /** Set by the parser. */ public byte nullness; ! /* public static final byte none = 0, *************** *** 92,102 **** sure = 2, absent = 3; ! final String nullnessString() { switch(nullness) { ! case maybe: return "?"; ! case sure: return "!"; default: return ""; } --- 47,57 ---- sure = 2, absent = 3; ! */ final String nullnessString() { switch(nullness) { ! case /*maybe*/1: return "?"; ! case /*sure*/2: return "!"; default: return ""; } *************** *** 110,117 **** switch (nullness) { ! case none: return raw; ! case maybe: return sourceMaybe(raw); ! case sure: return sourceSure(raw); ! case absent: if (raw instanceof MonotypeVar) { --- 65,72 ---- switch (nullness) { ! case /*none*/0: return raw; ! case /*maybe*/1: return sourceMaybe(raw); ! case /*sure*/2: return sourceSure(raw); ! case /*absent*/3: if (raw instanceof MonotypeVar) { *************** *** 129,159 **** /** iterates resolve() on the collection of Monotype */ - static final mlsub.typing.Monotype[] rawResolve(TypeMap s, Collection c) - { - if(c.size()==0) - return null; - - mlsub.typing.Monotype[] res = new mlsub.typing.Monotype[c.size()]; - - int n=0; - Iterator i=c.iterator(); - while(i.hasNext()) - { - Object o = i.next(); - if (!(o instanceof Monotype)) - Debug.println(o+" ::: "+o.getClass()); - - Monotype old = (Monotype) o; - mlsub.typing.Monotype nou = old.resolve(s); - - if(nou==null) - User.error(old,old+" : Monotype not defined"); - - res[n++]=nou; - } - return res; - } - - /** iterates resolve() on the collection of Monotype */ static final mlsub.typing.Monotype[] resolve(TypeMap s, Monotype[] c) { --- 84,87 ---- *************** *** 178,203 **** abstract Monotype substitute(Map map); - static List substitute(Map map, Collection c) - { - if(c==null) return null; - - List res = new ArrayList(c.size()); - Iterator i = c.iterator(); - - while(i.hasNext()) - res.add( ((Monotype)i.next()).substitute(map)); - - return res; - } - - static Monotype[] substitute(Map map, Monotype[] m) - { - Monotype[] res = new Monotype[m.length]; - for(int i = m.length; --i >= 0;) - res[i] = m[i].substitute(map); - - return res; - } - //temporarily method to call on TypeIdent's public mlsub.typing.TypeSymbol resolveToTypeSymbol(TypeMap scope) --- 106,109 ---- Index: nicefieldaccess.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/nicefieldaccess.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** nicefieldaccess.nice 10 Jan 2005 23:58:04 -0000 1.7 --- nicefieldaccess.nice 12 Jan 2005 18:50:38 -0000 1.8 *************** *** 44,48 **** { let classDef = field.getTypeDefinition(); ! let argType = Monotype.sure(classDef.lowlevelMonotype()); let params = createFormalParameters([new Parameter(type: Monotype.create(argType))]); --- 44,48 ---- { let classDef = field.getTypeDefinition(); ! let argType = sureMonotype(classDef.lowlevelMonotype()); let params = createFormalParameters([new Parameter(type: Monotype.create(argType))]); Index: try.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/try.nice,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** try.nice 11 Jan 2005 21:45:46 -0000 1.4 --- try.nice 12 Jan 2005 18:50:38 -0000 1.5 *************** *** 102,106 **** { Monotype type = createMonotypeConstructor(tc, null, tc.location()); ! type.nullness = Monotype.sure; this(exnVar: new MonoSymbol(varName, syntacticType: type), tc: tc, --- 102,106 ---- { Monotype type = createMonotypeConstructor(tc, null, tc.location()); ! type.nullness = /*sure*/2; this(exnVar: new MonoSymbol(varName, syntacticType: type), tc: tc, Index: analyse.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/analyse.nice,v retrieving revision 1.123 retrieving revision 1.124 diff -C2 -d -r1.123 -r1.124 *** analyse.nice 10 Jan 2005 23:58:04 -0000 1.123 --- analyse.nice 12 Jan 2005 18:50:37 -0000 1.124 *************** *** 627,631 **** c.type = new mlsub.typing.Polytype ! (Monotype.sure(new mlsub.typing.MonotypeConstructor(tc, null))); return c; --- 627,631 ---- c.type = new mlsub.typing.Polytype ! (sureMonotype(new mlsub.typing.MonotypeConstructor(tc, null))); return c; *************** *** 647,651 **** return new mlsub.typing.Polytype (res.getConstraint(), ! sure ? Monotype.sure(type) : Monotype.maybe(type)); } --- 647,651 ---- return new mlsub.typing.Polytype (res.getConstraint(), ! sure ? sureMonotype(type) : maybeMonotype(type)); } Index: constant.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constant.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** constant.nice 31 Dec 2004 18:40:45 -0000 1.6 --- constant.nice 12 Jan 2005 18:50:37 -0000 1.7 *************** *** 27,64 **** ?LocatedString className = null; - /* - ConstantExp() - { - } - - ConstantExp(Polytype type, TypeConstructor tc, Object value, String representation, - Location location) - { - this.type = type; - this.tc = tc; - this.value = value; - this.representation = representation; - setLocation(location); - } - - ConstantExp(TypeConstructor tc, Object value, String representation, - Location location) - { - this(new mlsub.typing.Polytype(Monotype.sure(new mlsub.typing.MonotypeConstructor(tc,null))), - tc, value, representation, location); - } - - ConstantExp(TypeConstructor tc, String representation, Location location) - { - this(tc, null, representation, location); - } - - public ConstantExp(Object value) - { - this.value = value; - this.representation = value.toString(); - } - */ - computeType() { --- 27,30 ---- *************** *** 287,291 **** let alpha = new mlsub.typing.MonotypeVar("any"); return new mlsub.typing.Polytype(new mlsub.typing.Constraint([alpha], null), ! bossa.syntax.Monotype.maybe(alpha)); } --- 253,257 ---- let alpha = new mlsub.typing.MonotypeVar("any"); return new mlsub.typing.Polytype(new mlsub.typing.Constraint([alpha], null), ! maybeMonotype(alpha)); } *************** *** 498,502 **** res.type = new mlsub.typing.Polytype (type.getConstraint(), ! Monotype.sure(new mlsub.typing.MonotypeConstructor (nice.tools.typing.PrimitiveType.classTC, [type.getMonotype()]))); return res; --- 464,468 ---- res.type = new mlsub.typing.Polytype (type.getConstraint(), ! sureMonotype(new mlsub.typing.MonotypeConstructor (nice.tools.typing.PrimitiveType.classTC, [type.getMonotype()]))); return res; *************** *** 576,580 **** return new mlsub.typing.Polytype (vars == null ? null : new mlsub.typing.Constraint(cast(vars), null), ! sure ? Monotype.sure(type) : Monotype.maybe(type)); } --- 542,546 ---- return new mlsub.typing.Polytype (vars == null ? null : new mlsub.typing.Constraint(cast(vars), null), ! sure ? sureMonotype(type) : maybeMonotype(type)); } Index: customConstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/customConstructor.nice,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** customConstructor.nice 11 Jan 2005 21:45:46 -0000 1.12 --- customConstructor.nice 12 Jan 2005 18:50:37 -0000 1.13 *************** *** 165,169 **** { let classe = new TypeIdent(name: className); ! classe.nullness = Monotype.sure; if (cst == trueConstraint) --- 165,169 ---- { let classe = new TypeIdent(name: className); ! classe.nullness = /*sure*/2; if (cst == trueConstraint) *************** *** 182,186 **** let res = createMonotypeConstructor (classe, new TypeParameters(content: params), classe.location()); ! res.nullness = Monotype.sure; return res; } --- 182,186 ---- let res = createMonotypeConstructor (classe, new TypeParameters(content: params), classe.location()); ! res.nullness = /*sure*/2; return res; } Index: monotype.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/monotype.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** monotype.nice 20 Dec 2004 17:16:48 -0000 1.6 --- monotype.nice 12 Jan 2005 18:50:37 -0000 1.7 *************** *** 60,64 **** Monotype res = createMonotypeConstructor (notNull(tc), ! new TypeParameters(content: Monotype.substitute(map, notNull(parameters.content))), loc); res.nullness = this.nullness; --- 60,64 ---- Monotype res = createMonotypeConstructor (notNull(tc), ! new TypeParameters(content: notNull(parameters.content).mapToArray(Monotype t => t.substitute(map))), loc); res.nullness = this.nullness; *************** *** 66,70 **** } ! containsAlike() = Monotype.containsAlike(notNull(parameters.content)); public ?TypeIdent getTC() = tc; --- 66,70 ---- } ! containsAlike() = notNull(parameters.content).any(Monotype t => t.containsAlike()); public ?TypeIdent getTC() = tc; *************** *** 115,119 **** public TypeParameters createTypeParameters(List<Monotype> tps) { ! return new TypeParameters(content: Monotype.toArray(tps)); } /** --- 115,119 ---- public TypeParameters createTypeParameters(List<Monotype> tps) { ! return new TypeParameters(content: tps.toArray()); } /** *************** *** 136,145 **** { bossa.syntax.Monotype res = new bossa.syntax.FunType ! (in: bossa.syntax.Monotype.substitute(map,in), out: out.substitute(map)); res.nullness = this.nullness; return res; } ! containsAlike() = Monotype.containsAlike(in) || out.containsAlike(); location() = out.location(); --- 136,145 ---- { bossa.syntax.Monotype res = new bossa.syntax.FunType ! (in: in.mapToArray(Monotype t => t.substitute(map)), out: out.substitute(map)); res.nullness = this.nullness; return res; } ! containsAlike() = in.any(Monotype t => t.containsAlike()) || out.containsAlike(); location() = out.location(); *************** *** 148,152 **** { return "(" + Util.map("", ", ", "", in) + ! (nullness == maybe ? ")?->" : ")->") + out; } --- 148,152 ---- { return "(" + Util.map("", ", ", "", in) + ! (nullness == /*maybe*/1 ? ")?->" : ")->") + out; } *************** *** 194,198 **** assert tc instanceof MonotypeConstructor; let res = createMonotypeConstructor(notNull(tc.lowlevelTC), ! new TypeParameters(content: Monotype.substitute(map, parameters)), loc); res.nullness = this.nullness; --- 194,198 ---- assert tc instanceof MonotypeConstructor; let res = createMonotypeConstructor(notNull(tc.lowlevelTC), ! new TypeParameters(content: parameters.mapToArray(Monotype t => t.substitute(map))), loc); res.nullness = this.nullness; *************** *** 211,216 **** String getAlikeID() = alike_id; ! public Monotype createAlike(List<Monotype> parameters, Location location) { ! return new Alike(parameters: Monotype.toArray(parameters), loc: location); } --- 211,216 ---- String getAlikeID() = alike_id; ! public Monotype createAlike(?List<Monotype> parameters, Location location) { ! return new Alike(parameters: parameters == null ? [] : parameters.toArray(), loc: location); } Index: niceMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceMethod.nice,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** niceMethod.nice 11 Jan 2005 21:45:46 -0000 1.11 --- niceMethod.nice 12 Jan 2005 18:50:38 -0000 1.12 *************** *** 293,297 **** thisType = Monotype.create ! (Monotype.sure (new mlsub.typing.MonotypeConstructor (alikeTC, c.getTypeParameters()))); --- 293,297 ---- thisType = Monotype.create ! (sureMonotype (new mlsub.typing.MonotypeConstructor (alikeTC, c.getTypeParameters()))); Index: methodDeclaration.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodDeclaration.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** methodDeclaration.nice 2 Jan 2005 02:20:59 -0000 1.1 --- methodDeclaration.nice 12 Jan 2005 18:50:37 -0000 1.2 *************** *** 15,23 **** import bossa.util.*; - //import mlsub.typing.*; - - //import gnu.bytecode.*; - //import gnu.expr.*; - /** Declaration of a method. --- 15,18 ---- Index: loop.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/loop.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** loop.nice 20 Dec 2004 17:16:48 -0000 1.9 --- loop.nice 12 Jan 2005 18:50:37 -0000 1.10 *************** *** 137,141 **** itertype = createMonotypeConstructor(new TypeIdent(name: new LocatedString("Iterator", loc)), createTypeParameters(tparams), loc); ! notNull(itertype).nullness = Monotype.sure; } --- 137,141 ---- itertype = createMonotypeConstructor(new TypeIdent(name: new LocatedString("Iterator", loc)), createTypeParameters(tparams), loc); ! notNull(itertype).nullness = /*sure*/2; } Index: methodImplementation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodImplementation.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** methodImplementation.nice 11 Jan 2005 21:45:46 -0000 1.8 --- methodImplementation.nice 12 Jan 2005 18:50:37 -0000 1.9 *************** *** 71,75 **** type.setKind(notNull(v)); ! type = bossa.syntax.Monotype.sure(type); } else --- 71,75 ---- type.setKind(notNull(v)); ! type = sureMonotype(type); } else Index: enum.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/enum.nice,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** enum.nice 11 Jan 2005 21:45:46 -0000 1.11 --- enum.nice 12 Jan 2005 18:50:37 -0000 1.12 *************** *** 174,178 **** { Monotype type = new TypeIdent(name: enumName); ! type.nullness = Monotype.absent; List<Arguments.Argument> args = new ArrayList(2 + fields.size()); args.add(new Arguments.Argument(createStringConstantExp(name.toString()), --- 174,178 ---- { Monotype type = new TypeIdent(name: enumName); ! type.nullness = /*absent*/3; List<Arguments.Argument> args = new ArrayList(2 + fields.size()); args.add(new Arguments.Argument(createStringConstantExp(name.toString()), Index: tools.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/tools.nice,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** tools.nice 11 Jan 2005 21:45:46 -0000 1.94 --- tools.nice 12 Jan 2005 18:50:38 -0000 1.95 *************** *** 51,58 **** mlsub.typing.Monotype makeSure(mlsub.typing.Monotype m) = ! notNull(bossa.syntax.Monotype.sure(nice.tools.typing.Types.rawType(m))); mlsub.typing.Monotype makeUnsure(mlsub.typing.Monotype m) = ! notNull(bossa.syntax.Monotype.maybe(nice.tools.typing.Types.rawType(m))); mlsub.typing.Monotype ensureMonomorphic(mlsub.typing.Polytype type, --- 51,64 ---- mlsub.typing.Monotype makeSure(mlsub.typing.Monotype m) = ! notNull(sureMonotype(nice.tools.typing.Types.rawType(m))); mlsub.typing.Monotype makeUnsure(mlsub.typing.Monotype m) = ! notNull(maybeMonotype(nice.tools.typing.Types.rawType(m))); ! ! mlsub.typing.Monotype sureMonotype(?mlsub.typing.Monotype type) = ! nice.tools.typing.Types.sureMonotype(type); ! ! mlsub.typing.Monotype maybeMonotype(?mlsub.typing.Monotype type) = ! nice.tools.typing.Types.maybeMonotype(type); mlsub.typing.Monotype ensureMonomorphic(mlsub.typing.Polytype type, *************** *** 121,125 **** try { ! return (sym, Monotype.sure(new mlsub.typing.MonotypeConstructor(tc, parameters))); } catch(BadSizeEx e) { return null; --- 127,131 ---- try { ! return (sym, sureMonotype(new mlsub.typing.MonotypeConstructor(tc, parameters))); } catch(BadSizeEx e) { return null; *************** *** 237,248 **** AST AST(List<Definition>, int) = native new AST(List, int); bossa.syntax.Monotype substitute(bossa.syntax.Monotype,Map<String,bossa.syntax.Monotype>) = native bossa.syntax.Monotype bossa.syntax.Monotype.substitute(Map); - List<bossa.syntax.Monotype> substitute(Map<String,bossa.syntax.Monotype>,Collection<bossa.syntax.Monotype>) = native List bossa.syntax.Monotype.substitute(Map,Collection); - boolean containsAlike(List<bossa.syntax.Monotype>) = native boolean bossa.syntax.Monotype.containsAlike(List); - mlsub.typing.Monotype[] rawResolve(TypeMap,Collection<bossa.syntax.Monotype>) = native mlsub.typing.Monotype[] bossa.syntax.Monotype.rawResolve(TypeMap, Collection); - boolean containsAlike(Monotype[]) = native boolean Monotype.containsAlike(Monotype[]); - bossa.syntax.Monotype[] substitute(Map<String,bossa.syntax.Monotype>,bossa.syntax.Monotype[]) = native bossa.syntax.Monotype[] bossa.syntax.Monotype.substitute(Map,bossa.syntax.Monotype[]); ?mlsub.typing.TypeSymbol lookup(TypeMap, LocatedString) = native mlsub.typing.TypeSymbol TypeMap.lookup(LocatedString); ?mlsub.typing.TypeSymbol lookup(TypeMap, String) = native mlsub.typing.TypeSymbol TypeMap.lookup(String); - Monotype[] Monotype_toArray(?List<Monotype>) = native Monotype[] Monotype.toArray(List); List<VarSymbol> lookup(VarScope, LocatedString) = native List VarScope.lookup(LocatedString); Map<gnu.bytecode.Type,mlsub.typing.TypeConstructor> javaTypeConstructors(bossa.modules.Compilation ) = native bossa.modules.Compilation.javaTypeConstructors; --- 243,248 ---- Index: importedconstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/importedconstructor.nice,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** importedconstructor.nice 10 Jan 2005 23:58:04 -0000 1.9 --- importedconstructor.nice 12 Jan 2005 18:50:37 -0000 1.10 *************** *** 96,100 **** let classDef = def.getDefinition(); ! let returnType = Monotype.create(Monotype.sure (new mlsub.typing.MonotypeConstructor(classDef.getTC(), classDef.getTypeParameters()))); --- 96,100 ---- let classDef = def.getDefinition(); ! let returnType = Monotype.create(sureMonotype (new mlsub.typing.MonotypeConstructor(classDef.getTC(), classDef.getTypeParameters()))); Index: dispatch.java.bootstrap =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/dispatch.java.bootstrap,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** dispatch.java.bootstrap 4 Jan 2005 21:20:39 -0000 1.50 --- dispatch.java.bootstrap 12 Jan 2005 18:50:37 -0000 1.51 *************** *** 34,40 **** { return null; } - public static Monotype createTypeIdent(LocatedString name) - { return null;} - public static void resetTypeDefinitionMappings() {} --- 34,37 ---- |