/** * The case-fold CLASS of a code point under ECMAScript's NON-Unicode `/i` * matching — the exact relation `keywords({ caseInsensitive: true })` compiles to. * * A first-set drives O(1) `choice` dispatch, so it MUST be a superset of every * character the combinator can really start with. For a case-insensitive matcher * that means: for every input char X that the matcher would accept as the first * char, X is in the set. Under `/i` WITHOUT `u`, two chars match iff they share a * canonical form, and that relation is NOT simply `{c, toUpperCase(c), * toLowerCase(c)}` — 67 BMP code points sit in classes those three miss: * * σ (U+03C3) ↔ Σ (U+03A3) ↔ ς (U+03C2) final sigma is in the class but is * neither the upper- nor lowercase of σ * µ (U+00B5) ↔ μ (U+03BC) ↔ Μ (U+039C) micro sign folds into Greek mu * DŽ (U+01C4) ↔ Dž (U+01C5) ↔ dž (U+01C6) titlecase digraphs (also LJLjljNJNjnjDZDzdz) * ͅ (U+0345) ↔ ι (U+03B9) ↔ ι (U+1FBE) combining iota subscript * * so widening a first-set by upper/lower alone is UNSOUND for them. * * The canonical form below is ECMAScript's `Canonicalize` for non-Unicode mode: * uppercase the char; if that is not exactly one char, or if it would cross the * ASCII boundary INTO Basic Latin, keep the original. That last clause is why * `/s/i` does not match `ſ` (U+017F) and `/k/i` does not match `K` (U+212A) — * cross-boundary folds are refused in BOTH directions, which is what keeps an * ASCII first-set tight and sound for the common all-ASCII keyword set. * * The classes are derived from the RUNNING engine's own `toUpperCase`, not a * frozen table, so they cannot drift from the regex engine that will do the * matching. Verified exhaustively against real `/i` behaviour across the BMP: * 1141 multi-member classes, 2307 members, zero disagreements in either * direction (see `test/unit/case-fold.test.ts`). */ /** * Every code point that a non-Unicode `/i` matcher treats as equal to `cp`, * INCLUDING `cp` itself. Union these into a first-set to keep case-insensitive * dispatch sound. */ export declare function caseFoldVariants(cp: number): readonly number[]; //# sourceMappingURL=case-fold.d.ts.map