Module Stream.Event

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.

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 scalar
  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