Pure OCaml Yaml 1.2 reader and writer using Bytesrw
1(*---------------------------------------------------------------------------
2 Copyright (c) 2025 Anil Madhavapeddy <anil@recoil.org>. All rights reserved.
3 SPDX-License-Identifier: ISC
4 ---------------------------------------------------------------------------*)
5
6(** YAML document with directives and content *)
7
8type t = {
9 version : (int * int) option;
10 tags : (string * string) list;
11 root : Yaml.t option;
12 implicit_start : bool;
13 implicit_end : bool;
14}
15
16val make :
17 ?version:(int * int) ->
18 ?tags:(string * string) list ->
19 ?implicit_start:bool ->
20 ?implicit_end:bool ->
21 Yaml.t option -> t
22(** Create a document *)
23
24(** {2 Accessors} *)
25
26val version : t -> (int * int) option
27val tags : t -> (string * string) list
28val root : t -> Yaml.t option
29val implicit_start : t -> bool
30val implicit_end : t -> bool
31
32(** {2 Modifiers} *)
33
34val with_version : int * int -> t -> t
35val with_tags : (string * string) list -> t -> t
36val with_root : Yaml.t -> t -> t
37
38(** {2 Comparison} *)
39
40val pp : Format.formatter -> t -> unit
41val equal : t -> t -> bool