Skip to content

yeast: Remove explicit ctx from tree builders - #22682

Open
tausbn wants to merge 2 commits into
mainfrom
tausbn/yeast-remove-explicit-tree-context
Open

tausbn wants to merge 2 commits into
mainfrom
tausbn/yeast-remove-explicit-tree-context

Conversation

@tausbn

@tausbn tausbn commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

We never used the ability to specify a different context from ctx in these builders anyway, so this commit makes it so that we always use the ambient ctx that is provided inside of rule bodies.

Note that if we end up needing a particular context anyway, then we can simply reassign ctx before calling the tree macros. This has the same effect as passing in a custom context would have now.

We never used the ability to specify a different context from `ctx` in
these builders anyway, so this commit makes it so that we always use the
ambient `ctx` that is provided inside of rule bodies.

Note that if we end up needing a particular context anyway, then we can
simply reassign `ctx` before calling the tree macros. This has the same
effect as passing in a custom context would have now.
@tausbn tausbn added the no-change-note-required This PR does not need a change note label Sep 25, 2026
@tausbn
tausbn marked this pull request as ready for review September 25, 2026 12:15
@tausbn
tausbn requested a review from a team as a code owner September 25, 2026 12:15
Copilot AI balanced review requested due to automatic review settings September 25, 2026 12:15

Copilot AI 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.

Copilot review overview

🟡 Changes recommended

The new argument scanner rejects valid Rust expressions containing top-level comma tokens.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Removes explicit context arguments from Yeast tree-builder macros, standardizing on the ambient ctx binding.

Changes:

  • Converts tree builders to implicit-context procedural macros.
  • Updates Swift translation rules, tests, and documentation.
  • Adds parsers for tree_at! and tree_spanning!.
File Description
unified/​extractor/​src/​languages/​swift/​swift.rs Migrates Swift tree-builder calls.
shared/​yeast/​tests/​test.rs Updates tree-builder tests.
shared/​yeast/​src/​lib.rs Re-exports the new procedural macros.
shared/​yeast/​doc/​yeast.md Documents implicit context usage.
shared/​yeast-macros/​src/​parse.rs Implements implicit-context macro parsing.
shared/​yeast-macros/​src/​lib.rs Exposes the new procedural macros.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread shared/yeast-macros/src/parse.rs Outdated
Does the parsing of arguments in a slightly more principled way.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation no-change-note-required This PR does not need a change note

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants