-
Notifications
You must be signed in to change notification settings - Fork 450
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This fixes a bug in the parser where a regex like `(?x)[ / - ]` would fail to parse. In particular, since whitespace insensitive mode is enabled, this regex should be equivalent to `[/-]`, where the `-` is treated as a literal `-` instead of a range since it is the last character in the class. However, the parser did not account for whitespace insensitive mode, so it didn't see the `-` in `(?x)[ / - ]` as trailing, and therefore reported an unclosed character class (since the `]` was treated as part of the range). We fix that in this commit by accounting for whitespace insensitive mode, which we do by adding a `peek` method that skips over whitespace. Fixes #455
- Loading branch information
1 parent
3e370e4
commit 102458f
Showing
2 changed files
with
62 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