]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/content_pres/termContentPres.ml
Huge commit with several changes:
[helm.git] / helm / software / components / content_pres / termContentPres.ml
index f1ea0b25e9abeb0b42a78842f7db2a58a721cc29..00f6c978982b5f7904f30a098c2eb699a401cd94 100644 (file)
@@ -94,6 +94,12 @@ let string_of_sort_kind = function
   | `CProp _ -> "CProp"
   | `Type _ -> "Type"
   | `NType s -> "Type[" ^ s ^ "]"
+  | `NCProp s -> "CProp[" ^ s ^ "]"
+
+let map_space f l =
+ HExtlib.list_concat
+  ~sep:[space] (List.map (fun x -> [f x]) l)
+;;
 
 let pp_ast0 t k =
   let rec aux =
@@ -146,7 +152,7 @@ let pp_ast0 t k =
          function
             Ast.Pattern (head, href, vars) ->
              hvbox true true (ident_w_href href head :: 
-               List.flatten (List.map (fun x -> [break;x]) (List.map aux_var vars)))
+               List.flatten (List.map (fun x -> [break;x]) (map_space aux_var vars)))
           | Ast.Wildcard -> builtin_symbol "_"
         in
         let patterns' =
@@ -205,8 +211,8 @@ let pp_ast0 t k =
           match rec_kind with `Inductive -> "rec" | `CoInductive -> "corec"
         in
         let mk_fun (args, (name,ty), body, rec_param) =
-         List.map aux_var args ,k name, HExtlib.map_option k ty, k body,  
-           fst (List.nth args rec_param)
+         List.flatten (List.map (fun x -> [aux_var x; space]) args),
+          k name, HExtlib.map_option k ty, k body, fst (List.nth args rec_param)
         in
         let mk_funs = List.map mk_fun in
         let fst_fun, tl_funs =
@@ -219,9 +225,10 @@ let pp_ast0 t k =
             space;
             keyword rec_op;
             space;
-            name] @
+            name;
+            space] @
             params @
-            [space; keyword "on" ; space ; rec_param ;space ] @
+            [keyword "on" ; space ; rec_param ;space ] @
             (match ty with None -> [] | Some ty -> [builtin_symbol ":"; ty]) @
             [ builtin_symbol "\\def";
             break;