diff options
Diffstat (limited to 'misctools/gen-unicode-table.js')
-rw-r--r-- | misctools/gen-unicode-table.js | 40 |
1 files changed, 9 insertions, 31 deletions
diff --git a/misctools/gen-unicode-table.js b/misctools/gen-unicode-table.js index ad38a0ec5..1696a4b9e 100644 --- a/misctools/gen-unicode-table.js +++ b/misctools/gen-unicode-table.js @@ -58,18 +58,12 @@ const idContinueESNext = require("@unicode/unicode-13.0.0/Binary_Property/ID_Con const idContinueESNextSet = new Set(idContinueESNext); // These identifiers are valid in both ES5 and ES6+ (i.e. an intersection of both) -const idStartES5AndESNext = idStartES5.filter((n) => idStartESNextSet.has(n)); -const idContinueES5AndESNext = idContinueES5.filter((n) => - idContinueESNextSet.has(n), -); +const idStartES5AndESNext = idStartES5.filter(n => idStartESNextSet.has(n)); +const idContinueES5AndESNext = idContinueES5.filter(n => idContinueESNextSet.has(n)); // These identifiers are valid in either ES5 or ES6+ (i.e. a union of both) -const idStartES5OrESNext = [...new Set(idStartES5.concat(idStartESNext))].sort( - (a, b) => a - b, -); -const idContinueES5OrESNext = [ - ...new Set(idContinueES5.concat(idContinueESNext)), -].sort((a, b) => a - b); +const idStartES5OrESNext = [...new Set(idStartES5.concat(idStartESNext))].sort((a, b) => a - b); +const idContinueES5OrESNext = [...new Set(idContinueES5.concat(idContinueESNext))].sort((a, b) => a - b); function generateRangeTable(codePoints) { let lines = []; @@ -86,11 +80,7 @@ function generateRangeTable(codePoints) { while (index < codePoints.length && codePoints[index] < 0x1000) { let start = codePoints[index]; index++; - while ( - index < codePoints.length && - codePoints[index] < 0x1000 && - codePoints[index] === codePoints[index - 1] + 1 - ) { + while (index < codePoints.length && codePoints[index] < 0x1000 && codePoints[index] === codePoints[index - 1] + 1) { index++; } let end = codePoints[index - 1]; @@ -103,10 +93,7 @@ function generateRangeTable(codePoints) { while (index < codePoints.length) { let start = codePoints[index]; index++; - while ( - index < codePoints.length && - codePoints[index] === codePoints[index - 1] + 1 - ) { + while (index < codePoints.length && codePoints[index] === codePoints[index - 1] + 1) { index++; } let end = codePoints[index - 1]; @@ -132,11 +119,7 @@ function generateBigSwitchStatement(codePoints) { while (index < codePoints.length && codePoints[index] < 0x1000) { let start = codePoints[index]; index++; - while ( - index < codePoints.length && - codePoints[index] < 0x1000 && - codePoints[index] === codePoints[index - 1] + 1 - ) { + while (index < codePoints.length && codePoints[index] < 0x1000 && codePoints[index] === codePoints[index - 1] + 1) { index++; } let end = codePoints[index - 1]; @@ -147,10 +130,7 @@ function generateBigSwitchStatement(codePoints) { while (index < codePoints.length) { let start = codePoints[index]; index++; - while ( - index < codePoints.length && - codePoints[index] === codePoints[index - 1] + 1 - ) { + while (index < codePoints.length && codePoints[index] === codePoints[index - 1] + 1) { index++; } let end = codePoints[index - 1]; @@ -165,9 +145,7 @@ function generateBigSwitchStatement(codePoints) { fs.writeFileSync( path.join(__dirname, "..", "src", "js_lexer", "unicode.zig"), - `// This file was automatically generated by ${path.basename( - __filename, - )}. Do not edit. + `// This file was automatically generated by ${path.basename(__filename)}. Do not edit. const RangeTable = @import("./range_table.zig"); |