Module Macro.Module_longident


module Module_longident: sig .. end
Management of module longidents (aka module paths).

type t 
exception Invalid of string
Invalid m is raised to indicate that the string m is not a valid module longident.
val of_string : string -> t
Return the module longident associated with the given string.
Raises Module_longident.Invalid if the string has not the correct format.
val to_string : t -> string
Return a string representing the module longident.
Raises Module_longident.Invalid if the string has not the correct format.
val is : string -> bool
is s returns true iff s represents a module longident.
val to_id : t ->
Camlp4.PreCast.Syntax.Ast.Loc.t -> Camlp4.PreCast.Syntax.Ast.ident
to_id m loc converts m to an identifier like <:ident< A.B.C >>.
val of_id : Camlp4.PreCast.Syntax.Ast.ident -> t
of_id returns the module longident corresponding to an identifier like <:ident< A.B.C >>. It is the inverse of to_id.
Raises Invalid_argument if the identifier does not have the right shape.
val of_list : string list -> t
Return the longident from the list of components.
val qualify_lid : string ->
t ->
Camlp4.PreCast.Syntax.Ast.Loc.t -> Camlp4.PreCast.Syntax.Ast.expr
qualify_lid lid m _loc returns the expression of the operator or function name lid qualified with the module longident m.
val qualify_uid : string ->
t ->
Camlp4.PreCast.Syntax.Ast.Loc.t -> Camlp4.PreCast.Syntax.Ast.expr
qualify_uid uid m _loc returns the expression of the constructor uid qualified with the module longident m.
val qualify : Camlp4.PreCast.Syntax.Ast.ident ->
t -> Camlp4.PreCast.Syntax.Ast.ident
qualify i returns the identifier i, e.g. <:ident< A.B.c >>, qualified with the module longident m. The localization is taken from the identifier.
val compare : t -> t -> int
Total comparison function on longidents.