• v2.2.0 1fc3d988f7

    v2.2.0 Stable

    michael released this 2026-10-16 21:30:45 +02:00 | 0 commits to main since this release

    daw-lua-common v2.2.0

    Highlights

    The pure-Lua YAML parser now reads a defined subset meant for files
    written by hand (question catalogs, tax rules), and everything outside
    it returns nil, err instead of silently different data. dump() and
    load() are round-trip safe. sys gains run_interactive() for
    programs that need the terminal.

    New

    • YAML block scalars |, >, |-, >- (pure-Lua backend).
    • YAML flow maps on one line -- {name: "UK VAT", rate: 20.0},
      also as list items; quoted commas inside [...], trailing comma.
    • YAML comment after a quoted value -- text: "x" # note.
    • YAML leading --- is accepted and ignored.
    • yaml/scalar.lua -- new internal submodule for single-line
      values; parse.lua keeps line structure and block scalars.
    • sys:run_interactive(cmd) -- runs a command with the terminal
      passed through (e.g. $EDITOR), returns the exit code; a signal
      maps to 128 + signal.
    • 11 new daw_i18n/v1 resources (240 -> 251).
    • test/test_yaml_subset.lua -- round-trip, subset and rejection
      tests (147 checks).

    Fixed

    • YAML quoted strings: \\ \" \n \t \r in double quotes and ''
      in single quotes are now resolved, so load(dump(x)) returns x.
      Other escapes stay literal ("^\d{5}$" keeps \d).
      Closes #60.
    • YAML multiline strings round-trip through dump()/load();
      block scalars no longer fail or load as "|".
      Closes #61.
    • YAML list items - {id: x}, - "a: b" and - http://x were
      read as one-key maps; they are now a table, a string and a string.
    • YAML {} loads as an empty table (was the string "{}", although
      dump() writes it for empty tables).
    • YAML key: # comment is null or a nested block (was the string
      "# comment").
    • yaml.dump() quotes strings containing \r or %; both did not
      survive a round-trip before.
    • YAML quoted keys: dump() quoted keys with :, # or spaces,
      but load() kept the quotes as part of the key ("a:b" even became
      "a). Quoted keys now load unquoted (block maps, list items,
      {...}); dump() escapes quotes inside keys and quotes - k.
    • yaml.dump() on a cyclic table overflowed the stack (a raw Lua
      error leaving the library, or the process being killed); it now
      returns nil, err (cyclic_table).

    Changed

    • YAML input outside the subset is rejected with nil, err
      (code unsupported, unterminated_quote, trailing_text or
      flow_entry; data.feature names unsupported syntax): anchors,
      aliases, tags, |+/>+, multi-document, tab indentation, nested or
      multi-line flow collections. The subset is
      documented in docs/yaml.md.

    Migration notes

    Files that only use plain maps, lists and simple scalars load as
    before. Things to check if you rely on details:

    • Double-quoted values containing \\ or \", and single-quoted
      values containing '', now load resolved (previously literal).
    • Values that used to load silently wrong (see Fixed) now load
      correctly or return nil, err -- code that worked around them can
      drop the workaround.
    • Programs pinned to an older version (e.g. the vendored
      daw.lua.common.yaml) are unaffected until they update.
    Downloads