package ocaml-base-compiler
Official release 5.2.1
Install
Dune Dependency
Authors
Maintainers
Sources
ocaml-5.2.1.tar.gz
sha256=2d0f8090951a97a2c0e5b8a11e90096c0e1791d2e471e4a67f87e3b974044cd0
doc/src/stdlib/char.ml.html
Source file char.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
(**************************************************************************) (* *) (* 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. *) (* *) (**************************************************************************) (* Character operations *) external code: char -> int = "%identity" external unsafe_chr: int -> char = "%identity" let chr n = if n < 0 || n > 255 then invalid_arg "Char.chr" else unsafe_chr n external bytes_create: int -> bytes = "caml_create_bytes" external bytes_unsafe_set : bytes -> int -> char -> unit = "%bytes_unsafe_set" external unsafe_to_string : bytes -> string = "%bytes_to_string" let escaped = function | '\'' -> "\\'" | '\\' -> "\\\\" | '\n' -> "\\n" | '\t' -> "\\t" | '\r' -> "\\r" | '\b' -> "\\b" | ' ' .. '~' as c -> let s = bytes_create 1 in bytes_unsafe_set s 0 c; unsafe_to_string s | c -> let n = code c in let s = bytes_create 4 in bytes_unsafe_set s 0 '\\'; bytes_unsafe_set s 1 (unsafe_chr (48 + n / 100)); bytes_unsafe_set s 2 (unsafe_chr (48 + (n / 10) mod 10)); bytes_unsafe_set s 3 (unsafe_chr (48 + n mod 10)); unsafe_to_string s let lowercase_ascii = function | 'A' .. 'Z' as c -> unsafe_chr(code c + 32) | c -> c let uppercase_ascii = function | 'a' .. 'z' as c -> unsafe_chr(code c - 32) | c -> c type t = char let compare c1 c2 = code c1 - code c2 let equal (c1: t) (c2: t) = compare c1 c2 = 0 external seeded_hash_param : int -> int -> int -> 'a -> int = "caml_hash" [@@noalloc] let seeded_hash seed x = seeded_hash_param 10 100 seed x let hash x = seeded_hash_param 10 100 0 x
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>