-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node .tokens()
is not correctly ordered for ContainedSpans
#161
Comments
This issue is also present for the following (listed here for reference in case this is relied upon by a downstream crate):
Items highlighted with (*) indicates that this issue also affects the node's surrounding trivia output |
Some of these can be attributed to using the wrong attributes, i.e. not using full-moon/full-moon/src/ast/mod.rs Lines 215 to 221 in 814b7f9
Most should probably just manually implement the trait though, I'm not a fan of the way proc macros have to be implemented in general. |
From what I can tell, the Should either of these two attributes be transformed to fix |
If the proc macro is to be kept, then a new attribute is preferred, but the proc macro is really hard to reason about from its code, at least to me. I think I prefer just defining it explicitly, |
My only gripe with converting it to explicit definitions would be that there is a significant amount of boilerplate/repeated code. I guess it could be abstracted out into some normal macros? Not sure what's best |
If you have an expression node contained in parentheses, e.g.
(foo)
inlocal x = (foo)
, and then call.tokens()
on it, then it is expected that the output is in the order ofLeftParens
,foo
,RightParens
.However, it is in the order
LeftParens
,RightParens
,foo
.This issue also affects
Node.surrounding_trivia()
, as the surrounding trivia is expected to be(Leading Trivia of LeftParens, Trailing Trivia of RightParens)
, however since it is not correctly ordered, what is actually returned is(Leading Trivia of LeftParens, Trailing Trivia of foo)
.The text was updated successfully, but these errors were encountered: