X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fsoftware%2Fcomponents%2Fcontent_pres%2FtermContentPres.ml;h=2544adb5d0deaec128f9d842a0768176f0a61e30;hb=b8e036c5f3f54406e36cee1177a78922d59a0295;hp=d6694cbb66419be45f3c88609c12f6434e4eef62;hpb=266fe24a5a5548c30f597ccd38578877643404d3;p=helm.git diff --git a/helm/software/components/content_pres/termContentPres.ml b/helm/software/components/content_pres/termContentPres.ml index d6694cbb6..2544adb5d 100644 --- a/helm/software/components/content_pres/termContentPres.ml +++ b/helm/software/components/content_pres/termContentPres.ml @@ -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 = @@ -145,16 +151,16 @@ let pp_ast0 t k = let mk_case_pattern = function Ast.Pattern (head, href, vars) -> - hvbox true false (ident_w_href href head :: List.map aux_var vars) + hvbox true true (ident_w_href href head :: + List.flatten (List.map (fun x -> [break;x]) (map_space aux_var vars))) | Ast.Wildcard -> builtin_symbol "_" in let patterns' = List.map (fun (lhs, rhs) -> remove_level_info - (hvbox false true [ - hbox false true [ - mk_case_pattern lhs; builtin_symbol "\\Rightarrow" ]; + (hovbox false true [ + mk_case_pattern lhs; break; builtin_symbol "\\Rightarrow"; break; top_pos (k rhs) ])) patterns in @@ -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; @@ -232,7 +239,7 @@ let pp_ast0 t k = (fun (params, name, ty, body, rec_param) -> [ break; hvbox false true ([ - keyword "and"; + keyword "and"; space; name] @ params @ [space; keyword "on" ; space; rec_param ;space ] @