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/Semant/modules/epcontext.sml
ViewVC logotype

Diff of /sml/trunk/src/compiler/Semant/modules/epcontext.sml

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

revision 249, Sat Apr 17 18:57:03 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 28  Line 28 
28  structure Key =  structure Key =
29    struct    struct
30      type ord_key = MI.modId      type ord_key = MI.modId
31      val cmpKey = MI.cmp      val compare = MI.cmp
32    end    end
33    
34  structure D = BinaryDict(Key)  structure D = BinaryMapFn(Key)
35    
36  type entPathR = EP.entVar list  type entPathR = EP.entVar list
37  type pathmap = entPathR D.dict  type pathmap = entPathR D.map
38    
39  (*  (*
40   * A structure body (struct decls end) is "closed" if   * A structure body (struct decls end) is "closed" if
# Line 64  Line 64 
64   * be accessed from outside (hence the null bindContext)   * be accessed from outside (hence the null bindContext)
65   *)   *)
66  fun enterClosed epc =  fun enterClosed epc =
67    LAYER {locals=ref(D.mkDict()), lookContext=[],    LAYER {locals=ref(D.empty), lookContext=[],
68           bindContext=[], outer=epc}           bindContext=[], outer=epc}
69    
70  (*  (*
# Line 87  Line 87 
87  fun lookPath (EMPTY, _) = NONE  fun lookPath (EMPTY, _) = NONE
88    | lookPath (LAYER{locals,lookContext,bindContext,outer}, id: MI.modId)    | lookPath (LAYER{locals,lookContext,bindContext,outer}, id: MI.modId)
89            : entPathR option =            : entPathR option =
90        (case D.peek(!locals,id)        (case D.find(!locals,id)
91          of NONE => lookPath(outer,id)          of NONE => lookPath(outer,id)
92           | SOME rp => SOME(relative(rev rp, lookContext)))           | SOME rp => SOME(relative(rev rp, lookContext)))
93    
94  (* probe(ctx,s) checks whether a stamp has already be bound before *)  (* probe(ctx,s) checks whether a stamp has already be bound before *)
95  fun probe (EMPTY, s) = false  fun probe (EMPTY, s) = false
96    | probe (LAYER{locals, outer, ...}, s) =    | probe (LAYER{locals, outer, ...}, s) =
97        (case D.peek(!locals, s)        (case D.find(!locals, s)
98          of NONE => probe(outer, s)          of NONE => probe(outer, s)
99           | _ => true)           | _ => true)
100    
# Line 115  Line 115 
115  end (* structure EntPathContext *)  end (* structure EntPathContext *)
116    
117  (*  (*
118   * $Log$   * $Log: epcontext.sml,v $
119     * Revision 1.1.1.1  1998/04/08 18:39:26  george
120     * Version 110.5
121     *
122   *)   *)

Legend:
Removed from v.249  
changed lines
  Added in v.411

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