{ "version": 3, "sources": ["../src/index.js", "../node_modules/.pnpm/regex-utilities@2.3.0/node_modules/regex-utilities/src/index.js"], "sourcesContent": ["import {Context, forEachUnescaped, getGroupContents, hasUnescaped, replaceUnescaped} from 'regex-utilities';\n\nconst r = String.raw;\nconst gRToken = r`\\\\g<(?[^>&]+)&R=(?[^>]+)>`;\nconst recursiveToken = r`\\(\\?R=(?[^\\)]+)\\)|${gRToken}`;\nconst namedCaptureDelim = r`\\(\\?<(?![=!])(?[^>]+)>`;\nconst captureDelim = r`${namedCaptureDelim}|(?\\()(?!\\?)`;\nconst token = new RegExp(r`${namedCaptureDelim}|${recursiveToken}|\\(\\?|\\\\?.`, 'gsu');\nconst overlappingRecursionMsg = 'Cannot use multiple overlapping recursions';\n\n/**\n@param {string} pattern\n@param {{\n flags?: string;\n captureTransfers?: Map>;\n hiddenCaptures?: Array;\n mode?: 'plugin' | 'external';\n}} [data]\n@returns {{\n pattern: string;\n captureTransfers: Map>;\n hiddenCaptures: Array;\n}}\n*/\nfunction recursion(pattern, data) {\n const {hiddenCaptures, mode} = {\n hiddenCaptures: [],\n mode: 'plugin',\n ...data,\n };\n // Capture transfer is used by \n let captureTransfers = data?.captureTransfers ?? new Map();\n // Keep the initial fail-check (which avoids unneeded processing) as fast as possible by testing\n // without the accuracy improvement of using `hasUnescaped` with `Context.DEFAULT`\n if (!(new RegExp(recursiveToken, 'su').test(pattern))) {\n return {\n pattern,\n captureTransfers,\n hiddenCaptures,\n };\n }\n if (mode === 'plugin' && hasUnescaped(pattern, r`\\(\\?\\(DEFINE\\)`, Context.DEFAULT)) {\n throw new Error('DEFINE groups cannot be used with recursion');\n }\n\n const addedHiddenCaptures = [];\n const hasNumberedBackref = hasUnescaped(pattern, r`\\\\[1-9]`, Context.DEFAULT);\n const groupContentsStartPos = new Map();\n const openGroups = [];\n let hasRecursed = false;\n let numCharClassesOpen = 0;\n let numCapturesPassed = 0;\n let match;\n token.lastIndex = 0;\n while ((match = token.exec(pattern))) {\n const {0: m, groups: {captureName, rDepth, gRNameOrNum, gRDepth}} = match;\n if (m === '[') {\n numCharClassesOpen++;\n } else if (!numCharClassesOpen) {\n\n // `(?R=N)`\n if (rDepth) {\n assertMaxInBounds(rDepth);\n if (hasRecursed) {\n throw new Error(overlappingRecursionMsg);\n }\n if (hasNumberedBackref) {\n // Could add support for numbered backrefs with extra effort, but it's probably not worth\n // it. To trigger this error, the regex must include recursion and one of the following:\n // - An interpolated regex that contains a numbered backref (since other numbered\n // backrefs are prevented by implicit flag n).\n // - A numbered backref, when flag n is explicitly disabled.\n // Note that Regex+'s extended syntax (atomic groups and sometimes subroutines) can also\n // add numbered backrefs, but those work fine because external plugins like this one run\n // *before* the transformation of built-in syntax extensions\n throw new Error(\n // When used in `external` mode by transpilers other than Regex+, backrefs might have\n // gone through conversion from named to numbered, so avoid a misleading error\n `${mode === 'external' ? 'Backrefs' : 'Numbered backrefs'} cannot be used with global recursion`\n );\n }\n const left = pattern.slice(0, match.index);\n const right = pattern.slice(token.lastIndex);\n if (hasUnescaped(right, recursiveToken, Context.DEFAULT)) {\n throw new Error(overlappingRecursionMsg);\n }\n const reps = +rDepth - 1;\n pattern = makeRecursive(\n left,\n right,\n reps,\n false,\n hiddenCaptures,\n addedHiddenCaptures,\n numCapturesPassed\n );\n captureTransfers = mapCaptureTransfers(\n captureTransfers,\n left,\n reps,\n addedHiddenCaptures.length,\n 0,\n numCapturesPassed\n );\n // No need to parse further\n break;\n // `\\g`, `\\g`\n } else if (gRNameOrNum) {\n assertMaxInBounds(gRDepth);\n let isWithinReffedGroup = false;\n for (const g of openGroups) {\n if (g.name === gRNameOrNum || g.num === +gRNameOrNum) {\n isWithinReffedGroup = true;\n if (g.hasRecursedWithin) {\n throw new Error(overlappingRecursionMsg);\n }\n break;\n }\n }\n if (!isWithinReffedGroup) {\n throw new Error(r`Recursive \\g cannot be used outside the referenced group \"${\n mode === 'external' ? gRNameOrNum : r`\\g<${gRNameOrNum}&R=${gRDepth}>`\n }\"`);\n }\n const startPos = groupContentsStartPos.get(gRNameOrNum);\n const groupContents = getGroupContents(pattern, startPos);\n if (\n hasNumberedBackref &&\n hasUnescaped(groupContents, r`${namedCaptureDelim}|\\((?!\\?)`, Context.DEFAULT)\n ) {\n throw new Error(\n // When used in `external` mode by transpilers other than Regex+, backrefs might have\n // gone through conversion from named to numbered, so avoid a misleading error\n `${mode === 'external' ? 'Backrefs' : 'Numbered backrefs'} cannot be used with recursion of capturing groups`\n );\n }\n const groupContentsLeft = pattern.slice(startPos, match.index);\n const groupContentsRight = groupContents.slice(groupContentsLeft.length + m.length);\n const numAddedHiddenCapturesPreExpansion = addedHiddenCaptures.length;\n const reps = +gRDepth - 1;\n const expansion = makeRecursive(\n groupContentsLeft,\n groupContentsRight,\n reps,\n true,\n hiddenCaptures,\n addedHiddenCaptures,\n numCapturesPassed\n );\n captureTransfers = mapCaptureTransfers(\n captureTransfers,\n groupContentsLeft,\n reps,\n addedHiddenCaptures.length - numAddedHiddenCapturesPreExpansion,\n numAddedHiddenCapturesPreExpansion,\n numCapturesPassed\n );\n const pre = pattern.slice(0, startPos);\n const post = pattern.slice(startPos + groupContents.length);\n // Modify the string we're looping over\n pattern = `${pre}${expansion}${post}`;\n // Step forward for the next loop iteration\n token.lastIndex += expansion.length - m.length - groupContentsLeft.length - groupContentsRight.length;\n openGroups.forEach(g => g.hasRecursedWithin = true);\n hasRecursed = true;\n } else if (captureName) {\n numCapturesPassed++;\n groupContentsStartPos.set(String(numCapturesPassed), token.lastIndex);\n groupContentsStartPos.set(captureName, token.lastIndex);\n openGroups.push({\n num: numCapturesPassed,\n name: captureName,\n });\n } else if (m[0] === '(') {\n const isUnnamedCapture = m === '(';\n if (isUnnamedCapture) {\n numCapturesPassed++;\n groupContentsStartPos.set(String(numCapturesPassed), token.lastIndex);\n }\n openGroups.push(isUnnamedCapture ? {num: numCapturesPassed} : {});\n } else if (m === ')') {\n openGroups.pop();\n }\n\n } else if (m === ']') {\n numCharClassesOpen--;\n }\n }\n\n hiddenCaptures.push(...addedHiddenCaptures);\n\n return {\n pattern,\n captureTransfers,\n hiddenCaptures,\n };\n}\n\n/**\n@param {string} max\n*/\nfunction assertMaxInBounds(max) {\n const errMsg = `Max depth must be integer between 2 and 100; used ${max}`;\n if (!/^[1-9]\\d*$/.test(max)) {\n throw new Error(errMsg);\n }\n max = +max;\n if (max < 2 || max > 100) {\n throw new Error(errMsg);\n }\n}\n\n/**\n@param {string} left\n@param {string} right\n@param {number} reps\n@param {boolean} isSubpattern\n@param {Array} hiddenCaptures\n@param {Array} addedHiddenCaptures\n@param {number} numCapturesPassed\n@returns {string}\n*/\nfunction makeRecursive(\n left,\n right,\n reps,\n isSubpattern,\n hiddenCaptures,\n addedHiddenCaptures,\n numCapturesPassed\n) {\n const namesInRecursed = new Set();\n // Can skip this work if not needed\n if (isSubpattern) {\n forEachUnescaped(left + right, namedCaptureDelim, ({groups: {captureName}}) => {\n namesInRecursed.add(captureName);\n }, Context.DEFAULT);\n }\n const rest = [\n reps,\n isSubpattern ? namesInRecursed : null,\n hiddenCaptures,\n addedHiddenCaptures,\n numCapturesPassed,\n ];\n // Depth 2: 'left(?:left(?:)right)right'\n // Depth 3: 'left(?:left(?:left(?:)right)right)right'\n // Empty group in the middle separates tokens and absorbs a following quantifier if present\n return `${left}${\n repeatWithDepth(`(?:${left}`, 'forward', ...rest)\n }(?:)${\n repeatWithDepth(`${right})`, 'backward', ...rest)\n }${right}`;\n}\n\n/**\n@param {string} pattern\n@param {'forward' | 'backward'} direction\n@param {number} reps\n@param {Set | null} namesInRecursed\n@param {Array} hiddenCaptures\n@param {Array} addedHiddenCaptures\n@param {number} numCapturesPassed\n@returns {string}\n*/\nfunction repeatWithDepth(\n pattern,\n direction,\n reps,\n namesInRecursed,\n hiddenCaptures,\n addedHiddenCaptures,\n numCapturesPassed\n) {\n const startNum = 2;\n const getDepthNum = i => direction === 'forward' ? (i + startNum) : (reps - i + startNum - 1);\n let result = '';\n for (let i = 0; i < reps; i++) {\n const depthNum = getDepthNum(i);\n result += replaceUnescaped(\n pattern,\n r`${captureDelim}|\\\\k<(?[^>]+)>`,\n ({0: m, groups: {captureName, unnamed, backref}}) => {\n if (backref && namesInRecursed && !namesInRecursed.has(backref)) {\n // Don't alter backrefs to groups outside the recursed subpattern\n return m;\n }\n const suffix = `_$${depthNum}`;\n if (unnamed || captureName) {\n const addedCaptureNum = numCapturesPassed + addedHiddenCaptures.length + 1;\n addedHiddenCaptures.push(addedCaptureNum);\n incrementIfAtLeast(hiddenCaptures, addedCaptureNum);\n return unnamed ? m : `(?<${captureName}${suffix}>`;\n }\n return r`\\k<${backref}${suffix}>`;\n },\n Context.DEFAULT\n );\n }\n return result;\n}\n\n/**\nUpdates the array in place by incrementing each value greater than or equal to the threshold.\n@param {Array} arr\n@param {number} threshold\n*/\nfunction incrementIfAtLeast(arr, threshold) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] >= threshold) {\n arr[i]++;\n }\n }\n}\n\n/**\n@param {Map>} captureTransfers\n@param {string} left\n@param {number} reps\n@param {number} numCapturesAddedInExpansion\n@param {number} numAddedHiddenCapturesPreExpansion\n@param {number} numCapturesPassed\n@returns {Map>}\n*/\nfunction mapCaptureTransfers(captureTransfers, left, reps, numCapturesAddedInExpansion, numAddedHiddenCapturesPreExpansion, numCapturesPassed) {\n if (captureTransfers.size && numCapturesAddedInExpansion) {\n let numCapturesInLeft = 0;\n forEachUnescaped(left, captureDelim, () => numCapturesInLeft++, Context.DEFAULT);\n // Is 0 for global recursion\n const recursionDelimCaptureNum = numCapturesPassed - numCapturesInLeft + numAddedHiddenCapturesPreExpansion;\n const newCaptureTransfers = new Map();\n captureTransfers.forEach((from, to) => {\n const numCapturesInRight = (numCapturesAddedInExpansion - (numCapturesInLeft * reps)) / reps;\n const numCapturesAddedInLeft = numCapturesInLeft * reps;\n const newTo = to > (recursionDelimCaptureNum + numCapturesInLeft) ? to + numCapturesAddedInExpansion : to;\n const newFrom = [];\n for (const f of from) {\n // Before the recursed subpattern\n if (f <= recursionDelimCaptureNum) {\n newFrom.push(f);\n // After the recursed subpattern\n } else if (f > (recursionDelimCaptureNum + numCapturesInLeft + numCapturesInRight)) {\n newFrom.push(f + numCapturesAddedInExpansion);\n // Within the recursed subpattern, on the left of the recursion token\n } else if (f <= (recursionDelimCaptureNum + numCapturesInLeft)) {\n for (let i = 0; i <= reps; i++) {\n newFrom.push(f + (numCapturesInLeft * i));\n }\n // Within the recursed subpattern, on the right of the recursion token\n } else {\n for (let i = 0; i <= reps; i++) {\n newFrom.push(f + numCapturesAddedInLeft + (numCapturesInRight * i));\n }\n }\n }\n newCaptureTransfers.set(newTo, newFrom);\n });\n return newCaptureTransfers;\n }\n return captureTransfers;\n}\n\nexport {\n recursion,\n};\n", "// Constant properties for tracking regex syntax context\nexport const Context = Object.freeze({\n DEFAULT: 'DEFAULT',\n CHAR_CLASS: 'CHAR_CLASS',\n});\n\n/**\nReplaces all unescaped instances of a regex pattern in the given context, using a replacement\nstring or callback.\n\nDoesn't skip over complete multicharacter tokens (only `\\` plus its folowing char) so must be used\nwith knowledge of what's safe to do given regex syntax. Assumes UnicodeSets-mode syntax.\n@param {string} expression Search target\n@param {string} needle Search as a regex pattern, with flags `su` applied\n@param {string | (match: RegExpExecArray, details: {\n context: 'DEFAULT' | 'CHAR_CLASS';\n negated: boolean;\n}) => string} replacement\n@param {'DEFAULT' | 'CHAR_CLASS'} [context] All contexts if not specified\n@returns {string} Updated expression\n@example\nconst str = '.\\\\.\\\\\\\\.[[\\\\.].].';\nreplaceUnescaped(str, '\\\\.', '@');\n// \u2192 '@\\\\.\\\\\\\\@[[\\\\.]@]@'\nreplaceUnescaped(str, '\\\\.', '@', Context.DEFAULT);\n// \u2192 '@\\\\.\\\\\\\\@[[\\\\.].]@'\nreplaceUnescaped(str, '\\\\.', '@', Context.CHAR_CLASS);\n// \u2192 '.\\\\.\\\\\\\\.[[\\\\.]@].'\n*/\nexport function replaceUnescaped(expression, needle, replacement, context) {\n const re = new RegExp(String.raw`${needle}|(?<$skip>\\[\\^?|\\\\?.)`, 'gsu');\n const negated = [false];\n let numCharClassesOpen = 0;\n let result = '';\n for (const match of expression.matchAll(re)) {\n const {0: m, groups: {$skip}} = match;\n if (!$skip && (!context || (context === Context.DEFAULT) === !numCharClassesOpen)) {\n if (replacement instanceof Function) {\n result += replacement(match, {\n context: numCharClassesOpen ? Context.CHAR_CLASS : Context.DEFAULT,\n negated: negated[negated.length - 1],\n });\n } else {\n result += replacement;\n }\n continue;\n }\n if (m[0] === '[') {\n numCharClassesOpen++;\n negated.push(m[1] === '^');\n } else if (m === ']' && numCharClassesOpen) {\n numCharClassesOpen--;\n negated.pop();\n }\n result += m;\n }\n return result;\n}\n\n/**\nRuns a callback for each unescaped instance of a regex pattern in the given context.\n\nDoesn't skip over complete multicharacter tokens (only `\\` plus its folowing char) so must be used\nwith knowledge of what's safe to do given regex syntax. Assumes UnicodeSets-mode syntax.\n@param {string} expression Search target\n@param {string} needle Search as a regex pattern, with flags `su` applied\n@param {(match: RegExpExecArray, details: {\n context: 'DEFAULT' | 'CHAR_CLASS';\n negated: boolean;\n}) => void} callback\n@param {'DEFAULT' | 'CHAR_CLASS'} [context] All contexts if not specified\n*/\nexport function forEachUnescaped(expression, needle, callback, context) {\n // Do this the easy way\n replaceUnescaped(expression, needle, callback, context);\n}\n\n/**\nReturns a match object for the first unescaped instance of a regex pattern in the given context, or\n`null`.\n\nDoesn't skip over complete multicharacter tokens (only `\\` plus its folowing char) so must be used\nwith knowledge of what's safe to do given regex syntax. Assumes UnicodeSets-mode syntax.\n@param {string} expression Search target\n@param {string} needle Search as a regex pattern, with flags `su` applied\n@param {number} [pos] Offset to start the search\n@param {'DEFAULT' | 'CHAR_CLASS'} [context] All contexts if not specified\n@returns {RegExpExecArray | null}\n*/\nexport function execUnescaped(expression, needle, pos = 0, context) {\n // Quick partial test; avoid the loop if not needed\n if (!(new RegExp(needle, 'su').test(expression))) {\n return null;\n }\n const re = new RegExp(`${needle}|(?<$skip>\\\\\\\\?.)`, 'gsu');\n re.lastIndex = pos;\n let numCharClassesOpen = 0;\n let match;\n while (match = re.exec(expression)) {\n const {0: m, groups: {$skip}} = match;\n if (!$skip && (!context || (context === Context.DEFAULT) === !numCharClassesOpen)) {\n return match;\n }\n if (m === '[') {\n numCharClassesOpen++;\n } else if (m === ']' && numCharClassesOpen) {\n numCharClassesOpen--;\n }\n // Avoid an infinite loop on zero-length matches\n if (re.lastIndex == match.index) {\n re.lastIndex++;\n }\n }\n return null;\n}\n\n/**\nChecks whether an unescaped instance of a regex pattern appears in the given context.\n\nDoesn't skip over complete multicharacter tokens (only `\\` plus its folowing char) so must be used\nwith knowledge of what's safe to do given regex syntax. Assumes UnicodeSets-mode syntax.\n@param {string} expression Search target\n@param {string} needle Search as a regex pattern, with flags `su` applied\n@param {'DEFAULT' | 'CHAR_CLASS'} [context] All contexts if not specified\n@returns {boolean} Whether the pattern was found\n*/\nexport function hasUnescaped(expression, needle, context) {\n // Do this the easy way\n return !!execUnescaped(expression, needle, 0, context);\n}\n\n/**\nExtracts the full contents of a group (subpattern) from the given expression, accounting for\nescaped characters, nested groups, and character classes. The group is identified by the position\nwhere its contents start (the string index just after the group's opening delimiter). Returns the\nrest of the string if the group is unclosed.\n\nAssumes UnicodeSets-mode syntax.\n@param {string} expression Search target\n@param {number} contentsStartPos\n@returns {string}\n*/\nexport function getGroupContents(expression, contentsStartPos) {\n const token = /\\\\?./gsu;\n token.lastIndex = contentsStartPos;\n let contentsEndPos = expression.length;\n let numCharClassesOpen = 0;\n // Starting search within an open group, after the group's opening\n let numGroupsOpen = 1;\n let match;\n while (match = token.exec(expression)) {\n const [m] = match;\n if (m === '[') {\n numCharClassesOpen++;\n } else if (!numCharClassesOpen) {\n if (m === '(') {\n numGroupsOpen++;\n } else if (m === ')') {\n numGroupsOpen--;\n if (!numGroupsOpen) {\n contentsEndPos = match.index;\n break;\n }\n }\n } else if (m === ']') {\n numCharClassesOpen--;\n }\n }\n return expression.slice(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1C,QAASZ,EAAI,EAAGA,GAAKxB,EAAMwB,IACzBoB,EAAQ,KAAKC,EAAKT,EAAoBZ,CAAE,MAI1C,SAASA,EAAI,EAAGA,GAAKxB,EAAMwB,IACzBoB,EAAQ,KAAKC,EAAIH,EAA0BD,EAAqBjB,CAAE,EAIxEc,EAAoB,IAAIK,EAAOC,CAAO,CACxC,CAAC,EACMN,CACT,CACA,OAAOzD,CACT", "names": ["index_exports", "__export", "recursion", "Context", "replaceUnescaped", "expression", "needle", "replacement", "context", "re", "negated", "numCharClassesOpen", "result", "match", "m", "$skip", "forEachUnescaped", "callback", "execUnescaped", "pos", "hasUnescaped", "getGroupContents", "contentsStartPos", "token", "contentsEndPos", "numGroupsOpen", "r", "gRToken", "recursiveToken", "namedCaptureDelim", "captureDelim", "token", "overlappingRecursionMsg", "recursion", "pattern", "data", "hiddenCaptures", "mode", "captureTransfers", "hasUnescaped", "Context", "addedHiddenCaptures", "hasNumberedBackref", "groupContentsStartPos", "openGroups", "hasRecursed", "numCharClassesOpen", "numCapturesPassed", "match", "m", "captureName", "rDepth", "gRNameOrNum", "gRDepth", "assertMaxInBounds", "left", "right", "reps", "makeRecursive", "mapCaptureTransfers", "isWithinReffedGroup", "g", "startPos", "groupContents", "getGroupContents", "groupContentsLeft", "groupContentsRight", "numAddedHiddenCapturesPreExpansion", "expansion", "pre", "post", "isUnnamedCapture", "max", "errMsg", "isSubpattern", "namesInRecursed", "forEachUnescaped", "rest", "repeatWithDepth", "direction", "getDepthNum", "i", "result", "depthNum", "replaceUnescaped", "unnamed", "backref", "suffix", "addedCaptureNum", "incrementIfAtLeast", "arr", "threshold", "numCapturesAddedInExpansion", "numCapturesInLeft", "recursionDelimCaptureNum", "newCaptureTransfers", "from", "to", "numCapturesInRight", "numCapturesAddedInLeft", "newTo", "newFrom", "f"] }