Closed lukaslueg closed 6 years ago
Minimal example:
macro_rules! a {
($self:ident) => { ... };
}
We fail to parse $self
, $foo
works fine.
@dtolnay what's your oppinion of leaving syn
behind right now (and not trying to have a correct ™ macro_rules()
-parser with it) and using libsyntax
instead?
I think you will have a harder time with libsyntax. The API is not designed to be used outside of the compiler. In any case, this should be a one-line fix -- there is a syn!(Ident)
that needs to be call!(Ident::parse_any)
so as to permit keywords in the name of a fragment variable.
Fixed in 2a45b0c
This macro should parse, but doesn't: