package sexp

  1. Overview
  2. Docs
type t =
  1. | Capture of t * int
  2. | Any
  3. | Atom of string
  4. | Atom_regex of Re2.t
  5. | Sequence of t list
  6. | Star of t
  7. | Star_greedy of t
  8. | Plus of t
  9. | Plus_greedy of t
  10. | Maybe of t
  11. | Maybe_greedy of t
  12. | List of t
  13. | Set of (t * Query.Set_kind.t) list
  14. | Subsearch of t
  15. | And of t list
  16. | Or_shortcircuiting of t list
  17. | Or_all of t list
  18. | First_match_only of t

Same as Query.t, except that Re2 regexes have been compiled and captures have been boiled down into simply an index into an array where that capture should be stored.

val sexp_of_t : t -> Sexplib0.Sexp.t
val create : Query.t -> _ Output_method.t -> t * [ `Labels_of_captures of string array ]

Compiles a query. Returns t, `Labels_of_captures labels.

labels is the list of all unique keys that expect to receive a capture, a stringified integer in the case of a numbered capture, the string name in the case of a named capture, and unique default-created labels in the case of captures that the user did not themselves label.

The array indices of labels correspond one-to-one with the integers returned in the Capture variant of t.