package grace
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
A fancy diagnostics library that allows your compilers to exit with grace
Install
dune-project
Dependency
Authors
Maintainers
Sources
grace-0.4.0.tbz
sha256=388149857c0fbaf2489b1e396af25aadd6185998847b75570f9198a077ad1ace
sha512=9ffa701f7729f90976594c4ec77b968f15450d8d7a1f0c65fe60d092c136b18f1c8bbd5f5772a651c925dabcdc82ac7023c30a4caa1b94e3e158ef2efa34b85e
doc/src/grace.ansi_renderer/import.ml.html
Source file import.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 61include Grace_std include Grace module Source_reader = Grace_source_reader module Iter = IterLabels module Fmt = struct include Fmt let sp ppf () = Fmt.pf ppf " " let styled_multi style_multi t = List.fold_right style_multi ~init:t ~f:styled let with_style styles ppf t = styled_multi styles t ppf () let repeat ~width t ppf x = for _ = 1 to width do t ppf x done ;; let sps n ppf x = repeat ~width:n sp ppf x let newline ppf () = Fmt.pf ppf "@." (** Shadow [Fmt.str_like] with a version that allows the caller to specify the margin for the produced string *) let str_like ?(margin = 78) like fmt = let buf = Buffer.create 64 in let bppf = Fmt.with_buffer ~like buf in Format.pp_set_geometry bppf ~max_indent:(margin - 1) ~margin; let flush ppf = Format.pp_print_flush ppf (); let s = Buffer.contents buf in Buffer.reset buf; s in Format.kfprintf flush bppf fmt ;; end module List = struct include List let concat_map_with_next t ~f = let rec loop = function | [] -> [] | [ x ] -> f x ~next:None | x1 :: x2 :: t -> f x1 ~next:(Some x2) @ loop (x2 :: t) in loop t ;; let concat_map_with_next_and_prev t ~f = let rec loop t ~prev = match t with | [] -> [] | [ x ] -> f x ~prev ~next:None | x1 :: x2 :: t -> let t' = f x1 ~prev ~next:(Some x2) in t' @ loop (x2 :: t) ~prev:(last t') in loop t ~prev:None ;; end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>