Skip to content

Commit e3b5e6d

Browse files
committed
Preserve six-digit code points in legacy property ranges
Assisted-By: GPT-6
1 parent 259a466 commit e3b5e6d

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

‎scripts/parse-blocks-scripts-properties.mjs‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ const parseProperties = async (version) => {
326326
currentProperty = findCanonicalName(currentProperty) ?? currentProperty;
327327
map[currentProperty] = regenerate();
328328
} else if (
329-
(maybeRange = /^([A-F\d]{4,5})(?:..([A-F\d]{4,5}))?/.exec(line)) != null
329+
(maybeRange = /^([A-F\d]{4,6})(?:\.\.([A-F\d]{4,6}))?(?=\s|$)/.exec(
330+
line,
331+
)) != null
330332
) {
331333
if (maybeRange[2]) {
332334
map[currentProperty].addRange(

‎tests/parsers.mjs‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@ test('Hangul has pairwise canonical decomposition mappings', async (t) => {
1919
t.assert.equal(await parseDecompositionMapping('1.1.5'), undefined);
2020
});
2121

22+
test('Legacy property ranges preserve six-digit code points', async (t) => {
23+
const properties = await parseProperties('3.0.1');
24+
t.assert.ok(properties.Private_Use.contains(0x100000));
25+
t.assert.ok(properties.Private_Use.contains(0x10fffd));
26+
t.assert.ok(!properties.Private_Use.contains(0x10000));
27+
t.assert.ok(!properties.Private_Use.contains(0xffff));
28+
});
29+
2230
test('Property records do not require spaces around semicolons', async (t) => {
2331
for (const version of ['4.0.1', '4.1.0']) {
2432
const scripts = await parseScripts(version);

0 commit comments

Comments
 (0)