X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=matita%2Fmatita%2FapplyTransformation.ml;h=f761a153b5a839df843d61fd9ca21db2abf6fcef;hb=aad5588b82d0f2991c336f7ac2f3fadd76768eeb;hp=51ac812683488f6d5e0d6baa940da126d8ced93b;hpb=894d518aa760c9f816ddb0dc2b3fa88e1fe20a94;p=helm.git diff --git a/matita/matita/applyTransformation.ml b/matita/matita/applyTransformation.ml index 51ac81268..f761a153b 100644 --- a/matita/matita/applyTransformation.ml +++ b/matita/matita/applyTransformation.ml @@ -53,7 +53,7 @@ let ntxt_of_cic_sequent ~metasenv ~subst = (fun seq -> (new NCicPp.status)#ppmetasenv ~subst [seq]) let ntxt_of_cic_object ~map_unicode_to_tex = - to_text Interpretations.nmap_obj Content2pres.nobj2pres ~map_unicode_to_tex + to_text Interpretations.nmap_cobj Content2pres.nobj2pres ~map_unicode_to_tex (new NCicPp.status)#ppobj let ntxt_of_cic_term ~metasenv ~subst ~context = @@ -76,23 +76,35 @@ class status = inherit Interpretations.status inherit TermContentPres.status method ppterm ~context ~subst ~metasenv ?margin ?inside_fix t = - snd (ntxt_of_cic_term ~map_unicode_to_tex:true 80 self ~metasenv ~subst + snd (ntxt_of_cic_term ~map_unicode_to_tex:false 80 self ~metasenv ~subst ~context t) method ppcontext ?sep ~subst ~metasenv context = - snd (ntxt_of_cic_context ~map_unicode_to_tex:true 80 self ~metasenv ~subst + snd (ntxt_of_cic_context ~map_unicode_to_tex:false 80 self ~metasenv ~subst context) method ppsubst ~metasenv ?use_subst subst = - snd (ntxt_of_cic_subst ~map_unicode_to_tex:true 80 self ~metasenv ?use_subst + snd (ntxt_of_cic_subst ~map_unicode_to_tex:false 80 self ~metasenv ?use_subst subst) method ppmetasenv ~subst metasenv = String.concat "\n" (List.map - (fun m -> snd (ntxt_of_cic_sequent ~map_unicode_to_tex:true 80 self + (fun m -> snd (ntxt_of_cic_sequent ~map_unicode_to_tex:false 80 self ~metasenv ~subst m)) metasenv) method ppobj obj = - snd (ntxt_of_cic_object ~map_unicode_to_tex:true 80 self obj) + snd (ntxt_of_cic_object ~map_unicode_to_tex:false 80 self obj) end + +let notation_pp_term status term = + let to_pres = Content2pres.nterm2pres ?prec:None in + let content = term in + let size = 80 in + let ids_to_nrefs = Hashtbl.create 1 in + let pres = to_pres status ~ids_to_nrefs content in + let pres = CicNotationPres.mpres_of_box pres in + BoxPp.render_to_string ~map_unicode_to_tex:(Helm_registry.get_bool "matita.paste_unicode_as_tex") + (function x::_ -> x | _ -> assert false) size pres + +let _ = NotationPp.set_pp_term (fun status y -> snd (notation_pp_term (Obj.magic status) y))