Open durka opened 5 years ago
Minimal example is
macro_rules! a {
($($m:ident)::+) => {};
}
The problem is the ::
on the repetition. :
works fine, foo
is fine too, ::
is flat out.
Likely related to #4 then?
In a general sense, yes, yet I believe what we see here are the various intricacies of parsing rust's macro syntax. One will have to investigate.
My hunch is you ought to be allowing for a Separator
to be simply a token, rather than a Punct
(which can only be a single character). But I don't see a Token
type in proc_macro2
...
There isn't a Token
type in proc-macro2 or Syn because that is exclusively a macro_rules concept and neither crate is geared around manipulating macro_rules. There is no such thing as multi-character punctuation tokens like ::
in the procedural macro token API.
It should be possible to define a parser for multi-character punctuation in this crate, as you have with all the other macro_rules parsing logic.
[Edit: problem has been identified, see next comment]
The macro below results in
ParseError(None)
fromparse_str::<MacroRules>
. Not very helpful. Is there any way to get more output?