Lane 11 PR 2b: labels from expressions, first/last/join, and two robustness fixes, in both engines (#737) #967
Loading…
Reference in a new issue
No description provided.
Delete branch "build/lane11-2b-language"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Lane 11 (#737) PR 2b: a follow-up to the sheet language (#961, #965). Both definition authors (#962, #963) hit the same gaps, which stopped the sheet showing what the drawing shows. Everything below is done in both engines at once, and pinned by shared fixtures.
Additions:
label_expr, evaluated in the field's scope. When it isn't null, its text replaceslabel, so a term can read "Dex 4" rather than "Attribute".note_exprworks the same way. A null note is now left off rather than printed as "".label_expr, evaluated where its value is, so "Frightened 1" rather than "Frightened". It works for definition modifiers and for those carried by entries and conditions.first(list),last(list)andjoin(list, sep = ", "): these follow the same list rules assum/count. Numbers go through the number-to-text rule. This is what lets the sheet show "Chain mail 16" and "d10 → 8, 7".jion→ "join"), in both the validator and the compiler.Robustness fixes: both were found porting to JS (#965), and both used to raise where the documented result is null.
kindisn't a string no longer raises.Fixtures:
expr/first_last_join.json, 33 cases.sheet/labels-from-expressions.json: "Dex 4", notes, null fallbacks, "Frightened 1", "Chain mail 16" and "d10 → 8, 7".sheet/malformed-rows-and-infinite-ranks.json.Tests:
tests/sheetspasses (486), anddefinition.schema.jsonis regenerated.src/sheetspasses (447), and so does the full vitest suite (3213).changelog.py checkpasses.The PF2e and 5e definitions adopt the new labels in a later PR (they validate either way).
Changelog:
changelog.d/737-lane11-language-labels.added.md.🤖 Generated with Claude Code
This PR now also carries PR 5c: the PF2e and 5e definitions adopt the new labels, so the sheet reads as drawn. It was stacked directly on this branch, and the previous run failed only on a runner fault (Docker "AlreadyExists" on the phone journeys, run 1701), so one fresh run covers both.
What PR 5c changes:
tables.ability_short; armour names usefirst(...)and HP rolls usejoin(...).737-lane11-pf2e-labels.changed.mdand737-lane11-5e-labels.changed.md.Uses PR 2b's label_expr/note_expr: the varying attribute term is labelled by its short name ("Dex" + value 4 renders "Dex 4") for class DC, spell DC/attack and Strikes; HP reads "Ancestry 8 + 6 levels 60 (Class 8 + Con 2 each)"; valued conditions label their modifiers "Frightened 1" etc. Values unchanged; fixtures' derivation and modifier labels updated. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>