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

Add comments to the parsed AST #103

Open
rattrayalex opened this issue Apr 28, 2021 · 0 comments
Open

Add comments to the parsed AST #103

rattrayalex opened this issue Apr 28, 2021 · 0 comments

Comments

@rattrayalex
Copy link

Follow-on issue to #15 and #43

As of pg_query 2.0, comment tokens are included in the scan output!

This is accomplished with a patch in the lexer, and this could similarly be implemented with a patch to the parser (though it may be a heavier lift).

Alternatively, adding start/end location data to all nodes in the parsed AST may provide much of the same purpose (making it easier to match AST nodes with comments in the scanner) and could be simpler to implement.

@lfittl has indicated he does not have time to build this in the near-term, but would be open to reviewing a PR for this.

(I'm interested in doing this myself but am not likely to be able to in the near future either.)

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