package ppx_expect_nobase

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

    regexp: " \t*"

    *)
  2. orig : 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 -> int) -> 'a not_blank -> 'a not_blank -> int
val equal_not_blank : ('a -> 'a -> bool) -> 'a not_blank -> 'a not_blank -> bool
type 'a t =
  1. | Blank of string
    (*

    regexp: " \t*"

    *)
  2. | Conflict_marker of string
    (*

    regexp: "^(<

    ||

    |>

    |=

    )"

    *)
  3. | Not_blank of 'a not_blank
val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val invariant : ('a -> unit) -> 'a t -> unit
val map : 'a t -> f:(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:(string -> 'a) -> 'a
OCaml

Innovation. Community. Security.