Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend ending position of capture search.
When searching for captures, we first use the DFA to find the start and end of the match. We then pass just the matched region of text to the NFA engine to find sub-capture locations. This is a key optimization that prevents the NFA engine from searching a lot more text than what is necessary in some cases. One problem with this is that some instructions determine their match state based on whether the engine is at the boundary of the search text. For example, `$` matches if and only if the engine is at EOF. If we only provide the matched text region, then assertions like `\b` might not work, since it needs to examine at least one character past the end of the match. If we provide the matched text region plus one character, then `$` may match when it shouldn't. Therefore, we provide the matched text plus (at most) two characters. Fixes rust-lang#334
- Loading branch information