Skip to content

Releases: gvvaughan/lyaml

[ANN] lyaml 6.1 released

08 Oct 20:12
Compare
Choose a tag to compare

Read and write YAML-1.1 format files with Lua.

I am happy to announce release 6.1 of lyaml.

lyaml's home page is at http://github.com/gvvaughan/lyaml

Noteworthy changes in release 6.1 (2016-10-08) [stable]

Bug fixes

  • lyaml.load now correctly reads implicit null scalars in a YAML
    document as an lyaml.null reference, identical to the "~"
    shorthand syntax, according to the specification.

    empty:
    canonical: ~
    english: null
    ~: null key

Install it with LuaRocks, using:

luarocks install lyaml 6.1

[ANN] lyaml-6.0 released

27 Jul 01:00
Compare
Choose a tag to compare

Read and write YAML format files with Lua.

I am happy to announce release 6.0 of lyaml.

lyaml's home page is at http://github.com/gvvaughan/lyaml, and we have new LDoc generated API documentation at http://gvvaughan.github.io/lyaml for this release.

Noteworthy changes in release 6.0 (2015-07-27) [stable]

New Features

  • lyaml.load now correctly reads a !!bool tagged scalar from a YAML document, or an implicit bool value, according to the specification.

    %TAG ! tag:yaml.org,2002:
    ---
    truthy:
      - !bool Y
      - !bool y
      - !bool True
      - !bool "on"
    falsey:
      - !bool n
      - !bool OFF
      - !bool garbage
  • lyaml.load now correctly reads a !!float tagged scalar from a YAML document, or an implicit float value, according to the specification.

  • lyaml.load now correctly reads a !!int tagged scalar from a YAML document, or an implicit integer value, according to the specification.

  • lyaml.load now supports the !!merge key type according to the specification.

    - &MERGE { x: 1, y: 2 }
    - &OVERRIDE { x: 0, z: 1 }
    -
      << : [&MERGE, &OVERRIDE]
      z: 3

    The anchored tables remain in the document too, so this results in the following Lua table:

    {                           -- START_STREAM
      {                         -- START_DOCUMENT
        { x = 1, y = 2 },       -- MERGE
        { x = 0, z = 1 },       -- OVERRIDE
        { x = 1, y = 2, z = 3}, -- <<<
      }                         -- END_DOCUMENT
    }                           -- END_STREAM

Bug fixes

  • Multi-line strings were previously being dumped using single quotes which caused the dumped YAML to break.

    For example, { foo = "a\nmultiline\nstring" } would get dumped as:

    foo: 'a
    
    multiline
    
    string'

    Note the extra line-breaks in between each line. This also causes YAML parsing to fail (since the blank lines didn't have the expected indentation).

    This patch fixes the dump to use the YAML literal syntax for any multi-line strings so the same example gets dumped as:

    foo: |-
      a
      multiline
      string
  • lyaml.load now correctly reads the !!null tag in a YAML document as an lyaml.null reference, identical to the "~" shorthand syntax, according to the specification.

Incompatible Changes

  • lyaml.load now takes a table of options as an optional second argument, not a simple boolean to determine whether all documents should be returned from the stream. For now, a true second argument will be converted to the modern equivalent:

    lyaml.load (document, { all = true })
  • lyaml.dump now takes a table of options as an optional second argument, not an initial table of anchors. For now, a second argument without any new API keys will be converted to the modern equivalent:

    lyaml.dump (t, { anchors = arg2 })

Install it with LuaRocks, using:

luarocks install lyaml 6.0

[ANN] lyaml 5.1.4 released

01 Jan 17:43
Compare
Choose a tag to compare

Read and write YAML format files with Lua.

I am happy to announce release 5.1.4 of lyaml.

lyaml's home page is at http://github.com/gvvaughan/lyaml

With this release, lyaml is moving to semantic versioning. The main feature of this release is to add Lua 5.3.0 compatibility, though moving to the latest slingshot has improved the release process, and fixed some small bugs, This version of lyaml is required to use Specl 14.0.0 with Lua 5.3, but is a recommended upgrade for all users in any case.

Noteworthy changes in release 5.1.4 (2015-01-01) [stable]

New Features

  • Lua 5.3.0 compatibility.

Bugs Fixed

  • No more spurious .travis.yml is out of date warnings during
    luarocks install lyaml.
  • When using sudo make install instead of LuaRocks, lyaml.so is now
    correctly installed to $luaexecdir.

Install it with LuaRocks, using:

luarocks install lyaml 5.1.4

lyaml 5.1.0 released

17 Dec 12:51
Compare
Choose a tag to compare

libYAML binding for Lua

I am happy to announce release 5.1.0 of lyaml.

lyaml's home page is at http://github.com/gvvaughan/lyaml

With this release, lyaml now uses semantic versioning. It is identical
to the previous release, except for changes necessary to compile against
Lua-5.3.0(rc1).

Noteworthy changes in release 5.1.0 (2014-12-17) [stable]

New Features:

  • Lua 5.3.0 compatibility.

Install it with LuaRocks, using:

luarocks install lyaml 5.1.0

If the latest rocks are not yet available from the official repository,
you can install directly from the lyaml release branch, with:

$ luarocks install \
https://raw.githubusercontent.com/gvvaughan/lyaml/release-v5.1.0/lyaml-5.1.0-1.rockspec

lyaml 5 released

25 Sep 22:53
Compare
Choose a tag to compare

libYAML binding for Lua

I am happy to announce release 5 of lyaml.

lyaml's home page is at http://github.com/gvvaughan/lyaml

This release cleans up all known bugs, and finishes the partial
implementation of lyaml.dump from the previous release.

Noteworthy changes in release 5 (2014-09-25) [beta]

Build:

  • Significantly reduced pointer mismatch warnings from modern GNU
    compilers.

New Features:

  • lyaml.dump now takes a second argument containing a table of
    potential anchor values in ANCHOR_NAME = { "match", "elements" }
    pairs format. The first time any are matched in the table being
    dumped, they are preceded by &ANCHOR_NAME in the output YAML
    document; subsequent matches are not written out in full, but
    shortened to the appropriate *ANCHOR_NAME alias.

Bugs Fixed:

  • yaml.emitter no longer emits numbers in SINGLE_QUOTE style by
    default.
  • yaml.emitter ().emit returns error strings correctly for invalid
    STREAM_START encoding, and MAPPING_START, SEQUENCE_START & SCALAR
    style fields.

Install it with LuaRocks, using:

luarocks --server=http://rocks.moonscript.org install lyaml 5

If the latest rocks are not yet available from the official repository,
you can install directly from the lyaml release branch, with:

$ luarocks install \
https://raw.githubusercontent.com/gvvaughan/lyaml/release-v5/lyaml-5-1.rockspec

lyaml 4 released

12 Sep 02:24
Compare
Choose a tag to compare

libYAML binding for Lua

I am happy to announce release 4 of lyaml , a complete ground up rewrite!

lyaml's home page is at http://github.com/gvvaughan/lyaml

The main purpose of this release is to rewrite the libYAML binding much closer to the library's C API, which gives the flexibility to write custom parsers and emitters in Lua, which in turn provides a means to track any event metadata during load (such as line numbers for error messages), which was not possible with the previous high level load/dump API provided by the Andrew Danforth binding used by previous releases.

The old APIs are broadly supported by example Lua dump and load implementations in this release, which can be copied and tweaked to create your own customised YAML processing.

Noteworthy changes in release 4 (2013-09-11) [beta]

New Features:

  • New yaml.emitter API returns an object with an emit method for adding events using yaml_*_event_initialize() calls.
  • New yaml.parser API returns a Lua iterator that fetches the next event using yaml_parser_parse().
  • New yaml.scanner API returns a Lua iterator that fetches the next token using yaml_parser_scan().
  • Beginnings of Specl specs, starting with a reasonably comprehensive specifications for the new APIs above.
  • C implementation of lyaml.dump has moved to Lua implementation as yaml.dump.
  • C implementation of lyaml.load has moved to Lua implementation as yaml.load.
  • The new Lua implementation of lyaml.load () handles multi-document streams, and returns a table of documents when the new second argument is true.

Install it with LuaRocks, using:

luarocks install lyaml 4

Until the rocks are available from the official repository in a few days, you can install directly from the lyaml release branch, with:

$ luarocks install http://raw.github.com/gvvaughan/lyaml/release-v4/lyaml-4-1.rockspec