-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix query engine
OneOrMoreMatcher
to skip over in-between trivia (#…
…1133) The `OneOrMoreMatcher` would stop matching whenever it encountered a trivia item in a sequence. Since the parser may arbitrarily insert trivia items anywhere, this meant that the matched results would be incomplete. This was found with this query from the Solidity bindings rules: ``` @specifier [InheritanceSpecifier [InheritanceTypes . @Parents [_]+ .]] ``` Depending on the formatting of the parsed code, the parser would generate the children of `InheritanceTypes` with interleaved trivia items, eg. newlines if the inherited contracts/interfaces are enumerated in separate lines. Because `[_]+` would stop on the first trivia, the overall query would never match.
- Loading branch information
Showing
2 changed files
with
46 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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