fix/urzas saga phase two nested quote#147
Merged
Merged
Conversation
colin-riddell
marked this pull request as draft
May 2, 2026 16:36
colin-riddell
marked this pull request as ready for review
May 3, 2026 09:33
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix Urza's Saga chapter II creating a 0/0 Construct that immediately died to SBAs. Two cooperating bugs:
Parser (
parser/oracle_effect/token.rs):extract_token_static_abilitiesonly matched double-quoted spans. Chapter II's Oracle text nests the create-tokenclause inside a double-quoted activated ability (
This Saga gains "...with 'This token gets +1/+1...'"), so the inner ability uses single quotes — silently dropped,leaving the Token effect's
static_abilitiesfield empty.Added a structurally-anchored single-quote pass: open
'must followwith/and/or/,, close'is the last'in the text. That pairing rule keepsinternal apostrophes (
can't,creature's) safe as content, never delimiter. Generalises to the whole class of nested grant-create-token-with-ability cards.Engine (
game/effects/token.rs):apply_create_token_after_replacementonly wrote the spec's static abilities to livestatic_definitions, notbase_static_definitions. The layers reset atlayers.rs:519(obj.static_definitions = Arc::clone(&obj.base_static_definitions)) wiped the boost on every passbefore layer 7c could read it. The 0/0 Construct then died to CR 704.5f.
Mirrored the spec's static abilities onto
base_static_definitionsso the layers reset preserves them — same pattern already used for Role token statics attoken.rs:1326.Test plan
extract_static_single_quoted_ability_with_apostrophe_content,extract_static_single_quoted_boost_by_countapply_create_token_mirrors_static_abilities_to_basechapter_two_construct_survives_sba_via_self_count_boost— activates the granted{2}, {T}ability, resolves it, asserts theConstruct enters the battlefield as a 1/1 (counting itself) and survives SBAs
cargo test -p engine(6016 tests pass),cargo clippy -p engine --all-targets -- -D warnings,cargo fmt --all -- --check