package lascar
A library for manipulating Labeled Transition Systems in OCaml
Install
Dune Dependency
Authors
Maintainers
Sources
lascar-0.6-alpha.tbz
sha256=e33fd94f167bd7bc69f30d7a550226126692a00dac9b29c28ff0ff0aca7d7a21
sha512=98fe84ea351a288d371490f002c52c2e3637841f7fafadb1c3a1acb82befc436bbc6321b1c37fb1e2121b595e7fcb33da45510f3b623006a1d1b56d905313058
doc/src/lascar.utils/stringExt.ml.html
Source file stringExt.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
(**********************************************************************) (* *) (* LASCAr *) (* *) (* Copyright (c) 2017-present, Jocelyn SEROT. All rights reserved. *) (* *) (* This source code is licensed under the license found in the *) (* LICENSE file in the root directory of this source tree. *) (* *) (**********************************************************************) let is_uppercased s = match s.[0] with 'A' .. 'Z' -> true | _ -> false let rec explode s = if s = "" then [] else String.sub s 0 1 :: explode (String.sub s 1 (String.length s - 1)) let escape_car c s = let l = String.length s in let j = ref 0 in for i = 0 to l-1 do if s.[i] = c then incr j done; let s' = Bytes.create (l + !j) in j := 0; for i = 0 to l-1 do if s.[i] = c then begin Bytes.set s' !j '\\'; incr j end; Bytes.set s' !j s.[i]; incr j; done; Bytes.to_string s' let remove_car c s = let l = String.length s in let n = ref l in for i=0 to l-1 do if s.[i] = c then decr n done; let r = Bytes.create !n in let j = ref 0 in for i=0 to l-1 do if s.[i] <> c then begin Bytes.set r !j s.[i]; incr j end done; Bytes.to_string r let concat_sep sep ss = let rec concat = function [] -> "" | s::rest -> begin match s, concat rest with | "", "" -> "" | "", s -> s | s, "" -> s | s, s' -> s ^ sep ^ s' end in concat ss
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>