adjust choice of rust nonterminals (and their names) in macro patterns #3379
Labels
A-frontend
Area: Compiler frontend (errors, parsing and HIR)
A-grammar
Area: The grammar of Rust
A-syntaxext
Area: Syntax extensions
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
E-easy
Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Judging from the tutorial it seems that macro fragment matching is done with names coming directly from the grammar. It doesn't seem wise to tie names in user code to the entire grammar that a particular snapshot of a particular rust compiler uses internally. Perhaps it would be better to figure out a subset of non-terminals that are sensible to use in macros and that compilers are free to map however they like internally.
This would also make it easy to provide user-facing names that aren't as aggressively abbreviated as the internal names, e.g. type(?) instead of ty.
The text was updated successfully, but these errors were encountered: