(* $Id$ *)
-let ppterm =
- ref (fun ~context:_ ~subst:_ ~metasenv:_ ?inside_fix _ ->
- ignore (inside_fix) ; "Please, set a pp callback")
-;;
-
-let set_ppterm f = ppterm := f;;
-
-let ppterm ~context ~subst ~metasenv ?inside_fix t =
- !ppterm ~context ~subst ~metasenv ?inside_fix t
-;;
-
module C = NCic
module R = NReference
with NCicLibrary.ObjectNotFound _ -> R.string_of_reference r
;;
-let trivial_pp_term ~context ~subst:_ ~metasenv:_ ?(inside_fix=false) t =
+let ppterm ~context ~subst ~metasenv:_ ?(inside_fix=false) t =
let buff = Buffer.create 100 in
let f = Format.formatter_of_buffer buff in
let module F = Format in
if not toplevel then F.fprintf f ")";
F.fprintf f "@]"
| C.Implicit _ -> F.fprintf f "?"
+ | C.Meta (n,lc) when List.mem_assoc n subst ->
+ let _,_,t,_ = List.assoc n subst in
+ aux ctx (NCicSubstitution.subst_meta lc t)
| C.Meta (n,(shift,C.Irl len)) ->
F.fprintf f "?%d(%d,%d)" n shift len
| C.Meta (n,(shift,C.Ctx l)) ->
F.fprintf f "?%d(%d,[" n shift;
- List.iter (fun x -> aux ctx x; F.fprintf f ",") l;
+ if List.length l > 0 then
+ begin
+ aux ctx (List.hd l);
+ List.iter (fun x -> F.fprintf f ",";aux ctx x) (List.tl l);
+ end;
F.fprintf f "])"
| C.Sort C.Prop -> F.fprintf f "Prop"
| C.Sort (C.Type []) -> F.fprintf f "IllFormedUniverse"