Commit 88a2a62
committed
syntax: fix 'is_match_empty' predicate
This was incorrectly defined for \b. Previously, I had erroneously made
it return true only for \B since \B matches '' and \b does not match
''. However, \b does match the empty string. Like \B, it only matches a
subset of empty strings, depending on what the surrounding context is.
The important bit is that it can match *an* empty string, not that it
matches *the* empty string.
We were not yet using this predicate anywhere in the regex crate, so we
just fix the implementation and update the tests.
This does present a compatibility hazard for anyone who was using this
function, but as of this time, I'm considering this a bug fix since \b
clearly matches an empty string.
Fixes #8591 parent 72f09f1 commit 88a2a62
3 files changed
+17
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| 7 | + | |
| 8 | + | |
6 | 9 | | |
7 | 10 | | |
8 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
339 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
340 | 344 | | |
341 | 345 | | |
342 | 346 | | |
| |||
661 | 665 | | |
662 | 666 | | |
663 | 667 | | |
664 | | - | |
665 | | - | |
| 668 | + | |
| 669 | + | |
666 | 670 | | |
667 | 671 | | |
668 | 672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3139 | 3139 | | |
3140 | 3140 | | |
3141 | 3141 | | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
3142 | 3145 | | |
3143 | 3146 | | |
3144 | 3147 | | |
| |||
3148 | 3151 | | |
3149 | 3152 | | |
3150 | 3153 | | |
| 3154 | + | |
| 3155 | + | |
3151 | 3156 | | |
3152 | 3157 | | |
3153 | 3158 | | |
| |||
3157 | 3162 | | |
3158 | 3163 | | |
3159 | 3164 | | |
3160 | | - | |
3161 | | - | |
3162 | 3165 | | |
3163 | 3166 | | |
3164 | 3167 | | |
| |||
0 commit comments