Closed jmhain closed 5 years ago
Thanks for the PR!
The following macro should produce two literals '
and a
, yet the new parser seems to skip the '
and only produces one literal a
. Could you look into this?
macro_rules! a { ('a) => { ... }; }
The following macro should produce two literals ' and a, yet the new parser seems to skip the ' and only produces one literal a. Could you look into this?
Yeah, it looks like syn
stopped parsing '
as a Punct
, and instead only as part of a lifetime. Added a commit with a workaround.
Edit Actually I just realized the fix isn't technically what you asked for since it now produces one literal 'a
(instead of dropping the '
), rather than two separate literals. Not sure if this matters...
@jmhain thanks for the changes; @dtolnay your input is appreciated.
'a
should be parsed at one Literal as whitespace in between is not allowed. E.g. <'a>
in the macro_rules!()
can be matched by < 'a >
, <'a >
, < 'a>
but not <' a>
.
I've reviewed this and I'd like to go with @dtolnay 's PR, which seems more close to how syn
was designed for. @jmhain thanks very much for this PR, I know it's frustrating if a PR does not get pulled. I'd highly appreciate if you could tackle the remaining problems with the Parser, the multi-character Punct being the most pressing.
Saw the call for participation on TWIR for issue #17, so decided to give it a shot. Passes tests, but seems to be slower than the current syn 0.14-based parser.