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

Fix remaining travis warnings #81

Merged
merged 11 commits into from
Jun 25, 2019
Merged

Fix remaining travis warnings #81

merged 11 commits into from
Jun 25, 2019

Commits on Jun 10, 2019

  1. Fix remaining escape sequence warnings in lex patterns.

    Raw strings (marked by the `r` prefix) are normally used for
    regular expression patterns to allow that module to expand
    any backslash-escape sequences without interference from
    the Python interpreter's string expansion, and thus the
    requirement for extra quoting.
    
    This practice is further encouraged by python 3.5 and later
    raising a `DepreciationWarning` when encountering escape sequences
    it can't expand, as is common is re patterns.
    
    However, in python 2.7, the `re` module doesn't expand \u and \U
    escapes for unicode codepoints, so patterns with non-ascii
    characters can only be used in raw strings when using python 3.3
    or later, or the external `regex` module, and neither `u` nor `r`
    quoted strings will work for patterns in both languages.
    
    However, Python will concatenate whitespace-separated string
    literals even if they use different quoting. Take advantage
    of this to split the lexer patterns into raw- and unicode-quoted
    segments as appropriate.
    
    Also remove some unnecessary escape sequences.
    rillian committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    14e01ba View commit details
    Browse the repository at this point in the history
  2. travis: Replace pep8 with pycodestyle.

    The pep8 name is deprecated, and the tool continues under
    the new name.
    rillian committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    f2bdbe1 View commit details
    Browse the repository at this point in the history
  3. travis: Use pytest invocation.

    Now that we're using a newer pytest, we can invoke it as such
    even in the jython build, instead of using the older `py.test`.
    rillian committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    50d7165 View commit details
    Browse the repository at this point in the history
  4. Sanitize lexer pattern regex escapes.

    The parser's  token pattern strings escaped almost all punctuation
    characters, but the Python `re` module has a fairly limited set
    of special characters which must be backslash-escaped.
    
    In particular, characters like @ ! : and space do not need escapes,
    and even more are fine inside a [] environment describing a set
    of characters.
    
    Audit the expression strings and remove most unnecessary escapes.
    I left some sequences like `[^\^\[]` which aren't ambiguous without
    escapes for clarity of reading.
    rillian committed Jun 10, 2019
    Configuration menu
    Copy the full SHA
    508473f View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2019

  1. travis: Use the default python3 on macOS.

    The default osx image on travis doesn't have an up-to-date
    set of homebrew packages, so the `brew upgrade` step must
    compile many packages from source and takes tens of minutes
    to complete. This makes for very slow test feedback and
    occasionally failures when the job times out.
    
    Travis itself doesn't provide python3 packages through
    the `language` and `python` yaml keys like it does on
    Linux. Setting these keys fails trying to download the
    requested tarball.
    
    Give up therefore, and just use whatever python3 was installed
    on the image by default. Currently that is 3.6.5 from homebrew.
    This significantly speeds up test feedback.
    rillian committed Jun 11, 2019
    Configuration menu
    Copy the full SHA
    86a99d4 View commit details
    Browse the repository at this point in the history

Commits on Jun 20, 2019

  1. Add a lexer test to verify multiline notes.

    The #note environment can be any free text up to a double newline.
    Subsequent lines don't need to be intented like with #tr.
    
    It didn't seem like we had text coverage for this feature.
    rillian committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    fecf4e3 View commit details
    Browse the repository at this point in the history
  2. Add a lexer test to verify note termination.

    The #note environment can span multiple lines, but is supposed
    to be terminated by a new line label. There was a test for
    termination by an @object, but not for this.
    
    Check all the primed variants for line numbers to prevent regression
    of an issue I introduced addressing issue oracc#78.
    rillian committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    602530d View commit details
    Browse the repository at this point in the history
  3. Fix regression with #note and unprimed line numbers.

    Sanitizing the regular expression pattern strings, I accidentally
    removed the optional mark ('?') from the collection of prime
    characters used to conclude a #note when it doesn't end in a
    double newline.
    
    Restore this, and clarify the related comment.
    rillian committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    06bfd65 View commit details
    Browse the repository at this point in the history
  4. Backport regression test with #note to python2.

    Python 2.7 can't handle the unicode prime values in normal `str`
    objects, so construct the generated line label as a unicode object
    instead.
    rillian committed Jun 20, 2019
    Configuration menu
    Copy the full SHA
    26229aa View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2019

  1. Remove debug print.

    I used this to guide constructing the new unit tests.
    Thanks to ageorgou for catching that I'd left it in
    the committed version.
    rillian committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    e86c3b2 View commit details
    Browse the repository at this point in the history
  2. test: Avoid shadowing next.

    Rename a varable to avoid confusion with a built-in.
    Thanks to ageorgou for the suggestion.
    rillian committed Jun 21, 2019
    Configuration menu
    Copy the full SHA
    6959cd9 View commit details
    Browse the repository at this point in the history