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

properly support lookahead expresions in begin matches #2135

Merged
merged 10 commits into from
Oct 19, 2019

Commits on Oct 19, 2019

  1. new sequential parser

    - begin matches are matched a single time
      (they no longer need to be rematched after found)
    - look-ahead should now work properly for begin matches
      because of this change
    - should be a tiny bit faster
    
    Before
    
    The old parser would build a list of regexes per mode and then
    combine that into a large regex.  This is what was used to scan
    your code for matches.  But after a match was found it had no way
    on known WHICH match - so it would then have to re-run all the rules
    sequentially on the bit of match text trying to figure out which
    rule had matched.
    
    The problem is while the original matcher was running agianst the
    full code this "rematch" was only running aginst the matched text.
    So look-ahead matches would naturally fail becasue the content they
    were tryign to look-ahead to was no longer present.
    
    After
    
    We take the list of regexes per mode and combine then into a larger
    regex, but with match groups.  We keep track of which match group
    position correspond to which rule.  Now when we hit a match we can
    check which match group was matched and find the associated rule/mode
    that was matched withotu having to double check.
    
    Look-ahead begin matches now "just work" because the rules are always
    running against the full body of text and not just a subset.
    
    Caveats
    
    This doesn't solve look-ahead for end matching so naturally it also
    does nothing for endSameAsBegin. IE, don't expect look-aheads to work
    properly in those situations yet.
    joshgoebel committed Oct 19, 2019
    Configuration menu
    Copy the full SHA
    aa957a7 View commit details
    Browse the repository at this point in the history
  2. remove |$ hack from xml

    joshgoebel committed Oct 19, 2019
    Configuration menu
    Copy the full SHA
    4d9c06d View commit details
    Browse the repository at this point in the history
  3. remove |$ hack from stata

    joshgoebel committed Oct 19, 2019
    Configuration menu
    Copy the full SHA
    b46e6a3 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    2466174 View commit details
    Browse the repository at this point in the history
  5. remove incorrect comment

    joshgoebel committed Oct 19, 2019
    Configuration menu
    Copy the full SHA
    6987a21 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    80413f5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1902fd2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    2bc4024 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    33601b4 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    bec856c View commit details
    Browse the repository at this point in the history