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

Yet more parse_tt improvements #95425

Merged
merged 6 commits into from
Mar 30, 2022

Commits on Mar 28, 2022

  1. Add a useful assertion.

    nnethercote committed Mar 28, 2022
    Configuration menu
    Copy the full SHA
    df6ead5 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2022

  1. Configuration menu
    Copy the full SHA
    2b60cc0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ac3d8ce View commit details
    Browse the repository at this point in the history
  3. Improve comments and rename many things for consistency.

    In particular:
    - Replace use of "item" with "matcher position/"mp".
    - Replace use of "repetition" with "sequence".
    - Replace `ms` with `matcher`.
    nnethercote committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    a1b140c View commit details
    Browse the repository at this point in the history
  4. Overhaul how matches are recorded.

    Currently, matches within a sequence are recorded in a new empty
    `matches` vector. Then when the sequence finishes the matches are merged
    into the `matches` vector of the parent.
    
    This commit changes things so that a sequence mp inherits the matches
    made so far. This means that additional matches from the sequence don't
    need to be merged into the parent. `push_match` becomes more
    complicated, and the current sequence depth needs to be tracked. But
    it's a sizeable performance win because it avoids one or more
    `push_match` calls on every iteration of a sequence.
    
    The commit also removes `match_hi`, which is no longer necessary.
    nnethercote committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    524d21b View commit details
    Browse the repository at this point in the history
  5. Pre-allocate an empty Lrc<NamedMatchVec>.

    This avoids some allocations.
    nnethercote committed Mar 29, 2022
    Configuration menu
    Copy the full SHA
    6b0a16a View commit details
    Browse the repository at this point in the history