/[svn]/typing/typer.ml
ViewVC logotype

Diff of /typing/typer.ml

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

revision 140 by abate, Tue Jul 10 17:09:53 2007 UTC revision 141 by abate, Tue Jul 10 17:09:57 2007 UTC
# Line 22  Line 22 
22    
23  type ti = {  type ti = {
24    id : int;    id : int;
25      mutable seen : bool;
26    mutable loc' : loc;    mutable loc' : loc;
27    mutable fv : StringSet.t option;    mutable fv : StringSet.t option;
28    mutable descr': descr;    mutable descr': descr;
# Line 51  Line 52 
52      incr counter;      incr counter;
53      let rec x = {      let rec x = {
54        id = !counter;        id = !counter;
55          seen = false;
56        loc' = loc;        loc' = loc;
57        fv = None;        fv = None;
58        descr' = `Alias ("__dummy__", x);        descr' = `Alias ("__dummy__", x);
# Line 273  Line 275 
275  module IntSet =  module IntSet =
276    Set.Make(struct type t = int let compare (x:int) y = compare x y end)    Set.Make(struct type t = int let compare (x:int) y = compare x y end)
277    
278  let comp_fv_seen = ref IntSet.empty  let comp_fv_seen = ref []
279  let comp_fv_res = ref StringSet.empty  let comp_fv_res = ref StringSet.empty
280  let rec comp_fv s =  let rec comp_fv s =
281    match s.fv with    match s.fv with
# Line 281  Line 283 
283      | None ->      | None ->
284          (match s.descr' with          (match s.descr' with
285             | `Alias (_,x) ->             | `Alias (_,x) ->
286                 if IntSet.mem x.id !comp_fv_seen then ()                 if x.seen then ()
287                 else (                 else (
288                   comp_fv_seen := IntSet.add x.id !comp_fv_seen;                   x.seen <- true;
289                     comp_fv_seen := x :: !comp_fv_seen;
290                   comp_fv x                   comp_fv x
291                 )                 )
292               | `Or (s1,s2)               | `Or (s1,s2)
# Line 305  Line 308 
308          comp_fv s;          comp_fv s;
309          let l = !comp_fv_res in          let l = !comp_fv_res in
310          comp_fv_res := StringSet.empty;          comp_fv_res := StringSet.empty;
311          comp_fv_seen := IntSet.empty;          List.iter (fun n -> n.seen <- false) !comp_fv_seen;
312            comp_fv_seen := [];
313          s.fv <- Some l;          s.fv <- Some l;
314          l          l
315    
# Line 339  Line 343 
343  let type_node s =  let type_node s =
344    let s = typ_node s in    let s = typ_node s in
345    let s = Types.internalize s in    let s = Types.internalize s in
346  (*  Types.define s (Types.normalize (Types.descr s)); *)    Types.define s (Types.normalize (Types.descr s));
347    s    s
348    
349  let rec pat seen s : Patterns.descr =  let rec pat seen s : Patterns.descr =

Legend:
Removed from v.140  
changed lines
  Added in v.141

CVS Admin">CVS Admin
ViewVC Help
Powered by ViewVC 1.1.5