-
-
Notifications
You must be signed in to change notification settings - Fork 27
[WIP] Retain comments in the AST #58
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
Conversation
Notes on the WIP: I'm trying to rely on unused-do-bind, unused-matches, and unused variables warnings to indicate remaining comments that need to be captured. imo it's probably best to just add the comments in to the AST however makes it easiest for the parser code. imo it's not worth making the parser more complex for the purpose of making the AST make more "sense" for how an end-user would think of the code being structured. It'll be relatively simple to either have a normalization layer, or to make the formatting code a bit more complex to grab the comments from wherever they are. Also my sense of this so far it that it's probably going to be pretty tedious to add all this. My personal plan was to try to do small pieces one-by-one, picking one of the unused warnings, adding to the AST to capture that one unused comment, and then getting everything to compile and commit. And then repeat. |
Also I can't quite remember, but there's some stuff about parsing comments in main...avh4/finalize-format (as of 2022-07-26) as well... I can't remember if the Parse/Parse.Space stuff there is important w/r to this branch or not. |
@avh4 Just made a commit. Does my approach match what you had in mind? |
@robinheghan Yep, exactly! I hadn't really thought about if we'd need the Comments to be |
I thought it made sense in this case, this way we can just store a list of comments somewhere and use the location data to figure out where they fit in a later normalization step. |
Replaced by #132 |
No description provided.