Split yaml.lua into parser / dumper / api modules #6

Closed
opened 2026-03-17 12:23:42 +01:00 by michael · 1 comment
Owner

Summary

yaml.lua has grown to 300+ lines (pure Lua parser + lyaml tier +
dump serializer). This conflicts with the "Simple: Easy to understand,
easy to maintain" principle and makes AI-assisted editing harder.

Proposed split

  • src/daw/lua/common/yaml.lua -- public API only (load, dump, backend)
  • src/daw/lua/common/yaml_parser.lua -- pure Lua parser (load internals)
  • src/daw/lua/common/yaml_dumper.lua -- pure Lua serializer (dump internals)

yaml.lua remains the single require point -- no changes for callers.

Acceptance criteria

  • require("daw.lua.common.yaml") still works unchanged
  • all existing test/test_yaml.lua tests still pass
  • each file stays under 150 lines

Refs

DAW/daw-lua-common#5 (yaml.dump added, triggered this)

## Summary yaml.lua has grown to 300+ lines (pure Lua parser + lyaml tier + dump serializer). This conflicts with the "Simple: Easy to understand, easy to maintain" principle and makes AI-assisted editing harder. ## Proposed split - src/daw/lua/common/yaml.lua -- public API only (load, dump, backend) - src/daw/lua/common/yaml_parser.lua -- pure Lua parser (load internals) - src/daw/lua/common/yaml_dumper.lua -- pure Lua serializer (dump internals) yaml.lua remains the single require point -- no changes for callers. ## Acceptance criteria - require("daw.lua.common.yaml") still works unchanged - all existing test/test_yaml.lua tests still pass - each file stays under 150 lines ## Refs DAW/daw-lua-common#5 (yaml.dump added, triggered this)
Author
Owner

Split into yaml/parse.lua, yaml/dump.lua, yaml/init.lua (mirrors the json/ split). require("daw.common.yaml") unchanged for callers. All test_yaml.lua tests pass unchanged (31/31, verified against the real fixtures).

Split into yaml/parse.lua, yaml/dump.lua, yaml/init.lua (mirrors the json/ split). require("daw.common.yaml") unchanged for callers. All test_yaml.lua tests pass unchanged (31/31, verified against the real fixtures).
michael 2026-07-19 17:56:07 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-lua-common#6
No description provided.