package ppx_mikmatch

  1. Overview
  2. Docs

Source file regexp_types.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
open Ppxlib
exception PError of Location.t * string

let ( % ) f g x = f (g x)

type 'a t = 'a node Location.loc

and 'a node =
  | Code of 'a
  | Seq of 'a t list
  | Alt of 'a t list
  | Opt of 'a t
  | Repeat of (int * int option) Location.loc * 'a t
  | Nongreedy of 'a t
  | Caseless of 'a t
  | Capture of 'a t
  | Capture_as of string Location.loc * conv_ty option * 'a t
  | Pipe_all of string Location.loc * Longident.t * 'a t
  | Call of Longident.t Location.loc
(* TODO: | Case_blind of t *)

and conv_ty =
  | Int
  | Float
  | Typ of Longident.t
  | Func of (Longident.t * Longident.t option) (* function name * type *)
  | Pipe_all_func of Longident.t

type flags = {
  case_insensitive : bool; (* i *)
  anchored : bool; (* for pcre: a - true | for mikmatch: u - false*)
}

let pcre_default_flags = { case_insensitive = false; anchored = false }
let mikmatch_default_flags = { case_insensitive = false; anchored = true }