fix(parser): keep amass after 'lose life and …' compound (#5341)#5371
Conversation
There was a problem hiding this comment.
Code Review
This pull request resolves issue #5341 by adding support for splitting compound clauses containing 'amass' (e.g., 'you lose 1 life and amass Zombies 1') in the parser. This ensures that both the life loss and the amass effects are processed instead of the amass effect being swallowed. The changes include parser updates, unit tests, and a new runtime integration test for Dreadhorde Invasion, all fully annotated with the relevant Comprehensive Rules (CR) references. I have no feedback to provide as the implementation is correct, idiomatic, and adheres to the repository's style guide.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Parse changes introduced by this PR · 1 card(s), 1 signature(s) (baseline: main
|
matthewevans
left a comment
There was a problem hiding this comment.
Parser and runtime evidence are clean: the bare and splitter now keeps Amass as a second instruction, the trigger parser preserves the sub-ability, the runtime test resolves Dreadhorde Invasion through the scenario pipeline, and the parse-diff is limited to the expected Amass gain for Dreadhorde Invasion.
…hase-rs#5340 branch The Witch's Oven test commit reverted tag("amass ") and its parser/trigger regressions from phase-rs#5371. Restore them from origin/main so Dreadhorde Invasion and the lose-life-plus-amass class keep both clauses. Co-authored-by: Cursor <cursoragent@cursor.com>
…phase-rs#5340) (phase-rs#5379) * test(engine): pin Witch's Oven Food token counts for ConditionInstead (phase-rs#5340) * fix: restore phase-rs#5341 amass splitter accidentally dropped from phase-rs#5340 branch The Witch's Oven test commit reverted tag("amass ") and its parser/trigger regressions from phase-rs#5371. Restore them from origin/main so Dreadhorde Invasion and the lose-life-plus-amass class keep both clauses. Co-authored-by: Cursor <cursoragent@cursor.com> * fix(PR-5379): correct Witch's Oven CR reference --------- Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: matthewevans <matthewevans@users.noreply.github.com>
Summary
Dreadhorde Invasion's upkeep trigger claimed coverage support but only resolved
LoseLife—amass Zombies 1was dropped by the parser, so the Army never arrived. This fix teaches the bare-" and "clause splitter to treatamassas an imperative clause starter so LoseLife + Amass compound instructions both survive.Fixes #5341.
Root cause
Coverage for
marked the upkeep clause
supported: true, butparse_details/ card-data only emittedLoseLife. The bare-" and "splitter inoracle_effect/sequence.rsdid not recognizeamassas a clause start, so the whole chunk stayed one clause and the LoseLife half greedily swallowed the Amass remainder.Standalone amass (Herald of the Dreadhorde, Dreadhorde Twins) already worked — only the compound
"lose … life and amass …"shape was broken.Changes
Parser — bare-and clause starter
tag("amass ")tostarts_bare_and_clause_lower(CR 701.47a + CR 608.2c).create,sacrifice): amass always takes a subtype + count."lose N life and amass [subtype] N"compounds, not only this card.Tests
bare_and_splits_lose_life_and_amasseffect_chain_lose_life_and_amass_keeps_both_clausesdreadhorde_invasion_upkeep_lose_life_and_amassdreadhorde_invasion_upkeep_amasses_zombie_army— controller loses 1 life and gets a Zombie Army token with one +1/+1 counterOut of scope
card-data.json/ coverage so shipped card data reflects the Amass sub_ability (needs the usual card-data pipeline after merge).Test plan
cargo fmt --allcargo test -p engine --lib bare_and_splits_lose_life_and_amasscargo test -p engine --lib effect_chain_lose_life_and_amasscargo test -p engine --lib dreadhorde_invasion_upkeep_lose_life_and_amasscargo test -p engine --test dreadhorde_invasion_amassRisk notes
amasswas never treated as a noun-phrase continuation, so recognizing it as a clause start only unlocks previously dropped conjuncts.