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

/* ... */-style comments not parsed as separate, comment tokens #720

Open
the21st opened this issue May 17, 2023 · 0 comments
Open

/* ... */-style comments not parsed as separate, comment tokens #720

the21st opened this issue May 17, 2023 · 0 comments

Comments

@the21st
Copy link

the21st commented May 17, 2023

Example:

import sqlparse

sql = """
SELECT * -- comment
FROM table
  WHERE table.id = '123'
/* second comment */
"""

parsed = sqlparse.parse(sql)
statement = parsed[0]
print(statement.tokens[-1])

outputs: instance of Where

WHERE table.id = '123'
/* second comment */

expected output: instance of Comment

/* second comment */
@the21st the21st changed the title /*-style comments not parsed as separate, comment tokens /* ... */-style comments not parsed as separate, comment tokens May 17, 2023
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