package catapult
Tracing system based on the Catapult/TEF format
Install
Dune Dependency
Authors
Maintainers
Sources
v0.1.tar.gz
md5=a7bfa27c3ddd2d29c27173de09293149
sha512=49766ea38c57734918debd6218d95c62f11eb12a6fd3ef5f6a2c60344cea7c274436a46fab1e48abbe0d3f125f31705d2005ab7cae9e56d5f41778c1d2943d65
doc/src/catapult.utils/json_out.ml.html
Source file json_out.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
(** Basic output of json values to a buffer *) let char = Buffer.add_char let raw_string = Buffer.add_string let int out i = raw_string out (string_of_int i) let int64 out i = raw_string out (Int64.to_string i) let float out f = raw_string out (Printf.sprintf "%.1f" f) let bool out = function true -> raw_string out "true" | false -> raw_string out "false" let null oc = raw_string oc "null" let str_val oc (s:string) = char oc '"'; let encode_char c = match c with | '"' -> raw_string oc {|\"|} | '\\' -> raw_string oc {|\\|} | '\n' -> raw_string oc {|\n|} | '\b' -> raw_string oc {|\b|} | '\r' -> raw_string oc {|\r|} | '\t' -> raw_string oc {|\t|} | _ when Char.code c <= 0x1f -> raw_string oc {|\u00|}; Printf.bprintf oc "%02x" (Char.code c) | c -> char oc c in String.iter encode_char s; char oc '"' let arg oc = function | `Int i -> int oc i | `String s -> str_val oc s | `Bool b -> bool oc b | `Float f -> float oc f | `Null -> null oc let char_val oc (c:char) = char oc '"'; char oc c; char oc '"'
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>