regexp-generator: Fix indentation

Our config files specify two-space indents for JS files. These scripts
were probably written before that was a thing. Update the indentation of
the script and the generated tests all in one go.
This commit is contained in:
Philip Chimento 2024-11-04 12:24:50 -08:00 committed by Philip Chimento
parent 7e1f1e749d
commit 9a0aa4c719
26 changed files with 1088 additions and 1088 deletions

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for digit class escape \d with flags ug
Compare range for digit class escape \d with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -57,16 +57,16 @@ const re = /\d/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for digit class escape \d+ with flags ug
Compare range for digit class escape \d+ with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -57,16 +57,16 @@ const re = /\d+/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for digit class escape \d+ with flags g
Compare range for digit class escape \d+ with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -57,16 +57,16 @@ const re = /\d+/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for digit class escape \d with flags g
Compare range for digit class escape \d with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -57,16 +57,16 @@ const re = /\d/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-digit class escape \D with flags ug
Compare range for non-digit class escape \D with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -60,16 +60,16 @@ const re = /\D/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-digit class escape \D+ with flags ug
Compare range for non-digit class escape \D+ with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -60,16 +60,16 @@ const re = /\D+/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-digit class escape \D+ with flags g
Compare range for non-digit class escape \D+ with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -60,16 +60,16 @@ const re = /\D+/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-digit class escape \D with flags g
Compare range for non-digit class escape \D with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -60,16 +60,16 @@ const re = /\D/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-whitespace class escape \S with flags ug
Compare range for non-whitespace class escape \S with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -69,16 +69,16 @@ const re = /\S/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-whitespace class escape \S+ with flags ug
Compare range for non-whitespace class escape \S+ with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -69,16 +69,16 @@ const re = /\S+/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-whitespace class escape \S+ with flags g
Compare range for non-whitespace class escape \S+ with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -69,16 +69,16 @@ const re = /\S+/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-whitespace class escape \S with flags g
Compare range for non-whitespace class escape \S with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -69,16 +69,16 @@ const re = /\S/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-word class escape \W with flags ug
Compare range for non-word class escape \W with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -62,16 +62,16 @@ const re = /\W/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-word class escape \W+ with flags ug
Compare range for non-word class escape \W+ with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -62,16 +62,16 @@ const re = /\W+/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-word class escape \W+ with flags g
Compare range for non-word class escape \W+ with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -62,16 +62,16 @@ const re = /\W+/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for non-word class escape \W with flags g
Compare range for non-word class escape \W with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -62,16 +62,16 @@ const re = /\W/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for whitespace class escape \s with flags ug
Compare range for whitespace class escape \s with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -67,16 +67,16 @@ const re = /\s/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for whitespace class escape \s+ with flags ug
Compare range for whitespace class escape \s+ with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -67,16 +67,16 @@ const re = /\s+/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for whitespace class escape \s+ with flags g
Compare range for whitespace class escape \s+ with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -67,16 +67,16 @@ const re = /\s+/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for whitespace class escape \s with flags g
Compare range for whitespace class escape \s with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -67,16 +67,16 @@ const re = /\s/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for word class escape \w with flags ug
Compare range for word class escape \w with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -59,16 +59,16 @@ const re = /\w/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for word class escape \w+ with flags ug
Compare range for word class escape \w+ with flags ug
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -59,16 +59,16 @@ const re = /\w+/ug;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for word class escape \w+ with flags g
Compare range for word class escape \w+ with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -59,16 +59,16 @@ const re = /\w+/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -4,42 +4,42 @@
/*---
esid: prod-CharacterClassEscape
description: >
Compare range for word class escape \w with flags g
Compare range for word class escape \w with flags g
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
@ -59,16 +59,16 @@ const re = /\w/g;
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);

View File

@ -1,50 +1,50 @@
export default description => {
let header = `// Copyright (C) 2018 Leo Balter. All rights reserved.
let header = `// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: prod-CharacterClassEscape
description: >
${description}
${description}
info: |
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
This is a generated test. Please check out
https://github.com/tc39/test262/tree/main/tools/regexp-generator/
for any changes.
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
CharacterClassEscape[UnicodeMode] ::
d
D
s
S
w
W
[+UnicodeMode] p{ UnicodePropertyValueExpression }
[+UnicodeMode] P{ UnicodePropertyValueExpression }
22.2.2.9 Runtime Semantics: CompileToCharSet
22.2.2.9 Runtime Semantics: CompileToCharSet
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3,
4, 5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: d
1. Return the ten-element CharSet containing the characters 0, 1, 2, 3, 4,
5, 6, 7, 8, and 9.
CharacterClassEscape :: D
1. Let S be the CharSet returned by CharacterClassEscape :: d.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: s
1. Return the CharSet containing all characters corresponding to a code
point on the right-hand side of the WhiteSpace or LineTerminator
productions.
CharacterClassEscape :: S
1. Let S be the CharSet returned by CharacterClassEscape :: s.
2. Return CharacterComplement(rer, S).
CharacterClassEscape :: w
1. Return MaybeSimpleCaseFolding(rer, WordCharacters(rer)).
CharacterClassEscape :: W
1. Let S be the CharSet returned by CharacterClassEscape :: w.
2. Return CharacterComplement(rer, S).
features: [String.fromCodePoint]
includes: [regExpUtils.js]
flags: [generated]
---*/\n`;
return header;
return header;
};

View File

@ -8,81 +8,81 @@ import slugify from 'slugify';
import header from './header.mjs';
const patterns = {
'whitespace class escape': '\\s',
'non-whitespace class escape': '\\S',
'word class escape': '\\w',
'non-word class escape': '\\W',
'digit class escape': '\\d',
'non-digit class escape': '\\D',
'whitespace class escape': '\\s',
'non-whitespace class escape': '\\S',
'word class escape': '\\w',
'non-word class escape': '\\W',
'digit class escape': '\\d',
'non-digit class escape': '\\D',
};
// Pretty-printing code adapted from unicode-property-escapes-tests.
// https://github.com/mathiasbynens/unicode-property-escapes-tests/blob/60f2dbec2b2a840ee67aa04dbd3449bb90fd2999/regenerate.js
function toHex(codePoint) {
return '0x' + ('00000' + codePoint.toString(16).toUpperCase()).slice(-6);
return '0x' + ('00000' + codePoint.toString(16).toUpperCase()).slice(-6);
};
function toTestData(reg) {
const data = reg.data;
// Iterate over the data per `(start, end)` pair.
let index = 0;
const length = data.length;
const loneCodePoints = [];
const ranges = [];
while (index < length) {
let start = data[index];
let end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
if (start == end) {
loneCodePoints.push(start);
} else {
ranges.push([start, end]);
}
index += 2;
const data = reg.data;
// Iterate over the data per `(start, end)` pair.
let index = 0;
const length = data.length;
const loneCodePoints = [];
const ranges = [];
while (index < length) {
let start = data[index];
let end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive.
if (start == end) {
loneCodePoints.push(start);
} else {
ranges.push([start, end]);
}
return [ loneCodePoints, ranges ];
index += 2;
}
return [ loneCodePoints, ranges ];
}
function prettyPrint([ loneCodePoints, ranges ]) {
const indent = ' ';
loneCodePoints = loneCodePoints.map((codePoint) => toHex(codePoint));
ranges = ranges.map(
(range) => `[${ toHex(range[0]) }, ${ toHex(range[1]) }]`
);
const loneCodePointsOutput = loneCodePoints.length ?
loneCodePoints.length === 1 ? `[${loneCodePoints[0]}]` :
`[\n${indent}${indent}${ loneCodePoints.join(`,\n${indent}${indent}`) },\n${indent}]` :
`[]`;
const rangesOutput = ranges.length ?
`[\n${indent}${indent}${ ranges.join(`,\n${indent}${indent}`) },\n${indent}]` :
`[]`;
return `{\n${indent}loneCodePoints: ${ loneCodePointsOutput },\n${indent}ranges: ${ rangesOutput },\n}`;
const indent = ' ';
loneCodePoints = loneCodePoints.map((codePoint) => toHex(codePoint));
ranges = ranges.map(
(range) => `[${ toHex(range[0]) }, ${ toHex(range[1]) }]`
);
const loneCodePointsOutput = loneCodePoints.length ?
loneCodePoints.length === 1 ? `[${loneCodePoints[0]}]` :
`[\n${indent}${indent}${ loneCodePoints.join(`,\n${indent}${indent}`) },\n${indent}]` :
`[]`;
const rangesOutput = ranges.length ?
`[\n${indent}${indent}${ ranges.join(`,\n${indent}${indent}`) },\n${indent}]` :
`[]`;
return `{\n${indent}loneCodePoints: ${ loneCodePointsOutput },\n${indent}ranges: ${ rangesOutput },\n}`;
}
const LOW_SURROGATES = regenerate().addRange(0xDC00, 0xDFFF);
function buildString(escapeChar, flags) {
const isUnicode = flags.includes('u');
let escapeData = ESCAPE_SETS[isUnicode ? 'UNICODE' : 'REGULAR'].get(escapeChar);
const isUnicode = flags.includes('u');
let escapeData = ESCAPE_SETS[isUnicode ? 'UNICODE' : 'REGULAR'].get(escapeChar);
const lowSurrogates = escapeData.clone().intersection(LOW_SURROGATES);
if (lowSurrogates.data.length === 0) {
return prettyPrint(toTestData(escapeData));
}
const rest = escapeData.clone().remove(LOW_SURROGATES);
const [ lowLoneCodePoints, lowRanges ] = toTestData(lowSurrogates);
const [ loneCodePoints, ranges ] = toTestData(rest);
loneCodePoints.unshift(...lowLoneCodePoints);
ranges.unshift(...lowRanges);
return prettyPrint([ loneCodePoints, ranges ]);
const lowSurrogates = escapeData.clone().intersection(LOW_SURROGATES);
if (lowSurrogates.data.length === 0) {
return prettyPrint(toTestData(escapeData));
}
const rest = escapeData.clone().remove(LOW_SURROGATES);
const [ lowLoneCodePoints, lowRanges ] = toTestData(lowSurrogates);
const [ loneCodePoints, ranges ] = toTestData(rest);
loneCodePoints.unshift(...lowLoneCodePoints);
ranges.unshift(...lowRanges);
return prettyPrint([ loneCodePoints, ranges ]);
}
function buildContent(desc, pattern, flags) {
let string = buildString(pattern[1], flags);
let string = buildString(pattern[1], flags);
let content = header(`Compare range for ${desc} ${pattern} with flags ${flags}`);
let content = header(`Compare range for ${desc} ${pattern} with flags ${flags}`);
content += `
content += `
const str = buildString(${string});
const re = /${pattern}/${flags};
@ -90,18 +90,18 @@ const re = /${pattern}/${flags};
const errors = [];
if (!re.test(str)) {
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
// Error, let's find out where
for (const char of str) {
if (!re.test(char)) {
errors.push('0x' + char.codePointAt(0).toString(16));
}
}
}
assert.sameValue(
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
errors.length,
0,
'Expected matching code points, but received: ' + errors.join(',')
);
`;
@ -109,45 +109,45 @@ assert.sameValue(
}
function writeFile(desc, content, suffix = '') {
const outPath = '../../test/built-ins/RegExp/CharacterClassEscapes';
const filename = `${outPath}/character-class-${slugify(filenamify(desc.toLowerCase()))}${suffix}.js`;
fs.writeFileSync(filename, content);
const outPath = '../../test/built-ins/RegExp/CharacterClassEscapes';
const filename = `${outPath}/character-class-${slugify(filenamify(desc.toLowerCase()))}${suffix}.js`;
fs.writeFileSync(filename, content);
}
// No additions
for (const [desc, escape] of Object.entries(patterns)) {
[
{
quantifier: '',
flags: '',
},
{
quantifier: '+',
flags: '',
suffix: '-plus-quantifier',
},
{
quantifier: '',
flags: 'u',
suffix: '-flags-u',
},
{
quantifier: '+',
flags: 'u',
suffix: '-plus-quantifier-flags-u',
},
].forEach(({quantifier, flags, suffix}) => {
flags += 'g';
[
{
quantifier: '',
flags: '',
},
{
quantifier: '+',
flags: '',
suffix: '-plus-quantifier',
},
{
quantifier: '',
flags: 'u',
suffix: '-flags-u',
},
{
quantifier: '+',
flags: 'u',
suffix: '-plus-quantifier-flags-u',
},
].forEach(({quantifier, flags, suffix}) => {
flags += 'g';
const pattern = `${escape}${quantifier}`;
const range = rewritePattern(pattern, flags, {
unicodeFlag: flags.includes('u') ? 'transform' : false,
});
console.log(`${pattern} => ${range}, flags: ${flags}`);
const content = buildContent(desc, pattern, flags);
writeFile(desc, content, suffix);
const pattern = `${escape}${quantifier}`;
const range = rewritePattern(pattern, flags, {
unicodeFlag: flags.includes('u') ? 'transform' : false,
});
console.log(`${pattern} => ${range}, flags: ${flags}`);
const content = buildContent(desc, pattern, flags);
writeFile(desc, content, suffix);
});
}