parseman 0.12.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/combinators/expect.d.ts.map +1 -1
  2. package/dist/combinators/node.d.ts +1 -1
  3. package/dist/combinators/node.d.ts.map +1 -1
  4. package/dist/combinators/parser.d.ts.map +1 -1
  5. package/dist/combinators/regex-analyze.d.ts +6 -0
  6. package/dist/combinators/regex-analyze.d.ts.map +1 -0
  7. package/dist/combinators/regex.d.ts +16 -1
  8. package/dist/combinators/regex.d.ts.map +1 -1
  9. package/dist/compiler/build-arity.d.ts.map +1 -1
  10. package/dist/compiler/codegen.d.ts +45 -0
  11. package/dist/compiler/codegen.d.ts.map +1 -1
  12. package/dist/compiler/inline-build.d.ts.map +1 -1
  13. package/dist/compiler/linker.d.ts +44 -0
  14. package/dist/compiler/linker.d.ts.map +1 -0
  15. package/dist/compiler/scannable-run.d.ts +80 -2
  16. package/dist/compiler/scannable-run.d.ts.map +1 -1
  17. package/dist/cst/offset-model.d.ts +119 -0
  18. package/dist/cst/offset-model.d.ts.map +1 -0
  19. package/dist/cst/relative-spans.d.ts +56 -0
  20. package/dist/cst/relative-spans.d.ts.map +1 -0
  21. package/dist/cst/types.d.ts +1 -1
  22. package/dist/functional/doc.d.ts +26 -6
  23. package/dist/functional/doc.d.ts.map +1 -1
  24. package/dist/functional/run.d.ts +63 -0
  25. package/dist/functional/run.d.ts.map +1 -0
  26. package/dist/index.cjs +1613 -148
  27. package/dist/index.cjs.map +4 -4
  28. package/dist/index.d.ts +11 -3
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +1613 -148
  31. package/dist/index.js.map +4 -4
  32. package/dist/plugin/evaluator.d.ts.map +1 -1
  33. package/dist/plugin/index.cjs +1520 -187
  34. package/dist/plugin/index.cjs.map +4 -4
  35. package/dist/plugin/index.d.ts.map +1 -1
  36. package/dist/plugin/index.js +1520 -187
  37. package/dist/plugin/index.js.map +4 -4
  38. package/dist/types.d.ts +12 -3
  39. package/dist/types.d.ts.map +1 -1
  40. package/package.json +7 -4
  41. package/dist/combinators/lazy.d.ts +0 -14
  42. package/dist/combinators/lazy.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/combinators/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,UAAU,EAAE,MAAM,aAAa,CAAA;AAEhG,YAAY,EAAE,UAAU,EAAE,CAAA;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAoB/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAmB/F"}
1
+ {"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/combinators/expect.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,UAAU,EAAE,MAAM,aAAa,CAAA;AAEhG,YAAY,EAAE,UAAU,EAAE,CAAA;AAE1B;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CA2B/D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,GAAG,UAAU,CAAC,CAmB/F"}
@@ -33,5 +33,5 @@ export type BuildNode<N> = (children: ReadonlyArray<unknown>, rawChildren: Reado
33
33
  export type NodeOptions = {
34
34
  collapse?: boolean;
35
35
  };
36
- export declare function node<N>(type: string, combinator: Combinator<unknown>, build: BuildNode<N>, opts?: NodeOptions): Combinator<N>;
36
+ export declare function node<N>(type: string, combinator: Combinator<unknown>, build?: BuildNode<N>, opts?: NodeOptions): Combinator<N>;
37
37
  //# sourceMappingURL=node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/combinators/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAoD,MAAM,aAAa,CAAA;AAI/F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CACzB,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,EAChC,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,EACnC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACpC,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,KAAK,EAAE,OAAO,KACX,CAAC,CAAA;AAEN;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAShD,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,CA8C7H"}
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/combinators/node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAoD,MAAM,aAAa,CAAA;AAI/F;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CACzB,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,EAChC,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,EACnC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACpC,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,KAAK,EAAE,OAAO,KACX,CAAC,CAAA;AAEN;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAShD,wBAAgB,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,CAmD9H"}
@@ -1 +1 @@
1
- {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/combinators/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAG7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EACjE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,GACxB,CAAC,CAmCH"}
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/combinators/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAG7C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EACjE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,GACxB,CAAC,CAwCH"}
@@ -0,0 +1,6 @@
1
+ import type { FirstSet } from '../types.ts';
2
+ export declare function firstSetFromRegex(pattern: string): {
3
+ firstSet: FirstSet;
4
+ canMatchNewline: boolean;
5
+ };
6
+ //# sourceMappingURL=regex-analyze.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regex-analyze.d.ts","sourceRoot":"","sources":["../../src/combinators/regex-analyze.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAG3C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAOnG"}
@@ -1,3 +1,18 @@
1
- import type { Combinator } from '../types.ts';
1
+ import type { Combinator, FirstSet } from '../types.ts';
2
+ /**
3
+ * Computes a regex terminal's first-set (for choice-dispatch fast paths). The
4
+ * only implementation — `firstSetFromRegex` in `./regex-analyze.ts` — is backed
5
+ * by `regexp-tree` (~264 KB) and is registered by the interpreter/library entry
6
+ * (`index.ts`) via `registerRegexAnalyzer`. It is injected rather than imported
7
+ * so that consumers who ship only compiled grammars (or import `regex` directly
8
+ * from this subpath) never pull `regexp-tree` into their bundle. When no
9
+ * analyzer is registered, `regex()` uses the permissive `PERMISSIVE_FIRST_SET`
10
+ * below — this only disables the dispatch fast paths, never changing matches.
11
+ */
12
+ export type RegexFirstSetAnalyzer = (pattern: string) => {
13
+ firstSet: FirstSet;
14
+ canMatchNewline: boolean;
15
+ };
16
+ export declare function registerRegexAnalyzer(analyzer: RegexFirstSetAnalyzer): void;
2
17
  export declare function regex(pattern: string | RegExp, flags?: string): Combinator<string>;
3
18
  //# sourceMappingURL=regex.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/combinators/regex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAmD,MAAM,aAAa,CAAA;AA6H9F,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,SAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CA0B9E"}
1
+ {"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/combinators/regex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,QAAQ,EAAE,MAAM,aAAa,CAAA;AAK9F;;;;;;;;;GASG;AACH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAAA;AAIzG,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,qBAAqB,GAAG,IAAI,CAE3E;AAQD,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,SAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAyB9E"}
@@ -1 +1 @@
1
- {"version":3,"file":"build-arity.d.ts","sourceRoot":"","sources":["../../src/compiler/build-arity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;;;;;;;;;GAUG;AAEH,KAAK,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAkBlD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuB9D;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKtD;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAKrD"}
1
+ {"version":3,"file":"build-arity.d.ts","sourceRoot":"","sources":["../../src/compiler/build-arity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAE5C;;;;;;;;;;GAUG;AAEH,KAAK,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAkBlD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAuB9D;AAED,sFAAsF;AACtF,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAMtD;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAMrD"}
@@ -31,6 +31,15 @@ export type CompiledParser<T> = {
31
31
  */
32
32
  inlineExpression: string | null;
33
33
  };
34
+ /**
35
+ * Dependency manifest for the linkable form: for each rule in the map, the set
36
+ * of OTHER rule names its body references (by name). A referenced rule is a
37
+ * boundary — we record the edge and do NOT descend into it (its own deps are its
38
+ * own entry). Used by the linker for à la carte dep-closure selection and the
39
+ * compose-time name-closure check (every referenced name must resolve in the
40
+ * final set). Self-references are included (a recursive rule depends on itself).
41
+ */
42
+ export declare function ruleDependencies(ruleMap: ReadonlyArray<readonly [string, Combinator<unknown>]>): Map<string, string[]>;
34
43
  /**
35
44
  * Compile a combinator tree into an optimized parse function at runtime.
36
45
  *
@@ -74,4 +83,40 @@ export declare function compileRuleMap(ruleMap: ReadonlyArray<readonly [string,
74
83
  keys: string[];
75
84
  replacement: string;
76
85
  } | null;
86
+ /**
87
+ * The linkable form of a rule map (RULE_ABI_PLAN §3): the same compiled rule
88
+ * bodies as `compileRuleMap`, but returned as **splice-able pieces** under a
89
+ * namespace `ns` so multiple independently-compiled maps fuse into one scope
90
+ * (see `fuseRules`). `ns` MUST be non-empty and unique per artifact (the caller
91
+ * derives it — module identity in the macro, a counter in `compile()`).
92
+ *
93
+ * prelude — namespaced hoisted decls (regexes, expected, `_mf`/`_build`, and
94
+ * private `_pf` helper fns). Sentinels / `_EMPTY_TL` / `_collator`
95
+ * are NOT here — they are SHARED, emitted once by the linker.
96
+ * ruleFns — name → `function _r_<Name>(…) { … }` source (the composition
97
+ * surface; siblings call these by name).
98
+ * wrappers — name → public `(input,pos,ctx) => ParseResult` wrapper source.
99
+ * deps — name → referenced rule names (from `ruleDependencies`).
100
+ *
101
+ * Returns null on the same "can't inline" conditions as `compileRuleMap`.
102
+ */
103
+ export type LinkablePieces = {
104
+ ns: string;
105
+ keys: string[];
106
+ prelude: string[];
107
+ ruleFns: Map<string, string>;
108
+ wrappers: Map<string, string>;
109
+ deps: Map<string, string[]>;
110
+ needsEmptyTl: boolean;
111
+ needsCollator: boolean;
112
+ /**
113
+ * Transform (`_mf`) / build (`_build`) callback FUNCTIONS, injected into the
114
+ * fused scope via `_env` when their SOURCE isn't available (runtime `compile()`
115
+ * mode). Empty when the callbacks were inlined from source (macro mode). Keyed
116
+ * for `_env` as `<ns>mf` / `<ns>build`.
117
+ */
118
+ mfFns: ReadonlyArray<(...args: unknown[]) => unknown>;
119
+ buildFns: ReadonlyArray<(...args: unknown[]) => unknown>;
120
+ };
121
+ export declare function compileLinkable(ruleMapArg: ReadonlyArray<readonly [string, Combinator<unknown>]>, ns: string): LinkablePieces | null;
77
122
  //# sourceMappingURL=codegen.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/compiler/codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,UAAU,EAAuB,WAAW,EAAE,YAAY,EAAE,UAAU,EAAkB,MAAM,aAAa,CAAA;AA0azH,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAA0B;AA83CjF,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI;IAC9B,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;IAClD,kGAAkG;IAClG,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE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CAAC,CAAA;IAC7B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC3B,YAAY,EAAE,OAAO,CAAA;IACrB,aAAa,EAAE,OAAO,CAAA;IACtB;;;;;OAKG;IACH,KAAK,EAAE,aAAa,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAA;IACrD,QAAQ,EAAE,aAAa,CAAC,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAA;CACzD,CAAA;AAED,wBAAgB,eAAe,CAC7B,UAAU,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,EACjE,EAAE,EAAE,MAAM,GACT,cAAc,GAAG,IAAI,CAwJvB"}
@@ -1 +1 @@
1
- {"version":3,"file":"inline-build.d.ts","sourceRoot":"","sources":["../../src/compiler/inline-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAiB5C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,GAAG,IAAI,CAS5F;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,MAAM,CAER"}
1
+ {"version":3,"file":"inline-build.d.ts","sourceRoot":"","sources":["../../src/compiler/inline-build.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAiB5C;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,GAAG,IAAI,CAU5F;AAED,gFAAgF;AAChF,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,MAAM,CAER"}
@@ -0,0 +1,44 @@
1
+ import type { LinkablePieces } from './codegen.ts';
2
+ import type { Combinator } from '../types.ts';
3
+ export declare function linkable(rulesMap: Record<string, Combinator<unknown>>, ns?: string): LinkablePieces;
4
+ /**
5
+ * A generic positioned-CST build host (RULE_ABI_PLAN §7). Pass as `ctx.build`
6
+ * (or `parseDoc(..., { build: cstBuildHost })`) to make ANY linkable/fused
7
+ * grammar produce a uniform CST — `{ _tag:'node', type, span, state, children }`
8
+ * — instead of its own eval-AST builders. This is the host the linter and IDE
9
+ * drivers use; the eval driver leaves `ctx.build` unset (grammar's own builders).
10
+ */
11
+ export declare function cstBuildHost(type: string, children: ReadonlyArray<unknown>, _rawChildren: ReadonlyArray<unknown>, span: {
12
+ start: number;
13
+ end: number;
14
+ }, _triviaLog?: readonly number[], state?: unknown): unknown;
15
+ export type FusedRule = (input: string, pos: number, ctx: Record<string, unknown>) => {
16
+ ok: boolean;
17
+ value?: unknown;
18
+ span: {
19
+ start: number;
20
+ end: number;
21
+ };
22
+ };
23
+ /**
24
+ * Restrict a grammar/artifact to `names` plus their transitive rule-dependency
25
+ * closure (à la carte selection) — e.g. Jess taking parts of Less and parts of
26
+ * Sass: `compose([pick(less, ['MixinCall']), pick(sass, ['EachFor']), css])`. A
27
+ * picked rule pulls in every rule name it references, so the result is always
28
+ * self-consistent within the artifact. Accepts a grammar (`rules()` result) or a
29
+ * compiled artifact; returns an artifact for `compose()`.
30
+ */
31
+ export declare function pick(grammar: LinkablePieces | Record<string, Combinator<unknown>>, names: string[]): LinkablePieces;
32
+ /** Fuse at RUNTIME (via `new Function`) — used by `compose()` when not compiled
33
+ * by the macro (like `compile()`). The macro path uses `emitFusedSource` instead. */
34
+ export declare function fuseRules(pieces: LinkablePieces[]): Record<string, FusedRule>;
35
+ /**
36
+ * Fuse at BUILD time — emit the fused closure as a self-contained SOURCE
37
+ * expression (`(() => { … })()`), with **no `new Function`**. This is what the
38
+ * macro splices in for a `compose([...])` call, so macro output stays eval-free.
39
+ * Requires every callback to be inlined from source (macro mode); throws if any
40
+ * artifact carries runtime-only callback functions.
41
+ */
42
+ export declare function emitFusedSource(pieces: LinkablePieces[]): string;
43
+ export declare function compose(items: Array<LinkablePieces | Record<string, unknown>>): Record<string, FusedRule>;
44
+ //# sourceMappingURL=linker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../src/compiler/linker.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAa7C,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAC7C,EAAE,CAAC,EAAE,MAAM,GACV,cAAc,CAIhB;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,EAChC,YAAY,EAAE,aAAa,CAAC,OAAO,CAAC,EACpC,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACpC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,EAC9B,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAIT;AAED,MAAM,MAAM,SAAS,GAAG,CACtB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACzB;IAAE,EAAE,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAA;AAE3E;;;;;;;GAOG;AACH,wBAAgB,IAAI,CAClB,OAAO,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAC7D,KAAK,EAAE,MAAM,EAAE,GACd,cAAc,CA2BhB;AA+CD;qFACqF;AACrF,wBAAgB,SAAS,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAI7E;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAMhE;AA8BD,wBAAgB,OAAO,CACrB,KAAK,EAAE,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACrD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAK3B"}
@@ -7,6 +7,13 @@
7
7
  * [X]+ / [X]* → run while the char ∈ X (chars)
8
8
  * <lit>[^X]* → consume <lit>, run until char ∈ X (until)
9
9
  * <open>(?:…)*<close> → consume <open>, run to <close> literal (delimited)
10
+ * x?<lit><[X]*>… → a general linear chain of lit/run (seq)
11
+ *
12
+ * `seq` is the CATEGORY generalization: any chain of literal segments (required
13
+ * or optional `x?`) and char-class runs (positive/negated, `?`/`*`/`+`). It
14
+ * subsumes CSS/Less `-?ident`, `--custom`, `@-?keyword`, `[^…]+`, `::?`, etc.
15
+ * without hardcoding a single byte — lowered only when a greedy one-pass scan
16
+ * provably equals the engine's backtracking (see `seqIsUnambiguous`).
10
17
  *
11
18
  * A `oneOrMore(choice(a, b, …))` where every arm is one of these compiles to a
12
19
  * single char-dispatch loop with one branch per arm — any count/order, because
@@ -14,6 +21,40 @@
14
21
  * (whitespace + comments) is just the value-discarded instance of this; nothing
15
22
  * here is trivia-specific.
16
23
  */
24
+ /**
25
+ * One segment of a `seq` shape. A `seq` is the general category "a fixed linear
26
+ * chain of literals and char-class runs" — no alternation, no groups, no
27
+ * backtracking. It subsumes every CSS/Less token that is "(optional prefix)?
28
+ * literal* char-run* …" without hardcoding any particular byte:
29
+ *
30
+ * lit — a run of fixed code points, optionally present (`x?`) or required.
31
+ * run — a char-class run: positive/negated ranges, min 0/1, bounded to one
32
+ * char (`[x]`, `[x]?`) or unbounded (`[x]*`, `[x]+`).
33
+ * group — a non-capturing sub-pattern `(?:…)` (§8f), quantified the same way
34
+ * as `run` (`min`/`unbounded`). `inner` is any already-recognized
35
+ * `ScanShape` for the group's body (so a group can itself contain
36
+ * `seq`/`chars`/`alt`/… — including a nested alternation via §8e).
37
+ * Only used when `groupInnerSafe(inner)` holds (see that function).
38
+ *
39
+ * We only lower a `seq` when greedy left-to-right scanning provably equals the
40
+ * regex engine's backtracking match (see `seqIsUnambiguous`).
41
+ */
42
+ export type SeqPart = {
43
+ part: 'lit';
44
+ cps: number[];
45
+ optional: boolean;
46
+ } | {
47
+ part: 'run';
48
+ ranges: Array<[number, number]>;
49
+ negated: boolean;
50
+ min: 0 | 1;
51
+ unbounded: boolean;
52
+ } | {
53
+ part: 'group';
54
+ inner: ScanShape;
55
+ min: 0 | 1;
56
+ unbounded: boolean;
57
+ };
17
58
  export type ScanShape = {
18
59
  kind: 'chars';
19
60
  ranges: Array<[number, number]>;
@@ -35,13 +76,49 @@ export type ScanShape = {
35
76
  quote: number;
36
77
  excluded: Array<[number, number]>;
37
78
  escLineTerm: boolean;
79
+ } | {
80
+ kind: 'seq';
81
+ parts: SeqPart[];
82
+ } | {
83
+ kind: 'litFold';
84
+ open: number[];
85
+ } | {
86
+ kind: 'lookahead';
87
+ inner: ScanShape;
88
+ ranges: Array<[number, number]>;
89
+ classNegated: boolean;
90
+ negative: boolean;
91
+ } | {
92
+ kind: 'alt';
93
+ arms: ScanShape[];
94
+ disjoint: boolean;
95
+ firsts: Array<CharSet | null>;
38
96
  };
39
97
  /** Backslash (`\`) code point — the escape lead char in string shapes. */
40
98
  export declare const BACKSLASH = 92;
99
+ /**
100
+ * `\s`'s code-point set per the spec's `WhiteSpace` + `LineTerminator`
101
+ * productions — TAB/LF/VT/FF/CR, SPACE, NBSP, and the Unicode `Zs` space
102
+ * separators. This set is fixed regardless of the `u` flag (unlike `\d`/`\w`,
103
+ * which are ASCII-only without `u` but widen with it), so it's always safe to
104
+ * lower to a fixed range scan.
105
+ */
106
+ export declare const SPACE_RANGES: Array<[number, number]>;
107
+ export declare function parseClassRanges(body: string): Array<[number, number]> | null;
108
+ type CharSet = {
109
+ ranges: Array<[number, number]>;
110
+ negated: boolean;
111
+ };
41
112
  /**
42
113
  * Recognize one scannable arm from its regex source, or null if it isn't one of
43
- * the structural shapes. Order matters: char-class run, ident, string, then
44
- * open-until-terminator, then delimited.
114
+ * the structural shapes. Top-level alternation (§8e) is tried FIRST — `|` has
115
+ * the lowest precedence in regex, so splitting on it happens before anything
116
+ * else, with each arm then recursively re-entering this same function (so an
117
+ * arm's own trailing lookahead, or its own nested `(?:…)`-wrapped alternation,
118
+ * is still recognized). Failing that: char-class run, ident, string, then
119
+ * open-until-terminator, delimited, and finally the general linear `seq` chain.
120
+ * A trailing `(?!class)`/`(?=class)` is peeled off next (§8b) and re-wraps
121
+ * whatever shape the remaining base recognizes as.
45
122
  */
46
123
  export declare function parseScanShape(source: string): ScanShape | null;
47
124
  /**
@@ -95,4 +172,5 @@ export declare function scanBranch(shape: ScanShape, mint: Mint): string;
95
172
  * kindIndex] trivia chunk. Same completion semantics as scanBranch.
96
173
  */
97
174
  export declare function scanBranchLabeled(shape: ScanShape, kindIndex: number, mint: Mint): string;
175
+ export {};
98
176
  //# sourceMappingURL=scannable-run.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scannable-run.d.ts","sourceRoot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* The premise (see docs): most trivia carries nothing that isn't already implied
6
+ * by the source offsets of the tokens around it. A gap between a slot ending at
7
+ * 100 and the next starting at 103 IS three characters of trivia — known without
8
+ * storing anything. So we store only the slot boundaries (which the tree already
9
+ * has) and reconstruct trivia from them:
10
+ *
11
+ * - exact printing: slice the source between two slots (`gapText`);
12
+ * - inference: widths / indents / alignment / blank-lines are subtraction;
13
+ * - positional queries: binary search over the sorted slot array (O(log n)),
14
+ * collapsing the old double-indexed before/after maps into one index.
15
+ *
16
+ * A "slot" is a leaf token's source span. Trivia lives in the GAPS between
17
+ * consecutive slots (plus the leading gap before the first slot and the trailing
18
+ * gap after the last). Gaps are fully determined by the sorted slot list, so
19
+ * there is no separate trivia store for whitespace at all.
20
+ */
21
+ /** A leaf token's source span — the anchor points; trivia is between them. */
22
+ export type Slot = {
23
+ readonly start: number;
24
+ readonly end: number;
25
+ };
26
+ /** A trivia region between two slots (or a document boundary). Half-open `[start, end)`. */
27
+ export type Gap = {
28
+ readonly start: number;
29
+ readonly end: number;
30
+ };
31
+ /**
32
+ * A positional index over an ordered set of slots (leaf spans) within a source
33
+ * of length `docEnd`. Answers "what trivia is before/after/around this offset"
34
+ * by binary search, and reconstructs the exact trivia text by slicing `source`.
35
+ *
36
+ * Slots must be non-overlapping. They are sorted by `start` on construction;
37
+ * out-of-order or overlapping input throws (the caller's spans are wrong).
38
+ */
39
+ export declare class OffsetIndex {
40
+ /** Slot starts, sorted ascending. Parallel to `_ends`. */
41
+ private readonly _starts;
42
+ private readonly _ends;
43
+ readonly count: number;
44
+ readonly docStart: number;
45
+ readonly docEnd: number;
46
+ constructor(slots: readonly Slot[], docStart?: number, docEnd?: number);
47
+ /** The slot at index `i` (0-based, source order), or undefined. */
48
+ slot(i: number): Slot | undefined;
49
+ /**
50
+ * Index of the gap that CONTAINS `offset`, in `[0, count]`. Gap `i` spans
51
+ * `[endOf(i-1), startOf(i))` where `endOf(-1)=docStart` and `startOf(count)=docEnd`.
52
+ * An offset that lands inside a slot returns that slot's TRAILING gap index
53
+ * (i.e. the gap after it) — callers querying at slot boundaries get the
54
+ * intuitive answer via `gapBefore`/`gapAfter`.
55
+ */
56
+ gapIndexAt(offset: number): number;
57
+ /** The gap at index `i` in `[0, count]`. */
58
+ gap(i: number): Gap | undefined;
59
+ /**
60
+ * The trivia gap immediately BEFORE `offset` (`[prevSlotEnd, offset)`), where
61
+ * `prevSlotEnd` is the end of the last slot ending at or before `offset` (or
62
+ * `docStart`). For a real slot start this is the gap preceding that slot; for an
63
+ * adjacent slot the gap is empty and agrees with `gapAfter` on the same seam.
64
+ */
65
+ gapBefore(offset: number): Gap | undefined;
66
+ /**
67
+ * The trivia gap immediately AFTER `offset` (`[offset, nextSlotStart)`), where
68
+ * `nextSlotStart` is the least slot start at or after `offset` (or `docEnd`).
69
+ */
70
+ gapAfter(offset: number): Gap | undefined;
71
+ /** Least slot start `>= offset`, else `docEnd`. */
72
+ private _ceilStart;
73
+ /** Is this gap empty (adjacent slots, no trivia)? */
74
+ isEmpty(gap: Gap): boolean;
75
+ }
76
+ /** Exact trivia text of a gap: `source.slice(gap.start, gap.end)`. */
77
+ export declare function gapText(source: string, gap: Gap): string;
78
+ /** Count of line breaks (`\n`, with `\r\n` counted once) within a gap. */
79
+ export declare function lineBreaksIn(source: string, gap: Gap): number;
80
+ /** Blank lines in a gap = breaks - 1 (a single break is just a line end, not a blank line). */
81
+ export declare function blankLinesIn(source: string, gap: Gap): number;
82
+ /**
83
+ * Offset just after the last line break in the gap (the start of the final
84
+ * line's indent), or `gap.start` if the gap has no break. This is the ONE
85
+ * non-inferable position; every indent quantity derives from it by subtraction.
86
+ */
87
+ export declare function lineStartWithin(source: string, gap: Gap): number;
88
+ /**
89
+ * Indent width of the line the NEXT slot sits on: `nextStart - lineStart`.
90
+ * `nextStart` is `gap.end` (the following slot's start). Zero if the gap has no
91
+ * line break (the next slot is on the same line).
92
+ */
93
+ export declare function indentWidth(source: string, gap: Gap): number;
94
+ /** True if the final line's indent mixes tabs and spaces (the one case width can't capture). */
95
+ export declare function indentMixed(source: string, gap: Gap): boolean;
96
+ /** Comment spans within a gap (absolute offsets), tokenized by `comment`. */
97
+ export declare function commentsIn(source: string, gap: Gap, comment: RegExp): Span[];
98
+ /**
99
+ * Does the gap carry anything a normalizing printer must preserve? True if it
100
+ * contains a comment or a line break; a pure inline-whitespace gap returns false
101
+ * and needs no record at all (the printer re-derives canonical spacing).
102
+ */
103
+ export declare function gapIsSignificant(source: string, gap: Gap, comment?: RegExp): boolean;
104
+ /**
105
+ * Collect the leaf-token spans of a CST in source order. Nodes/errors (which
106
+ * carry `children`) are descended into; only childless spanned items (terminals)
107
+ * become slots. Node spans are skipped — they overlap their children and would
108
+ * double-cover the gaps.
109
+ */
110
+ export declare function collectLeafSlots(root: unknown): Slot[];
111
+ /**
112
+ * Build an `OffsetIndex` directly from a parseman CST root and its source. This
113
+ * is the drop-in replacement for the double-indexed `buildTriviaIndex`: the same
114
+ * before/after trivia is recovered by `gapBefore`/`gapAfter` + `gapText`, and it
115
+ * additionally supports arbitrary positional queries and inference — with nothing
116
+ * stored per whitespace gap.
117
+ */
118
+ export declare function buildOffsetIndex(root: unknown, input?: string): OffsetIndex;
119
+ //# sourceMappingURL=offset-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"offset-model.d.ts","sourceRoot":"","sources":["../../src/cst/offset-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,IAAI,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAEnE,4FAA4F;AAC5F,MAAM,MAAM,GAAG,GAAG;IAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,CA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,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,CAMhE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,MAAM,CAI5D;AAED,gGAAgG;AAChG,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,OAAO,CAU7D;AAED,6EAA6E;AAC7E,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,EAAE,CAW5E;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAKpF;AAcD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,EAAE,CAYtD;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,SAAK,GAAG,WAAW,CAEvE"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Relative span model for incremental edits.
3
+ *
4
+ * Absolute source offsets are simple but fragile: an insertion at offset `at`
5
+ * shifts EVERY downstream offset, so a whole-tree renumber is O(nodes-after-edit).
6
+ * Storing each node's span RELATIVE to its parent's start makes edits local: an
7
+ * insertion inside child k of a node only changes
8
+ * (a) child k's relative end,
9
+ * (b) the relative start of siblings after k,
10
+ * and leaves the *children* of those shifted siblings untouched — they move with
11
+ * their parent for free. So the mutation count is O(depth + trailing siblings),
12
+ * not O(all following nodes), and every unaffected subtree is shared by identity.
13
+ *
14
+ * An absolute view is recovered on query by accumulating the parent base as you
15
+ * descend (the `absolutize` / `absoluteSpanAt` cursor) — one source of truth,
16
+ * two manifestations.
17
+ */
18
+ /** A node with an ABSOLUTE source span and ordered children. */
19
+ export type AbsNode = {
20
+ readonly start: number;
21
+ readonly end: number;
22
+ readonly children: readonly AbsNode[];
23
+ };
24
+ /** A node whose `start`/`end` are RELATIVE to its parent's start (root base = 0). */
25
+ export type RelNode = {
26
+ readonly start: number;
27
+ readonly end: number;
28
+ readonly children: readonly RelNode[];
29
+ };
30
+ /** Convert an absolute tree to parent-relative spans. */
31
+ export declare function relativize(node: AbsNode, parentBase?: number): RelNode;
32
+ /** Reconstruct absolute spans from a relative tree. Inverse of `relativize`. */
33
+ export declare function absolutize(node: RelNode, parentBase?: number): AbsNode;
34
+ /**
35
+ * Absolute span of the node at `path` (child indices from the root), accumulating
36
+ * the base as it descends — O(path length), no full absolutize. The relative-form
37
+ * cursor: query any node's absolute position without materializing the whole tree.
38
+ */
39
+ export declare function absoluteSpanAt(root: RelNode, path: readonly number[]): {
40
+ start: number;
41
+ end: number;
42
+ };
43
+ /** Naive absolute reshift (baseline): shift every offset >= `at` by `delta`. */
44
+ export declare function shiftAbsolute(node: AbsNode, at: number, delta: number): AbsNode;
45
+ /**
46
+ * Apply an edit of `delta` characters at absolute offset `at` to a RELATIVE tree.
47
+ * Returns a new relative tree; every subtree that ends at/before `at` (in absolute
48
+ * terms) is returned by IDENTITY (unchanged), so the result structurally shares
49
+ * all unaffected subtrees with the input.
50
+ *
51
+ * `stats.allocated` counts nodes that had to be re-created — the incremental cost.
52
+ */
53
+ export declare function applyEdit(root: RelNode, at: number, delta: number, stats?: {
54
+ allocated: number;
55
+ }): RelNode;
56
+ //# sourceMappingURL=relative-spans.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relative-spans.d.ts","sourceRoot":"","sources":["../../src/cst/relative-spans.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,gEAAgE;AAChE,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;CACtC,CAAA;AAED,qFAAqF;AACrF,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAA;CACtC,CAAA;AAED,yDAAyD;AACzD,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,SAAI,GAAG,OAAO,CAMjE;AAED,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,UAAU,SAAI,GAAG,OAAO,CAOjE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAUrG;AAED,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ/E;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CACvB,IAAI,EAAE,OAAO,EACb,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAC5B,OAAO,CAGT"}
@@ -5,7 +5,7 @@ import type { Span } from '../types.ts';
5
5
  * and `children` works — whether from `node()` build callbacks or custom ASTs.
6
6
  *
7
7
  * `children` only needs items with `_tag` so traversal can distinguish sub-nodes
8
- * from leaves. `makeFunctionalDoc` uses an optional `rebuild` callback (or a
8
+ * from leaves. `parseDoc` uses an optional `rebuild` callback (or a
9
9
  * shallow spread) when grafting a re-parsed subtree.
10
10
  */
11
11
  export type NodeLike = {
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Functional incremental document — incremental re-parse over a rules() registry.
2
+ * Incremental parse document — incremental re-parse over a rules() registry.
3
3
  */
4
4
  import type { ParseContext, ParseFail, ParseResult } from '../types.ts';
5
5
  import type { NodeLike, CSTLeaf, CSTError } from '../cst/types.ts';
@@ -7,7 +7,7 @@ import type { NodeLike, CSTLeaf, CSTError } from '../cst/types.ts';
7
7
  export type RuleFn<N> = (input: string, pos: number, ctx: ParseContext) => ParseResult<N>;
8
8
  /** Rule name → parser function. This is exactly the shape `rules()` returns. */
9
9
  export type Registry<N> = Record<string, RuleFn<N>>;
10
- export type FunctionalDocOptions<N extends NodeLike> = {
10
+ export type ParseDocOptions<N extends NodeLike> = {
11
11
  /** Initial grammar state threaded into ctx.state for the root parse. */
12
12
  state?: unknown;
13
13
  /**
@@ -16,20 +16,40 @@ export type FunctionalDocOptions<N extends NodeLike> = {
16
16
  * works for plain-object nodes; class-instance ASTs should supply their own.
17
17
  */
18
18
  rebuild?: (node: N, children: ReadonlyArray<N | CSTLeaf | CSTError>) => N;
19
+ /**
20
+ * Mode host for a linkable/fused grammar (RULE_ABI_PLAN §7): threaded into
21
+ * `ctx.build` on every (re)parse so `node()` rules build a positioned CST /
22
+ * language-service tree instead of their own eval-AST. Unset → the grammar's
23
+ * own builders (eval mode).
24
+ */
25
+ build?: ParseContext['build'];
19
26
  };
20
- export interface FunctionalDoc<N extends NodeLike> {
27
+ export interface ParseDoc<N extends NodeLike> {
21
28
  readonly tree: N | null;
22
29
  readonly errors: ParseFail[];
23
30
  readonly input: string;
24
31
  /**
25
32
  * Incrementally re-parse after a text change. `from`/`to` are byte offsets in
26
33
  * the OLD input; `replacement` fills that range (editor change-event shape).
34
+ * Sound: the result tree is always structurally identical to a fresh
35
+ * `parseDoc` of the edited text (the Stage-2 guard falls back to a full
36
+ * reparse whenever reuse can't be proven safe). Reuse/strategy is intentionally
37
+ * NOT reported here — an observer derives it by diffing this tree against the
38
+ * previous one (see the incremental tests); the runtime's job is to be fast,
39
+ * not to measure itself.
27
40
  */
28
- edit(from: number, to: number, replacement: string): FunctionalDoc<N>;
41
+ edit(from: number, to: number, replacement: string): ParseDoc<N>;
29
42
  }
30
43
  /**
31
- * Parse `input` from `rootRule` and wrap the result in a FunctionalDoc that can
44
+ * Deep structural equality on parse trees: `_tag`, `span`, node `type`, leaf
45
+ * `value`, and children pairwise. This is the oracle relation `.edit()` must
46
+ * preserve against a full reparse; it's also what the Stage-2 guard compares
47
+ * probe results with.
48
+ */
49
+ export declare function structurallyEqual(a: unknown, b: unknown): boolean;
50
+ /**
51
+ * Parse `input` from `rootRule` and wrap the result in a ParseDoc that can
32
52
  * be incrementally re-parsed via `.edit()`.
33
53
  */
34
- export declare function makeFunctionalDoc<N extends NodeLike>(registry: Registry<N>, rootRule: string, input: string, opts?: FunctionalDocOptions<N>): FunctionalDoc<N>;
54
+ export declare function parseDoc<N extends NodeLike>(registry: Registry<N>, rootRule: string, input: string, opts?: ParseDocOptions<N>): ParseDoc<N>;
35
55
  //# sourceMappingURL=doc.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"doc.d.ts","sourceRoot":"","sources":["../../src/functional/doc.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACvE,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAElE,qFAAqF;AACrF,MAAM,MAAM,MAAM,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,KAAK,WAAW,CAAC,CAAC,CAAC,CAAA;AAEzF,gFAAgF;AAChF,MAAM,MAAM,QAAQ,CAAC,CAAC,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;AAEnD,MAAM,MAAM,oBAAoB,CAAC,CAAC,S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