mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 22:15:24 +02:00
regexp-generator: Remove dead code
These are unused parameters and variables, and all have no effect on the output.
This commit is contained in:
parent
07ddc3b41b
commit
54e02bdd56
@ -77,10 +77,8 @@ function buildString(escapeChar, flags) {
|
|||||||
return prettyPrint([ loneCodePoints, ranges ]);
|
return prettyPrint([ loneCodePoints, ranges ]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildContent(desc, pattern, range, max, flags, skip180e) {
|
function buildContent(desc, pattern, flags) {
|
||||||
let string = buildString(pattern[1], flags);
|
let string = buildString(pattern[1], flags);
|
||||||
let method;
|
|
||||||
let features = [];
|
|
||||||
|
|
||||||
let content = header(`Compare range for ${desc} ${pattern} with flags ${flags}`);
|
let content = header(`Compare range for ${desc} ${pattern} with flags ${flags}`);
|
||||||
|
|
||||||
@ -118,7 +116,6 @@ function writeFile(desc, content, suffix = '') {
|
|||||||
|
|
||||||
// No additions
|
// No additions
|
||||||
for (const [desc, escape] of Object.entries(patterns)) {
|
for (const [desc, escape] of Object.entries(patterns)) {
|
||||||
const skip180e = escape.toLowerCase().includes('s');
|
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
quantifier: '',
|
quantifier: '',
|
||||||
@ -127,23 +124,19 @@ for (const [desc, escape] of Object.entries(patterns)) {
|
|||||||
{
|
{
|
||||||
quantifier: '+',
|
quantifier: '+',
|
||||||
flags: '',
|
flags: '',
|
||||||
posCb(u) { return [u, u+u]},
|
|
||||||
suffix: '-plus-quantifier',
|
suffix: '-plus-quantifier',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
quantifier: '',
|
quantifier: '',
|
||||||
flags: 'u',
|
flags: 'u',
|
||||||
max: 0x10FFFF,
|
|
||||||
suffix: '-flags-u',
|
suffix: '-flags-u',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
quantifier: '+',
|
quantifier: '+',
|
||||||
flags: 'u',
|
flags: 'u',
|
||||||
posCb(u) { return [u, u+u]},
|
|
||||||
suffix: '-plus-quantifier-flags-u',
|
suffix: '-plus-quantifier-flags-u',
|
||||||
max: 0x10FFFF,
|
|
||||||
},
|
},
|
||||||
].forEach(({quantifier, max = 0xFFFF, flags, suffix, posCb = u => [u], negCb = u => [u]}) => {
|
].forEach(({quantifier, flags, suffix}) => {
|
||||||
flags += 'g';
|
flags += 'g';
|
||||||
|
|
||||||
const pattern = `${escape}${quantifier}`;
|
const pattern = `${escape}${quantifier}`;
|
||||||
@ -153,7 +146,7 @@ for (const [desc, escape] of Object.entries(patterns)) {
|
|||||||
|
|
||||||
console.log(`${pattern} => ${range}, flags: ${flags}`);
|
console.log(`${pattern} => ${range}, flags: ${flags}`);
|
||||||
|
|
||||||
const content = buildContent(desc, pattern, range, max, flags, skip180e);
|
const content = buildContent(desc, pattern, flags);
|
||||||
|
|
||||||
writeFile(desc, content, suffix);
|
writeFile(desc, content, suffix);
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user