]> matita.cs.unibo.it Git - helm.git/commitdiff
Printing extremely large terms no longer raises Failure.
authorClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 8 Oct 2009 16:07:20 +0000 (16:07 +0000)
committerClaudio Sacerdoti Coen <claudio.sacerdoticoen@unibo.it>
Thu, 8 Oct 2009 16:07:20 +0000 (16:07 +0000)
helm/software/components/ng_kernel/nCicPp.ml

index f608acc15109f913c4f92a428a8d0cc5452887e9..62dc58e4ece81720642de8bd74977029e8f691b9 100644 (file)
@@ -180,11 +180,14 @@ let ppterm ~formatter:f ~context ~subst ~metasenv:_ ?(inside_fix=false) t =
 ;;
 
 let on_buffer f t = 
+ try
   let buff = Buffer.create 100 in
   let formatter = F.formatter_of_buffer buff in
   f ~formatter:formatter t;
   F.fprintf formatter "@?";
   Buffer.contents buff
+ with Failure m ->
+  "[[Unprintable: " ^ m ^ "]]"
 ;;
 
 let ppterm ~formatter ~context ~subst ~metasenv ?(margin=80) ?inside_fix t =