Skip to content

feat(parser): compound-subject land type-change static (CR 305.7 / CR 611.3)#5301

Merged
matthewevans merged 1 commit into
phase-rs:mainfrom
claytonlin1110:clayton/compound-land-type-change-5299
Jul 7, 2026
Merged

feat(parser): compound-subject land type-change static (CR 305.7 / CR 611.3)#5301
matthewevans merged 1 commit into
phase-rs:mainfrom
claytonlin1110:clayton/compound-land-type-change-5299

Conversation

@claytonlin1110

Copy link
Copy Markdown
Contributor

Summary

Completes the compound-subject static class started in #5219 / #5293 by adding the land type-change sibling handler. The parallel grammar \All and all are \ previously strict-failed because \parse_land_type_change\ only resolves single-subject filters.

\parse_compound_all_subjects_land_type_change\ mirrors the #5219 structure:

  • Land-only Or subject distribution via \parse_compound_all_subjects_land_filter\ (CR 611.3)
  • Shared predicate parsing via factored \parse_land_type_change_predicate_modifications\
  • Dispatched after compound animation handlers, before \parse_land_type_change\

Closes #5299

Test plan

  • cargo fmt --all
  • cargo check -p engine
  • 7 new compound land type-change tests

Made with Cursor

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request implements parsing support for compound-subject land type-change static abilities (e.g., "All Mountains and all Forests are Plains") under CR 611.3 and CR 305.7. It refactors single-subject land type-change parsing to share predicate modification logic with the new compound-subject parser and adds extensive unit tests. The review feedback points out a violation of Repository Style Guide Rule R6, noting that the new helper function parse_compound_all_subjects_land_filter is missing a mandatory CR annotation comment.

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.

Comment on lines +2135 to +2139
/// Parse "all `<X>` and all `<Y>`[ and all `<Z>`…]" into an `Or` of land-only
/// per-subject filters. Each conjunct must resolve through
/// [`parse_land_type_change_subject`] — mixed land/creature compounds (Life and
/// Limb's "Forests and Saprolings") return `None` so animation handlers keep
/// ownership.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

[MEDIUM] Missing mandatory CR annotation on rules-touching parser helper. Evidence: crates/engine/src/parser/oracle_static/type_change.rs:2135. Why it matters: Rule R6 of the Repository Style Guide requires every rules-touching line of engine code to carry a comment of the form CR <number>: <description>. Suggested fix: Add a CR 611.3 annotation to the doc comment.

Suggested change
/// Parse "all `<X>` and all `<Y>`[ and all `<Z>`…]" into an `Or` of land-only
/// per-subject filters. Each conjunct must resolve through
/// [`parse_land_type_change_subject`] — mixed land/creature compounds (Life and
/// Limb's "Forests and Saprolings") return `None` so animation handlers keep
/// ownership.
/// CR 611.3: Parse "all <X> and all <Y>[ and all <Z>...]" into an Or of land-only
/// per-subject filters. Each conjunct must resolve through
/// [parse_land_type_change_subject] — mixed land/creature compounds (Life and
/// Limb's "Forests and Saprolings") return None so animation handlers keep
/// ownership.
References
  1. Rule R6: Every rules-touching line of engine code must carry a comment of the form CR : . (link)

@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown

Parse changes introduced by this PR

✓ No card-parse changes detected.

… 611.3)

Mirror the compound-subject animation handler structure for land type-change predicates: distribute dual-subject lines into an Or filter and parse the shared land-type predicate once via parse_land_type_change_predicate_modifications.

Closes phase-rs#5299

Co-authored-by: Cursor <cursoragent@cursor.com>
@claytonlin1110 claytonlin1110 force-pushed the clayton/compound-land-type-change-5299 branch from d477982 to 833d402 Compare July 7, 2026 12:26
@matthewevans matthewevans self-assigned this Jul 7, 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-only compound land type-change support lands at the existing static type-change seam, reuses the land-type predicate parser, and has focused parser coverage for replacement, additive, multi-type, triple-subject, mixed-subject decline, and single-subject fallthrough cases. Parse-diff Equipment entries are from already-merged main changes between b1a9f9b and origin/main, not this PR diff.

@matthewevans matthewevans added the enhancement New feature or request label Jul 7, 2026
@matthewevans matthewevans added this pull request to the merge queue Jul 7, 2026
@matthewevans matthewevans removed their assignment Jul 7, 2026
Merged via the queue into phase-rs:main with commit 03f9ece Jul 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(parser): compound-subject land type-change static (CR 305.7 / CR 611.3)

2 participants