package ppxlib
Standard infrastructure for ppx rewriters
Install
Dune Dependency
Authors
Maintainers
Sources
ppxlib-0.36.0.tbz
sha256=5aba1bce14c53108614130110c843d004bf93bd2cf3a0778fd7086b85390a434
sha512=1e3e8fee42fe74bffc178dbcbb2db8ec38dd23e71f6fed3c4c92618cf93892f5847787e6e9abb322f5c85d29a76afde28ce840b42e10fedc14cd82ba578ad06a
doc/src/ppxlib.astlib/keyword.ml.html
Source file keyword.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 91 92 93 94 95 96 97 98 99
let is_keyword = function | "and" -> true | "as" -> true | "assert" -> true | "begin" -> true | "class" -> true | "constraint" -> true | "do" -> true | "done" -> true | "downto" -> true | "else" -> true | "end" -> true | "exception" -> true | "external" -> true | "false" -> true | "for" -> true | "fun" -> true | "function" -> true | "functor" -> true | "if" -> true | "in" -> true | "include" -> true | "inherit" -> true | "initializer" -> true | "lazy" -> true | "let" -> true | "match" -> true | "method" -> true | "module" -> true | "mutable" -> true | "new" -> true | "nonrec" -> true | "object" -> true | "of" -> true | "open" -> true | "or" -> true (* | "parser" -> true *) | "private" -> true | "rec" -> true | "sig" -> true | "struct" -> true | "then" -> true | "to" -> true | "true" -> true | "try" -> true | "type" -> true | "val" -> true | "virtual" -> true | "when" -> true | "while" -> true | "with" -> true | "lor" -> true | "lxor" -> true | "mod" -> true | "land" -> true | "lsl" -> true | "lsr" -> true | "asr" -> true | _ -> false let apply_keyword_edition ~cli () = let from_ocaml_param = match Sys.getenv "OCAMLPARAM" with | s -> ( let items = if String.equal s "" then [] else (* cf. Compenv.parse_args *) match s.[0] with | (':' | '|' | ';' | ' ' | ',') as c -> List.tl (String.split_on_char c s) | _ -> String.split_on_char ',' s in let fold_settings (acc, after_cli) item = match (item, acc) with | "_", None -> (acc, true) | _ -> let len = String.length item in if len >= 9 && String.sub item 0 9 = "keywords=" then (Some (String.sub item 9 (len - 9)), after_cli) else (acc, after_cli) in let from_ocaml_param, after_cli = List.fold_left fold_settings (None, false) items in match from_ocaml_param with | None -> None | Some s -> Some (s, after_cli)) | exception Not_found -> None in let keyword_edition = match (cli, from_ocaml_param) with | None, None -> None | None, Some (s, _) | Some _, Some (s, true) -> Some s | _ -> cli in (*IF_AT_LEAST 503 let () = if Option.is_some keyword_edition then Clflags.keyword_edition := keyword_edition in*) (*IF_NOT_AT_LEAST 503 let () = ignore keyword_edition in*) ()
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>