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

Fixes for rewrite_repeat #250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Commits on Oct 10, 2020

  1. Fixes for rewrite_repeat

    rewrite_repeat, used for rewriting nested repeats contained a comment
    that said repeats can only be combined if the range of the result is not
    more than the sum of the ranges of the inputs, but the assertion
    actually tested the opposite: it tested that the range of the result is
    more than the sum of the ranges of the inputs. This assertion does not
    universally hold either way: a{2}{2} can be rewritten to a{4}, but the
    range as calculated of the latter (0) is equal to the sum of the ranges
    of the inputs (also 0).
    
    Separate from the assert, the rewrite was not performed in some cases
    where it is valid to do so. It is valid whenever the inner repeat has
    a lower bound of 0 or 1, whenever the inner repeat has no upper bound
    and the outer repeat has a positive lower bound, and whenever the outer
    range has a lower bound equal to the upper bound. The last case was
    missing. An example is a{2,3}{2}, which would previously be preserved
    in that form, but is now rewritten as a{4,6}.
    hvdijk committed Oct 10, 2020
    Configuration menu
    Copy the full SHA
    977f223 View commit details
    Browse the repository at this point in the history