Skip to content

Add line and block comment support - #9

Open
SanjanaBoggaramJ wants to merge 1 commit into
masterfrom
feature/comments
Open

Add line and block comment support#9
SanjanaBoggaramJ wants to merge 1 commit into
masterfrom
feature/comments

Conversation

@SanjanaBoggaramJ

Copy link
Copy Markdown
Collaborator

Summary

  • Adds LINE_COMMENT (--) and BLOCK_COMMENT (/* */) lexer terminals, %ignore'd, per the N1QL comments spec.
  • Both exclude a leading '+' so existing hint-comment syntax (/*+ ... */, --+ ...) is unaffected.
  • Removes the old comment/block_comment rules — unreferenced and only matched an empty comment body.
    Solves the COMMENT issue mentioned in Few Queries not handled in the parser #6

Test plan

  • Added test_line_comment and test_block_comment covering leading, trailing, inline, multiline, and empty comments.
  • Confirmed hint-comment syntax unaffected (found a separate pre-existing bug there, unrelated to this change).
  • Full existing test suite passes with no regressions.

Adds LINE_COMMENT (--) and BLOCK_COMMENT (/* */) terminals per the
N1QL comments spec, ignored by the lexer. Both exclude a leading '+'
so existing hint-comment syntax (/*+ ... */, --+ ...) is unaffected.
Removes the old block_comment/comment rules, which were unreferenced
and only matched an empty comment body.
@SanjanaBoggaramJ
SanjanaBoggaramJ requested a review from chedim August 6, 2026 14:40
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.

1 participant