Skip to content

<Gaurav> strip line comments (--) to prevent broken nested block comments - #283

Merged
gauravdawar-e6 merged 2 commits into
mainfrom
fix/strip-line-comments
Jul 6, 2026
Merged

<Gaurav> strip line comments (--) to prevent broken nested block comments#283
gauravdawar-e6 merged 2 commits into
mainfrom
fix/strip-line-comments

Conversation

@gauravdawar-e6

Copy link
Copy Markdown
Collaborator

BI tools emit queries like "-- /* text /" where a line comment contains block comment syntax. sqlglot converts -- to / / wrapping, creating broken "/ /* text */ */" that crashes the engine parser.

Fix: single-pass regex in strip_comment that strips both -- and /* / comments while preserving --, / */ text inside quoted strings ('...'), identifiers ("..."), and backtick identifiers (...).

@gauravdawar-e6
gauravdawar-e6 merged commit eaae0c7 into main Jul 6, 2026
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants