Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add known upper limit to capture search. #217

Merged
merged 1 commit into from
Apr 27, 2016
Merged

Commits on Apr 27, 2016

  1. Add known upper limit to capture search.

    The DFA will report the end location of a match, so we should pass that
    along to capture detection. In theory, the DFA and the NFA report the
    same match locations, so this upper bound shouldn't be necessary---the
    NFA should quit once it finds the right match. It turns out though
    bounding the text has two important ramifications:
    
    1. It will enable the backtracking engine to be used more often. In
    particular, the backtracking engine can only be used on small inputs and
    this change decreases the size of the input by only considering the
    match.
    2. The backtracking engine must start every search by zeroing memory
    that is proportional to the size of the input. If the input is smaller,
    then this runs more quickly.
    
    We are also careful to bound the match to one additional "character"
    past the end of the match, so that lookahead operators work correctly.
    BurntSushi committed Apr 27, 2016
    Configuration menu
    Copy the full SHA
    49e8df5 View commit details
    Browse the repository at this point in the history