Skip to content

Commit

Permalink
Update per Unicode 15.1 (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung authored Sep 19, 2023
1 parent d5f4abe commit b9e4a9b
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 12 deletions.
6 changes: 6 additions & 0 deletions data/iu-mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module.exports = new Map([
[0x1F1, 0x1F2],
[0x1F2, 0x1F1],
[0x345, 0x1FBE],
[0x390, 0x1FD3],
[0x392, 0x3D0],
[0x395, 0x3F5],
[0x398, 0x3F4],
Expand All @@ -28,6 +29,7 @@ module.exports = new Map([
[0x3A3, 0x3C2],
[0x3A6, 0x3D5],
[0x3A9, 0x2126],
[0x3B0, 0x1FE3],
[0x3B8, 0x3F4],
[0x3C2, 0x3A3],
[0x3C9, 0x2126],
Expand Down Expand Up @@ -121,6 +123,8 @@ module.exports = new Map([
]],
[0x1FC3, 0x1FCC],
[0x1FCC, 0x1FC3],
[0x1FD3, 0x390],
[0x1FE3, 0x3B0],
[0x1FF3, 0x1FFC],
[0x1FFC, 0x1FF3],
[0x2126, [
Expand All @@ -133,6 +137,8 @@ module.exports = new Map([
0xE5
]],
[0xA64A, 0x1C88],
[0xFB05, 0xFB06],
[0xFB06, 0xFB05],
[0x10400, 0x10428],
[0x10401, 0x10429],
[0x10402, 0x1042A],
Expand Down
2 changes: 1 addition & 1 deletion demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const rewritePattern = require('./rewrite-pattern.js');
const parse = require('regjsparser').parse;
const generate = require('@babel/regjsgen').generate;
const generate = require('regjsgen').generate;
const regenerate = require('regenerate');

const pattern = String.raw`\p{RGI_Emoji}`;
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@
},
"dependencies": {
"regenerate": "^1.4.2",
"regenerate-unicode-properties": "^10.1.0",
"@babel/regjsgen": "^0.8.0",
"regjsparser": "^0.9.1",
"regenerate-unicode-properties": "^10.1.1",
"regjsgen": "^0.8.0",
"regjsparser": "^0.10.0",
"unicode-match-property-ecmascript": "^2.0.0",
"unicode-match-property-value-ecmascript": "^2.1.0"
},
Expand All @@ -62,6 +62,6 @@
"lodash": "^4.17.21",
"mocha": "^10.1.0",
"regexpu-fixtures": "^2.1.6",
"@unicode/unicode-15.0.0": "^1.3.1"
"@unicode/unicode-15.1.0": "^1.5.2"
}
}
2 changes: 2 additions & 0 deletions property-escapes.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ $ node -e 'require("regenerate-unicode-properties").get("Script_Extensions").for
\p{Script_Extensions=Kaithi}
\p{Script_Extensions=Kannada}
\p{Script_Extensions=Katakana}
\p{Script_Extensions=Kawi}
\p{Script_Extensions=Kayah_Li}
\p{Script_Extensions=Kharoshthi}
\p{Script_Extensions=Khitan_Small_Script}
Expand Down Expand Up @@ -179,6 +180,7 @@ $ node -e 'require("regenerate-unicode-properties").get("Script_Extensions").for
\p{Script_Extensions=Multani}
\p{Script_Extensions=Myanmar}
\p{Script_Extensions=Nabataean}
\p{Script_Extensions=Nag_Mundari}
\p{Script_Extensions=Nandinagari}
\p{Script_Extensions=New_Tai_Lue}
\p{Script_Extensions=Newa}
Expand Down
2 changes: 1 addition & 1 deletion rewrite-pattern.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const generate = require('@babel/regjsgen').generate;
const generate = require('regjsgen').generate;
const parse = require('regjsparser').parse;
const regenerate = require('regenerate');
const unicodeMatchProperty = require('unicode-match-property-ecmascript');
Expand Down
2 changes: 1 addition & 1 deletion scripts/character-class-escape-sets.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const fs = require('fs');
const jsesc = require('jsesc');
const regenerate = require('regenerate');

const Zs = require('@unicode/unicode-15.0.0/General_Category/Space_Separator/code-points.js');
const Zs = require('@unicode/unicode-15.1.0/General_Category/Space_Separator/code-points.js');

const iuMappings = require('../data/iu-mappings.js');

Expand Down
4 changes: 2 additions & 2 deletions scripts/iu-mappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ const extend = (map, key, value, callback) => {
// A. To do a simple case folding, use the mappings with status C + S.
// B. To do a full case folding, use the mappings with status C + F.

const commonMappings = require('@unicode/unicode-15.0.0/Case_Folding/C/code-points.js');
const simpleMappings = require('@unicode/unicode-15.0.0/Case_Folding/S/code-points.js');
const commonMappings = require('@unicode/unicode-15.1.0/Case_Folding/C/code-points.js');
const simpleMappings = require('@unicode/unicode-15.1.0/Case_Folding/S/code-points.js');

// We want the `C` mappings in both directions (i.e. `A` should fold to `a`
// and `a` to `A`), and the `S` mappings in both directions (i.e. `ẞ` should
Expand Down
5 changes: 2 additions & 3 deletions tests/tests.js

Large diffs are not rendered by default.

0 comments on commit b9e4a9b

Please sign in to comment.