You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] JSQLParser master (dff722b) : ALL : block comment followed directly by a non-whitespace character #2509
AI disclosure: this issue was prepared with AI coding agents, reviewed and revised line by line by me.
Failing SQL Feature:
A block comment followed directly by a non-whitespace character breaks parsing — the first character after */ is swallowed into the comment token.
SQL Example:
SELECT/* c */1-- ParseExceptionSELECT1/* c */+2-- ParseExceptionSELECT1/*x*/+2-- ParseExceptionSELECT1/* c */+2-- fine (blank after */)
Software Information:
JSqlParser: current master dff722b (verified with a local build today)
Database: dialect-independent (lexer level)
Tips:
Discovered while working on #2508 (the # line comments switch) — implementing its stream-level pieces required a close read of the lexer and the block comment machinery.
Suspected cause: the BLOCK_COMMENT_END production matches one char with ~[] and relies on its token action (input_stream.backup(1) + image restore) to put it back — but the JavaCC fork does not execute SPECIAL_TOKEN actions (the special path calls SkipLexicalActions, whose generated switch only contains the SKIP cases), so the char after */ is consumed into the comment token. -- line comments are self-contained productions and unaffected.
Happy to provide a fix as a separate PR once a direction is agreed.
Activity
manticore-projects commentedon Aug 26, 2026
That is on me then, I will have a look asap. (Technically, there is no need for the fork but you won't reach anyone at JavaCC anymore :-( )
manticore-projects commentedon Aug 28, 2026
Fixed via 94bbadc.