Skip to content
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

trivia association #113

Open
elenakrittik opened this issue Mar 16, 2025 · 1 comment
Open

trivia association #113

elenakrittik opened this issue Mar 16, 2025 · 1 comment

Comments

@elenakrittik
Copy link
Contributor

elenakrittik commented Mar 16, 2025

figure out how to reliably attach trivia tokens (comments/whitespace) to relevant nodes

the biggest issue is that right now parsing type A = &B\n will put \n in the node tree before B. that's because we eagerly process all trivia so that the parser can assume no trivia exists, greatly simplifying it's job.

similarly, any comments will usually get attached to the last open node, but that is only really correct if the comment hangs at the end of a line. in all other cases, it makes more sense to attach the comment to the first node after it.

Copy link

linear bot commented Mar 16, 2025

MET-19 doc comments

@elenakrittik elenakrittik changed the title doc comments trivia association Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant