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.1.tbz
sha256=d49754224206de44855590848b3a5a6cc1d5c46cf99a4e5810ca3041d436a28e
sha512=2984b5a6284bf8bbd05419cf850c15c34bc19c19f0c8928b83cc1be1c0bfc84aafef6d992e7435c2f48ba361a6f3aab679abd02f0e6472361c8cec7d497bc405
doc/src/grace/source.ml.html
Source file source.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 73 74 75 76open! Import module Reader = struct module T = struct type t = { id : int ; name : string option [@ignore] ; length : int [@ignore] ; unsafe_get : int -> char [@ignore] } [@@deriving sexp] let compare t1 t2 = if phys_equal t1 t2 then 0 else Int.compare t1.id t2.id end include T include Comparable.Make (T) let name r = Option.value r.name ~default:(Int.to_string r.id) end type string_source = { name : string option ; content : string } [@@deriving sexp] let compare_string_source str_src1 str_src2 = if phys_equal str_src1 str_src2 then 0 else ( match Option.compare String.compare str_src1.name str_src2.name with | 0 -> String.compare str_src1.content str_src2.content | n -> n) ;; module T = struct type t = [ `File of string | `String of string_source | `Reader of Reader.t ] [@@deriving sexp] let compare t1 t2 = if phys_equal t1 t2 then 0 else ( match t1, t2 with | `File fname1, `File fname2 -> String.compare fname1 fname2 | `String str_src1, `String str_src2 -> compare_string_source str_src1 str_src2 | `Reader rd1, `Reader rd2 -> Reader.compare rd1 rd2 | _, _ -> (* Compare the tags *) Stdlib.compare t1 t2) ;; end include T include Comparable.Make (T) let name = function | `File name -> Some name | `String { name; _ } -> name | `Reader reader -> Some (Reader.name reader) ;; let length = function | `File filename -> let length = In_channel.(with_open_bin filename length) in (match Int64.to_int length with | Some length -> length | _ -> invalid_argf "file size is larger than an OCaml 63-bit integer") | `String { content; _ } -> String.length content | `Reader { Reader.length; _ } -> length ;;
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>