Lines 2922-2962javascript
2922 triviaCaptureNames: /* @__PURE__ */ new Map(),
2923 triviaFnNames: /* @__PURE__ */ new Map(),
2925 capturing: hasNodeDef(combinator),
2926 lazyUsage: analyzeLazyUsage(combinator)
2928 const r = emit(combinator, ctx, "_pos");
2929 const collatorDecl = ctx.needsCollator ? `const _collator = new Intl.Collator(undefined, { sensitivity: 'accent' })
2931 const namedPrelude = ctx.namedFnDecls.length > 0 ? [...namedFnPrelude(), ""] : [];
2936 ctx.namedFnDecls.join("\n\n"),
2937 `${collatorDecl}function _parse(input, _pos, _rp, _mf, _build, _ctx) {`,
2940 ` return { ok: true, value: ${r.valueVar}, span: { start: _pos, end: ${r.endVar} } }`,
2943 const fn = new Function("input", "_pos", "_rp", "_mf", "_build", "_ctx", [
2944 ...ctx.regexDecls,
LowEval
Package source references a known benign dynamic code generation pattern.
dist/plugin/index.jsView on unpkg · L2942 2947 ...ctx.namedFnDecls.flatMap((decl, i) => i > 0 ? ["", decl] : [decl]),
2950 `return { ok: true, value: ${r.valueVar}, span: { start: _pos, end: ${r.endVar} } }`
2952 const defaultCtx = {
2954 ...ctx.triviaKindLabels ? { triviaKindLabels: ctx.triviaKindLabels } : {}
2956 const derivedSrcs = ctx.mapFnSrcs.length === ctx.mapFns.length && ctx.mapFnSrcs.every((s) => s !== null) ? ctx.mapFnSrcs : void 0;
2957 const effectiveSources = mapFnSources ?? derivedSrcs;
2958 const buildCovered = ctx.buildFns.length === 0 || ctx.buildSrcs.every((s) => s !== null);
2959 const buildSources = ctx.buildFns.length === 0 ? void 0 : ctx.buildSrcs;
2960 const mfCovered = ctx.mapFns.length === 0 || effectiveSources !== void 0 && effectiveSources.length === ctx.mapFns.length;
2961 const canInline = ctx.runtimeParsers.length === 0 && mfCovered && buildCovered;
2962 const inlineExpression = canInline ? buildInlineExpression(ctx, r, collatorDecl, effectiveSources, buildSources) : null;