diff options
author | 2023-03-02 19:02:10 -0800 | |
---|---|---|
committer | 2023-03-02 19:02:10 -0800 | |
commit | 9388b3f8257bc2e580deaece4cd2677928104fc6 (patch) | |
tree | 3f6aff2009cef69897f599fe51305b894f81a376 /misctools/gen-unicode-table.js | |
parent | b469e5035161286abeb1a7726518d1afcc163a51 (diff) | |
download | bun-9388b3f8257bc2e580deaece4cd2677928104fc6.tar.gz bun-9388b3f8257bc2e580deaece4cd2677928104fc6.tar.zst bun-9388b3f8257bc2e580deaece4cd2677928104fc6.zip |
Add a zig fmt action (#2277)
* Add a zig fmt action
* add failing file
* Setup prettier better
* Update prettier-fmt.yml
* Fail on error
* Update prettier-fmt.yml
* boop
* boop2
* tar.gz
* Update zig-fmt.yml
* Update zig-fmt.yml
* Update zig-fmt.yml
* Update zig-fmt.yml
* Update zig-fmt.yml
* boop
* Update prettier-fmt.yml
* tag
* newlines
* multiline
* fixup
* Update zig-fmt.yml
* update it
* fixup
* both
* w
* Update prettier-fmt.yml
* prettier all the things
* Update package.json
* zig fmt
* ❌ ✅
* bump
* .
* quotes
* fix prettier ignore
* once more
* Update prettier-fmt.yml
* Update fallback.ts
* consistentcy
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
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"); |