-
Notifications
You must be signed in to change notification settings - Fork 7
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
Create <whitespace> and <newline>, (, ), etc nodes rather than throwing out tokens #16
Comments
I realized after submitting that review that the pr was merged, so just to keep the context organized I figured I would re-post it here to see if we need to follow up: I might be wrong here, but I think we need a
Am I missing something here? The implementation looks right, but I think it is just miss-represented in the grammar spec. |
@wesleytodd this was intentional on my part, I see no reason that:
shouldn't parse correctly, since it doesn't cause any trouble for the grammar. |
@byCedric @wesleytodd having been playing around a bit with a tree visitor, it jumps out at me that we'll probably also want to add This allows us to do something like |
Not opposed to this, but it is a change (might be breaking even?) from the current spec. What does the current parser do in this case?
This was my main concern with not having these. If you want to modify and stringify, these markers are very helpful to maintain exact formatting. |
Yeah, it feels a bit odd that we remove those scopes. In this change I had to mitigate it by doing some stuff differently. One thing we could add is something similar to |
I think I've made a few breaking changes as we transcribe the grammar. I'm trying to channel all the things I've seen colleagues accidentally get wrong, and then reach out to me about. Making the grammar as forgiving as possible, but then having a linter on top of it, I'd say is the ideal. We can have a linter indicate that it's recommended to have
I'm happy with a |
So that there's no lost information in the parse tree, we should create
<whitespace>
and<newline>
tokens for spacing characters that fall outside of<text>
nodes.The text was updated successfully, but these errors were encountered: