aboutsummaryrefslogtreecommitdiffhomepage
path: root/contrib/extraction/scheme.ml
diff options
context:
space:
mode:
authorGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-01-22 01:22:34 +0000
committerGravatar letouzey <letouzey@85f007b7-540e-0410-9357-904b9bb8a0f7>2003-01-22 01:22:34 +0000
commit7da1f2925cd7c355d38f5cfac7d5d3195f6191e9 (patch)
tree1b16a7d57c23678e45bd4b400726c836e0c597d8 /contrib/extraction/scheme.ml
parent7c4ffd70946030c74105323f8b45d6d9edfa7ac0 (diff)
Extraction des modules, enfin !
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3569 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'contrib/extraction/scheme.ml')
-rw-r--r--contrib/extraction/scheme.ml31
1 files changed, 21 insertions, 10 deletions
diff --git a/contrib/extraction/scheme.ml b/contrib/extraction/scheme.ml
index 75533f788..b6d0014ac 100644
--- a/contrib/extraction/scheme.ml
+++ b/contrib/extraction/scheme.ml
@@ -17,6 +17,7 @@ open Nameops
open Libnames
open Miniml
open Mlutil
+open Table
open Ocaml
(*s Scheme renaming issues. *)
@@ -46,7 +47,7 @@ let pp_abst st = function
module Make = functor(P : Mlpp_param) -> struct
-let pp_global r = P.pp_global r
+let pp_global r = P.pp_global initial_path r
let empty_env () = [], P.globals()
(*s Pretty-printing of expressions. *)
@@ -109,8 +110,6 @@ let rec pp_expr env args =
pp_expr env args a
| MLmagic a ->
pp_expr env args a
- | MLcustom s -> str s
-
and pp_one_pat env (r,ids,t) =
let pp_arg id = str "?" ++ pr_id id in
@@ -141,10 +140,9 @@ and pp_fix env j (ids,bl) args =
(*s Pretty-printing of a declaration. *)
-let pp_decl = function
+let pp_decl _ = function
| Dind _ -> mt ()
| Dtype _ -> mt ()
- | DcustomType _ -> mt ()
| Dfix (rv, defs,_) ->
let ppv = Array.map pp_global rv in
prvect_with_sep fnl
@@ -153,12 +151,25 @@ let pp_decl = function
(paren (str "define " ++ pi ++ spc () ++
(pp_expr (empty_env ()) [] ti))
++ fnl ()))
- (array_map2 (fun p b -> (p,b)) ppv defs)
+ (array_map2 (fun p b -> (p,b)) ppv defs) ++
+ fnl ()
| Dterm (r, a, _) ->
- hov 2 (paren (str "define " ++ pp_global r ++ spc () ++
- pp_expr (empty_env ()) [] a)) ++ fnl ()
- | DcustomTerm (r,s) ->
- hov 2 (paren (str "define " ++ pp_global r ++ spc () ++ str s) ++ fnl ())
+ if is_inline_custom r then mt ()
+ else
+ hov 2 (paren (str "define " ++ pp_global r ++ spc () ++
+ pp_expr (empty_env ()) [] a)) ++ fnl () ++ fnl ()
+
+let pp_structure_elem mp = function
+ | (l,SEdecl d) -> pp_decl mp d
+ | (l,SEmodule m) ->
+ failwith "TODO: Scheme extraction of modules not implemented yet"
+ | (l,SEmodtype m) ->
+ failwith "TODO: Scheme extraction of modules not implemented yet"
+
+let pp_struct =
+ prlist (fun (mp,sel) -> prlist (pp_structure_elem mp) sel)
+
+let pp_signature s = assert false
end