Skip to content

Participle v2 upgrade - #135

Merged
scudette merged 6 commits into
Velocidex:masterfrom
predictiple:participle-v2-upgrade
Aug 11, 2026
Merged

Participle v2 upgrade#135
scudette merged 6 commits into
Velocidex:masterfrom
predictiple:participle-v2-upgrade

Conversation

@predictiple

Copy link
Copy Markdown
Contributor

No description provided.

predictiple and others added 6 commits July 31, 2026 19:34
- Rewrite the regex lexer from a single named-group regex to
  lexer.SimpleRule entries preserving token order and flags.
- Convert participle.MustBuild to the generic form and update
  ParseString call sites to the new (filename, string) signature.
- Replace participle.Elide with a lexer-level droppingLexerDef
  wrapper so comments are stripped at the lexer level exactly as
  v0.7.1 did, while MultiParseWithComments still captures them.
- Handle the new participle.Error interface in reportError.
- Add (?s)/(?m) flags to string and comment patterns to match the
  global (?ms) flags of the original regex.
participle v2 automatically populates Pos and EndPos fields of type
lexer.Position on any grammar struct. Add them to VQL, _Select,
Plugin, _Args, _AliasedExpression, _MemberExpression and
_AndExpression so LSP-style tooling can map AST nodes back to source
offsets.

Exclude lexer.Position from the serialization round-trip comparison
since positions legitimately change when queries are reformatted.
@scudette
scudette merged commit d89b560 into Velocidex:master Aug 11, 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