Changelog
Source:NEWS.md
zuyaml 0.1.0
First release. The API is complete and the package is well tested, but it is not frozen: names, defaults and return types may still change. Pin the version if you depend on it.
Features
yaml_parse()/yaml_parse_all()parse YAML 1.2 from a string or a raw vector,yaml_emit()/yaml_emit_all()convert R objects back to YAML, andyaml_read()/yaml_read_all()/yaml_write()/yaml_write_all()do the same for files. Throughout,_allmeans a YAML stream: several documents separated by---, which is a different thing from a sequence.Scalars follow the YAML 1.2 core schema, so
yesandnoare strings and dates are not coerced. Quoted scalars are always strings, and a quoted empty string never becomesNULL.Integers beyond 2^53 are preserved as
zuyaml_bigintrather than silently rounded.big_integersselects a different policy.Tags override schema resolution, so
!!str 12is the string"12", in every spelling a core tag has: the shorthand, the verbatim form, and a handle bound by a%TAGdirective. Application tags such as!durationare ignored by default;tags = "error"refuses them.Mappings whose keys are sequences or mappings become
zuyaml_maprather than having their structure flattened into names. This is parse-only.Errors are classed conditions carrying a stable
code,lineandcolumn, so callers never have to match on message text.max_size,max_depthandmax_nodesbound untrusted input. The last of these is what stops alias-expansion bombs, which are small and shallow by construction and so escape the first two.A value emitted with
yaml_emit()parses back to the same value. Strings containing a line break, and strings with leading or trailing whitespace, are quoted so that neither is lost; a double with an integral value emits as1.0, so it does not come back as an integer; and mapping keys are treated exactly like values. Asserted over the whole yaml-test-suite and over generated input. The exceptions are listed invignette("zuyaml").A literal NUL byte in the input is refused with an
embedded_nulcondition and a position. The underlying library treats one as end of input, so the rest of the document – including any later documents in the stream – would otherwise be discarded without a word.A UTF-8 byte order mark at the start of a stream is not part of the document.
A float outside the range of a double converts to the nearest one:
1e309isInf,1e-324is0, and1e-323is the subnormal it names. One extreme value never changes the R type of a field.