Detect invalid Unicode class specification "\\p". #1690
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Testing:
X86_64 only . All tests pass.