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

Comment handling #175

Open
maxcountryman opened this issue May 29, 2020 · 5 comments
Open

Comment handling #175

maxcountryman opened this issue May 29, 2020 · 5 comments

Comments

@maxcountryman
Copy link
Contributor

I've been working on a SQL formatter that leverages this library extensively. One problem with using sqlparser-rs right now is that comments are treated like whitespace and removed from the AST. I'm curious if there would be any interest in bringing comments into the AST? Perhaps this could be optional, since I imagine it's not terribly useful for most cases.

@nickolay
Copy link
Contributor

I mentioned before that I am interested in experimenting with an alternative design, in which the parser's output can be concatenated back together to form exactly the input string. I should probably share the prototype I have, despite it being very incomplete as I seldom work on it...

I don't see another way for the comments to be retained.

@maxcountryman
Copy link
Contributor Author

@nickolay I'd be very curious to see your prototype--if there's any way I can contribute, I'd be happy to. 🙂

@mullr
Copy link

mullr commented Jun 4, 2020

This is /exactly/ the use case I had in mind for #161.

@nickolay
Copy link
Contributor

nickolay commented Jun 7, 2020

Sorry for the delay, I posted the prototype in #189

@olalonde
Copy link

I also would like to access comments in the AST :( Any progress on this?

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

4 participants