Skip to content

fix(parser): route name-hate search clauses to MultiZoneSameNameExile#3438

Merged
matthewevans merged 4 commits into
phase-rs:mainfrom
andriypolanski:fix/name-hate-parser-routing
Jun 16, 2026
Merged

fix(parser): route name-hate search clauses to MultiZoneSameNameExile#3438
matthewevans merged 4 commits into
phase-rs:mainfrom
andriypolanski:fix/name-hate-parser-routing

Conversation

@andriypolanski

@andriypolanski andriypolanski commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary

Classic name-hate spells (Eradicate, Quash, Counterbore, Crumble to Dust, Surgical Extraction, etc.) were parsed as Unimplemented even though the engine already supports the full effect chain via MultiZoneSameNameExileChangeZoneAll { InAnyZone[Graveyard, Hand, Library] + SameNameAsParentTarget } + shuffle (Memoricide / Lost Legacy class).

This PR fixes two parser routing gaps:

  1. Chain splitter suffix matcher too narrowparse_search_exile_name_suffix only recognized …with the same name as that card, not the demonstrative card-type back-references Oracle uses on name-hate cards (that creature, that land, that spell, …). When the suffix failed, the bare-and splitter bisected …and exile them into a standalone exile them clause that re-bound to ParentTarget instead of the multi-zone same-name filter.

  2. SearchLibrary intrinsic continuation precedence — When a mis-split search clause fell through to SearchLibrary, parse_intrinsic_continuation_ast synthesized a generic SearchDestination → ChangeZone exile rider from the full sentence text. Suppress that continuation when the full Oracle sentence matches the existing try_parse_multi_zone_same_name_exile recognizer so the correct ChangeZoneAll lowering wins.

Runtime resolution (FilterProp::SameNameAsParentTarget, multi-zone ChangeZoneAll, shuffle) is unchanged — this is parser-only.

Affected cards (representative)

Card Key suffix
Eradicate …same name as that creature…
Quash / Counterbore …same name as that spell…
Crumble to Dust …same name as that land…
Surgical Extraction …same name as that card… (also covered; splitter fix is defensive)

Changes

  • crates/engine/src/parser/oracle_effect/sequence.rs
    • Extend parse_search_exile_name_suffix with composed alt over card-type demonstratives (mirrors try_parse_multi_zone_same_name_exile).
    • Suppress SearchDestination intrinsic continuation for multi-zone same-name exile compounds.
    • Add clause-splitter regression tests for creature/spell/land suffixes.
  • crates/engine/src/parser/oracle_effect/imperative.rs
    • Export try_parse_multi_zone_same_name_exile for shared recognition at the continuation layer.
  • crates/engine/src/parser/oracle_effect/mod.rs
    • End-to-end parse_effect_chain tests for the five issue cards.

Rules

  • CR 201.2 (same name)
  • CR 400.7 (zone change creates new object; last-known-info for name)
  • CR 701.23 (Search)
  • CR 701.24 (Shuffle)

Test plan

  • cargo test -p engine bare_and_keeps_same_name_creature_search_exile_compound
  • cargo test -p engine bare_and_keeps_same_name_spell_search_exile_compound
  • cargo test -p engine bare_and_keeps_same_name_land_search_exile_compound
  • cargo test -p engine name_hate_spells_parse_multi_zone_same_name_exile_chain
  • cargo test -p engine parse_multi_zone_same_name_exile_pattern (existing building-block tests)
  • Tilt: clippy, test-engine, card-data green
  • Manual: cast Eradicate / Counterbore in client — confirm search+exile+shuffle resolves across GY/hand/library copies

Closes

#3436

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@matthewevans matthewevans self-assigned this Jun 16, 2026

@matthewevans matthewevans left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maintainer review: parser routing and owner/controller zone scoping verified; local pre-push checks passed.

@matthewevans matthewevans added the bug Bug fix label Jun 16, 2026
@matthewevans matthewevans enabled auto-merge June 16, 2026 02:22
@matthewevans matthewevans removed their assignment Jun 16, 2026
@matthewevans matthewevans added this pull request to the merge queue Jun 16, 2026
Merged via the queue into phase-rs:main with commit 2383686 Jun 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants