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

Move all regex usage to separate module to add support for fancy-regex #270

Merged
merged 16 commits into from
Mar 29, 2020

Commits on Mar 15, 2020

  1. Move all regex usage to separate module

    That way we can add fancy-regex support behind a feature.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    5901e1b View commit details
    Browse the repository at this point in the history
  2. Bump fancy-regex to 0.3.0

    * Adds a std::error::Error impl for Error
    * Adds a backtracking limit to mitigate catastrophic backtracking
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    d05bde4 View commit details
    Browse the repository at this point in the history
  3. Restore optimization of reusing Regions

    Without this, some parsing benchmarks took 30% longer to run.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    df56e71 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f1af918 View commit details
    Browse the repository at this point in the history
  5. Add YAML parsing test

    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    f37b17b View commit details
    Browse the repository at this point in the history
  6. Compile regexes in multi-line mode for the "newlines" syntaxes

    Some of the regexes include `$` and expect it to match end of line. In
    fancy-regex, `$` means end of text by default. Adding `(?m)` activates
    multi-line mode which changes `$` to match end of line.
    
    This fixes a large number of the failed assertions with syntest.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    0b78764 View commit details
    Browse the repository at this point in the history
  7. Replace POSIX character classes so that they match Unicode as well

    In fancy-regex, POSIX character classes only match ASCII characters.
    Sublime's syntaxes expect them to match Unicode characters as well, so
    transform them to corresponding Unicode character classes.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    5caa56a View commit details
    Browse the repository at this point in the history
  8. Replace ^ with \A in multi-line mode regexes

    With the regex crate and fancy-regex, `^` in multi-line mode also
    matches at the end of a string like "test\n". There are some regexes in
    the syntax definitions like `^\s*$`, which are intended to match a blank
    line only. So change `^` to `\A` which only matches at the beginning of
    text.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    bece70d View commit details
    Browse the repository at this point in the history
  9. Fix code that skips a character to work with unicode

    Note that this wasn't a problem with Oniguruma because it works on UTF-8
    bytes, but fancy-regex works on characters.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    d8eeff9 View commit details
    Browse the repository at this point in the history
  10. Fix rewriting of "newlines" mode regexes

    Always adding `(?m)` for the entire regex meant that `.` also changed meaning,
    which is not what we want. The safer option is to use `(?m:$)` for `$` only.
    
    That also means we don't have to bother with `\A`. But we do need to parse
    look-behinds because we can't use `(?m:$)` in it.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    62d79e7 View commit details
    Browse the repository at this point in the history
  11. Remove special treatment of look-behind

    Turns out `(?m:$)` works in look-behinds, just not `(?m)$(?-m)` which I was
    using before.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    fa92de0 View commit details
    Browse the repository at this point in the history
  12. Bump fancy-regex to 0.3.2

    Includes the fix for
    fancy-regex/fancy-regex#37 which caused a test
    failure with the Java syntax.
    robinst committed Mar 15, 2020
    Configuration menu
    Copy the full SHA
    a7045b1 View commit details
    Browse the repository at this point in the history

Commits on Mar 21, 2020

  1. Only load regex module for features that need it

    Might be worth introducing a specific feature for this and then have
    other features depend on it? Not sure.
    robinst committed Mar 21, 2020
    Configuration menu
    Copy the full SHA
    4f09143 View commit details
    Browse the repository at this point in the history
  2. Test fancy-regex mode in CI

    trishume committed Mar 21, 2020
    Configuration menu
    Copy the full SHA
    0a74d87 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2020

  1. Make packs to fix html::tests::strings test for fancy

    This applies the regex rewriting fixes on this branch to the default
    packs.
    robinst committed Mar 25, 2020
    Configuration menu
    Copy the full SHA
    da2d4b5 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2020

  1. Configuration menu
    Copy the full SHA
    9cbe524 View commit details
    Browse the repository at this point in the history