Participle v2 upgrade - #135
Merged
Merged
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.