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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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