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/branches/primop-branch-2/src/compiler/FLINT/trans/translate.sml
ViewVC logotype

Diff of /sml/branches/primop-branch-2/src/compiler/FLINT/trans/translate.sml

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

revision 903, Mon Aug 20 19:34:06 2001 UTC revision 904, Mon Aug 20 19:50:05 2001 UTC
# Line 289  Line 289 
289   * clean up this is to put all the core constructors and primitives into   * clean up this is to put all the core constructors and primitives into
290   * the primitive environment. (ZHONG)   * the primitive environment. (ZHONG)
291   *)   *)
292    exception NoCore
293    
294  fun coreExn id =  fun coreExn id =
295    ((case coreLookup(id, env)      (case CoreAccess.getCon' (fn () => raise NoCore) (env, id) of
296       of V.CON(TP.DATACON{name, rep as DA.EXN _, typ, ...}) =>           TP.DATACON { name, rep as DA.EXN _, typ, ... } =>
297            let val nt = toDconLty DI.top typ            let val nt = toDconLty DI.top typ
298                val nrep = mkRep(rep, nt, name)                val nrep = mkRep(rep, nt, name)
299             in CON'((name, nrep, nt), [], unitLexp)             in CON'((name, nrep, nt), [], unitLexp)
300            end            end
301        | _ => bug "coreExn in translate")        | _ => bug "coreExn in translate")
302     handle NoCore => (say "WARNING: no Core access \n"; INT 0))      handle NoCore => (say "WARNING: no Core access\n"; INT 0)
303    
304  and coreAcc id =  and coreAcc id =
305    ((case coreLookup(id, env)      (case CoreAccess.getVar' (fn () => raise NoCore) (env, id) of
306       of V.VAL(V.VALvar{access, typ, path, ...}) =>           V.VALvar { access, typ, path, ... } =>
307             mkAccT(access, toLty DI.top (!typ), getNameOp path)             mkAccT(access, toLty DI.top (!typ), getNameOp path)
308        | _ => bug "coreAcc in translate")        | _ => bug "coreAcc in translate")
309     handle NoCore => (say "WARNING: no Core access \n"; INT 0))      handle NoCore => (say "WARNING: no Core access\n"; INT 0)
   
310    
311  (** expands the flex record pattern and convert the EXN access pat *)  (** expands the flex record pattern and convert the EXN access pat *)
312  (** internalize the conrep's access, always exceptions *)  (** internalize the conrep's access, always exceptions *)

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

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