summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Seguin <guillaume@segu.in>2009-01-12 02:59:12 +0100
committerGuillaume Seguin <guillaume@segu.in>2009-01-12 02:59:12 +0100
commit2dec387f350c80bb779dd82dabd32cac44655101 (patch)
tree4247d7ce9b5c5c924a48861ff3a232e9286c22b3
parentb36746147373df9ead999e19c4874a94670746f4 (diff)
downloadpetitcaml-2dec387f350c80bb779dd82dabd32cac44655101.tar.gz
petitcaml-2dec387f350c80bb779dd82dabd32cac44655101.tar.bz2
[petitcaml] closure.ml : fix imports and improve errors
-rw-r--r--closure.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/closure.ml b/closure.ml
index 22c29a0..7549c86 100644
--- a/closure.ml
+++ b/closure.ml
@@ -1,3 +1,6 @@
+open Ast
+open Utils
+
let next_fun_id = ref 0
let get_function_name f =
@@ -9,7 +12,6 @@ let get_function_name f =
name
| Some s -> s
-
module Sset = Set.Make(String)
let rec motif_vars m =
@@ -49,7 +51,7 @@ let rec free_vars expr =
Sset.union (Sset.union (free_vars match_expr)
(free_vars empty_expr))
(Sset.diff (free_vars result_expr) motifs_idents)
- | Eclos _ -> failwith "Unreachable matching"
+ | Eclos _ -> failwith "free_vars : Unreachable matching"
let rec replace_funcs expr =
match expr.e with
@@ -113,7 +115,7 @@ let rec replace_funcs expr =
(raw_expr (Ematch (match_expr, empty_expr,
head_m, tail_m, result_expr))),
letfuns1 @ letfuns2 @ letfuns3
- | Eclos _ -> failwith "Unreachable matching"
+ | Eclos _ -> failwith "replace_funcs : Unreachable matching"
and build_letfun fname f fvars =
let fbody, letfuns = replace_funcs f.body
in