package ppx_expect

  1. Overview
  2. Docs
type 'a not_blank = {
  1. trailing_blanks : Base.string;
    (*

    regexp: " \t*"

    *)
  2. orig : Base.string;
    (*

    Original contents of the line without the trailing blanks or indentation. regexp: "^\n*^ \t\n"

    *)
  3. data : 'a;
    (*

    Data associated to the line.

    *)
}
val sexp_of_not_blank : ('a -> Sexplib0.Sexp.t) -> 'a not_blank -> Sexplib0.Sexp.t
val compare_not_blank : ('a -> 'a -> Base.int) -> 'a not_blank -> 'a not_blank -> Base.int
val equal_not_blank : ('a -> 'a -> Base.bool) -> 'a not_blank -> 'a not_blank -> Base.bool
type 'a t =
  1. | Blank of Base.string
    (*

    regexp: " \t*"

    *)
  2. | Conflict_marker of Base.string
    (*

    regexp: "^(<

    ||

    |>

    |=

    )"

    *)
  3. | Not_blank of 'a not_blank
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
include Base.Exported_for_specific_uses.Ppx_compare_lib.Comparable.S1 with type 'a t := 'a t
val compare : 'a Base__Ppx_compare_lib.compare -> 'a t Base__Ppx_compare_lib.compare
include Base.Exported_for_specific_uses.Ppx_compare_lib.Equal.S1 with type 'a t := 'a t
val equal : 'a Base__Ppx_compare_lib.equal -> 'a t Base__Ppx_compare_lib.equal
val invariant : ('a -> Base.unit) -> 'a t -> Base.unit
val map : 'a t -> f:(Base.string -> 'a -> 'b) -> 'b t

The callback receive the orig and data fields

val strip : 'a t -> 'a t

Delete trailing blanks (everything for blank lines)

val data : 'a t -> blank:'a -> conflict_marker:(Base.string -> 'a) -> 'a
OCaml

Innovation. Community. Security.