Module PyCommon.Ident

type t

Python uses qualified identifiers such as sys.exit. Locally defined names don't have any prefix, but we still add some in textual to deal with ambiguity. The only identifiers without any prefix are local variables.

include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
val root : t -> t

Strip the whole path of an identifier, only keeping its root

val from_string : ?on:char -> ?global:bool -> ?loc:Textuallib.Textual.Location.t -> string -> t option
val pp : Stdlib.Format.formatter -> t -> unit
val fold : f_root: ('a -> global:bool -> loc:Textuallib.Textual.Location.t -> string -> 'b) -> f_path:(string -> 'b -> 'b) -> init:'a -> t -> 'b
val to_string : sep:string -> t -> string
val to_qualified_procname : t -> Textuallib.Textual.QualifiedProcName.t
val to_type_name : ?static:bool -> t -> Textuallib.Textual.TypeName.t
val to_proc_name : t -> Textuallib.Textual.ProcName.t
val to_constructor : t -> Textuallib.Textual.ProcName.t
val to_typ : t -> Textuallib.Textual.Typ.t
val is_primitive_type : t -> bool
val to_var_name : t -> Textuallib.Textual.VarName.t
val mk_unknown_ident : ?loc:Textuallib.Textual.Location.t -> string -> t

Wrap a variable name into a special enclosing class when a global's origin can't be found.

val extend_unknown_ident : t -> t

Wrap an existing identifier into a special enclosing class when a global's origin can't be found.

val mk : ?global:bool -> ?loc:Textuallib.Textual.Location.t -> string -> t
val extend : prefix:t -> string -> t
val pop : t -> string * t option
val mk_builtin : string -> t
val is_imported_ABC : t -> bool

Checks if an id is the standard abc.ABC metaclass name

module Map : IStdlib.IStd.Caml.Map.S with type key = t
module Set : IStdlib.IStd.Caml.Set.S with type elt = t