summaryrefslogtreecommitdiff
path: root/parsing/printer.ml
diff options
context:
space:
mode:
Diffstat (limited to 'parsing/printer.ml')
-rw-r--r--parsing/printer.ml36
1 files changed, 23 insertions, 13 deletions
diff --git a/parsing/printer.ml b/parsing/printer.ml
index cf0050a5..75cdead9 100644
--- a/parsing/printer.ml
+++ b/parsing/printer.ml
@@ -1,12 +1,12 @@
(************************************************************************)
(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2010 *)
+(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2011 *)
(* \VV/ **************************************************************)
(* // * This file is distributed under the terms of the *)
(* * GNU Lesser General Public License Version 2.1 *)
(************************************************************************)
-(* $Id: printer.ml 13390 2010-09-02 08:03:01Z herbelin $ *)
+(* $Id: printer.ml 14641 2011-11-06 11:59:10Z herbelin $ *)
open Pp
open Util
@@ -499,14 +499,26 @@ let pr_prim_rule = function
let prterm = pr_lconstr
-(* spiwack: printer function for sets of Environ.assumption.
- It is used primarily by the Print Assumption command. *)
+(* Printer function for sets of Assumptions.assumptions.
+ It is used primarily by the Print Assumptions command. *)
+
+open Assumptions
+
let pr_assumptionset env s =
- if (Environ.ContextObjectMap.is_empty s) then
- str "Closed under the global context"
+ if ContextObjectMap.is_empty s then
+ str "Closed under the global context" ++ fnl()
else
+ let safe_pr_constant env kn =
+ try pr_constant env kn
+ with Not_found ->
+ let mp,_,lab = repr_con kn in
+ str (string_of_mp mp ^ "." ^ string_of_label lab)
+ in
+ let safe_pr_ltype typ =
+ try str " : " ++ pr_ltype typ with _ -> mt ()
+ in
let (vars,axioms,opaque) =
- Environ.ContextObjectMap.fold (fun t typ r ->
+ ContextObjectMap.fold (fun t typ r ->
let (v,a,o) = r in
match t with
| Variable id -> ( Some (
@@ -521,9 +533,8 @@ let pr_assumptionset env s =
| Axiom kn -> ( v ,
Some (
Option.default (fnl ()) a
- ++ (pr_constant env kn)
- ++ str " : "
- ++ pr_ltype typ
+ ++ safe_pr_constant env kn
+ ++ safe_pr_ltype typ
++ fnl ()
)
, o
@@ -531,9 +542,8 @@ let pr_assumptionset env s =
| Opaque kn -> ( v , a ,
Some (
Option.default (fnl ()) o
- ++ (pr_constant env kn)
- ++ str " : "
- ++ pr_ltype typ
+ ++ safe_pr_constant env kn
+ ++ safe_pr_ltype typ
++ fnl ()
)
)