Tracking Issue for `macro_named_capture_groups`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
This is a tracking issue for the RFC "Named macro capture groups" (rust-lang/rfcs#3649).
The feature gate for the issue is #![feature(macro_named_capture_groups)].
macro_rules! foo {
( $group1( $a:ident ),+ ) => {
$group1( println!("{}", $a); )+
}
}
This feature is currently experimental to figure out ideal behavior; an RFC has not yet been accepted.
About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
- Lang experiment request https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/Lang.20experiment.20for.20named.20macro.20capture.20groups/with/525589974
- Implement the RFC (cc @rust-lang/XXX -- can anyone write up mentoring
instructions?) - Adjust documentation (see instructions on rustc-dev-guide)
- Style updates for any new syntax (nightly-style-procedure)
- Style team decision on new formatting
- Formatting for new syntax has been added to the Style Guide
- (non-blocking) Formatting has been implemented in
rustfmt
- Stabilization PR (see instructions on rustc-dev-guide)
Unresolved Questions
- What syntax should be used for groups?
$group(..)in the capture is nice, but$group(..)in the capture (expand the group) differs from$metavar(..)(expand a metavar followed by a new group) and context is needed to handle this correctly.$'groupwas proposed to avoid this.
- What syntax should be used for expanding the group in-place?
- Standalone
$groupis nice but there is no way to expand the entire group and add parens after ($group (..)is ambiguous "expand group with parens" or "expand entire group, follow it by new parens") $...groupwas proposed to avoid this.
- Standalone
XXX --- list all the "unresolved questions" found in the RFC to ensure they are
not forgotten
Implementation history
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with RFC rust-lang/rfcs#3649 and the tracking issue's unresolved questions, then review the linked language-team discussion. The checklist indicates that done requires implementing the RFC, updating documentation, addressing style decisions, and eventually completing stabilization; no implementation file or test is named.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100