Skip to content

v0.6.1

Choose a tag to compare

@github-actions github-actions released this 05 Sep 21:15
· 335 commits to main since this release
v0.6.1
edac301

parseAs: "stmts" accepts more than one statement.

It was mapped straight onto stmt at the top of ContextParser::parse() and then met the single-statement check, so the context could not do the one thing its name promises — while operations.md had been documenting "one or more Stmt" for it all along. The documentation was right and the code was not.

The cost was concrete. Inserting a guard needs two statements: an assignment and the if that reads it. With stmts unusable that took two edits, and the second shifted the index the first had just moved — the pair landed in the wrong order and had to be repaired by hand. That happened twice while building 0.5.0 and 0.6.0.

stmts is now stmt with the arity relaxed: same host, same template, several statements returned as they came. The stmt error names it, so the next caller to meet the limit is told what to use rather than left to split the edit. And the name a caller passed stays in every message — a snippet that asks for stmts and fails to parse is no longer told it does not fit the stmt context, which sent the reader to the wrong contract. Thanks to @CybotTM for catching both that and a test assertion that would have passed with the second statement dropped.

Upgrading

Nothing is removed and nothing behaves differently for callers who were not using stmts. Anyone who split an insertion into two edits to get around this can put it back together — and should, since the second edit shifts the index the first has just moved.

Full Changelog: v0.6.0...v0.6.1