package comby-kernel
A match engine for structural code search and replace that supports ~every language
Install
Dune Dependency
Authors
Maintainers
Sources
comby-kernel.1.7.0.tar.gz
md5=ee6556d8bd9b25ed0445ebe23862e48a
sha512=e6386c8ce5ef14bbcab2b0ead5b1edc39375438f56330d5f02e81e467afe6623a7e299f97f26008d77bbc62850c6dc63a7cbe5b81671b5183ff3adeee5946bb3
doc/src/comby-kernel.parsers/omega_comments.ml.html
Source file omega_comments.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
open Core_kernel open Vangstrom let (|>>) p f = p >>= fun x -> return (f x) let any_char_except ~reserved = List.fold reserved ~init:(return `OK) ~f:(fun acc reserved_sequence -> option `End_of_input (peek_string (String.length reserved_sequence) >>= fun s -> if String.equal s reserved_sequence then return `Reserved_sequence else acc)) >>= function | `OK -> any_char | `End_of_input -> any_char | `Reserved_sequence -> fail "reserved sequence hit" let between left right p = left *> p <* right let to_string from until between : string = from ^ (String.of_char_list between) ^ until let anything_including_newlines ~until = many (any_char_except ~reserved:[until]) let anything_excluding_newlines () = anything_including_newlines ~until:"\n" let non_nested_comment from until = between (string from) (string until) (anything_including_newlines ~until) |>> to_string from until module Multiline = struct module type S = sig val left : string val right : string end module Make (M : S) = struct let comment = non_nested_comment M.left M.right end end (* Consumes the newline if we don't reintroduce it. This can be improved, we shouldn't need to reintroduce it.*) let until_newline start = (string start *> anything_excluding_newlines () |>> fun l -> start^(String.of_char_list l)) module Until_newline = struct module type S = sig val start : string end module Make (M : S) = struct let comment = until_newline M.start end end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>