yaml

Parse and generate YAML 1.1/1.2 files
IN THIS PACKAGE
Module Yaml . Stream . Event
type pos = {
start_mark : Mark.t;
end_mark : Mark.t;
}

Delimited positioning information for an event in the document.

type t =
| Stream_start of {
encoding : encoding;
}
| Document_start of {
version : version option;
implicit : bool;
}
| Document_end of {
implicit : bool;
}
| Mapping_start of {
anchor : string option;
tag : string option;
implicit : bool;
style : layout_style;
}
| Mapping_end
| Stream_end
| Scalar of scalar
| Sequence_start of {
anchor : string option;
tag : string option;
implicit : bool;
style : layout_style;
}
| Sequence_end
| Alias of {
anchor : string;
}
| 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