-
Notifications
You must be signed in to change notification settings - Fork 20
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
Add support for the /u
flag (RegExp.prototype.unicode
)
#9
Comments
Note: the current support for Unicode code point escapes should only be enabled when the |
Bug: |
Just tried with the current version and now get this output: {
"type": "alternative",
"body": [
{
"type": "value",
"kind": "unicode",
"codePoint": 119558,
"range": [
0,
12
],
"raw": "\\uD834\\uDF06"
}
],
"range": [
0,
12
],
"raw": "\\uD834\\uDF06",
"lastMatchIdx": 0
} Therefore, closing this issue. |
Wait, what? I thought we renamed that? |
You are right, I and it is renamed - I was not on the {
"type": "alternative",
"body": [
{
"type": "value",
"kind": "unicodeCodePointEscape",
"codePoint": 119558,
"range": [
0,
12
],
"raw": "\\uD834\\uDF06"
}
],
"range": [
0,
12
],
"raw": "\\uD834\\uDF06",
"lastMatchIdx": 0
} |
Your example still says it’s an escape sequence (because the CLI is used and it considers the > regjsparser.parse('\uD834\uDF06', 'u')
{ type: 'alternative',
body:
[ { type: 'value',
kind: 'symbol',
codePoint: 119558,
range: [Object],
raw: '\uD834\uDF06' } ],
range: [ 0, 2 ],
raw: '\uD834\uDF06',
lastMatchIdx: 0 } |
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-get-regexp.prototype.unicode
Contrary to #8, this does affect parsing; based on whether or not the
u
flag was set, different parsing logic applies.The text was updated successfully, but these errors were encountered: