package gospel

  1. Overview
  2. Docs

Module Identifier.IdentSource

Identifiers

These are uniquely tagged identifiers produced by the typing.

Sourcetype 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.

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

Pretty printer for identifiers.

Sourceval 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.

Sourceval 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

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

set_loc t loc is t with loc as its location.

Sourceval add_attr : t -> string -> t

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

OCaml

Innovation. Community. Security.