MCPcopy Create free account
hub / github.com/RtlZeroMemory/Rezi / parseIncPairRanges

Function parseIncPairRanges

scripts/check-unicode-sync.mjs:91–102  ·  view source on GitHub ↗
(incText, name)

Source from the content-addressed store, hash-verified

89}
90
91function parseIncPairRanges(incText, name) {
92 const block = extractBlock(incText, `static const zr_unicode_range_t ${name}[]`);
93 const out = [];
94 const re = /\{\s*(0x[0-9A-Fa-f]+)u\s*,\s*(0x[0-9A-Fa-f]+)u\s*\}/g;
95 for (;;) {
96 const m = re.exec(block);
97 if (!m) break;
98 out.push(Number.parseInt(m[1], 16), Number.parseInt(m[2], 16));
99 }
100 if (out.length === 0) throw new Error(`parsed 0 ranges from inc for ${name}`);
101 return out;
102}
103
104function parseTsUint32Array(tsText, exportName) {
105 const marker = `export const ${exportName} = new Uint32Array([`;

Callers 1

checkUnicodeSyncFunction · 0.85

Calls 2

extractBlockFunction · 0.85
pushMethod · 0.45

Tested by

no test coverage detected