Skip to content

Conversation

LeeTibbert
Copy link
Contributor

  • This PR ports re2j PR
    #74
    "Detect invalid Unicode class specification", dated 2018-10-23, to
    Scala Native.

    Prior to this PR, compiling the pattern "\p" would lead to an
    unexpected java.lang.StringIndexOutOfBoundsException.
    As of this PR the PatternSyntaxException used by the JVM is thrown.

    The text of the exception is slightly different. JVM reports the unknown
    property name, or {?}. Doing that in SN regex is harder that time allowed.

  • A new ERR_UNKNOWN_CHARACTER_PROPERTY_NAME message was added and
    and the initial word of three messages converted to Titlecase as used by JVM.

    Message texts from SN regex (née re2s) still do not match JVM
    exactly but they are moving closer.

  • The message text for the invalid specification "\p{" was
    also changed.

Documentation:

* The standard changelog entry is requested.

Testing:

  • Built and tested ("test-all") in debug mode, Java 8, using sbt 1.2.8 on
    X86_64 only . All tests pass.

@LeeTibbert LeeTibbert force-pushed the PR_sn_regex_DetectInvalidUnicodeClassSpec branch from f8fc435 to 69284c7 Compare August 22, 2019 09:10
  * This PR ports [re2j](https://github.com/google/re2j/) PR
    #[74](https://github.com/google/re2j/)
    "Detect invalid Unicode class specification", dated 2018-10-23, to
    Scala Native.

    Prior to this PR, compiling the pattern "\\p" would lead to an
    unexpected java.lang.StringIndexOutOfBoundsException.
    As of this PR the PatternSyntaxException used by the JVM is thrown.

    The text of the exception is slightly different. JVM reports the unknown
    property name, or {?}. Doing that in SN regex is harder that time allowed.

  * A new ERR_UNKNOWN_CHARACTER_PROPERTY_NAME message was added and
    and the initial word of several messages converted to Titlecase.
    Messages on the JVM start with an initial capital letter.

    Message texts from SN regex (née re2s) still do not match JVM
    exactly but they are moving closer.

  * The message text for the invalid specification "\\p{" was
    also changed.

Documentation:

    * The standard changelog entry is requested.

Testing:

  * Built and tested ("test-all") in debug mode, Java 8, using sbt 1.2.8 on
    X86_64 only . All tests pass.
@LeeTibbert LeeTibbert force-pushed the PR_sn_regex_DetectInvalidUnicodeClassSpec branch from 69284c7 to 0d68fe4 Compare May 16, 2020 01:03
@LeeTibbert
Copy link
Contributor Author

Proactively rebased. Travis CI is all green

@WojciechMazur
Copy link
Contributor

Rebased and merged in #2402. Thank you for publishing the original solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants