-
Notifications
You must be signed in to change notification settings - Fork 446
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syntax: fix literal extraction for 'ab??'
Previously, 'ab??' returned [Complete(ab), Complete(a)], but the order matters here because of greediness. The correct result is [Complete(a), Complete(ab)]. Instead of trying to actually fix literal extraction (which is a mess), we just rewrite 'ab?' (and 'ab??') as 'ab*'. 'ab*' still produces literals in the incorrect order, i.e., [Cut(ab), Complete(a)], but since one is cut we are guaranteed that the regex engine will be called to confirm the match. In so doing, it will correctly report 'a' as a match for 'ab??' in 'ab'. Fixes #862
- Loading branch information
1 parent
88a2a62
commit 1c19619
Showing
3 changed files
with
24 additions
and
14 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
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