Commit 8f72bec
committed
Handle interaction of regexp's makesearch and MATCHALL more honestly.
Second thoughts about commit 824bf71: we apply makesearch() to
an NFA after having determined whether it is a MATCHALL pattern.
Prepending ".*" doesn't make it non-MATCHALL, but it does change the
maximum possible match length, and makesearch() failed to update that.
This has no ill effects given the stylized usage of search NFAs, but
it seems like it's better to keep the data structure consistent. In
particular, fixing this allows more honest handling of the MATCHALL
check in matchuntil(): we can now assert that maxmatchall is infinity,
instead of lamely assuming that it should act that way.
In passing, improve the code in dump[c]nfa so that infinite maxmatchall
is printed as "inf" not a magic number.1 parent d782d59 commit 8f72bec
3 files changed
+23
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3660 | 3660 | | |
3661 | 3661 | | |
3662 | 3662 | | |
3663 | | - | |
3664 | | - | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
3665 | 3670 | | |
3666 | 3671 | | |
3667 | 3672 | | |
| |||
3824 | 3829 | | |
3825 | 3830 | | |
3826 | 3831 | | |
3827 | | - | |
3828 | | - | |
| 3832 | + | |
| 3833 | + | |
| 3834 | + | |
| 3835 | + | |
| 3836 | + | |
| 3837 | + | |
| 3838 | + | |
3829 | 3839 | | |
3830 | 3840 | | |
3831 | 3841 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
599 | 599 | | |
600 | 600 | | |
601 | 601 | | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
602 | 609 | | |
603 | 610 | | |
604 | 611 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
385 | 385 | | |
386 | 386 | | |
387 | 387 | | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | 388 | | |
395 | 389 | | |
| 390 | + | |
| 391 | + | |
396 | 392 | | |
397 | 393 | | |
398 | 394 | | |
| |||
0 commit comments