Nice/src/bossa/syntax customConstructor.nice,1.25,1.26 enum.nice,1.22,1.23 locals.nice,1.11,1.12 loop.nice,1.13,1.14 monotype.nice,1.13,1.14 try.nice,1.6,1.7

Arjan Boeijink <[email protected]> Sun, 10 Apr 2005 14:57:10 +0000
Newsgroups gmane.comp.lang.nice.cvs
Message-ID <[email protected]>
Update of /cvsroot/nice/Nice/src/bossa/syntax
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24986/F:/nice/src/bossa/syntax

Modified Files:
	customConstructor.nice enum.nice locals.nice loop.nice 
	monotype.nice try.nice 
Log Message:
Constants for nullness tags.

Index: customConstructor.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/customConstructor.nice,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** customConstructor.nice	26 Mar 2005 00:48:09 -0000	1.25
--- customConstructor.nice	10 Apr 2005 14:57:05 -0000	1.26
***************
*** 162,166 ****
  {
    let classe = new TypeIdent(name: className);
!   classe.nullness = /*sure*/2;
  
    if (cst == trueConstraint)
--- 162,166 ----
  {
    let classe = new TypeIdent(name: className);
!   classe.nullness = nullness_sure;
  
    if (cst == trueConstraint)
***************
*** 179,183 ****
    let res = createMonotypeConstructor
        (classe, new TypeParameters(content: params), classe.location());
!   res.nullness = /*sure*/2;
    return res;
  }
--- 179,183 ----
    let res = createMonotypeConstructor
        (classe, new TypeParameters(content: params), classe.location());
!   res.nullness = nullness_sure;
    return res;
  }

Index: loop.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/loop.nice,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** loop.nice	22 Feb 2005 13:00:20 -0000	1.13
--- loop.nice	10 Apr 2005 14:57:07 -0000	1.14
***************
*** 131,135 ****
  	tc: new TypeIdent(name: new LocatedString("Iterator", loc)),
  	parameters: new TypeParameters(content: [vartype]),
! 	loc: loc, nullness: /*sure*/2);
  
    let getiter = createCallExp(createIdentExp(new LocatedString("forIterator", loc)), container);
--- 131,135 ----
  	tc: new TypeIdent(name: new LocatedString("Iterator", loc)),
  	parameters: new TypeParameters(content: [vartype]),
! 	loc: loc, nullness: nullness_sure);
  
    let getiter = createCallExp(createIdentExp(new LocatedString("forIterator", loc)), container);

Index: monotype.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/monotype.nice,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** monotype.nice	25 Mar 2005 16:40:00 -0000	1.13
--- monotype.nice	10 Apr 2005 14:57:07 -0000	1.14
***************
*** 15,18 ****
--- 15,23 ----
  import bossa.util.*;
  
+ public let byte nullness_none = 0;
+ public let byte nullness_maybe = 1;
+ public let byte nullness_sure = 2;
+ public let byte nullness_absent = 3;
+ 
  /**
     Syntactic monomorphic type.
***************
*** 22,33 ****
  {
    /** Set by the parser. */
!   public byte nullness = 0;
! /*
!   public static final byte
!     none = 0,
!     maybe = 1,
!     sure = 2,
!     absent = 3;
! */
  
    /** @return true if "alike" appears inside this monotype. */
--- 27,31 ----
  {
    /** Set by the parser. */
!   public byte nullness = nullness_none;
  
    /** @return true if "alike" appears inside this monotype. */
***************
*** 42,48 ****
    String nullnessString()
    {
!     if (nullness == /*maybe*/1)
        return "?";
!     else if (nullness == /*sure*/2)
        return "!";
      else
--- 40,46 ----
    String nullnessString()
    {
!     if (nullness == nullness_maybe)
        return "?";
!     else if (nullness == nullness_sure)
        return "!";
      else
***************
*** 54,64 ****
      mlsub.typing.Monotype raw = this.rawResolve(tm);
  
!     if (nullness == /*none*/0)
        return raw;
!     else if (nullness == /*maybe*/1)
        return maybeMonotype(nice.tools.typing.Types.rawType(raw));
!     else if (nullness ==  /*sure*/2)
        return sureMonotype(nice.tools.typing.Types.rawType(raw));
!     else if (nullness == /*absent*/3)
        {
  	if (raw instanceof mlsub.typing.MonotypeVar)
--- 52,62 ----
      mlsub.typing.Monotype raw = this.rawResolve(tm);
  
!     if (nullness == nullness_none)
        return raw;
!     else if (nullness == nullness_maybe)
        return maybeMonotype(nice.tools.typing.Types.rawType(raw));
!     else if (nullness ==  nullness_sure)
        return sureMonotype(nice.tools.typing.Types.rawType(raw));
!     else if (nullness == nullness_absent)
        {
  	if (raw instanceof mlsub.typing.MonotypeVar)
***************
*** 291,295 ****
    {
      return "(" + Util.map("", ", ", "", in) + 
!       (nullness == /*maybe*/1 ? ")?->" : ")->") + out;
    }
    
--- 289,293 ----
    {
      return "(" + Util.map("", ", ", "", in) + 
!       (nullness == nullness_maybe ? ")?->" : ")->") + out;
    }
    

Index: enum.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/enum.nice,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** enum.nice	26 Mar 2005 02:11:34 -0000	1.22
--- enum.nice	10 Apr 2005 14:57:06 -0000	1.23
***************
*** 176,180 ****
  {
    Monotype type = new TypeIdent(name: enumName);
!   type.nullness = /*absent*/3;
    List<Argument> args = new ArrayList(2 + fields.size());
    args.add(new Argument(value: createStringConstantExp(name.toString()),
--- 176,180 ----
  {
    Monotype type = new TypeIdent(name: enumName);
!   type.nullness = nullness_absent;
    List<Argument> args = new ArrayList(2 + fields.size());
    args.add(new Argument(value: createStringConstantExp(name.toString()),

Index: try.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/try.nice,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** try.nice	16 Jan 2005 00:28:21 -0000	1.6
--- try.nice	10 Apr 2005 14:57:07 -0000	1.7
***************
*** 100,104 ****
  {
    Monotype type = createMonotypeConstructor(tc, null, tc.location());
!   type.nullness = /*sure*/2;
  
    this(exnVar: new MonoSymbol(varName, syntacticType: type), tc: tc,
--- 100,104 ----
  {
    Monotype type = createMonotypeConstructor(tc, null, tc.location());
!   type.nullness = nullness_sure;
  
    this(exnVar: new MonoSymbol(varName, syntacticType: type), tc: tc,

Index: locals.nice
===================================================================
RCS file: /cvsroot/nice/Nice/src/bossa/syntax/locals.nice,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** locals.nice	22 Feb 2005 10:27:07 -0000	1.11
--- locals.nice	10 Apr 2005 14:57:07 -0000	1.12
***************
*** 214,218 ****
    let value = createFunExp(trueConstraint, parameters.getMonoSymbols(), 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);
  }
--- 214,218 ----
    let value = createFunExp(trueConstraint, parameters.getMonoSymbols(), body);
    let symbol = new FunSymbol(name, trueConstraint, parameters, returnType);
!   notNull(symbol.syntacticType).monotype.nullness = nullness_sure;
    return new LocalFunction(left: symbol, value: value, parameters: parameters);
  }



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click