Module Nameops

Identifiers and names

val make_ident : string -> int option -> Names.Id.t
val repr_ident : Names.Id.t -> string * int option
val atompart_of_id : Names.Id.t -> string

remove trailing digits

val root_of_id : Names.Id.t -> Names.Id.t

remove trailing digits, ' and _

val add_suffix : Names.Id.t -> string -> Names.Id.t
val add_prefix : string -> Names.Id.t -> Names.Id.t

Below, by subscript we mean a suffix composed solely from (decimal) digits.

module Subscript : sig ... end
val has_subscript : Names.Id.t -> bool
val get_subscript : Names.Id.t -> Names.Id.t * Subscript.t

Split an identifier into a base name and a subscript.

val add_subscript : Names.Id.t -> Subscript.t -> Names.Id.t

Append the subscript to the identifier.

val increment_subscript : Names.Id.t -> Names.Id.t

Return the same identifier as the original one but whose subscript is incremented. If the original identifier does not have a suffix, 0 is appended to it.

Example mappings:

barbar0

bar0bar1

bar00bar01

bar1bar2

bar01bar01

bar9bar10

bar09bar10

bar99bar100

val forget_subscript : Names.Id.t -> Names.Id.t
module Name : sig ... end
val pr_meta : Constr.metavariable -> Pp.t

Metavariables

val string_of_meta : Constr.metavariable -> string