From 03f203779699068d517f298fe31b511821cdd561 Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Thu, 8 Oct 2009 16:07:20 +0000 Subject: [PATCH] Printing extremely large terms no longer raises Failure. --- helm/software/components/ng_kernel/nCicPp.ml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helm/software/components/ng_kernel/nCicPp.ml b/helm/software/components/ng_kernel/nCicPp.ml index f608acc15..62dc58e4e 100644 --- a/helm/software/components/ng_kernel/nCicPp.ml +++ b/helm/software/components/ng_kernel/nCicPp.ml @@ -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 = -- 2.39.2