Conversation
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.
Contributor
There was a problem hiding this comment.
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
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!andtree_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.
Does the parsing of arguments in a slightly more principled way.
This branch has not been deployed
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.

We never used the ability to specify a different context from
ctxin these builders anyway, so this commit makes it so that we always use the ambientctxthat is provided inside of rule bodies.Note that if we end up needing a particular context anyway, then we can simply reassign
ctxbefore calling the tree macros. This has the same effect as passing in a custom context would have now.