Skip to content

Matching tt is almost useless #9364

Closed
Closed
@paulstansifer

Description

@paulstansifer

Because of #3232, the macro parser can't match syntax of the form $($x:some_nt)* under any circumstances. However, this is the natural way to deal with token trees, and adding a delimiter of some kind is prohibitively unergonomic.

As a short-term fix, we could special-case tt so that the macro parser doesn't farm it out to the main Rust parser. We could also introduce a ttseq or something to mean "zero or more tts". It's conceivable that we could also try being smarter with lookahead, but I don't think that's going to be fruitful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)A-syntaxextArea: Syntax extensions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions