-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
Review trivia which can't be inferred from their node kind #223
Comments
I looked through parser.jl. General impression is that there's still various cases such as trailing commas etc, but they mostly don't matter. A borderline case is not being able to distinguish |
I don't know, I'm kind of finding myself uninspired by this issue... it seems only marginally useful to change the remaining cases. If we're going to add a flag for |
Actually let's fix the |
The |
Some tokens becomes trivia after parsing has done its work. For example, parentheses in both
f(x)
and(x)
only appear in the green tree as trivia. For the function call, the presence of parentheses can be inferred from the tree(call f x)
because there's only one type of function call syntax. That is, we can reconstruct the trivia which isn't whitespace or comments.In contrast, this is not the case for
(x)
, until #222 is merged because the green tree didn't represent grouping parentheses (these ended up as trivia on the parent node instead).In general, it seems that a nice invariant for the green tree to have would be that
Presumably there's cases other than #222 to fix - would be good to review all cases of
bump
used together withTRIVIA_FLAG
.The text was updated successfully, but these errors were encountered: