8 lines
51 KiB
Plaintext
8 lines
51 KiB
Plaintext
{
|
||
"version": 3,
|
||
"sources": ["../../src/parse-class.ts", "../../src/index.ts"],
|
||
"sourcesContent": ["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { <posix class>: [<translation>, negated]\nconst posixClasses: { [k: string]: [e: string, n?: boolean] } = {\n '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}'],\n '[:alpha:]': ['\\\\p{L}\\\\p{Nl}'],\n '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f'],\n '[:blank:]': ['\\\\p{Zs}\\\\t'],\n '[:cntrl:]': ['\\\\p{Cc}'],\n '[:digit:]': ['\\\\p{Nd}'],\n '[:graph:]': ['\\\\p{Z}\\\\p{C}', true],\n '[:lower:]': ['\\\\p{Ll}'],\n '[:print:]': ['\\\\p{C}', true],\n '[:punct:]': ['\\\\p{P}\\\\p{S}'],\n '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f'],\n '[:upper:]': ['\\\\p{Lu}'],\n '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}'],\n '[:xdigit:]': ['A-Fa-f0-9'],\n}\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n\nexport type ParseClassResult = [re: RegExp, consumed: number]\n\nexport type Form = 'NFC' | 'NFD' | 'NFKC' | 'NFKD'\n\nconst noMatch = /$./\n\n// Takes a glob string at a posix brace expression. Returns a RegExp\n// that tests one character, and the number of glob chars consumed.\n// If the class is not closed, consumed is 0, and the `[` must be\n// treated as a literal character.\n// Out of order ranges are removed. If nothing is left, the RegExp\n// is `/$./`, and the rest of the glob is consumed, so that the\n// whole glob cannot match.\nexport const parseClass = (\n glob: string,\n position: number,\n nocase: boolean = false,\n form?: Form,\n): ParseClassResult => {\n // normalize one class member, if it stays one code point\n const norm = (c: string) => {\n const n = form ? c.normalize(form) : c\n return [...n].length === 1 ? n : c\n }\n const pos = position\n /* c8 ignore start */\n if (glob.charAt(pos) !== '[') {\n throw new Error('not in a brace expression')\n }\n /* c8 ignore stop */\n const ranges: string[] = []\n const negs: string[] = []\n\n let i = pos + 1\n let sawStart = false\n let escaping = false\n let negate = false\n let endPos = pos\n let rangeStart = ''\n WHILE: while (i < glob.length) {\n const c = String.fromCodePoint(glob.codePointAt(i)!)\n if ((c === '!' || c === '^') && i === pos + 1) {\n negate = true\n i++\n continue\n }\n\n if (c === ']' && sawStart && !escaping) {\n endPos = i + 1\n break\n }\n\n sawStart = true\n if (c === '\\\\') {\n if (!escaping) {\n escaping = true\n i++\n continue\n }\n // escaped \\ char, fall through and treat like normal char\n }\n if (c === '[' && !escaping) {\n // either a posix class, a collation equivalent, or just a [\n for (const [cls, [unip, neg]] of Object.entries(posixClasses)) {\n if (glob.startsWith(cls, i)) {\n // invalid, [a-[] is fine, but not [a-[:alpha]]\n if (rangeStart) {\n return [noMatch, glob.length - pos]\n }\n i += cls.length\n if (neg) negs.push(unip)\n else ranges.push(unip)\n continue WHILE\n }\n }\n }\n\n // now it's just a normal character, effectively\n escaping = false\n const n = norm(c)\n if (rangeStart) {\n // throw this range away if it's not valid, but others\n // can still match.\n if (n.codePointAt(0)! > rangeStart.codePointAt(0)!) {\n ranges.push(braceEscape(rangeStart) + '-' + braceEscape(n))\n } else if (n === rangeStart) {\n ranges.push(braceEscape(n))\n }\n rangeStart = ''\n i += c.length\n continue\n }\n\n // now might be the start of a range.\n // can be either c-d or c-] or c<more...>] or c] at this point\n if (glob.startsWith('-]', i + c.length)) {\n ranges.push(braceEscape(n + '-'))\n i += c.length + 1\n continue\n }\n if (glob.startsWith('-', i + c.length)) {\n rangeStart = n\n i += c.length + 1\n continue\n }\n\n // not the start of a range, just a single character\n ranges.push(braceEscape(n))\n i += c.length\n }\n\n if (endPos < i) {\n // didn't see the end of the class, not a valid class,\n // but might still be valid as a literal match.\n return [noMatch, 0]\n }\n\n // if we got no ranges and no negates, then we have a range that\n // cannot possibly match anything, and that poisons the whole glob\n if (!ranges.length && !negs.length) {\n return [noMatch, glob.length - pos]\n }\n\n const sranges = '[' + (negate ? '^' : '') + ranges.join('') + ']'\n const snegs = '[' + (negate ? '' : '^') + negs.join('') + ']'\n const comb =\n '^' +\n (ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n : ranges.length ? sranges\n : snegs)\n\n return [new RegExp(comb, nocase ? 'iu' : 'u'), endPos - pos]\n}\n", "import { type Form, parseClass } from './parse-class.js'\n\nexport type { Form }\n\nexport type MatcherOptions = {\n /** perform a case-insensitive match */\n nocase?: boolean\n /** do not treat strings starting with `.` specially */\n dot?: boolean\n /** do not match extglobs (treat them as normal strings) */\n noext?: boolean\n /**\n * normalize unicode in the pattern and the tested strings, with\n * this form. `true` means `'NFC'`.\n */\n normalize?: boolean | Form\n}\n\n// parsed pattern items\nexport type Item =\n | { t: 'lit'; ch: string }\n | { t: 'any' | 'star' }\n | { t: 'class'; re: RegExp }\n | { t: 'ext'; type: string; alts: Item[][] }\n\n// extglob syntax tokens become literals if they are not part of a\n// closed extglob\nexport type Token =\n Item | { t: 'open'; type: string } | { t: 'bar' } | { t: 'close' }\n\n// state machine nodes\nexport type NegNode = { t: 'neg'; id: number; sub: Node; next: Node }\nexport type SplitNode = { t: 'split'; id: number; out: Node[] }\nexport type Node =\n | ({ t: 'lit'; id: number; next: Node } & Lit)\n | { t: 'any' | 'star'; id: number; next: Node }\n | { t: 'class'; id: number; re: RegExp; next: Node }\n | SplitNode\n | NegNode\n | { t: 'match'; id: number }\n\n// the end of the pattern, or of a negated sub-pattern\nconst MATCH: Node = { t: 'match', id: 0 }\n\nconst extTypes = '!?+*@'\n\nconst lit = (ch: string): Item => ({ t: 'lit', ch })\n\nconst reEscape = (s: string) => s.replace(/[\\\\^$.*+?()[\\]{}|/]/g, '\\\\$&')\n\n// a RegExp that only matches `s`, with unicode case folding\nconst newFoldRe = (s: string) => new RegExp(`^${reEscape(s)}$`, 'iu')\n\n// foldRe for one literal char. The same chars are in most patterns,\n// so keep them. A RegExp without the `g` or `y` flag has no state to\n// share.\nconst foldCache = new Map<string, RegExp>()\nconst foldRe = (ch: string) => {\n let re = foldCache.get(ch)\n if (!re) {\n re = newFoldRe(ch)\n if (foldCache.size >= 1000) foldCache.clear()\n foldCache.set(ch, re)\n }\n return re\n}\n\n/**\n * A literal char. With `nocase:true`, `re` folds case, and `ascii`\n * holds its results for ASCII chars, by char code: 1 for a match,\n * and 2 for not.\n */\nexport type Lit = { ch: string; re?: RegExp; ascii?: Uint8Array }\n\nconst litMatch = (l: Lit, c: string) => {\n if (c === l.ch) return true\n if (!l.re) return false\n const code = c.charCodeAt(0)\n if (code >= 128) return l.re.test(c)\n const ascii = (l.ascii ??= new Uint8Array(128))\n ascii[code] ||= l.re.test(c) ? 1 : 2\n return ascii[code] === 1\n}\n\nconst tokenize = (\n p: string,\n nocase: boolean,\n noext: boolean,\n form?: Form,\n) => {\n const toks: Token[] = []\n for (let i = 0; i < p.length;) {\n const c = String.fromCodePoint(p.codePointAt(i)!)\n if (c === '\\\\') {\n // a trailing \\ is a literal \\\n const e = p.codePointAt(i + 1)\n const ch = e === undefined ? c : String.fromCodePoint(e)\n toks.push(lit(ch))\n i += 1 + ch.length\n continue\n }\n if (c === '[') {\n const [re, consumed] = parseClass(p, i, nocase, form)\n if (consumed) {\n toks.push({ t: 'class', re })\n i += consumed\n continue\n }\n }\n if (!noext && extTypes.includes(c) && p[i + 1] === '(') {\n toks.push({ t: 'open', type: c })\n i += 2\n continue\n }\n toks.push(\n !noext && c === '|' ? { t: 'bar' }\n : !noext && c === ')' ? { t: 'close' }\n : c === '*' ? { t: 'star' }\n : c === '?' ? { t: 'any' }\n : lit(c),\n )\n i += c.length\n }\n return toks\n}\n\n// map each open token index to the index of its close token\nconst pair = (toks: Token[]) => {\n const pairs = new Map<number, number>()\n const stack: number[] = []\n toks.forEach((tok, i) => {\n if (tok.t === 'open') stack.push(i)\n else if (tok.t === 'close' && stack.length) pairs.set(stack.pop()!, i)\n })\n return pairs\n}\n\n// build the alternatives between start and end. An open token that\n// is not closed is never inside a closed extglob, so bar and close\n// tokens are only literal at the top level.\nconst build = (\n toks: Token[],\n pairs: Map<number, number>,\n start: number,\n end: number,\n top: boolean,\n): Item[][] => {\n let seq: Item[] = []\n const alts = [seq]\n for (let i = start; i < end; i++) {\n const tok = toks[i]!\n const close = pairs.get(i)\n if (tok.t === 'open' && close !== undefined) {\n const sub = build(toks, pairs, i + 1, close, false)\n seq.push({ t: 'ext', type: tok.type, alts: sub })\n i = close\n } else if (tok.t === 'bar' && !top) {\n alts.push((seq = []))\n } else if (tok.t === 'open') {\n seq.push(lit(tok.type), lit('('))\n } else if (tok.t === 'bar') {\n seq.push(lit('|'))\n } else if (tok.t === 'close') {\n seq.push(lit(')'))\n } else {\n seq.push(tok)\n }\n }\n return alts\n}\n\n// normalize each run of literal chars as one string, so that a char\n// and the combining marks after it compose (or decompose) together.\n// Syntax is already parsed, so a char that normalizes to a syntax\n// char (such as full-width `*` in NFKC) stays a literal.\nconst normalize = (items: Item[], form: Form): Item[] => {\n const out: Item[] = []\n let run = ''\n const flush = () => {\n for (const ch of run.normalize(form)) out.push(lit(ch))\n run = ''\n }\n for (const it of items) {\n if (it.t === 'lit') {\n run += it.ch\n continue\n }\n flush()\n out.push(\n it.t === 'ext' ?\n { ...it, alts: it.alts.map(a => normalize(a, form)) }\n : it,\n )\n }\n flush()\n return out\n}\n\n// the start node, and the number of node ids. Ids are dense, from 0\n// for the match node.\nconst compile = (\n items: Item[],\n nocase: boolean,\n): [start: Node, size: number] => {\n let id = 1\n const split = (out: Node[]): SplitNode => ({ t: 'split', id: id++, out })\n const seq = (items: Item[], next: Node): Node =>\n items.reduceRight((next, it) => item(it, next), next)\n const item = (it: Item, next: Node): Node => {\n switch (it.t) {\n case 'lit':\n const re = nocase ? foldRe(it.ch) : undefined\n return { t: 'lit', id: id++, ch: it.ch, re, next }\n case 'any':\n case 'star':\n return { t: it.t, id: id++, next }\n case 'class':\n return { t: 'class', id: id++, re: it.re, next }\n }\n const alts = (next: Node) => it.alts.map(a => seq(a, next))\n switch (it.type) {\n case '@':\n return split(alts(next))\n case '?':\n return split([next, ...alts(next)])\n case '!':\n return { t: 'neg', id: id++, sub: split(alts(MATCH)), next }\n }\n // * and +, loop back after each match\n const after = split([])\n const entry = split(alts(after))\n after.out.push(next, entry)\n return it.type === '*' ? after : entry\n }\n const start = seq(items, MATCH)\n return [start, id]\n}\n\n// one line per node, in the order that a walk from the start\n// reaches them. Edges point to node ids. The nodes of a negated\n// sub-pattern are indented under their negation.\nconst show = (start: Node): string => {\n const lines: string[] = []\n const seen = new Set<Node>()\n const ref = (n: Node) => (n.t === 'match' ? 'match' : String(n.id))\n const walk = (n: Node, indent: string) => {\n if (n.t === 'match' || seen.has(n)) return\n seen.add(n)\n const line = (desc: string) => lines.push(`${indent}${n.id}: ${desc}`)\n switch (n.t) {\n case 'split':\n line(`split -> ${n.out.map(ref).join(', ')}`)\n for (const o of n.out) walk(o, indent)\n return\n case 'neg':\n line(`!(${ref(n.sub)}) -> ${ref(n.next)}`)\n walk(n.sub, indent + ' ')\n return walk(n.next, indent)\n case 'lit':\n line(`${JSON.stringify(n.ch)} -> ${ref(n.next)}`)\n break\n case 'class':\n line(`${n.re} -> ${ref(n.next)}`)\n break\n default:\n line(`${n.t === 'any' ? '?' : '*'} -> ${ref(n.next)}`)\n }\n walk(n.next, indent)\n }\n walk(start, '')\n return [`start -> ${ref(start)}`, ...lines].join('\\n')\n}\n\n// A thread inside a !(...) negation. It holds the threads of the\n// negated sub-pattern, started where the negation started. The\n// negation matches the chars so far if the sub-pattern does not.\ntype Run = { t: 'run'; neg: NegNode; state: State }\n\n// The threads at one position in the string. Each node thread is\n// only kept once, and runs with the same state are only kept once,\n// so that identical threads merge. The match node is not in\n// `threads`, because it can not step. It sets `match` instead.\nclass State {\n // set by the Sim, to mark the nodes that this state has\n gen: number\n threads: Node[] = []\n match = false\n runs: Run[] = []\n // the sorted ids of the threads, with 0 for a match, once the\n // state is done\n ids: number[] = []\n\n constructor(gen: number) {\n this.gen = gen\n }\n\n // no threads, so nothing more can match\n get dead() {\n return !this.threads.length && !this.match && !this.runs.length\n }\n}\n\n// true if the two states hold the same threads\nconst sameState = (a: State, b: State): boolean => {\n if (a.ids.length !== b.ids.length) return false\n if (a.runs.length !== b.runs.length) return false\n if (a.ids.some((id, i) => id !== b.ids[i])) return false\n return a.runs.every(r =>\n b.runs.some(o => o.neg === r.neg && sameState(o.state, r.state)),\n )\n}\n\n/**\n * For each node id, the gen of the last state that has the node as\n * a thread, and of the last state that walked through it. A state is\n * built to the end before the states around it go on, and the nodes\n * of a negated sub-pattern are only in its states (other than the\n * match node, which is never marked). So one mark for each node is\n * enough to know if the state being built has it. The Sims of a\n * matcher never run at the same time, so they share one Marks.\n */\nexport type Marks = { has: Float64Array; seen: Float64Array; gen: number }\n\nconst marks = (size: number): Marks => ({\n has: new Float64Array(size),\n seen: new Float64Array(size),\n gen: 0,\n})\n\nclass Sim {\n // `.` and `..` only match literal dots, even with `dot:true`\n dots: boolean\n // the string starts with `.`, and `dot:true` is not set\n dotStart: boolean\n #marks: Marks\n\n constructor(dots: boolean, dotStart: boolean, marks: Marks) {\n this.dots = dots\n this.dotStart = dotStart\n this.#marks = marks\n }\n\n state() {\n return new State(++this.#marks.gen)\n }\n\n // sort the ids of a state, once it has all of its threads\n done(state: State) {\n state.ids = state.threads.map(n => n.id).sort((a, b) => a - b)\n if (state.match) state.ids.unshift(MATCH.id)\n return state\n }\n\n // true the first time that the state walks through the node, so\n // that loops in the graph stop\n #visit(state: State, node: Node) {\n const { seen } = this.#marks\n if (seen[node.id] === state.gen) return false\n seen[node.id] = state.gen\n return true\n }\n\n #addThread(state: State, node: Node) {\n const { has } = this.#marks\n if (has[node.id] === state.gen) return false\n has[node.id] = state.gen\n state.threads.push(node)\n return true\n }\n\n // wildcards only match a leading dot if `dot:true`. In a negated\n // sub-pattern, this does not apply, because the negation itself\n // can not match a leading dot.\n restricted(i: number, top: boolean) {\n return top && (this.dots || (this.dotStart && i === 0))\n }\n\n add(state: State, node: Node, i: number, top: boolean): void {\n switch (node.t) {\n case 'split':\n if (!this.#visit(state, node)) return\n for (const o of node.out) this.add(state, o, i, top)\n return\n case 'neg':\n if (!this.#visit(state, node)) return\n const sub = this.state()\n this.add(sub, node.sub, i, false)\n this.done(sub)\n return this.addRun(\n state,\n { t: 'run', neg: node, state: sub },\n i,\n top,\n )\n case 'star':\n // a * can not start a dotfile, even if it matches nothing\n if (this.restricted(i, top)) return\n if (this.#addThread(state, node))\n this.add(state, node.next, i, top)\n return\n case 'match':\n state.match = true\n return\n default:\n this.#addThread(state, node)\n }\n }\n\n addRun(state: State, run: Run, i: number, top: boolean) {\n for (const r of state.runs) {\n if (r.neg === run.neg && sameState(r.state, run.state)) return\n }\n state.runs.push(run)\n if (!run.state.match) {\n this.add(state, run.neg.next, i, top)\n }\n }\n\n // the threads after char `c`, at index `i`\n step(state: State, c: string, i: number, top: boolean): State {\n const next = this.state()\n for (const th of state.threads) {\n switch (th.t) {\n case 'lit':\n if (litMatch(th, c)) {\n this.add(next, th.next, i + 1, top)\n }\n break\n case 'any':\n if (!this.restricted(i, top)) this.add(next, th.next, i + 1, top)\n break\n case 'class':\n if (!this.restricted(i, top) && th.re.test(c)) {\n this.add(next, th.next, i + 1, top)\n }\n break\n case 'star':\n if (!this.restricted(i, top)) this.add(next, th, i + 1, top)\n }\n }\n if (!this.restricted(i, top)) {\n for (const run of state.runs) {\n // a sub-pattern with no threads can not match again, so the\n // run stays the same\n if (run.state.dead) {\n this.addRun(next, run, i + 1, top)\n continue\n }\n const sub = this.step(run.state, c, i, false)\n this.addRun(\n next,\n { t: 'run', neg: run.neg, state: sub },\n i + 1,\n top,\n )\n }\n }\n return this.done(next)\n }\n}\n\n// A canonical key for the threads in a state. States with the same\n// key hold the same threads, so they match the same strings.\nconst stateKey = (state: State): string => {\n const ids = state.ids.join()\n if (!state.runs.length) return ids\n const runs = state.runs.map(r => `${r.neg.id}(${stateKey(r.state)})`)\n return `${ids}|${runs.sort().join('|')}`\n}\n\n// A cached state of the simulation, and the states that each char\n// leads to.\ntype DState = {\n state: State\n match: boolean\n // no threads, so nothing more can match\n dead: boolean\n // the next state for each ASCII char, by char code, and for the\n // other chars\n ascii?: (DState | undefined)[]\n next: Map<string, DState>\n}\n\n// The cache can hold about this many chars of state keys and\n// transitions. When it is full, it is cleared, so that a pattern\n// can not use an unbounded amount of memory.\nconst DFA_BUDGET = 1 << 18\n\n// A cache of the states that the simulation reaches, built as the\n// matcher is used. Each char of a string is then one Map lookup,\n// once the states that it leads to are known.\n//\n// The dot rules only restrict the first char of a dotfile (strings\n// that are only `.` or `..` do not use the cache). So a dotfile\n// starts at its own state, which takes its first step with the\n// restriction, and every other state takes steps without it.\nclass Dfa {\n #start: Node\n #states = new Map<string, DState>()\n #size = 0\n #plain?: DState\n #dotStart?: DState\n #sim: Sim\n #dotSim: Sim\n\n constructor(start: Node, marks: Marks) {\n this.#start = start\n this.#sim = new Sim(false, false, marks)\n this.#dotSim = new Sim(false, true, marks)\n }\n\n #make(state: State): DState {\n return {\n state,\n match: state.match,\n dead: state.dead,\n next: new Map(),\n }\n }\n\n #intern(state: State): DState {\n const key = stateKey(state)\n const found = this.#states.get(key)\n if (found) return found\n if (this.#size > DFA_BUDGET) this.#clear()\n const d = this.#make(state)\n this.#states.set(key, d)\n this.#size += key.length + 1\n return d\n }\n\n #clear() {\n this.#states.clear()\n this.#size = 0\n this.#plain = undefined\n this.#dotStart = undefined\n }\n\n start(dotStart: boolean): DState {\n if (dotStart) {\n if (this.#dotStart) return this.#dotStart\n const state = this.#dotSim.state()\n this.#dotSim.add(state, this.#start, 0, true)\n return (this.#dotStart = this.#make(this.#dotSim.done(state)))\n }\n if (this.#plain) return this.#plain\n const state = this.#sim.state()\n this.#sim.add(state, this.#start, 0, true)\n return (this.#plain = this.#intern(this.#sim.done(state)))\n }\n\n // the next state, after a miss in `d.ascii`\n next(d: DState, c: string): DState {\n const code = c.charCodeAt(0)\n const found = code < 128 ? undefined : d.next.get(c)\n if (found) return found\n // the dotfile start is not in the cache, so it is never shared\n const n =\n d === this.#dotStart ?\n this.#intern(this.#dotSim.step(d.state, c, 0, true))\n : this.#intern(this.#sim.step(d.state, c, 1, true))\n if (code < 128) {\n if (!d.ascii) {\n d.ascii = new Array(128)\n this.#size += 128\n }\n d.ascii[code] = n\n } else {\n d.next.set(c, n)\n }\n this.#size++\n return n\n }\n}\n\n/**\n * A node in a graph with no splits or negations. Such a graph is a\n * chain of nodes that each match one char, or a `*`.\n */\nexport type LinearNode = Exclude<\n Node,\n SplitNode | NegNode | { t: 'match' }\n>\n\n// the nodes in order, if the graph is a single chain\nconst linear = (start: Node): LinearNode[] | undefined => {\n const nodes: LinearNode[] = []\n for (let n = start; n.t !== 'match'; n = n.next) {\n if (n.t === 'split' || n.t === 'neg') return undefined\n nodes.push(n)\n }\n return nodes\n}\n\n// Match a chain of nodes. Each node other than `*` matches exactly\n// one char, so on a failure it is enough to go back to the last `*`\n// and let it match one more char. This takes at most\n// nodes.length * chars.length steps.\nconst testLinear = (\n nodes: LinearNode[],\n chars: ArrayLike<string>,\n start: number,\n end: number,\n) => {\n let ni = 0\n let ci = start\n let starNi = -1\n let starCi = 0\n while (ci < end) {\n const n = nodes[ni]\n if (n?.t === 'star') {\n starNi = ni++\n starCi = ci\n continue\n }\n const c = chars[ci]!\n if (\n n &&\n (n.t === 'any' ||\n (n.t === 'lit' && litMatch(n, c)) ||\n (n.t === 'class' && n.re.test(c)))\n ) {\n ni++\n ci++\n continue\n }\n if (starNi === -1) return false\n ni = starNi + 1\n ci = ++starCi\n }\n while (nodes[ni]?.t === 'star') ni++\n return ni === nodes.length\n}\n\n// The least and most chars that the items can match. These are only\n// bounds: a negation can match a string of any length, so it counts\n// as 0 to Infinity.\nconst lengths = (items: Item[]): [min: number, max: number] => {\n let min = 0\n let max = 0\n for (const it of items) {\n const [lo, hi] = itemLengths(it)\n min += lo\n max += hi\n }\n return [min, max]\n}\n\nconst itemLengths = (it: Item): [min: number, max: number] => {\n if (it.t === 'star') return [0, Infinity]\n if (it.t !== 'ext') return [1, 1]\n if (it.type === '!') return [0, Infinity]\n const alts = it.alts.map(lengths)\n const min = Math.min(...alts.map(a => a[0]))\n const max = Math.max(...alts.map(a => a[1]))\n // a loop of alternatives that only match the empty string is empty\n const loop = max === 0 ? 0 : Infinity\n return (\n it.type === '@' ? [min, max]\n : it.type === '?' ? [0, max]\n : it.type === '*' ? [0, loop]\n : [min, loop]\n )\n}\n\n// true if the chars from `start` match the literals\nconst hasAffix = (\n lits: Lit[],\n chars: ArrayLike<string>,\n start: number,\n) => {\n for (let j = 0; j < lits.length; j++) {\n if (!litMatch(lits[j]!, chars[start + j]!)) return false\n }\n return true\n}\n\n// a `/`, or half of a surrogate pair\nconst slashOrSurrogate = /[/\\ud800-\\udfff]/\nconst surrogate = /[\\ud800-\\udfff]/\n\n// a string can be indexed by code point, unless it has surrogate\n// pairs\nconst codePoints = (s: string): ArrayLike<string> =>\n surrogate.test(s) ? [...s] : s\n\nconst noSlash = (s: string) => {\n if (s.includes('/')) {\n throw new Error('can only match a single path portion, got: ' + s)\n }\n}\n\nexport class Matcher {\n pattern: string\n options: MatcherOptions\n #start: Node\n // the number of node ids\n #size: number\n #marks?: Marks\n // the Sim for strings that are only `.` or `..`\n #dotsSim?: Sim\n // the string to compare, if the pattern has no magic. With\n // `nocase:true`, the RegExp that folds case is made when it is\n // first used.\n #literal?: string\n #literalFold = false\n #literalRe?: RegExp\n // the nodes between the prefix and suffix, if the graph is a\n // single chain\n #linear?: LinearNode[]\n // the linear nodes are only `*` and `?`, so the length bounds and\n // the prefix and suffix decide the match\n #wild = false\n // the least and most chars that a match can have\n #min = 0\n #max = Infinity\n // the literals that a match must start and end with. Each one\n // matches exactly one char, and they are distinct items in the\n // pattern, so a string that does not have them can not match.\n #prefix: Lit[] = []\n #suffix: Lit[] = []\n // the prefix and suffix as strings, if they do not fold case\n #prefixStr?: string\n #suffixStr?: string\n // there is a prefix or suffix to check\n #affix = false\n #dfa?: Dfa\n #form?: Form\n\n constructor(pattern: string, options: MatcherOptions = {}) {\n if (pattern.includes('/')) {\n throw new Error(\n 'can only match a single path portion, got pattern: ' + pattern,\n )\n }\n this.pattern = pattern\n this.options = options\n const { nocase = false, noext = false, normalize: n } = options\n this.#form = n === true ? 'NFC' : n || undefined\n // a pattern that is only an empty extglob is a literal string,\n // except for `!()`, which matches any non-empty string\n const literal = /^[?*+@]\\(\\)$/.test(pattern)\n const toks = tokenize(pattern, nocase, noext || literal, this.#form)\n let [items] = build(toks, pair(toks), 0, toks.length, true)\n if (this.#form) items = normalize(items!, this.#form)\n const [start, size] = compile(items!, nocase)\n this.#start = start\n this.#size = size\n if (items!.every(it => it.t === 'lit')) {\n this.#literal = items!.map(it => it.ch).join('')\n this.#literalFold = nocase\n } else {\n const lit = (it: Item): Lit | undefined =>\n it.t !== 'lit' ? undefined\n : nocase ? { ch: it.ch, re: foldRe(it.ch) }\n : { ch: it.ch }\n for (const it of items!) {\n const l = lit(it)\n if (!l) break\n this.#prefix.push(l)\n }\n for (let j = items!.length - 1; j >= 0; j--) {\n const l = lit(items![j]!)\n if (!l) break\n this.#suffix.unshift(l)\n }\n this.#affix = !!(this.#prefix.length || this.#suffix.length)\n if (!nocase) {\n this.#prefixStr = this.#prefix.map(l => l.ch).join('')\n this.#suffixStr = this.#suffix.map(l => l.ch).join('')\n }\n this.#linear = linear(this.#start)?.slice(\n this.#prefix.length,\n -this.#suffix.length || undefined,\n )\n this.#wild = !!this.#linear?.every(\n n => n.t === 'star' || n.t === 'any',\n )\n const [min, max] = lengths(items!)\n this.#min = min\n this.#max = max\n }\n }\n\n test(s: string): boolean {\n // The `/` check uses the string as given, so with normalization it\n // is a separate step. Otherwise, one scan finds both a `/` and the\n // surrogate pairs that stop the string being indexed by code point.\n if (this.#form) {\n noSlash(s)\n return this.#test(s.normalize(this.#form))\n }\n if (slashOrSurrogate.test(s)) {\n noSlash(s)\n return this.#test(s, [...s])\n }\n return this.#test(s, s)\n }\n\n /**\n * The same as {@link Matcher#test}, but the string is not checked\n * for `/` chars, so the result for a string that has one is not\n * defined. Only use it for a string that is known to be one path\n * portion, such as a part of a path that was split on `/`. It can\n * be faster, because some patterns do not need to look at each char\n * of the string.\n */\n testUnchecked(s: string): boolean {\n return this.#test(this.#form ? s.normalize(this.#form) : s)\n }\n\n // Test a string that has no `/`. `chars` indexes it by code point.\n // If it is not given, it is only found if a step needs it.\n #test(s: string, chars?: ArrayLike<string>): boolean {\n if (this.#literal !== undefined) {\n return this.#literalFold ?\n (this.#literalRe ??= newFoldRe(this.#literal)).test(s)\n : s === this.#literal\n }\n // the length check means that the prefix and suffix do not\n // overlap. Without the chars, the length in code points is from\n // half of the UTF-16 length (if each one is a surrogate pair) to\n // all of it, which is often enough to know.\n const min = this.#min\n const max = this.#max\n if (chars === undefined) {\n const most = s.length\n const least = (most + 1) >> 1\n if (most < min || least > max) return false\n if (least < min || most > max) chars = codePoints(s)\n }\n if (\n chars !== undefined &&\n (chars.length < min || chars.length > max)\n ) {\n return false\n }\n const prefix = this.#prefix.length\n if (this.#affix) {\n if (this.#prefixStr !== undefined && this.#suffixStr !== undefined) {\n if (\n !s.startsWith(this.#prefixStr) ||\n !s.endsWith(this.#suffixStr)\n ) {\n return false\n }\n } else {\n chars ??= codePoints(s)\n const end = chars.length - this.#suffix.length\n if (\n !hasAffix(this.#prefix, chars, 0) ||\n !hasAffix(this.#suffix, chars, end)\n ) {\n return false\n }\n }\n }\n const dotStart = !this.options.dot && s.startsWith('.')\n if (this.#linear) {\n // `.` and `..` only match literal dots, even with `dot:true`\n if (s === '.' || s === '..') return false\n // only a literal can match the leading dot. A `*` can not\n // start a dotfile, even if it matches nothing.\n if (dotStart && !prefix) return false\n if (this.#wild) return true\n chars ??= codePoints(s)\n const end = chars.length - this.#suffix.length\n return testLinear(this.#linear, chars, prefix, end)\n }\n chars ??= codePoints(s)\n if (s === '.' || s === '..') {\n this.#marks ??= marks(this.#size)\n const sim = (this.#dotsSim ??= new Sim(true, false, this.#marks))\n const start = sim.state()\n sim.add(start, this.#start, 0, true)\n let state = sim.done(start)\n for (let i = 0; i < chars.length; i++) {\n state = sim.step(state, chars[i]!, i, true)\n }\n return state.match\n }\n this.#marks ??= marks(this.#size)\n const dfa = (this.#dfa ??= new Dfa(this.#start, this.#marks))\n let d = dfa.start(dotStart)\n // read char codes from the string, so that a one-char string is\n // only made for a cache miss\n const str = chars === s\n for (let i = 0; i < chars.length; i++) {\n if (d.dead) return false\n const code = str ? s.charCodeAt(i) : chars[i]!.charCodeAt(0)\n d = d.ascii?.[code] ?? dfa.next(d, chars[i]!)\n }\n return d.match\n }\n\n /** a readable listing of the state machine */\n toString(): string {\n return show(this.#start)\n }\n}\n"],
|
||
"mappings": "AAIA,IAAMA,EAA0D,CAC9D,YAAa,CAAC,sBAAsB,EACpC,YAAa,CAAC,eAAe,EAC7B,YAAa,CAAC,aAAuB,EACrC,YAAa,CAAC,YAAY,EAC1B,YAAa,CAAC,SAAS,EACvB,YAAa,CAAC,SAAS,EACvB,YAAa,CAAC,eAAgB,EAAI,EAClC,YAAa,CAAC,SAAS,EACvB,YAAa,CAAC,SAAU,EAAI,EAC5B,YAAa,CAAC,cAAc,EAC5B,YAAa,CAAC,uBAAuB,EACrC,YAAa,CAAC,SAAS,EACvB,WAAY,CAAC,6BAA6B,EAC1C,aAAc,CAAC,WAAW,GAKtBC,EAAeC,GAAcA,EAAE,QAAQ,YAAa,MAAM,EAM1DC,EAAU,KASHC,EAAa,CACxBC,EACAC,EACAC,EAAkB,GAClBC,IACoB,CAEpB,IAAMC,EAAQC,GAAa,CACzB,IAAMC,EAAIH,EAAOE,EAAE,UAAUF,CAAI,EAAIE,EACrC,MAAO,CAAC,GAAGC,CAAC,EAAE,SAAW,EAAIA,EAAID,CACnC,EACME,EA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AAQ,CACN,OAAO5C,EAAK,KAAKgC,EAAM,CACzB",
|
||
"names": ["posixClasses", "braceEscape", "s", "noMatch", "parseClass", "glob", "position", "nocase", "form", "norm", "c", "n", "pos", "ranges", "negs", "i", "sawStart", "escaping", "negate", "endPos", "rangeStart", "WHILE", "cls", "unip", "neg", "sranges", "snegs", "comb", "MATCH", "extTypes", "lit", "ch", "reEscape", "s", "newFoldRe", "foldCache", "foldRe", "re", "litMatch", "l", "c", "code", "ascii", "tokenize", "p", "nocase", "noext", "form", "toks", "i", "e", "consumed", "parseClass", "pair", "pairs", "stack", "tok", "build", "start", "end", "top", "seq", "alts", "close", "sub", "normalize", "items", "out", "run", "flush", "it", "a", "compile", "id", "split", "next", "item", "after", "entry", "show", "lines", "seen", "ref", "walk", "indent", "line", "desc", "o", "State", "gen", "sameState", "b", "r", "marks", "size", "Sim", "#marks", "dots", "dotStart", "state", "n", "#visit", "node", "#addThread", "has", "th", "stateKey", "ids", "runs", "DFA_BUDGET", "Dfa", "#start", "#states", "#size", "#plain", "#dotStart", "#sim", "#dotSim", "#make", "#intern", "key", "found", "#clear", "d", "linear", "nodes", "testLinear", "chars", "ni", "ci", "starNi", "starCi", "lengths", "min", "max", "lo", "hi", "itemLengths", "loop", "hasAffix", "lits", "j", "slashOrSurrogate", "surrogate", "codePoints", "noSlash", "Matcher", "#dotsSim", "#literal", "#literalFold", "#literalRe", "#linear", "#wild", "#min", "#max", "#prefix", "#suffix", "#prefixStr", "#suffixStr", "#affix", "#dfa", "#form", "pattern", "options", "literal", "#test", "most", "least", "prefix", "sim", "dfa", "str"]
|
||
}
|