-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ensure every CST element has a SOURCE, suggest how to capture whitespace and comments #28
Comments
There are two separate questions here:
|
Thank you for the pointer to that branch. I hope this functionality makes its way into master. Using the branch and adopting the example you cited, I was able to get exactly what I wanted (a tree structure with sufficient information to fully reproduce the full text of the source file) with a much simpler implementation. See https://github.com/GrammaTech/sel/blob/wip-lisp-diff-uses-eclector-parse-result-protocol-2/ast-diff/lisp-diff.lisp |
To followup, over a year later we're still using this branch. Any chance this functionality will (or maybe has already) make its way to master? |
This has not happened yet, but several steps towards that goal are underway. |
To clarify, the parse-result protocol has made it into master, but I'm not sure it fully supports this use-case. |
I made GrammaTech/sel#11. Let me know if that works for you. |
I'd like to be able to parse a source file into a tree structure which includes all information required to build the source (including whitespace and comments). This would be easier if every parsed CST element has a valid associated source range. Currently that isn't the case for (at least) QUOTE elements. See:
I've taken a shot at building this using
cst-read
andrecord-skipped-input
with some custom code to fold everything together and add whitespace. See https://github.com/GrammaTech/sel/blob/master/ast-diff/lisp-diff.lisp#L71, is there a better way?Thanks!
The text was updated successfully, but these errors were encountered: