]> matita.cs.unibo.it Git - helm.git/blobdiff - matita/components/ng_extraction/ocamlExtraction.ml
Bug fixed: "open X" were not printed in .mli because streams are destructive.
[helm.git] / matita / components / ng_extraction / ocamlExtraction.ml
index 1d672c49d80409b050ef958e722f6ce54333b4d5..6465aa86d26a57e9f68dcf30e640db202e792ed3 100644 (file)
@@ -10,18 +10,17 @@ let print_ocaml_of_obj0 status ((_uri,_,_,_,_) as obj) =
       let status,cmds = Ocaml.pp_spec status ml in
       print_ppcmds ~in_ml:false status (cmds ++ fnl () ++ fnl ());
       status,()) resl in
-  match res with
-     None ->
-(*    print_ppcmds status
-       (str("(* " ^ NUri.string_of_uri uri ^ " non informative *)\n")++ fnl ());*)
-      status
-   | Some ml ->
-      let status,std_ppcmds = Ocaml.pp_decl status ml in
-      print_ppcmds status ~in_ml:true (std_ppcmds ++ fnl ());
-      status
+  let status,_ =
+   map_status status
+    (fun status ml ->
+      let status,cmds = Ocaml.pp_decl status ml in
+      print_ppcmds ~in_ml:true status (cmds ++ fnl () ++ fnl ());
+      status,()) res in
+  status
  with
-  HExtlib.Localized (_,exn) ->
-   prerr_endline (Printexc.to_string exn); assert false
+    HExtlib.Localized (_,exn)
+  | exn ->
+     prerr_endline (Printexc.to_string exn); assert false
 
 let do_if_ocaml_set f status =
  if try ignore (Helm_registry.get "extract_ocaml"); true
@@ -42,6 +41,7 @@ let print_open status uris =
      List.map (fun uri -> Filename.basename (NUri.string_of_uri uri)) uris in
     let status,cmds = map_status status Ocaml.pp_open fnames in
     List.iter (print_ppcmds status ~in_ml:true) cmds;
+    let status,cmds = map_status status Ocaml.pp_open fnames in
     List.iter (print_ppcmds status ~in_ml:false) cmds;
     status
   ) status