diff options
Diffstat (limited to 'printing/pputils.ml')
-rw-r--r-- | printing/pputils.ml | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/printing/pputils.ml b/printing/pputils.ml index 9ef9162ae..a544b4762 100644 --- a/printing/pputils.ml +++ b/printing/pputils.ml @@ -9,7 +9,6 @@ open Util open Pp open Genarg -open Nameops open Misctypes open Locus open Genredexpr @@ -27,7 +26,7 @@ let pr_located pr (loc, x) = let pr_or_var pr = function | ArgArg x -> pr x - | ArgVar (_,s) -> pr_id s + | ArgVar (_,s) -> Names.Id.print s let pr_with_occurrences pr keyword (occs,c) = match occs with @@ -104,6 +103,9 @@ let pr_red_expr (pr_constr,pr_lconstr,pr_ref,pr_pattern) keyword = function | CbvNative o -> keyword "native_compute" ++ pr_opt (pr_with_occurrences (pr_union pr_ref pr_pattern) keyword) o +let pr_red_expr_env env sigma (pr_constr,pr_lconstr,pr_ref,pr_pattern) = + pr_red_expr (pr_constr env sigma, pr_lconstr env sigma, pr_ref, pr_pattern env sigma) + let pr_or_by_notation f = function | AN v -> f v | ByNotation (_,(s,sc)) -> qs s ++ pr_opt (fun sc -> str "%" ++ str sc) sc @@ -128,7 +130,10 @@ let rec pr_raw_generic env (GenArg (Rawwit wit, x)) = let q = in_gen (rawwit wit2) q in hov_if_not_empty 0 (pr_sequence (pr_raw_generic env) [p; q]) | ExtraArg s -> - Genprint.generic_raw_print (in_gen (rawwit wit) x) + let open Genprint in + match generic_raw_print (in_gen (rawwit wit) x) with + | PrinterBasic pp -> pp () + | PrinterNeedsLevel { default_ensure_surrounded; printer } -> printer default_ensure_surrounded let rec pr_glb_generic env (GenArg (Glbwit wit, x)) = @@ -150,4 +155,7 @@ let rec pr_glb_generic env (GenArg (Glbwit wit, x)) = let ans = pr_sequence (pr_glb_generic env) [p; q] in hov_if_not_empty 0 ans | ExtraArg s -> - Genprint.generic_glb_print (in_gen (glbwit wit) x) + let open Genprint in + match generic_glb_print (in_gen (glbwit wit) x) with + | PrinterBasic pp -> pp () + | PrinterNeedsLevel { default_ensure_surrounded; printer } -> printer default_ensure_surrounded |