From fa6d5dd5efed2fe1f732d61eac126e39fef38305 Mon Sep 17 00:00:00 2001 From: Regis-Gianas Date: Tue, 4 Nov 2014 21:51:25 +0100 Subject: printing/Pptacticsig: New signature for tactic pretty-printers. printing/Pptactic: Use it. --- printing/pptactic.mli | 109 +----------------------------------------- printing/pptacticsig.mli | 120 +++++++++++++++++++++++++++++++++++++++++++++++ printing/printing.mllib | 1 + 3 files changed, 122 insertions(+), 108 deletions(-) create mode 100644 printing/pptacticsig.mli diff --git a/printing/pptactic.mli b/printing/pptactic.mli index f76e5a3f66..1afd731b73 100644 --- a/printing/pptactic.mli +++ b/printing/pptactic.mli @@ -6,111 +6,4 @@ (* * GNU Lesser General Public License Version 2.1 *) (************************************************************************) -open Pp -open Genarg -open Names -open Constrexpr -open Tacexpr -open Ppextend -open Environ -open Pattern -open Misctypes - -val pr_or_var : ('a -> std_ppcmds) -> 'a or_var -> std_ppcmds -val pr_and_short_name : ('a -> std_ppcmds) -> 'a and_short_name -> std_ppcmds -val pr_or_by_notation : ('a -> std_ppcmds) -> 'a or_by_notation -> std_ppcmds - -type 'a raw_extra_genarg_printer = - (constr_expr -> std_ppcmds) -> - (constr_expr -> std_ppcmds) -> - (tolerability -> raw_tactic_expr -> std_ppcmds) -> - 'a -> std_ppcmds - -type 'a glob_extra_genarg_printer = - (glob_constr_and_expr -> std_ppcmds) -> - (glob_constr_and_expr -> std_ppcmds) -> - (tolerability -> glob_tactic_expr -> std_ppcmds) -> - 'a -> std_ppcmds - -type 'a extra_genarg_printer = - (Term.constr -> std_ppcmds) -> - (Term.constr -> std_ppcmds) -> - (tolerability -> glob_tactic_expr -> std_ppcmds) -> - 'a -> std_ppcmds - -val declare_extra_genarg_pprule : - ('a, 'b, 'c) genarg_type -> - 'a raw_extra_genarg_printer -> - 'b glob_extra_genarg_printer -> - 'c extra_genarg_printer -> unit - -type grammar_terminals = string option list - -type pp_tactic = { - pptac_args : argument_type list; - pptac_prods : int * grammar_terminals; -} - -val declare_ml_tactic_pprule : ml_tactic_name -> pp_tactic -> unit -val declare_notation_tactic_pprule : KerName.t -> pp_tactic -> unit - -val pr_clauses : bool option -> - ('a -> Pp.std_ppcmds) -> 'a Locus.clause_expr -> Pp.std_ppcmds -val pr_raw_generic : - (constr_expr -> std_ppcmds) -> - (constr_expr -> std_ppcmds) -> - (tolerability -> raw_tactic_expr -> std_ppcmds) -> - (constr_expr -> std_ppcmds) -> - (Libnames.reference -> std_ppcmds) -> rlevel generic_argument -> - std_ppcmds - -val pr_glb_generic : - (glob_constr_and_expr -> Pp.std_ppcmds) -> - (glob_constr_and_expr -> Pp.std_ppcmds) -> - (tolerability -> glob_tactic_expr -> std_ppcmds) -> - (glob_constr_pattern_and_expr -> std_ppcmds) -> - glevel generic_argument -> std_ppcmds - -val pr_top_generic : - (Term.constr -> std_ppcmds) -> - (Term.constr -> std_ppcmds) -> - (tolerability -> glob_tactic_expr -> std_ppcmds) -> - (Pattern.constr_pattern -> std_ppcmds) -> - tlevel generic_argument -> - std_ppcmds - -val pr_raw_extend: - (constr_expr -> std_ppcmds) -> (constr_expr -> std_ppcmds) -> - (tolerability -> raw_tactic_expr -> std_ppcmds) -> - (constr_expr -> std_ppcmds) -> int -> - ml_tactic_name -> raw_generic_argument list -> std_ppcmds - -val pr_glob_extend: - (glob_constr_and_expr -> std_ppcmds) -> (glob_constr_and_expr -> std_ppcmds) -> - (tolerability -> glob_tactic_expr -> std_ppcmds) -> - (glob_constr_pattern_and_expr -> std_ppcmds) -> int -> - ml_tactic_name -> glob_generic_argument list -> std_ppcmds - -val pr_extend : - (Term.constr -> std_ppcmds) -> (Term.constr -> std_ppcmds) -> - (tolerability -> glob_tactic_expr -> std_ppcmds) -> - (constr_pattern -> std_ppcmds) -> int -> - ml_tactic_name -> typed_generic_argument list -> std_ppcmds - -val pr_ltac_constant : Nametab.ltac_constant -> std_ppcmds - -val pr_raw_tactic : raw_tactic_expr -> std_ppcmds - -val pr_raw_tactic_level : tolerability -> raw_tactic_expr -> std_ppcmds - -val pr_glob_tactic : env -> glob_tactic_expr -> std_ppcmds - -val pr_tactic : env -> tactic_expr -> std_ppcmds - -val pr_hintbases : string list option -> std_ppcmds - -val pr_auto_using : ('constr -> std_ppcmds) -> 'constr list -> std_ppcmds - -val pr_bindings : - ('constr -> std_ppcmds) -> - ('constr -> std_ppcmds) -> 'constr bindings -> std_ppcmds +include Pptacticsig.Pp diff --git a/printing/pptacticsig.mli b/printing/pptacticsig.mli new file mode 100644 index 0000000000..f088d7b74e --- /dev/null +++ b/printing/pptacticsig.mli @@ -0,0 +1,120 @@ +(************************************************************************) +(* v * The Coq Proof Assistant / The Coq Development Team *) +(* std_ppcmds) -> 'a or_var -> std_ppcmds + val pr_and_short_name : ('a -> std_ppcmds) -> 'a and_short_name -> std_ppcmds + val pr_or_by_notation : ('a -> std_ppcmds) -> 'a or_by_notation -> std_ppcmds + + type 'a raw_extra_genarg_printer = + (constr_expr -> std_ppcmds) -> + (constr_expr -> std_ppcmds) -> + (tolerability -> raw_tactic_expr -> std_ppcmds) -> + 'a -> std_ppcmds + + type 'a glob_extra_genarg_printer = + (glob_constr_and_expr -> std_ppcmds) -> + (glob_constr_and_expr -> std_ppcmds) -> + (tolerability -> glob_tactic_expr -> std_ppcmds) -> + 'a -> std_ppcmds + + type 'a extra_genarg_printer = + (Term.constr -> std_ppcmds) -> + (Term.constr -> std_ppcmds) -> + (tolerability -> glob_tactic_expr -> std_ppcmds) -> + 'a -> std_ppcmds + + val declare_extra_genarg_pprule : + ('a, 'b, 'c) genarg_type -> + 'a raw_extra_genarg_printer -> + 'b glob_extra_genarg_printer -> + 'c extra_genarg_printer -> unit + + type grammar_terminals = string option list + + type pp_tactic = { + pptac_args : argument_type list; + pptac_prods : int * grammar_terminals; + } + + val declare_ml_tactic_pprule : ml_tactic_name -> pp_tactic -> unit + val declare_notation_tactic_pprule : KerName.t -> pp_tactic -> unit + + val pr_clauses : bool option -> + ('a -> Pp.std_ppcmds) -> 'a Locus.clause_expr -> Pp.std_ppcmds + val pr_raw_generic : + (constr_expr -> std_ppcmds) -> + (constr_expr -> std_ppcmds) -> + (tolerability -> raw_tactic_expr -> std_ppcmds) -> + (constr_expr -> std_ppcmds) -> + (Libnames.reference -> std_ppcmds) -> rlevel generic_argument -> + std_ppcmds + + val pr_glb_generic : + (glob_constr_and_expr -> Pp.std_ppcmds) -> + (glob_constr_and_expr -> Pp.std_ppcmds) -> + (tolerability -> glob_tactic_expr -> std_ppcmds) -> + (glob_constr_pattern_and_expr -> std_ppcmds) -> + glevel generic_argument -> std_ppcmds + + val pr_top_generic : + (Term.constr -> std_ppcmds) -> + (Term.constr -> std_ppcmds) -> + (tolerability -> glob_tactic_expr -> std_ppcmds) -> + (Pattern.constr_pattern -> std_ppcmds) -> + tlevel generic_argument -> + std_ppcmds + + val pr_raw_extend: + (constr_expr -> std_ppcmds) -> (constr_expr -> std_ppcmds) -> + (tolerability -> raw_tactic_expr -> std_ppcmds) -> + (constr_expr -> std_ppcmds) -> int -> + ml_tactic_name -> raw_generic_argument list -> std_ppcmds + + val pr_glob_extend: + (glob_constr_and_expr -> std_ppcmds) -> (glob_constr_and_expr -> std_ppcmds) -> + (tolerability -> glob_tactic_expr -> std_ppcmds) -> + (glob_constr_pattern_and_expr -> std_ppcmds) -> int -> + ml_tactic_name -> glob_generic_argument list -> std_ppcmds + + val pr_extend : + (Term.constr -> std_ppcmds) -> (Term.constr -> std_ppcmds) -> + (tolerability -> glob_tactic_expr -> std_ppcmds) -> + (constr_pattern -> std_ppcmds) -> int -> + ml_tactic_name -> typed_generic_argument list -> std_ppcmds + + val pr_ltac_constant : Nametab.ltac_constant -> std_ppcmds + + val pr_raw_tactic : raw_tactic_expr -> std_ppcmds + + val pr_raw_tactic_level : tolerability -> raw_tactic_expr -> std_ppcmds + + val pr_glob_tactic : env -> glob_tactic_expr -> std_ppcmds + + val pr_tactic : env -> tactic_expr -> std_ppcmds + + val pr_hintbases : string list option -> std_ppcmds + + val pr_auto_using : ('constr -> std_ppcmds) -> 'constr list -> std_ppcmds + + val pr_bindings : + ('constr -> std_ppcmds) -> + ('constr -> std_ppcmds) -> 'constr bindings -> std_ppcmds + +end diff --git a/printing/printing.mllib b/printing/printing.mllib index 713c2dee6f..7910702984 100644 --- a/printing/printing.mllib +++ b/printing/printing.mllib @@ -5,6 +5,7 @@ Ppconstr Ppconstrsig Printer Pptactic +Pptacticsig Printmod Prettyp Ppvernac -- cgit v1.2.3