Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/compiler/Elaborator/elaborate/elabutil.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Elaborator/elaborate/elabutil.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 902, Wed Aug 15 21:17:05 2001 UTC revision 903, Mon Aug 20 19:34:06 2001 UTC
# Line 94  Line 94 
94  val CONSpat = fn pat => APPpat(consDcon,[],pat)  val CONSpat = fn pat => APPpat(consDcon,[],pat)
95  val CONSexp = CONexp(consDcon,[])  val CONSexp = CONexp(consDcon,[])
96    
97  val unitExp = RECORDexp nil  val unitExp = AbsynUtil.unitExp
98  val unitPat = RECORDpat{fields = nil, flex = false, typ = ref UNDEFty}  val unitPat = RECORDpat{fields = nil, flex = false, typ = ref UNDEFty}
99  val bogusExp = VARexp(ref(V.mkVALvar(bogusID, A.nullAcc)), [])  val bogusExp = VARexp(ref(V.mkVALvar(bogusID, A.nullAcc)), [])
100    
# Line 210  Line 210 
210       in assign(0, sortRecord(fields',err)); RECORDexp(f(0,fields'))       in assign(0, sortRecord(fields',err)); RECORDexp(f(0,fields'))
211      end      end
212    
213    val TUPLEexp = AbsynUtil.TUPLEexp
214    (*
215  fun TUPLEexp l =  fun TUPLEexp l =
216      let fun addlabels(i,e::r) =      let fun addlabels(i,e::r) =
217                (LABEL{number=i-1,name=(Tuples.numlabel i)},e)                (LABEL{number=i-1,name=(Tuples.numlabel i)},e)
# Line 217  Line 219 
219            | addlabels(_, nil) = nil            | addlabels(_, nil) = nil
220       in RECORDexp (addlabels(1,l))       in RECORDexp (addlabels(1,l))
221      end      end
222    *)
223    
224  fun TPSELexp(e, i) =  fun TPSELexp(e, i) =
225      let val lab = LABEL{number=i-1, name=(Tuples.numlabel i)}      let val lab = LABEL{number=i-1, name=(Tuples.numlabel i)}
# Line 242  Line 245 
245  fun completeMatch' (RULE(p,e)) =  fun completeMatch' (RULE(p,e)) =
246      completeMatch'' (fn marker => RULE(p,marker e))      completeMatch'' (fn marker => RULE(p,marker e))
247    
248  exception NoCore  (*
   
 val bogusExn = V.mkBogusEXN BasicTypes.exnTy  
   
249  fun getCoreExn(env,name) =  fun getCoreExn(env,name) =
250      (case LU.lookVal(env,SP.SPATH[CoreSym.coreSym, varSymbol name],      (case LU.lookVal(env,SP.SPATH[CoreSym.coreSym, varSymbol name],
251                       fn _ => fn s => fn _ => raise NoCore)                       fn _ => fn s => fn _ => raise NoCore)
# Line 258  Line 258 
258                       fn _ => fn _ => fn _ => raise NoCore)                       fn _ => fn _ => fn _ => raise NoCore)
259        of V.VAL v => v        of V.VAL v => v
260         | _ => raise Fail ("getCoreVar: not found: " ^ name))         | _ => raise Fail ("getCoreVar: not found: " ^ name))
261    *)
262    
263  fun completeMatch(env,name) =  fun completeMatch(env,name) =
264      completeMatch''      completeMatch''
265        (fn marker =>        (fn marker =>
266            RULE(WILDpat,            RULE(WILDpat,
267                 marker(RAISEexp(CONexp(getCoreExn(env,name),[]), UNDEFty))))                 marker(RAISEexp(CONexp(CoreAccess.getExn(env,name),[]),
268                                   UNDEFty))))
269    
270  val trivialCompleteMatch = completeMatch(SE.empty,"Match")  val trivialCompleteMatch = completeMatch(SE.empty,"Match")
271    
# Line 274  Line 276 
276  fun IFexp (a,b,c) =  fun IFexp (a,b,c) =
277      CASEexp(a, trivialCompleteMatch [RULE(TRUEpat,b), RULE(FALSEpat,c)],true)      CASEexp(a, trivialCompleteMatch [RULE(TRUEpat,b), RULE(FALSEpat,c)],true)
278    
279    val TUPLEpat = AbsynUtil.TUPLEpat
280    (*
281  fun TUPLEpat l =  fun TUPLEpat l =
282      let fun addlabels(i,e::r) = (Tuples.numlabel i, e) :: addlabels(i+1, r)      let fun addlabels(i,e::r) = (Tuples.numlabel i, e) :: addlabels(i+1, r)
283            | addlabels(_, nil) = nil            | addlabels(_, nil) = nil
284       in RECORDpat{fields=addlabels(1,l), flex=false, typ=ref UNDEFty}       in RECORDpat{fields=addlabels(1,l), flex=false, typ=ref UNDEFty}
285      end      end
286    *)
287    
288  fun wrapRECdecGen (rvbs, compInfo as {mkLvar=mkv, ...} : compInfo) =  fun wrapRECdecGen (rvbs, compInfo as {mkLvar=mkv, ...} : compInfo) =
289    let fun g (RVB{var=v as VALvar{path=SP.SPATH [sym], ...}, ...},    let fun g (RVB{var=v as VALvar{path=SP.SPATH [sym], ...}, ...},

Legend:
Removed from v.902  
changed lines
  Added in v.903

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0