Commit 7d79cceb authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2002-11-17 11:56:27 by cvscast] Empty log message

Original author: cvscast
Date: 2002-11-17 11:56:46+00:00
parent 2a36912f
......@@ -22,6 +22,7 @@ let raise_loc loc exn = raise (Location (loc,exn))
type ti = {
id : int;
mutable seen : bool;
mutable loc' : loc;
mutable fv : StringSet.t option;
mutable descr': descr;
......@@ -51,6 +52,7 @@ let mk' =
incr counter;
let rec x = {
id = !counter;
seen = false;
loc' = loc;
fv = None;
descr' = `Alias ("__dummy__", x);
......@@ -273,7 +275,7 @@ and compile_many env b =
module IntSet =
Set.Make(struct type t = int let compare (x:int) y = compare x y end)
let comp_fv_seen = ref IntSet.empty
let comp_fv_seen = ref []
let comp_fv_res = ref StringSet.empty
let rec comp_fv s =
match s.fv with
......@@ -281,9 +283,10 @@ let rec comp_fv s =
| None ->
(match s.descr' with
| `Alias (_,x) ->
if IntSet.mem x.id !comp_fv_seen then ()
if x.seen then ()
else (
comp_fv_seen := IntSet.add x.id !comp_fv_seen;
x.seen <- true;
comp_fv_seen := x :: !comp_fv_seen;
comp_fv x
)
| `Or (s1,s2)
......@@ -305,7 +308,8 @@ let fv s =
comp_fv s;
let l = !comp_fv_res in
comp_fv_res := StringSet.empty;
comp_fv_seen := IntSet.empty;
List.iter (fun n -> n.seen <- false) !comp_fv_seen;
comp_fv_seen := [];
s.fv <- Some l;
l
......@@ -339,7 +343,7 @@ and typ_node s : Types.node =
let type_node s =
let s = typ_node s in
let s = Types.internalize s in
(* Types.define s (Types.normalize (Types.descr s)); *)
Types.define s (Types.normalize (Types.descr s));
s
let rec pat seen s : Patterns.descr =
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment