diff options
author | Stephane Glondu <steph@glondu.net> | 2011-12-25 13:19:42 +0100 |
---|---|---|
committer | Stephane Glondu <steph@glondu.net> | 2011-12-25 13:19:42 +0100 |
commit | 300293c119981054c95182a90c829058530a6b6f (patch) | |
tree | d7303613741c5796b58ced7db24ec7203327dbb2 /parsing/printer.ml | |
parent | 9d27ae09786866b6e3d7b79d1fa7667e5e2aa309 (diff) |
Imported Upstream version 8.3.pl3upstream/8.3.pl3
Diffstat (limited to 'parsing/printer.ml')
-rw-r--r-- | parsing/printer.ml | 36 |
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 () ) ) |