package ocamlformat-mlx-lib
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=fb3af0d7a0b6ced6c9cbd84858e7aa86fe2a4b9f4b8f46080a04bc465b0e6eff
sha512=c0dc6c33aea286fbc007fdf02b09c37b72caf76d12ccf92576a04823cdcacf3044b6deba3372f40a87a0ae6f602da20d5840ebf0f116f4ca346b85c4d540b2f0
doc/ocamlformat-mlx-lib.ocaml_common/Ocamlformat_ocaml_common/Longident/index.html
Module Ocamlformat_ocaml_common.LongidentSource
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.
type t = | Lident of string| Ldot of t Location.loc * string Location.loc| Lapply of t Location.loc * t Location.loc
same t t' compares the longidents t and t' without taking locations into account.
For a non-empty list l, unflatten l is Some lid where lid is the long identifier created by concatenating the elements of l with Ldot. unflatten [] is None.
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 unflatten is safer and faster. 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.