-
v2.2.0 Stable
released this
2026-10-16 21:30:45 +02:00 | 0 commits to main since this releasedaw-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 returnsnil, errinstead of silently different data.dump()and
load()are round-trip safe.sysgainsrun_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.luakeeps 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 to128 + signal.- 11 new
daw_i18n/v1resources (240 -> 251). test/test_yaml_subset.lua-- round-trip, subset and rejection
tests (147 checks).
Fixed
- YAML quoted strings:
\\ \" \n \t \rin double quotes and''
in single quotes are now resolved, soload(dump(x))returnsx.
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://xwere
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: # commentis null or a nested block (was the string
"# comment"). yaml.dump()quotes strings containing\ror%; both did not
survive a round-trip before.- YAML quoted keys:
dump()quoted keys with:,#or spaces,
butload()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
returnsnil, err(cyclic_table).
Changed
- YAML input outside the subset is rejected with
nil, err
(codeunsupported,unterminated_quote,trailing_textor
flow_entry;data.featurenames unsupported syntax): anchors,
aliases, tags,|+/>+, multi-document, tab indentation, nested or
multi-line flow collections. The subset is
documented indocs/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 returnnil, 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
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- YAML block scalars