Skip to content

adjust choice of rust nonterminals (and their names) in macro patterns #3379

Closed
@jesse99

Description

@jesse99

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)A-grammarArea: The grammar of RustA-syntaxextArea: Syntax extensionsC-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions