Skip to content

Conversation

@YoEight
Copy link
Owner

@YoEight YoEight commented Jan 4, 2026

Summary

Add support for single-line comments (//) in EventQL queries. Comments are now properly tokenized and discarded during parsing, allowing developers to document their queries inline.

Changes

Lexer

  • Added comment() parser function to recognize // style comments
  • Handles cross-platform line endings:
  • Implemented skip_whitespace_and_comments() to handle any combination of whitespace and comments
  • Refactored token() function to use the new whitespace/comment skipper
  • Improved lexer error handling with dedicated LexerError type while using the tokenize function

Example

Queries can now include documentation:

// This is a comment that will be discarded by the parser
FROM e IN events
// This is another line that should be ignored
WHERE e.source != "foobar"
// And again another useless comment
PROJECT INTO e

@YoEight YoEight merged commit d865908 into master Jan 4, 2026
4 checks passed
@YoEight YoEight deleted the comment branch January 4, 2026 18:53
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