diff options
author | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-10-03 15:09:21 +0200 |
---|---|---|
committer | Pierre-Marie Pédrot <pierre-marie.pedrot@inria.fr> | 2017-10-03 18:59:00 +0200 |
commit | 811ed22e8dcb12d8c88e2c320bbc2221bdff30ab (patch) | |
tree | 02fa0c79935c69c3596a9701d14134941a01f39a /printing/prettyp.mli | |
parent | 1a6a26d29252da54b86bf663a66ddd909905d1cb (diff) |
Implementing a generic mechanism for locating named objects from Coq side.
Diffstat (limited to 'printing/prettyp.mli')
-rw-r--r-- | printing/prettyp.mli | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/printing/prettyp.mli b/printing/prettyp.mli index f4277b6c5..dbd101159 100644 --- a/printing/prettyp.mli +++ b/printing/prettyp.mli @@ -50,12 +50,34 @@ val print_all_instances : unit -> Pp.t val inspect : int -> Pp.t -(** Locate *) +(** {5 Locate} *) + +type 'a locatable_info = { + locate : qualid -> 'a option; + (** Locate the most precise object with the provided name if any. *) + locate_all : qualid -> 'a list; + (** Locate all objects whose name is a suffix of the provided name *) + shortest_qualid : 'a -> qualid; + (** Return the shortest name in the current context *) + name : 'a -> Pp.t; + (** Data as printed by the Locate command *) + print : 'a -> Pp.t; + (** Data as printed by the Print command *) + about : 'a -> Pp.t; + (** Data as printed by the About command *) +} +(** Generic data structure representing locatable objects. *) + +val register_locatable : string -> 'a locatable_info -> unit +(** Define a new type of locatable objects that can be reached via the + corresponding generic vernacular commands. The string should be a unique + name describing the kind of objects considered and that is added as a + grammar command prefix for vernacular commands Locate. *) val print_located_qualid : reference -> Pp.t val print_located_term : reference -> Pp.t -val print_located_tactic : reference -> Pp.t val print_located_module : reference -> Pp.t +val print_located_other : string -> reference -> Pp.t type object_pr = { print_inductive : mutual_inductive -> Pp.t; |