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

allow starting DFA in noncontinuous bytes #1031

Closed
wants to merge 1 commit into from

Commits on Jul 9, 2023

  1. allow starting DFA in noncontinuous bytes

    regex-automtaton already supports transversing the DFA one byte at a time with
    `next_state`. This is potentially very useful when scanning noncontinuous data
    like network stream or a rope data structures as commonly used in editors.
    
    However, to start the DFA with `start_state_forward`/`start_state_reverse`
    currently requires an `Input` and will look ahead/look one byte behind the
    span boundaries. To support that (especially when using prefilters/literal
    optimization) a streaming use case can not provide such a haystack easily (it
    can be worked around with a temporary array and copying one byte over but its
    extremely brittle/hacky).
    
    This commit adds the `start_state_forward_with`/`start_state_reverse_with`
    function which allow passing the information extracted from the Input directly.
    pascalkuthe committed Jul 9, 2023
    Configuration menu
    Copy the full SHA
    1d98af1 View commit details
    Browse the repository at this point in the history