Use ES6 syntax for astral Unicode characters #651
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.
PR type
Prerequisites
Description
This PR is constructed on #586 but uses the ES 6 syntax for astral Unicode characters
\u{1F4AF}
instead of the syntax\U0001F4AF
(recognised in Python world).The rule
CodePoint
(named after ECMAScript grammar) recognises the following sequences:\u{0+}
e.g.\u{00000000000000}
resulting in the Unicode character U+0000\u{0*HexDigit{1,4}}
resulting in the Unicode character in BMP\u{0*(10|HexDigit)HexDigit{4}}
resulting in the Unicode character in astral planeThis PR or #586 have a similar goal but a different proposed syntax.
They are both limited to constant strings and do both a bad job in characters classes like
[a-\u{1F4AF}]
. Characters classes should be treated by further PRs, see my comment for other points.