|
|
1.1 ! root 1: (* Copyright 1989 by AT&T Bell Laboratories *) ! 2: structure Nonrec = ! 3: struct ! 4: local open Access Basics Absyn ! 5: in ! 6: exception Isrec ! 7: ! 8: fun nonrec (VALRECdec[RVB{var=var as VALvar{access=LVAR(lvar),...}, ! 9: exp,resultty,tyvars}]) = ! 10: let val rec findexp = ! 11: fn VARexp(ref(VALvar{access=PATH[v],...})) => ! 12: if v=lvar then raise Isrec else () ! 13: | VARexp(ref(VALvar{access=_,...})) => () ! 14: | RECORDexp l => app (fn (lab,e)=>findexp e) l ! 15: | SEQexp l => app findexp l ! 16: | APPexp (a,b) => (findexp a; findexp b) ! 17: | CONSTRAINTexp (e,_) => findexp e ! 18: | HANDLEexp (e, HANDLER h) => (findexp e; findexp h) ! 19: | RAISEexp e => findexp e ! 20: | LETexp (d,e) => (finddec d; findexp e) ! 21: | CASEexp (e,l) => (findexp e; app (fn RULE (_,e) => findexp e) l) ! 22: | FNexp l => app (fn RULE (_,e) => findexp e) l ! 23: | MARKexp(e,a,b) => findexp e ! 24: | _ => () ! 25: and finddec = ! 26: fn VALdec vbl => app (fn (VB{exp,...})=>findexp exp) vbl ! 27: | VALRECdec rvbl => app (fn(RVB{exp,...})=>findexp exp) rvbl ! 28: | LOCALdec (a,b) => (finddec a; finddec b) ! 29: | SEQdec l => app finddec l ! 30: | MARKdec (dec,a,b) => finddec dec ! 31: | _ => () ! 32: in findexp exp; ! 33: VALdec[VB{pat=VARpat var, tyvars=tyvars, ! 34: exp = case resultty of ! 35: SOME ty => CONSTRAINTexp(exp,ty) ! 36: | NONE => exp}] ! 37: end ! 38: ! 39: | nonrec _ = raise Isrec ! 40: ! 41: end (* local *) ! 42: end (* struct *)
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.