logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Longident - Long identifiers, used in parsetree.

Documentation

       Module Longident
        : sigend

       Long identifiers, used in parsetree.

       Warning: this module is unstable and part of Compiler_libs .

       To print a longident, see Pprintast.longident , using Format.asprintf to convert to a string.

       typet =
        | Lident ofstring
        | Ldot oft*string
        | Lapply oft*tvalflatten : t->stringlistvalunflatten : stringlist->toption

       For  a  non-empty  list  l  ,  unflattenl  is  Somelid  where  lid  is the long identifier created by
       concatenating the elements of l with Ldot .  unflatten[] is None .

       vallast : t->stringvalparse : string->tDeprecated.  this function may misparse its input, use "Parse.longident" or "Longident.unflatten"

       This function is broken on identifiers that are  not  just  "Word.Word.word";  for  example,  it  returns
       incorrect results on infix operators and extended module paths.

       If  you  want  to  generate  long  identifiers that are a list of dot-separated identifiers, the function
       Longident.unflatten is safer and faster.  Longident.unflatten is available since OCaml 4.06.0.

       If you want to parse any identifier correctly, use the long-identifiers functions from the Parse  module,
       in  particular  Parse.longident  .   They  are  available  since  OCaml  4.11,  and  also  provide proper
       input-location support.

OCamldoc                                           2025-06-12                                      Longident(3o)

Module

       Module   Longident

Name

       Longident - Long identifiers, used in parsetree.

See Also