From 718bc2af6826440f30c25a3379c3ed953b65d27e Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Thu, 31 Oct 2024 17:49:21 -0700 Subject: [PATCH 01/14] Add files from bocoup/test262-regexp-generator Old upstream: https://github.com/bocoup/test262-regexp-generator --- tools/regexp-generator/LICENSE | 21 ++++++ tools/regexp-generator/README.md | 2 + tools/regexp-generator/header.js | 42 ++++++++++++ tools/regexp-generator/index.js | 102 ++++++++++++++++++++++++++++ tools/regexp-generator/package.json | 18 +++++ 5 files changed, 185 insertions(+) create mode 100644 tools/regexp-generator/LICENSE create mode 100644 tools/regexp-generator/README.md create mode 100644 tools/regexp-generator/header.js create mode 100644 tools/regexp-generator/index.js create mode 100644 tools/regexp-generator/package.json diff --git a/tools/regexp-generator/LICENSE b/tools/regexp-generator/LICENSE new file mode 100644 index 0000000000..6f3bc14776 --- /dev/null +++ b/tools/regexp-generator/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Bocoup + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/tools/regexp-generator/README.md b/tools/regexp-generator/README.md new file mode 100644 index 0000000000..ab8da0b0d5 --- /dev/null +++ b/tools/regexp-generator/README.md @@ -0,0 +1,2 @@ +# test262-regexp-generator +Generete tests for RegExp based on unicode data diff --git a/tools/regexp-generator/header.js b/tools/regexp-generator/header.js new file mode 100644 index 0000000000..bedcf9d09a --- /dev/null +++ b/tools/regexp-generator/header.js @@ -0,0 +1,42 @@ +module.exports = description => { + 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} +info: | + This is a generated test. Please check out + https://github.com/bocoup/test262-regexp-generator + for any changes. + + CharacterClassEscape[U] :: + d + D + s + S + w + W + + 21.2.2.12 CharacterClassEscape + + The production CharacterClassEscape :: d evaluates as follows: + Return the ten-element set of characters containing the characters 0 through 9 inclusive. + The production CharacterClassEscape :: D evaluates as follows: + Return the set of all characters not included in the set returned by CharacterClassEscape :: d. + The production CharacterClassEscape :: s evaluates as follows: + Return the set of characters containing the characters that are on the right-hand side of + the WhiteSpace or LineTerminator productions. + The production CharacterClassEscape :: S evaluates as follows: + Return the set of all characters not included in the set returned by CharacterClassEscape :: s. + The production CharacterClassEscape :: w evaluates as follows: + Return the set of all characters returned by WordCharacters(). + The production CharacterClassEscape :: W evaluates as follows: + Return the set of all characters not included in the set returned by CharacterClassEscape :: w. +features: [String.fromCodePoint] +includes: [regExpUtils.js] +---*/\n`; + + return header; +}; diff --git a/tools/regexp-generator/index.js b/tools/regexp-generator/index.js new file mode 100644 index 0000000000..dd77b19135 --- /dev/null +++ b/tools/regexp-generator/index.js @@ -0,0 +1,102 @@ +const fs = require('fs'); +const rewritePattern = require('regexpu-core'); +const slugify = require('slugify'); +const filenamify = require('filenamify'); +const jsesc = require('jsesc'); +const header = require('./header'); + +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', +}; + +function buildContent(desc, pattern, range, max, flags, skip180e) { + let method; + let features = []; + + let content = header(`Compare range for ${desc} ${pattern} with flags ${flags}`); + + content += ` +const str = buildString({ loneCodePoints: [], ranges: [[0, ${ + jsesc(max, { numbers: 'hexadecimal' }) +}]] }); + +const re = /${pattern}/${flags}; +const matchingRange = /${range}/${flags}; + +const errors = []; + +function matching(str) { + return str.replace(re, '') === str.replace(matchingRange, ''); +} + +if (!matching(str)) { + // Error, let's find out where + for (const char of str) { + if (!matching(char)) { + errors.push('0x' + char.codePointAt(0).toString(16)); + } + } +} + +assert.sameValue( + errors.length, + 0, + 'Expected matching code points, but received: ' + errors.join(',') +); +`; + + return content; +} + +function writeFile(desc, content, suffix = '') { + const filename = `output/character-class-${slugify(filenamify(desc.toLowerCase()))}${suffix}.js`; + fs.writeFileSync(filename, content); +} + +// No additions +for (const [desc, escape] of Object.entries(patterns)) { + const skip180e = escape.toLowerCase().includes('s'); + [ + { + quantifier: '', + flags: '', + }, + { + quantifier: '+', + flags: '', + posCb(u) { return [u, u+u]}, + suffix: '-plus-quantifier', + }, + { + quantifier: '', + flags: 'u', + max: 0x10FFFF, + suffix: '-flags-u', + }, + { + quantifier: '+', + flags: 'u', + posCb(u) { return [u, u+u]}, + suffix: '-plus-quantifier-flags-u', + max: 0x10FFFF, + }, + ].forEach(({quantifier, max = 0xFFFF, flags, suffix, posCb = u => [u], negCb = u => [u]}) => { + flags += 'g'; + + const pattern = `${escape}${quantifier}`; + const range = rewritePattern(pattern, flags, { + useUnicodeFlag: flags.includes('u') + }); + + console.log(`${pattern} => ${range}, flags: ${flags}`); + + const content = buildContent(desc, pattern, range, max, flags, skip180e); + + writeFile(desc, content, suffix); + }); +} diff --git a/tools/regexp-generator/package.json b/tools/regexp-generator/package.json new file mode 100644 index 0000000000..57b661b8c0 --- /dev/null +++ b/tools/regexp-generator/package.json @@ -0,0 +1,18 @@ +{ + "name": "test262-regexp-class-escapes", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "build": "node index.js" + }, + "author": "", + "license": "MIT", + "dependencies": { + "filenamify": "^2.1.0", + "jsesc": "^2.5.1", + "regexpu-core": "^4.2.0", + "slugify": "^1.3.0" + } +} From 31e01cc27909049a2eb998b288cccc899983a66a Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 16:21:34 -0700 Subject: [PATCH 02/14] regexp-generator: Update output path Instead of an output/ folder, output the tests directly into the folder where they live. --- tools/regexp-generator/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/regexp-generator/index.js b/tools/regexp-generator/index.js index dd77b19135..e3e816c4c6 100644 --- a/tools/regexp-generator/index.js +++ b/tools/regexp-generator/index.js @@ -54,7 +54,8 @@ assert.sameValue( } function writeFile(desc, content, suffix = '') { - const filename = `output/character-class-${slugify(filenamify(desc.toLowerCase()))}${suffix}.js`; + const outPath = '../../test/built-ins/RegExp/CharacterClassEscapes'; + const filename = `${outPath}/character-class-${slugify(filenamify(desc.toLowerCase()))}${suffix}.js`; fs.writeFileSync(filename, content); } From c8a515501fc45d27a674392992331fa86486465a Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 16:26:00 -0700 Subject: [PATCH 03/14] regexp-generator: Ensure folder exists before generating --- tools/regexp-generator/package.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tools/regexp-generator/package.json b/tools/regexp-generator/package.json index 57b661b8c0..977418ec29 100644 --- a/tools/regexp-generator/package.json +++ b/tools/regexp-generator/package.json @@ -5,6 +5,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", + "prebuild": "mkdirp ../../test/built-ins/RegExp/CharacterClassEscapes", "build": "node index.js" }, "author": "", @@ -14,5 +15,8 @@ "jsesc": "^2.5.1", "regexpu-core": "^4.2.0", "slugify": "^1.3.0" + }, + "devDependencies": { + "mkdirp": "^3.0.1" } } From 86665928e02e998ce73c125c39ec51eb34d434c9 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 16:28:07 -0700 Subject: [PATCH 04/14] regexp-generator: Add 'npm run clean' script --- tools/regexp-generator/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/regexp-generator/package.json b/tools/regexp-generator/package.json index 977418ec29..ba0bf2b161 100644 --- a/tools/regexp-generator/package.json +++ b/tools/regexp-generator/package.json @@ -5,6 +5,7 @@ "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", + "clean": "rimraf ../../test/built-ins/RegExp/CharacterClassEscapes", "prebuild": "mkdirp ../../test/built-ins/RegExp/CharacterClassEscapes", "build": "node index.js" }, @@ -17,6 +18,7 @@ "slugify": "^1.3.0" }, "devDependencies": { - "mkdirp": "^3.0.1" + "mkdirp": "^3.0.1", + "rimraf": "^6.0.1" } } From 34bdc5661e508f513504e87c1e23902cf29aee42 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 16:21:49 -0700 Subject: [PATCH 05/14] regexp-generator: Expand README Add some minimal instructions for regenerating the tests. --- tools/regexp-generator/README.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/regexp-generator/README.md b/tools/regexp-generator/README.md index ab8da0b0d5..f68d9c25e4 100644 --- a/tools/regexp-generator/README.md +++ b/tools/regexp-generator/README.md @@ -1,2 +1,12 @@ -# test262-regexp-generator -Generete tests for RegExp based on unicode data +# RegExp Generator + +This tool generates the tests in the +`test/built-ins/RegExp/CharacterClassEscapes/` folder from Unicode data. + +To run: + +```sh +$ npm install # before first run +$ npm run clean # optional +$ npm run build +``` From 50a1ff1aa37e205f19f34858e37ac4f78a5e7b8c Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 16:34:14 -0700 Subject: [PATCH 06/14] regexp-generator: Use ES modules, update dependencies This code hasn't been touched in a while, so it's probably good to bring in the newest versions of the dependencies. We can easily tell if there was any incompatible effect on the output. The latest version of filenamify requires using ES modules. We also have to adapt to a breaking change in regexpu-core (see https://github.com/mathiasbynens/regexpu-core/pull/49). Also convert the dependencies to devDependencies, since this tool is not necessary for executing test262. --- tools/regexp-generator/{header.js => header.mjs} | 2 +- tools/regexp-generator/{index.js => index.mjs} | 15 ++++++++------- tools/regexp-generator/package.json | 16 +++++++--------- 3 files changed, 16 insertions(+), 17 deletions(-) rename tools/regexp-generator/{header.js => header.mjs} (97%) rename tools/regexp-generator/{index.js => index.mjs} (90%) diff --git a/tools/regexp-generator/header.js b/tools/regexp-generator/header.mjs similarity index 97% rename from tools/regexp-generator/header.js rename to tools/regexp-generator/header.mjs index bedcf9d09a..6f2263a461 100644 --- a/tools/regexp-generator/header.js +++ b/tools/regexp-generator/header.mjs @@ -1,4 +1,4 @@ -module.exports = description => { +export default description => { let header = `// Copyright (C) 2018 Leo Balter. All rights reserved. // This code is governed by the BSD license found in the LICENSE file. diff --git a/tools/regexp-generator/index.js b/tools/regexp-generator/index.mjs similarity index 90% rename from tools/regexp-generator/index.js rename to tools/regexp-generator/index.mjs index e3e816c4c6..0f664b7726 100644 --- a/tools/regexp-generator/index.js +++ b/tools/regexp-generator/index.mjs @@ -1,9 +1,10 @@ -const fs = require('fs'); -const rewritePattern = require('regexpu-core'); -const slugify = require('slugify'); -const filenamify = require('filenamify'); -const jsesc = require('jsesc'); -const header = require('./header'); +import filenamify from 'filenamify'; +import fs from 'node:fs'; +import jsesc from 'jsesc'; +import rewritePattern from 'regexpu-core'; +import slugify from 'slugify'; + +import header from './header.mjs'; const patterns = { 'whitespace class escape': '\\s', @@ -91,7 +92,7 @@ for (const [desc, escape] of Object.entries(patterns)) { const pattern = `${escape}${quantifier}`; const range = rewritePattern(pattern, flags, { - useUnicodeFlag: flags.includes('u') + unicodeFlag: flags.includes('u') ? 'transform' : false, }); console.log(`${pattern} => ${range}, flags: ${flags}`); diff --git a/tools/regexp-generator/package.json b/tools/regexp-generator/package.json index ba0bf2b161..cffae050be 100644 --- a/tools/regexp-generator/package.json +++ b/tools/regexp-generator/package.json @@ -2,23 +2,21 @@ "name": "test262-regexp-class-escapes", "version": "1.0.0", "description": "", - "main": "index.js", + "main": "index.mjs", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "clean": "rimraf ../../test/built-ins/RegExp/CharacterClassEscapes", "prebuild": "mkdirp ../../test/built-ins/RegExp/CharacterClassEscapes", - "build": "node index.js" + "build": "node index.mjs" }, "author": "", "license": "MIT", - "dependencies": { - "filenamify": "^2.1.0", - "jsesc": "^2.5.1", - "regexpu-core": "^4.2.0", - "slugify": "^1.3.0" - }, "devDependencies": { + "filenamify": "^6.0.0", + "jsesc": "^3.0.2", "mkdirp": "^3.0.1", - "rimraf": "^6.0.1" + "regexpu-core": "^6.1.1", + "rimraf": "^6.0.1", + "slugify": "^1.6.6" } } From 16fce73e98f296e319459ca9ef23082519b30806 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 16:49:48 -0700 Subject: [PATCH 07/14] regexp-generator: Implement downstream changes The optimizations from commit e558b29b were never incorporated into the upstream test generator. This does so now. As far as I can tell, the changes to the Unicode ranges are purely cosmetic. Some are formatted as 6-digit hex numbers instead of 4-digit. Others move the low-surrogates range 0xDC00-0xDCFF to the beginning of the array, but the union of the ranges is still the same. --- ...racter-class-digit-class-escape-flags-u.js | 2 +- ...it-class-escape-plus-quantifier-flags-u.js | 2 +- ...lass-digit-class-escape-plus-quantifier.js | 2 +- .../character-class-digit-class-escape.js | 2 +- ...er-class-non-digit-class-escape-flags-u.js | 4 +- ...it-class-escape-plus-quantifier-flags-u.js | 12 +-- ...-non-digit-class-escape-plus-quantifier.js | 12 +-- .../character-class-non-digit-class-escape.js | 12 +-- tools/regexp-generator/index.mjs | 78 ++++++++++++++++--- tools/regexp-generator/package.json | 2 +- 10 files changed, 96 insertions(+), 32 deletions(-) diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js index de3c16f4e5..0820f1c1c0 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js @@ -40,7 +40,7 @@ includes: [regExpUtils.js] const str = buildString({ loneCodePoints: [], ranges: [ - [0x0030, 0x0039], + [0x000030, 0x000039], ], }); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js index 1c6462e766..9108d26f04 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js @@ -40,7 +40,7 @@ includes: [regExpUtils.js] const str = buildString({ loneCodePoints: [], ranges: [ - [0x0030, 0x0039], + [0x000030, 0x000039], ], }); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js index 66418758b7..32b0adb0e7 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js @@ -40,7 +40,7 @@ includes: [regExpUtils.js] const str = buildString({ loneCodePoints: [], ranges: [ - [0x0030, 0x0039], + [0x000030, 0x000039], ], }); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js index 090e5a7e9a..1124993ff2 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js @@ -40,7 +40,7 @@ includes: [regExpUtils.js] const str = buildString({ loneCodePoints: [], ranges: [ - [0x0030, 0x0039], + [0x000030, 0x000039], ], }); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js index e9385c0004..ab304348b8 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js @@ -40,8 +40,10 @@ includes: [regExpUtils.js] const str = buildString({ loneCodePoints: [], ranges: [ + [0x00DC00, 0x00DFFF], [0x000000, 0x00002F], - [0x00003A, 0x10FFFF], + [0x00003A, 0x00DBFF], + [0x00E000, 0x10FFFF], ], }); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js index bf534de854..14ae451846 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js @@ -38,11 +38,13 @@ includes: [regExpUtils.js] ---*/ const str = buildString({ - loneCodePoints: [], - ranges: [ - [0x000000, 0x00002F], - [0x00003A, 0x10FFFF], - ], + loneCodePoints: [], + ranges: [ + [0x00DC00, 0x00DFFF], + [0x000000, 0x00002F], + [0x00003A, 0x00DBFF], + [0x00E000, 0x10FFFF], + ], }); const re = /\D+/ug; diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js index 0c2c703ae8..f1e626f151 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js @@ -38,11 +38,13 @@ includes: [regExpUtils.js] ---*/ const str = buildString({ - loneCodePoints: [], - ranges: [ - [0x000000, 0x00002F], - [0x00003A, 0x00FFFF], - ], + loneCodePoints: [], + ranges: [ + [0x00DC00, 0x00DFFF], + [0x000000, 0x00002F], + [0x00003A, 0x00DBFF], + [0x00E000, 0x00FFFF], + ], }); const re = /\D+/g; diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js index ac626beb49..394ede390a 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js @@ -38,11 +38,13 @@ includes: [regExpUtils.js] ---*/ const str = buildString({ - loneCodePoints: [], - ranges: [ - [0x000000, 0x00002F], - [0x00003A, 0x00FFFF], - ], + loneCodePoints: [], + ranges: [ + [0x00DC00, 0x00DFFF], + [0x000000, 0x00002F], + [0x00003A, 0x00DBFF], + [0x00E000, 0x00FFFF], + ], }); const re = /\D/g; diff --git a/tools/regexp-generator/index.mjs b/tools/regexp-generator/index.mjs index 0f664b7726..694e94a318 100644 --- a/tools/regexp-generator/index.mjs +++ b/tools/regexp-generator/index.mjs @@ -1,7 +1,8 @@ import filenamify from 'filenamify'; import fs from 'node:fs'; -import jsesc from 'jsesc'; +import regenerate from 'regenerate'; import rewritePattern from 'regexpu-core'; +import ESCAPE_SETS from 'regexpu-core/data/character-class-escape-sets.js'; import slugify from 'slugify'; import header from './header.mjs'; @@ -15,30 +16,85 @@ const patterns = { '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); +}; + +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; + } + 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 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 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, range, max, flags, skip180e) { + let string = buildString(pattern[1], flags); let method; let features = []; let content = header(`Compare range for ${desc} ${pattern} with flags ${flags}`); content += ` -const str = buildString({ loneCodePoints: [], ranges: [[0, ${ - jsesc(max, { numbers: 'hexadecimal' }) -}]] }); +const str = buildString(${string}); const re = /${pattern}/${flags}; -const matchingRange = /${range}/${flags}; const errors = []; -function matching(str) { - return str.replace(re, '') === str.replace(matchingRange, ''); -} - -if (!matching(str)) { +if (!re.test(str)) { // Error, let's find out where for (const char of str) { - if (!matching(char)) { + if (!re.test(char)) { errors.push('0x' + char.codePointAt(0).toString(16)); } } diff --git a/tools/regexp-generator/package.json b/tools/regexp-generator/package.json index cffae050be..e8c9e4b2f0 100644 --- a/tools/regexp-generator/package.json +++ b/tools/regexp-generator/package.json @@ -13,8 +13,8 @@ "license": "MIT", "devDependencies": { "filenamify": "^6.0.0", - "jsesc": "^3.0.2", "mkdirp": "^3.0.1", + "regenerate": "^1.4.2", "regexpu-core": "^6.1.1", "rimraf": "^6.0.1", "slugify": "^1.6.6" From e7c5b8c52e5e2886da4d574d9a58788710594616 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 18:18:26 -0700 Subject: [PATCH 08/14] regexp-generator: Remove dead code These are unused parameters and variables, and all have no effect on the output. --- tools/regexp-generator/index.mjs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tools/regexp-generator/index.mjs b/tools/regexp-generator/index.mjs index 694e94a318..47a0aa20cd 100644 --- a/tools/regexp-generator/index.mjs +++ b/tools/regexp-generator/index.mjs @@ -77,10 +77,8 @@ function buildString(escapeChar, flags) { return prettyPrint([ loneCodePoints, ranges ]); } -function buildContent(desc, pattern, range, max, flags, skip180e) { +function buildContent(desc, pattern, flags) { let string = buildString(pattern[1], flags); - let method; - let features = []; let content = header(`Compare range for ${desc} ${pattern} with flags ${flags}`); @@ -118,7 +116,6 @@ function writeFile(desc, content, suffix = '') { // No additions for (const [desc, escape] of Object.entries(patterns)) { - const skip180e = escape.toLowerCase().includes('s'); [ { quantifier: '', @@ -127,23 +124,19 @@ for (const [desc, escape] of Object.entries(patterns)) { { quantifier: '+', flags: '', - posCb(u) { return [u, u+u]}, suffix: '-plus-quantifier', }, { quantifier: '', flags: 'u', - max: 0x10FFFF, suffix: '-flags-u', }, { quantifier: '+', flags: 'u', - posCb(u) { return [u, u+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'; const pattern = `${escape}${quantifier}`; @@ -153,7 +146,7 @@ for (const [desc, escape] of Object.entries(patterns)) { 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); }); From d0687823b3a5477674de649126254ed057b24d00 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 17:01:46 -0700 Subject: [PATCH 09/14] regexp-generator: Update front matter Add the `generated` flag, and update the link to the generator script. --- .../character-class-digit-class-escape-flags-u.js | 3 ++- ...aracter-class-digit-class-escape-plus-quantifier-flags-u.js | 3 ++- .../character-class-digit-class-escape-plus-quantifier.js | 3 ++- .../character-class-digit-class-escape.js | 3 ++- .../character-class-non-digit-class-escape-flags-u.js | 3 ++- ...ter-class-non-digit-class-escape-plus-quantifier-flags-u.js | 3 ++- .../character-class-non-digit-class-escape-plus-quantifier.js | 3 ++- .../character-class-non-digit-class-escape.js | 3 ++- .../character-class-non-whitespace-class-escape-flags-u.js | 3 ++- ...lass-non-whitespace-class-escape-plus-quantifier-flags-u.js | 3 ++- ...racter-class-non-whitespace-class-escape-plus-quantifier.js | 3 ++- .../character-class-non-whitespace-class-escape.js | 3 ++- .../character-class-non-word-class-escape-flags-u.js | 3 ++- ...cter-class-non-word-class-escape-plus-quantifier-flags-u.js | 3 ++- .../character-class-non-word-class-escape-plus-quantifier.js | 3 ++- .../character-class-non-word-class-escape.js | 3 ++- .../character-class-whitespace-class-escape-flags-u.js | 3 ++- ...er-class-whitespace-class-escape-plus-quantifier-flags-u.js | 3 ++- .../character-class-whitespace-class-escape-plus-quantifier.js | 3 ++- .../character-class-whitespace-class-escape.js | 3 ++- .../character-class-word-class-escape-flags-u.js | 3 ++- ...haracter-class-word-class-escape-plus-quantifier-flags-u.js | 3 ++- .../character-class-word-class-escape-plus-quantifier.js | 3 ++- .../CharacterClassEscapes/character-class-word-class-escape.js | 3 ++- tools/regexp-generator/header.mjs | 3 ++- 25 files changed, 50 insertions(+), 25 deletions(-) diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js index 0820f1c1c0..b8449807ab 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for digit class escape \d with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js index 9108d26f04..d55b1a1732 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for digit class escape \d+ with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js index 32b0adb0e7..93fffb8db6 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js @@ -7,7 +7,7 @@ description: > Compare range for digit class escape \d+ with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js index 1124993ff2..13dc81094d 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js @@ -7,7 +7,7 @@ description: > Compare range for digit class escape \d with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js index ab304348b8..8ceb94fd8c 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for non-digit class escape \D with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js index 14ae451846..95db8b614e 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for non-digit class escape \D+ with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js index f1e626f151..1d00928aec 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js @@ -7,7 +7,7 @@ description: > Compare range for non-digit class escape \D+ with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js index 394ede390a..634d0f0d9c 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js @@ -7,7 +7,7 @@ description: > Compare range for non-digit class escape \D with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js index d635f47092..930dfcb463 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for non-whitespace class escape \S with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js index 1275d209c9..633017c0e0 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for non-whitespace class escape \S+ with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js index f70d16c78f..b0dd01235c 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js @@ -7,7 +7,7 @@ description: > Compare range for non-whitespace class escape \S+ with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js index a605b0b132..7acda42a88 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js @@ -7,7 +7,7 @@ description: > Compare range for non-whitespace class escape \S with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js index 9eb98145d1..de152cb9f3 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for non-word class escape \W with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js index 080aeec12f..56e10eee74 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for non-word class escape \W+ with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js index 8b04bdf927..fd50a3589c 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js @@ -7,7 +7,7 @@ description: > Compare range for non-word class escape \W+ with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js index 477df9f72e..47b663fadf 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js @@ -7,7 +7,7 @@ description: > Compare range for non-word class escape \W with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js index 185e25dcb2..e7efac3600 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for whitespace class escape \s with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js index 1a9bdf0d7f..2619d5b348 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for whitespace class escape \s+ with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js index 0d10492a9e..4cfeee9ab8 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js @@ -7,7 +7,7 @@ description: > Compare range for whitespace class escape \s+ with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js index 1d024382a5..62f60a0180 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js @@ -7,7 +7,7 @@ description: > Compare range for whitespace class escape \s with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js index 9bc78b3408..0443554efc 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for word class escape \w with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js index 6ce6c2c781..a04b661f6f 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js @@ -7,7 +7,7 @@ description: > Compare range for word class escape \w+ with flags ug info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js index a80b5c7336..d312c1e103 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js @@ -7,7 +7,7 @@ description: > Compare range for word class escape \w+ with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js index 879c9ae340..13c55d1a74 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js @@ -7,7 +7,7 @@ description: > Compare range for word class escape \w with flags g info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -35,6 +35,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/ const str = buildString({ diff --git a/tools/regexp-generator/header.mjs b/tools/regexp-generator/header.mjs index 6f2263a461..d52388647c 100644 --- a/tools/regexp-generator/header.mjs +++ b/tools/regexp-generator/header.mjs @@ -8,7 +8,7 @@ description: > ${description} info: | This is a generated test. Please check out - https://github.com/bocoup/test262-regexp-generator + https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. CharacterClassEscape[U] :: @@ -36,6 +36,7 @@ info: | Return the set of all characters not included in the set returned by CharacterClassEscape :: w. features: [String.fromCodePoint] includes: [regExpUtils.js] +flags: [generated] ---*/\n`; return header; From f2f6c0bfc6a16a6d20de8a9501d5b00ba4f8e4e7 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Fri, 1 Nov 2024 17:02:33 -0700 Subject: [PATCH 10/14] regexp-generator: Include these generated tests in make.py This is necessary so that updates to the tests without corresponding updates to the generator script will be flagged in CI runs. --- .github/workflows/checks.yml | 5 +++++ make.py | 18 +++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 817ab13ad8..861d58b7dc 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -72,6 +72,11 @@ jobs: python -m pip install --upgrade pip pip install -r tools/generation/requirements.txt + - name: Install dependencies for regexp-generator tool + run: | + cd tools/regexp-generator + npm install + - name: Build tests run: | ./make.py clean >/dev/null diff --git a/make.py b/make.py index 2f5cf91d2a..9905d745c4 100755 --- a/make.py +++ b/make.py @@ -8,8 +8,10 @@ OUT_DIR = os.environ.get('OUT_DIR') or 'test' SRC_DIR = os.environ.get('SRC_DIR') or 'src' -def shell(*args): - sp = subprocess.Popen(list(args), stdout=subprocess.PIPE, universal_newlines=True) + +def shell(*args, **kwargs): + sp = subprocess.Popen(list(args), stdout=subprocess.PIPE, + universal_newlines=True, **kwargs) cmd_str = ' '.join(args) print('> ' + cmd_str) @@ -36,17 +38,27 @@ def wrapped(): return wrapped return other + @target() +def npm_deps(): + shell('npm', 'install', cwd='./tools/regexp-generator') + + +@target('npm_deps') def build(): shell(sys.executable, 'tools/generation/generator.py', 'create', '--parents', '--out', OUT_DIR, SRC_DIR) + shell('npm', 'run', 'build', cwd='./tools/regexp-generator') -@target() + +@target('npm_deps') def clean(): shell(sys.executable, 'tools/generation/generator.py', 'clean', OUT_DIR) + shell('npm', 'run', 'clean', cwd='./tools/regexp-generator') + if len(sys.argv) == 1: targets['build']() From f17cbf2f7a7a8f47df796f3bfd84ef1ad2db4a5f Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 4 Nov 2024 10:35:33 -0800 Subject: [PATCH 11/14] regexp-generator: Make package private As per the package.json docs, these are optional if the package is not being published. --- tools/regexp-generator/package.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/regexp-generator/package.json b/tools/regexp-generator/package.json index e8c9e4b2f0..0698fee84f 100644 --- a/tools/regexp-generator/package.json +++ b/tools/regexp-generator/package.json @@ -1,7 +1,5 @@ { - "name": "test262-regexp-class-escapes", - "version": "1.0.0", - "description": "", + "private": true, "main": "index.mjs", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", From 10cc46c175c714f05ebec8d5827b77e50c6d2cc2 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 4 Nov 2024 11:34:21 -0800 Subject: [PATCH 12/14] regexp-generator: Update ECMA-262 quote in header While we're touching this we may as well update the quote from ECMA-262 to match what it currently says. --- ...racter-class-digit-class-escape-flags-u.js | 37 +++++++++++-------- ...it-class-escape-plus-quantifier-flags-u.js | 37 +++++++++++-------- ...lass-digit-class-escape-plus-quantifier.js | 37 +++++++++++-------- .../character-class-digit-class-escape.js | 37 +++++++++++-------- ...er-class-non-digit-class-escape-flags-u.js | 37 +++++++++++-------- ...it-class-escape-plus-quantifier-flags-u.js | 37 +++++++++++-------- ...-non-digit-class-escape-plus-quantifier.js | 37 +++++++++++-------- .../character-class-non-digit-class-escape.js | 37 +++++++++++-------- ...ass-non-whitespace-class-escape-flags-u.js | 37 +++++++++++-------- ...ce-class-escape-plus-quantifier-flags-u.js | 37 +++++++++++-------- ...whitespace-class-escape-plus-quantifier.js | 37 +++++++++++-------- ...acter-class-non-whitespace-class-escape.js | 37 +++++++++++-------- ...ter-class-non-word-class-escape-flags-u.js | 37 +++++++++++-------- ...rd-class-escape-plus-quantifier-flags-u.js | 37 +++++++++++-------- ...s-non-word-class-escape-plus-quantifier.js | 37 +++++++++++-------- .../character-class-non-word-class-escape.js | 37 +++++++++++-------- ...r-class-whitespace-class-escape-flags-u.js | 37 +++++++++++-------- ...ce-class-escape-plus-quantifier-flags-u.js | 37 +++++++++++-------- ...whitespace-class-escape-plus-quantifier.js | 37 +++++++++++-------- ...character-class-whitespace-class-escape.js | 37 +++++++++++-------- ...aracter-class-word-class-escape-flags-u.js | 37 +++++++++++-------- ...rd-class-escape-plus-quantifier-flags-u.js | 37 +++++++++++-------- ...class-word-class-escape-plus-quantifier.js | 37 +++++++++++-------- .../character-class-word-class-escape.js | 37 +++++++++++-------- tools/regexp-generator/header.mjs | 37 +++++++++++-------- 25 files changed, 550 insertions(+), 375 deletions(-) diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js index b8449807ab..ab314ff581 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js index d55b1a1732..230ceb7cce 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js index 93fffb8db6..9401e9a1d6 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js index 13dc81094d..6968fb0a93 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js index 8ceb94fd8c..e634524ab3 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js index 95db8b614e..6cde639a1b 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js index 1d00928aec..94a8d83129 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js index 634d0f0d9c..305a95235e 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js index 930dfcb463..2880d6b5bd 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js index 633017c0e0..ba49812bd7 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js index b0dd01235c..13078ae813 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js index 7acda42a88..74c1093384 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js index de152cb9f3..3b0c7e4db3 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js index 56e10eee74..1b4a6f7009 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js index fd50a3589c..893efc8fe4 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js index 47b663fadf..358db870d5 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js index e7efac3600..a04b7a6daf 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js index 2619d5b348..42c80fc5fe 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js index 4cfeee9ab8..a62c2864b9 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js index 62f60a0180..42c8b93e3b 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js index 0443554efc..0c271591d0 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js index a04b661f6f..26f035fabb 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js index d312c1e103..d8d3692c34 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js index 13c55d1a74..d7950ae9d5 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js @@ -10,29 +10,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] diff --git a/tools/regexp-generator/header.mjs b/tools/regexp-generator/header.mjs index d52388647c..26fbe8ec25 100644 --- a/tools/regexp-generator/header.mjs +++ b/tools/regexp-generator/header.mjs @@ -11,29 +11,36 @@ info: | https://github.com/tc39/test262/tree/main/tools/regexp-generator/ for any changes. - CharacterClassEscape[U] :: + CharacterClassEscape[UnicodeMode] :: d D s S w W + [+UnicodeMode] p{ UnicodePropertyValueExpression } + [+UnicodeMode] P{ UnicodePropertyValueExpression } - 21.2.2.12 CharacterClassEscape + 22.2.2.9 Runtime Semantics: CompileToCharSet - The production CharacterClassEscape :: d evaluates as follows: - Return the ten-element set of characters containing the characters 0 through 9 inclusive. - The production CharacterClassEscape :: D evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: d. - The production CharacterClassEscape :: s evaluates as follows: - Return the set of characters containing the characters that are on the right-hand side of - the WhiteSpace or LineTerminator productions. - The production CharacterClassEscape :: S evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: s. - The production CharacterClassEscape :: w evaluates as follows: - Return the set of all characters returned by WordCharacters(). - The production CharacterClassEscape :: W evaluates as follows: - Return the set of all characters not included in the set returned by CharacterClassEscape :: w. + 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] From 2fa0c9436868f77ba4a735d56f4a66bc142f7a71 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 4 Nov 2024 12:24:50 -0800 Subject: [PATCH 13/14] 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. --- ...racter-class-digit-class-escape-flags-u.js | 80 ++++---- ...it-class-escape-plus-quantifier-flags-u.js | 80 ++++---- ...lass-digit-class-escape-plus-quantifier.js | 80 ++++---- .../character-class-digit-class-escape.js | 80 ++++---- ...er-class-non-digit-class-escape-flags-u.js | 80 ++++---- ...it-class-escape-plus-quantifier-flags-u.js | 80 ++++---- ...-non-digit-class-escape-plus-quantifier.js | 80 ++++---- .../character-class-non-digit-class-escape.js | 80 ++++---- ...ass-non-whitespace-class-escape-flags-u.js | 80 ++++---- ...ce-class-escape-plus-quantifier-flags-u.js | 80 ++++---- ...whitespace-class-escape-plus-quantifier.js | 80 ++++---- ...acter-class-non-whitespace-class-escape.js | 80 ++++---- ...ter-class-non-word-class-escape-flags-u.js | 80 ++++---- ...rd-class-escape-plus-quantifier-flags-u.js | 80 ++++---- ...s-non-word-class-escape-plus-quantifier.js | 80 ++++---- .../character-class-non-word-class-escape.js | 80 ++++---- ...r-class-whitespace-class-escape-flags-u.js | 80 ++++---- ...ce-class-escape-plus-quantifier-flags-u.js | 80 ++++---- ...whitespace-class-escape-plus-quantifier.js | 80 ++++---- ...character-class-whitespace-class-escape.js | 80 ++++---- ...aracter-class-word-class-escape-flags-u.js | 80 ++++---- ...rd-class-escape-plus-quantifier-flags-u.js | 80 ++++---- ...class-word-class-escape-plus-quantifier.js | 80 ++++---- .../character-class-word-class-escape.js | 80 ++++---- tools/regexp-generator/header.mjs | 68 +++---- tools/regexp-generator/index.mjs | 192 +++++++++--------- 26 files changed, 1090 insertions(+), 1090 deletions(-) diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js index ab314ff581..c3259250e6 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js index 230ceb7cce..63902cf76e 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js index 9401e9a1d6..fe930f650d 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape-plus-quantifier.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js index 6968fb0a93..1d95fd4740 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-digit-class-escape.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js index e634524ab3..7b3b98b4fc 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js index 6cde639a1b..56791800cd 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js index 94a8d83129..249d5598e3 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape-plus-quantifier.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js index 305a95235e..94b0bb98a9 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-digit-class-escape.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js index 2880d6b5bd..35cd6a9748 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js index ba49812bd7..a296c4f34c 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js index 13078ae813..0865bce22a 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape-plus-quantifier.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js index 74c1093384..09a6a556d4 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-whitespace-class-escape.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js index 3b0c7e4db3..60560ef61b 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js index 1b4a6f7009..2cca79f8a2 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js index 893efc8fe4..598d0e8c05 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape-plus-quantifier.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js index 358db870d5..1b6d6b238f 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-non-word-class-escape.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js index a04b7a6daf..531a50c5f9 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js index 42c80fc5fe..a46c7b8502 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js index a62c2864b9..e9cdeed505 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape-plus-quantifier.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js index 42c8b93e3b..b9e1dcd5f4 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-whitespace-class-escape.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js index 0c271591d0..1cedbcc304 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js index 26f035fabb..2959480dc3 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier-flags-u.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js index d8d3692c34..5a756fd9cd 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape-plus-quantifier.js @@ -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(',') ); diff --git a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js index d7950ae9d5..da4db67850 100644 --- a/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js +++ b/test/built-ins/RegExp/CharacterClassEscapes/character-class-word-class-escape.js @@ -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(',') ); diff --git a/tools/regexp-generator/header.mjs b/tools/regexp-generator/header.mjs index 26fbe8ec25..33f342492e 100644 --- a/tools/regexp-generator/header.mjs +++ b/tools/regexp-generator/header.mjs @@ -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; }; diff --git a/tools/regexp-generator/index.mjs b/tools/regexp-generator/index.mjs index 47a0aa20cd..877c087b4d 100644 --- a/tools/regexp-generator/index.mjs +++ b/tools/regexp-generator/index.mjs @@ -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 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 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 ]); } 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'; - - 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); + [ + { + 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); + }); } From 8c4099182329c05b7babcfab622d3f1124f54ad9 Mon Sep 17 00:00:00 2001 From: Philip Chimento Date: Mon, 4 Nov 2024 11:23:31 -0800 Subject: [PATCH 14/14] Update indentation in editorconfig We have .mjs files now in the regexp-generator tool. Extend the same indentation from .js files to cover them as well. --- .editorconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.editorconfig b/.editorconfig index 380e57acad..0bf249f52b 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,7 +7,7 @@ end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true -[{README.md,package.json,*.yml,*.sh,*.js,*.case,*.template}] +[{README.md,package.json,*.yml,*.sh,*.js,*.mjs,*.case,*.template}] indent_style = space indent_size = 2