package ocamlformat-mlx-lib
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
OCaml .mlx Code Formatter
Install
dune-project
Dependency
Authors
Maintainers
Sources
ocamlformat-mlx-0.28.1.2.tbz
sha256=af4e7ed7e84bd681e1058c3573e255427aa3c3a9952c115f1c2441295766d14c
sha512=48a153ad33283a95b3d5a54cd04e8a26feb5d394b291a45aa01f77e376bcfc94a2b6350b3f3611a3d2511f25b0f69f6d2d694d7ace81004ed7e6850ac6947b4c
doc/src/ocamlformat-mlx-lib.ocaml_common/longident.ml.html
Source file longident.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72(**************************************************************************) (* *) (* OCaml *) (* *) (* Xavier Leroy, projet Cristal, INRIA Rocquencourt *) (* *) (* Copyright 1996 Institut National de Recherche en Informatique et *) (* en Automatique. *) (* *) (* All rights reserved. This file is distributed under the terms of *) (* the GNU Lesser General Public License version 2.1, with the *) (* special exception on linking described in the file LICENSE. *) (* *) (**************************************************************************) type t = Lident of string | Ldot of t Location.loc * string Location.loc | Lapply of t Location.loc * t Location.loc let rec same t t' = t == t' || match t, t' with | Lident s, Lident s' -> String.equal s s' | Ldot ({ txt = t; _ }, { txt = s; _ }), Ldot ({ txt = t'; _ }, { txt = s'; _ }) -> if String.equal s s' then same t t' else false | Lapply ({ txt = tl; _ }, { txt = tr; _ }), Lapply ({ txt = tl'; _ }, { txt = tr'; _ }) -> same tl tl' && same tr tr' | _, _ -> false let rec flat accu = function Lident s -> s :: accu | Ldot({ txt = lid; _ }, { txt = s; _ }) -> flat (s :: accu) lid | Lapply(_, _) -> Misc.fatal_error "Longident.flat" let flatten lid = flat [] lid let last = function Lident s -> s | Ldot(_, s) -> s.txt | Lapply(_, _) -> Misc.fatal_error "Longident.last" let rec split_at_dots s pos = try let dot = String.index_from s pos '.' in String.sub s pos (dot - pos) :: split_at_dots s (dot + 1) with Not_found -> [String.sub s pos (String.length s - pos)] let unflatten l = match l with | [] -> None | hd :: tl -> Some (List.fold_left (fun p s -> Ldot(Location.mknoloc p, Location.mknoloc s)) (Lident hd) tl ) let parse s = match unflatten (split_at_dots s 0) with | None -> Lident "" (* should not happen, but don't put assert false so as not to crash the toplevel (see Genprintval) *) | Some v -> v
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>