package yaml

  1. Overview
  2. Docs

Definition of an individual event during a processing stream

type pos = {
  1. start_mark : Mark.t;
  2. end_mark : Mark.t;
}

Delimited positioning information for an event in the document.

val sexp_of_pos : pos -> Ppx_sexp_conv_lib.Sexp.t
val pos_of_sexp : Ppx_sexp_conv_lib.Sexp.t -> pos
type t =
  1. | Stream_start of {
    1. encoding : encoding;
    }
  2. | Document_start of {
    1. version : version option;
    2. implicit : bool;
    }
  3. | Document_end of {
    1. implicit : bool;
    }
  4. | Mapping_start of {
    1. anchor : string option;
    2. tag : string option;
    3. implicit : bool;
    4. style : layout_style;
    }
  5. | Mapping_end
  6. | Stream_end
  7. | Scalar of {
    1. anchor : string option;
    2. tag : string option;
    3. value : string;
    4. plain_implicit : bool;
    5. quoted_implicit : bool;
    6. style : scalar_style;
    }
  8. | Sequence_start of {
    1. anchor : string option;
    2. tag : string option;
    3. implicit : bool;
    4. style : layout_style;
    }
  9. | Sequence_end
  10. | Alias of {
    1. anchor : string;
    }
  11. | Nothing

t represents a single event in a YAML processing stream.

These may be produced by a parser or consumed by an emitter. A valid sequence of events should obey the grammar:

  • stream ::= STREAM-START document* STREAM-END
  • document ::= DOCUMENT-START node DOCUMENT-END
  • node ::= ALIAS | SCALAR | sequence | mapping
  • sequence ::= SEQUENCE-START node* SEQUENCE-END
  • mapping ::= MAPPING-START (node node)* MAPPING-END
include Ppx_sexp_conv_lib.Sexpable.S with type t := t
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
OCaml

Innovation. Community. Security.