package ppx_mikmatch
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Matching Regular Expressions with OCaml Patterns using Mikmatch's syntax
Install
dune-project
Dependency
Authors
Maintainers
Sources
1.4.tar.gz
md5=3428892cb040a21968e25c451d45e47a
sha512=58ff6f86d962719aa5a34aa5eef2b027c2ba7c0c17cc46ea5eb08b56e9e1e8bc32150722383cce52d74ffc2c231cdaa5f8c9220a595f281e29221c2d308c0178
doc/src/ppx_mikmatch.lib/regexp.ml.html
Source file regexp.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 31open Regexp_types let parse_exn ~target ?(pos = Lexing.dummy_pos) s = let lexbuf = Lexing.from_string s in lexbuf.lex_curr_p <- pos; lexbuf.lex_start_p <- pos; lexbuf.lex_abs_pos <- pos.pos_cnum; let mk_loc ?loc pos lexbuf = let open Lexing in let open Location in match loc with | Some loc -> loc | None -> (* no location from parser, use lexbuf positions *) { loc_ghost = false; loc_start = { pos with pos_cnum = pos.pos_cnum + lexbuf.lex_start_p.pos_cnum }; loc_end = { pos with pos_cnum = pos.pos_cnum + lexbuf.lex_curr_p.pos_cnum }; } in let main = match target with `Match -> Mik_parser.main_match_case | `Let -> Mik_parser.main_let_expr in try main Mik_lexer.token lexbuf with | Mik_lexer.Error msg -> let loc = mk_loc pos lexbuf in Location.raise_errorf ~loc "%s" msg | PError (loc, msg) -> let loc = mk_loc ~loc pos lexbuf in Location.raise_errorf ~loc "Syntax error: %s" msg | Mik_parser.Error -> let loc = mk_loc pos lexbuf in Location.raise_errorf ~loc "Syntax error"
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>