-
Notifications
You must be signed in to change notification settings - Fork 138
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
[WIP] Retain comments in AST #3509
base: master
Are you sure you want to change the base?
Conversation
Is this still being worked on? If not, I may try to finish what remains |
Hi, yes I'm still working on this and plan to finish it including some follow up work, but I've just been busy with other stuff in the past few weeks. |
# Conflicts: # runtime/parser/lexer/lexer.go
hey @bartolomej , we recently restructured the cadence repo and as part of that, moved all the subdirectories under Let me know if you run into any issues/conflicts, I can help with resolving those. |
Description
POC for preserving comments in Cadence AST. This should enable us to make a fully working, pretty printer for Cadence.
This is a follow-up to my discussion in Discord some time ago: https://discord.com/channels/613813861610684416/1108479699732152503/1240749220357607475
Closes #308
Design
I decided to start tracking comments in the form of leading/trailing comment structs attached to lexer tokens and AST nodes as discussed in #308 (comment).
I believe this approach (instead of the old one where comments were tracked as AST nodes) could simplify comment parsing logic, as the lexer already computes which tokens are associated with which comments + it removes the need to skip comments when parsing.
Notes
TODO(preserve-comments)
in codeDefinition of Done
Description
master
branchFiles changed
in the Github PR explorer