package fmlib
Functional monadic library
Install
Dune Dependency
Authors
Maintainers
Sources
0.1.0.tar.gz
sha256=0558665285e4d7691e5a80c90ab05a7acb86c09f03ceef6589f150f6d3574573
md5=fb61f4d6e7233cf8d1d71758e6110c1e
doc/src/fmlib.fmlib_parse/error.ml.html
Source file error.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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
(* A parse error is either a list of syntax error or on semantic error. We need a list of syntax errors for the following reason: A syntax error signifies that something has been expected and has not been encountered. Since we have alternatives which can all fail without consuming tokens we can have a list of failed expectations. *) open Fmlib_std open Interfaces module Make (Expect: ANY) (Semantic: ANY) = struct type t = | Syntax of Expect.t list | Semantic of Semantic.t let to_string (e: t) (f: Expect.t -> string) (g: Semantic.t -> string) : string = match e with | Syntax lst -> "[" ^ String.concat ", " (List.rev_map f lst) ^ "]" | Semantic sem -> g sem let init: t = Syntax [] let clear_last (e: t): t = match e with | Syntax (_ :: tail) -> Syntax tail | _ -> e let add_expected (exp: Expect.t) (e: t): t = match e with | Syntax lst -> Syntax (exp :: lst) | _ -> Syntax [exp] let make_semantic (sem: Semantic.t): t = Semantic sem let make_expectations (lst: Expect.t list): t = Syntax (List.rev lst) let is_semantic (e: t): bool = match e with | Syntax _ -> false | _ -> true let is_syntax (e: t): bool = not (is_semantic e) let semantic (e: t): Semantic.t = match e with | Syntax _ -> assert false (* Illegal call! *) | Semantic sem -> sem let expectations (e: t): Expect.t list = match e with | Syntax es -> List.rev es | Semantic _ -> assert false (* Illegal call! *) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>