Debian Codegraph @

vendor/re/src/color_map.mli

raw
1 (* Color maps exists to provide an optimization for the regex engine. The fact
2 that some characters are entirely equivalent for some regexes means that we
3 can use them interchangeably.
4
5 A color map assigns a color to every character in our character set. Any two
6 characters with the same color will be treated equivalently by the automaton.
7 *)
8 type t
9
10 module Repr : sig
11 type t
12
13 val repr : t -> Cset.c -> char
14 val length : t -> int
15 end
16
17 module Table : sig
18 type t
19
20 val get_char : t -> Cset.c -> char
21 val get : t -> char -> Cset.c
22 val translate_colors : t -> Cset.t -> Cset.t
23 end
24
25 val make : unit -> t
26 val flatten : t -> Table.t * Repr.t
27 val split : t -> Cset.t -> unit