package gospel

  1. Overview
  2. Docs

Identifiers

These are uniquely tagged identifiers produced by the typing.

type t = private {
  1. id_str : string;
    (*

    The identifier name.

    *)
  2. id_attrs : string list;
    (*

    The attributes of the identifier.

    *)
  3. id_loc : Ppxlib.Location.t;
    (*

    The location of the identifier.

    *)
  4. id_tag : int;
    (*

    The unique tag of the identifier.

    *)
}

The type for identifiers.

val compare : t -> t -> int
val equal : t -> t -> bool
val hash : t -> int
val pp : Format.formatter -> t -> unit

Pretty printer for identifiers.

val create : ?attrs:string list -> loc:Ppxlib.Location.t -> string -> t

create ~attrs ~loc id is a new pre-identifier identified with id with attributes attrs and location loc. A unique tag is automatically affected to the new identifier Default attributes are empty, and default location is Location.none.

val of_preid : Preid.t -> t

of_preid pid is a fresh identifier using the same name, attributes and location as pid. A unique tag is automatically affected to the new identifier

val set_loc : t -> Ppxlib.Location.t -> t

set_loc t loc is t with loc as its location.

val add_attr : t -> string -> t

add_attr t attr is t with attr added to the list of its attributes.

OCaml

Innovation. Community. Security.