parseman 0.46.0 → 0.47.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.
- package/README.md +8 -3
- package/dist/analysis/choice-cost-render.d.ts +12 -4
- package/dist/analysis/choice-cost-render.d.ts.map +1 -1
- package/dist/analysis/choice-cost.d.ts +2 -2
- package/dist/analysis/choice-cost.d.ts.map +1 -1
- package/dist/analysis/commitment.d.ts +131 -0
- package/dist/analysis/commitment.d.ts.map +1 -0
- package/dist/analysis/diagnostics.cjs +9929 -7465
- package/dist/analysis/diagnostics.cjs.map +3 -4
- package/dist/analysis/diagnostics.d.ts +2 -2
- package/dist/analysis/diagnostics.js +9929 -7465
- package/dist/analysis/diagnostics.js.map +3 -4
- package/dist/analysis/duplication.d.ts.map +1 -1
- package/dist/analysis/fix.d.ts +3 -3
- package/dist/analysis/fix.d.ts.map +1 -1
- package/dist/analysis/format-number.d.ts +23 -0
- package/dist/analysis/format-number.d.ts.map +1 -0
- package/dist/analysis/gating.d.ts +39 -2
- package/dist/analysis/gating.d.ts.map +1 -1
- package/dist/analysis/rebuild.d.ts.map +1 -1
- package/dist/analysis/terminal.d.ts +5 -2
- package/dist/analysis/terminal.d.ts.map +1 -1
- package/dist/cli/index.cjs +10865 -8535
- package/dist/cli/index.cjs.map +3 -4
- package/dist/cli/index.js +10865 -8535
- package/dist/cli/index.js.map +3 -4
- package/dist/combinators/adjacency.d.ts +100 -0
- package/dist/combinators/adjacency.d.ts.map +1 -0
- package/dist/combinators/choice.d.ts.map +1 -1
- package/dist/combinators/completions.d.ts.map +1 -1
- package/dist/combinators/dispatch.d.ts +8 -1
- package/dist/combinators/dispatch.d.ts.map +1 -1
- package/dist/combinators/expect.d.ts.map +1 -1
- package/dist/combinators/first-set.d.ts.map +1 -1
- package/dist/combinators/gate.d.ts.map +1 -1
- package/dist/combinators/grammar.d.ts +22 -0
- package/dist/combinators/grammar.d.ts.map +1 -1
- package/dist/combinators/literal.d.ts +8 -0
- package/dist/combinators/literal.d.ts.map +1 -1
- package/dist/combinators/map.d.ts +0 -1
- package/dist/combinators/map.d.ts.map +1 -1
- package/dist/combinators/node.d.ts +13 -3
- package/dist/combinators/node.d.ts.map +1 -1
- package/dist/combinators/parser.d.ts +1 -1
- package/dist/combinators/parser.d.ts.map +1 -1
- package/dist/combinators/ref.d.ts.map +1 -1
- package/dist/combinators/regex.d.ts +1 -16
- package/dist/combinators/regex.d.ts.map +1 -1
- package/dist/combinators/repeat.d.ts +30 -2
- package/dist/combinators/repeat.d.ts.map +1 -1
- package/dist/combinators/scanTo.d.ts +71 -1
- package/dist/combinators/scanTo.d.ts.map +1 -1
- package/dist/combinators/sequence.d.ts.map +1 -1
- package/dist/combinators/token.d.ts.map +1 -1
- package/dist/combinators/trivia-boundary.d.ts +26 -0
- package/dist/combinators/trivia-boundary.d.ts.map +1 -0
- package/dist/combinators/trivia-skip.d.ts +40 -1
- package/dist/combinators/trivia-skip.d.ts.map +1 -1
- package/dist/combinators/withCtx.d.ts.map +1 -1
- package/dist/compiler/compile-linkable-table.d.ts +104 -0
- package/dist/compiler/compile-linkable-table.d.ts.map +1 -0
- package/dist/compiler/degradation.d.ts +0 -2
- package/dist/compiler/degradation.d.ts.map +1 -1
- package/dist/compiler/fields.d.ts +13 -0
- package/dist/compiler/fields.d.ts.map +1 -1
- package/dist/compiler/grammar-coverage-ids.d.ts +5 -5
- package/dist/compiler/grammar-coverage-ids.d.ts.map +1 -1
- package/dist/compiler/ir-serialize.d.ts.map +1 -1
- package/dist/compiler/linker.d.ts +47 -53
- package/dist/compiler/linker.d.ts.map +1 -1
- package/dist/compiler/token-alphabet.d.ts +81 -0
- package/dist/compiler/token-alphabet.d.ts.map +1 -0
- package/dist/compiler/token-dispatch.d.ts +95 -0
- package/dist/compiler/token-dispatch.d.ts.map +1 -0
- package/dist/compiler/token-scanner.d.ts +53 -0
- package/dist/compiler/token-scanner.d.ts.map +1 -0
- package/dist/compiler/value-usage.d.ts.map +1 -1
- package/dist/coverage.d.ts +1 -1
- package/dist/coverage.d.ts.map +1 -1
- package/dist/cst/capture-buffer.d.ts +35 -0
- package/dist/cst/capture-buffer.d.ts.map +1 -1
- package/dist/cst/reflection-attach.d.ts +8 -0
- package/dist/cst/reflection-attach.d.ts.map +1 -0
- package/dist/cst/reflection-symbols.d.ts +10 -0
- package/dist/cst/reflection-symbols.d.ts.map +1 -0
- package/dist/cst/reflection.d.ts +2 -4
- package/dist/cst/reflection.d.ts.map +1 -1
- package/dist/cst/root-trivia-scope.d.ts +26 -0
- package/dist/cst/root-trivia-scope.d.ts.map +1 -0
- package/dist/cst/trivia-charscan.d.ts +18 -0
- package/dist/cst/trivia-charscan.d.ts.map +1 -0
- package/dist/cst/trivia-kinds.d.ts +19 -0
- package/dist/cst/trivia-kinds.d.ts.map +1 -1
- package/dist/functional/doc.d.ts.map +1 -1
- package/dist/functional/run-tabled.d.ts +12 -0
- package/dist/functional/run-tabled.d.ts.map +1 -0
- package/dist/functional/run.d.ts +25 -42
- package/dist/functional/run.d.ts.map +1 -1
- package/dist/grammar-metadata.d.ts +3 -0
- package/dist/grammar-metadata.d.ts.map +1 -0
- package/dist/index.cjs +9224 -7203
- package/dist/index.cjs.map +3 -4
- package/dist/index.d.ts +18 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9219 -7198
- package/dist/index.js.map +3 -4
- package/dist/language-service/index.cjs +311 -121
- package/dist/language-service/index.cjs.map +3 -4
- package/dist/language-service/index.js +311 -121
- package/dist/language-service/index.js.map +3 -4
- package/dist/oracle/index.cjs.map +0 -1
- package/dist/oracle/index.js.map +0 -1
- package/dist/parse-context.d.ts +49 -0
- package/dist/parse-context.d.ts.map +1 -0
- package/dist/plugin/evaluator.d.ts +40 -1
- package/dist/plugin/evaluator.d.ts.map +1 -1
- package/dist/plugin/index.cjs +11146 -9593
- package/dist/plugin/index.cjs.map +3 -4
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +11146 -9593
- package/dist/plugin/index.js.map +3 -4
- package/dist/regex/classes.d.ts +28 -0
- package/dist/regex/classes.d.ts.map +1 -1
- package/dist/regex/first-set.d.ts +14 -0
- package/dist/regex/first-set.d.ts.map +1 -1
- package/dist/run/index.cjs +136 -51
- package/dist/run/index.cjs.map +2 -3
- package/dist/run/index.js +136 -51
- package/dist/run/index.js.map +2 -3
- package/dist/spec/index.cjs +2898 -1623
- package/dist/spec/index.cjs.map +3 -4
- package/dist/spec/index.js +2898 -1623
- package/dist/spec/index.js.map +3 -4
- package/dist/spec/model.d.ts +8 -0
- package/dist/spec/model.d.ts.map +1 -1
- package/dist/table/assemble.d.ts +307 -0
- package/dist/table/assemble.d.ts.map +1 -0
- package/dist/table/cell.d.ts +42 -0
- package/dist/table/cell.d.ts.map +1 -0
- package/dist/table/child-slots.d.ts +30 -0
- package/dist/table/child-slots.d.ts.map +1 -0
- package/dist/table/compile-rule-map.d.ts +136 -0
- package/dist/table/compile-rule-map.d.ts.map +1 -0
- package/dist/table/compile.d.ts +56 -0
- package/dist/table/compile.d.ts.map +1 -0
- package/dist/table/duplication-hook.d.ts +32 -0
- package/dist/table/duplication-hook.d.ts.map +1 -0
- package/dist/table/emit-assembly.d.ts +139 -0
- package/dist/table/emit-assembly.d.ts.map +1 -0
- package/dist/table/emit.d.ts +113 -0
- package/dist/table/emit.d.ts.map +1 -0
- package/dist/table/encode-baseline.d.ts +16 -0
- package/dist/table/encode-baseline.d.ts.map +1 -0
- package/dist/table/encode.d.ts +71 -0
- package/dist/table/encode.d.ts.map +1 -0
- package/dist/table/exec-baseline.d.ts +9 -0
- package/dist/table/exec-baseline.d.ts.map +1 -0
- package/dist/table/exec.d.ts +72 -0
- package/dist/table/exec.d.ts.map +1 -0
- package/dist/table/fold.d.ts +25 -0
- package/dist/table/fold.d.ts.map +1 -0
- package/dist/table/index.cjs +11375 -0
- package/dist/table/index.cjs.map +6 -0
- package/dist/table/index.d.ts +100 -0
- package/dist/table/index.d.ts.map +1 -0
- package/dist/table/index.js +11352 -0
- package/dist/table/index.js.map +6 -0
- package/dist/table/inspect.d.ts +17 -0
- package/dist/table/inspect.d.ts.map +1 -0
- package/dist/table/ops.d.ts +446 -0
- package/dist/table/ops.d.ts.map +1 -0
- package/dist/table/program.d.ts +493 -0
- package/dist/table/program.d.ts.map +1 -0
- package/dist/table/run-support.d.ts +38 -0
- package/dist/table/run-support.d.ts.map +1 -0
- package/dist/{compiler/scannable-run.d.ts → table/scan-shapes.d.ts} +14 -13
- package/dist/table/scan-shapes.d.ts.map +1 -0
- package/dist/table/site-labels.d.ts +58 -0
- package/dist/table/site-labels.d.ts.map +1 -0
- package/dist/table/stamp.d.ts +70 -0
- package/dist/table/stamp.d.ts.map +1 -0
- package/dist/types.d.ts +80 -24
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +25 -2
- package/src/analysis/choice-cost-gate.ts +359 -0
- package/src/analysis/choice-cost-render.ts +293 -0
- package/src/analysis/choice-cost.ts +1008 -0
- package/src/analysis/commitment.ts +557 -0
- package/src/analysis/corpus.ts +130 -0
- package/src/analysis/diagnose-render.ts +625 -0
- package/src/analysis/diagnose.ts +317 -0
- package/src/analysis/diagnostics.ts +33 -0
- package/src/analysis/duplication.ts +1955 -0
- package/src/analysis/fix-render.ts +217 -0
- package/src/analysis/fix.ts +669 -0
- package/src/analysis/format-number.ts +31 -0
- package/src/analysis/gating.ts +792 -0
- package/src/analysis/grammar.ts +72 -0
- package/src/analysis/rebuild.ts +287 -0
- package/src/analysis/terminal.ts +336 -0
- package/src/cli/index.ts +413 -0
- package/src/combinators/adjacency.ts +171 -0
- package/src/combinators/attempt.ts +41 -0
- package/src/combinators/case-fold.ts +90 -0
- package/src/combinators/choice.ts +466 -0
- package/src/combinators/completions.ts +64 -0
- package/src/combinators/dispatch.ts +358 -0
- package/src/combinators/expect.ts +159 -0
- package/src/combinators/first-set.ts +322 -0
- package/src/combinators/gate.ts +50 -0
- package/src/combinators/grammar.ts +272 -0
- package/src/combinators/keywords.ts +145 -0
- package/src/combinators/literal.ts +102 -0
- package/src/combinators/map.ts +106 -0
- package/src/combinators/node.ts +345 -0
- package/src/combinators/not.ts +55 -0
- package/src/combinators/parser.ts +266 -0
- package/src/combinators/peek.ts +63 -0
- package/src/combinators/probe.ts +25 -0
- package/src/combinators/ref.ts +109 -0
- package/src/combinators/regex.ts +170 -0
- package/src/combinators/repeat.ts +561 -0
- package/src/combinators/scanTo.ts +393 -0
- package/src/combinators/sequence.ts +221 -0
- package/src/combinators/token.ts +120 -0
- package/src/combinators/trivia-boundary.ts +48 -0
- package/src/combinators/trivia-skip.ts +821 -0
- package/src/combinators/withCtx.ts +45 -0
- package/src/compiler/build-arity.ts +330 -0
- package/src/compiler/compile-linkable-table.ts +209 -0
- package/src/compiler/degradation.ts +266 -0
- package/src/compiler/fields.ts +191 -0
- package/src/compiler/grammar-coverage-ids.ts +129 -0
- package/src/compiler/ir-serialize.ts +615 -0
- package/src/compiler/linker.ts +954 -0
- package/src/compiler/token-alphabet.ts +209 -0
- package/src/compiler/token-dispatch.ts +353 -0
- package/src/compiler/token-scanner.ts +318 -0
- package/src/compiler/value-usage.ts +147 -0
- package/src/coverage.ts +383 -0
- package/src/cst/capture-buffer.ts +297 -0
- package/src/cst/host-mode.ts +69 -0
- package/src/cst/reflection-attach.ts +11 -0
- package/src/cst/reflection-symbols.ts +9 -0
- package/src/cst/reflection.ts +149 -0
- package/src/cst/relative-spans.ts +207 -0
- package/src/cst/root-trivia-scope.ts +30 -0
- package/src/cst/trivia-charscan.ts +312 -0
- package/src/cst/trivia-entries.ts +285 -0
- package/src/cst/trivia-index.ts +131 -0
- package/src/cst/trivia-kinds.ts +358 -0
- package/src/cst/types.ts +76 -0
- package/src/cst/walk.ts +101 -0
- package/src/functional/doc.ts +959 -0
- package/src/functional/run-tabled.ts +153 -0
- package/src/functional/run.ts +558 -0
- package/src/grammar-metadata.ts +2 -0
- package/src/index.ts +189 -0
- package/src/language-service/index.ts +221 -0
- package/src/line-index.ts +131 -0
- package/src/oracle/digest.ts +620 -0
- package/src/oracle/index.ts +55 -0
- package/src/parse-context.ts +91 -0
- package/src/plugin/direct-builder-static.ts +102 -0
- package/src/plugin/evaluator.ts +1505 -0
- package/src/plugin/free-identifiers.ts +338 -0
- package/src/plugin/index.ts +2281 -0
- package/src/plugin/reducer-resolver.ts +606 -0
- package/src/recovery/scan.ts +155 -0
- package/src/regex/classes.ts +183 -0
- package/src/regex/first-set.ts +316 -0
- package/src/run/index.ts +31 -0
- package/src/spec/ebnf.ts +128 -0
- package/src/spec/index.ts +54 -0
- package/src/spec/model.ts +636 -0
- package/src/spec/railroad-lib.ts +559 -0
- package/src/spec/railroad.ts +256 -0
- package/src/table/assemble.ts +2994 -0
- package/src/table/cell.ts +42 -0
- package/src/table/child-slots.ts +113 -0
- package/src/table/compile-rule-map.ts +336 -0
- package/src/table/compile.ts +244 -0
- package/src/table/duplication-hook.ts +89 -0
- package/src/table/emit-assembly.ts +1766 -0
- package/src/table/emit.ts +418 -0
- package/src/table/encode-baseline.ts +340 -0
- package/src/table/encode.ts +1569 -0
- package/src/table/exec-baseline.ts +537 -0
- package/src/table/exec.ts +1672 -0
- package/src/table/fold.ts +38 -0
- package/src/table/index.ts +108 -0
- package/src/table/inspect.ts +52 -0
- package/src/table/ops.ts +459 -0
- package/src/table/program.ts +855 -0
- package/src/table/run-support.ts +66 -0
- package/src/table/scan-shapes.ts +1578 -0
- package/src/table/site-labels.ts +228 -0
- package/src/table/stamp.ts +229 -0
- package/src/types.ts +563 -0
- package/src/version.ts +16 -0
- package/dist/compiler/codegen.d.ts +0 -334
- package/dist/compiler/codegen.d.ts.map +0 -1
- package/dist/compiler/inline-build.d.ts +0 -11
- package/dist/compiler/inline-build.d.ts.map +0 -1
- package/dist/compiler/inline-callback.d.ts +0 -21
- package/dist/compiler/inline-callback.d.ts.map +0 -1
- package/dist/compiler/line-index.d.ts +0 -2
- package/dist/compiler/line-index.d.ts.map +0 -1
- package/dist/compiler/module-hoist.d.ts +0 -106
- package/dist/compiler/module-hoist.d.ts.map +0 -1
- package/dist/compiler/scannable-run.d.ts.map +0 -1
- package/dist/compiler/scannable-terminal.d.ts +0 -23
- package/dist/compiler/scannable-terminal.d.ts.map +0 -1
- package/dist/compiler/trivia-fast-path.d.ts +0 -38
- package/dist/compiler/trivia-fast-path.d.ts.map +0 -1
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { Combinator, ParseContext, ParseFail } from '../types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* ADJACENCY assertions — `adjacent()` and `notAdjacent()`.
|
|
4
|
+
*
|
|
5
|
+
* These are the authoring surface for `docs/design/derived-tokenization.md` §4,
|
|
6
|
+
* "Adjacency is a bit set at scan time". §4's fact is: *was there nothing between
|
|
7
|
+
* the previous token and this one?* The trivia skip already answers it at every
|
|
8
|
+
* sequence boundary and throws the answer away. `noTrivia` is today's POSITIVE
|
|
9
|
+
* spelling of that fact and has no negative twin, so a production that needs
|
|
10
|
+
* "these two are SEPARATED" has had to disable trivia and re-spell whitespace as a
|
|
11
|
+
* regex — which re-implements the dialect's trivia table inside an expression
|
|
12
|
+
* production, and drifts from it.
|
|
13
|
+
*
|
|
14
|
+
* The question is about the GAP, never about what a separator looks like:
|
|
15
|
+
*
|
|
16
|
+
* 1 - 2 the `-` is not adjacent to the `2` → subtraction
|
|
17
|
+
* 1 -2 the `-` IS adjacent to the `2` → signed number in a list
|
|
18
|
+
*
|
|
19
|
+
* and a third case, `1`, a block comment, `-`, a block comment, `2`: not adjacent,
|
|
20
|
+
* but the separation is a comment rather than whitespace. That case is why `kinds`
|
|
21
|
+
* exists. css-values-4 §10.1 requires REAL whitespace
|
|
22
|
+
* around `+`/`-` in `calc()`, because a comment vanishes at tokenisation:
|
|
23
|
+
* `notAdjacent({ kinds: ['whitespace'] })` states that and nothing else.
|
|
24
|
+
*
|
|
25
|
+
* LOWERING. Both are marker tags, recognised by `sequence()` at term `i` and lowered
|
|
26
|
+
* at that boundary into a test of the trivia scan the boundary already performs
|
|
27
|
+
* (`scanEnd > cur`). That is deliberate on two counts: it costs nothing at all where
|
|
28
|
+
* no assertion is written (no ctx field, no extra branch in the ordinary boundary),
|
|
29
|
+
* and it sidesteps `sequence`'s trivia REWIND — a self-contained zero-width
|
|
30
|
+
* combinator sitting at index `i` matches zero-width by construction, so the
|
|
31
|
+
* `result.span.end > scanEnd` test would roll the gap it just asserted back out.
|
|
32
|
+
* When derived tokenization lands, the same tag lowers to a `tight` bit test on the
|
|
33
|
+
* token instead; the assertion an author writes does not change.
|
|
34
|
+
*/
|
|
35
|
+
export type AdjacencyDef = {
|
|
36
|
+
tag: 'adjacency';
|
|
37
|
+
polarity: 'adjacent' | 'notAdjacent';
|
|
38
|
+
kinds?: readonly string[];
|
|
39
|
+
};
|
|
40
|
+
/** The adjacency spec of `p`, or null when `p` is an ordinary combinator. */
|
|
41
|
+
export declare function adjacencyOf(p: Combinator<unknown>): AdjacencyDef | null;
|
|
42
|
+
/** Failure label, matched byte-for-byte by the compiled path. */
|
|
43
|
+
export declare function adjacencyExpected(def: AdjacencyDef): string;
|
|
44
|
+
/**
|
|
45
|
+
* Evaluate one adjacency assertion at a sequence boundary. `cur` is the position
|
|
46
|
+
* BEFORE the ambient trivia scan. No capture, no cursor movement, no ctx writes.
|
|
47
|
+
*/
|
|
48
|
+
export declare function holdsAdjacency(input: string, cur: number, ctx: ParseContext, def: AdjacencyDef): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* The test itself, over the two things a def actually carries.
|
|
51
|
+
*
|
|
52
|
+
* Split from `holdsAdjacency` so the TABLE drivers can reach it: both decode a
|
|
53
|
+
* polarity word and a const-pool slot out of the instruction stream and have no
|
|
54
|
+
* `AdjacencyDef` object to hand — and manufacturing one per assertion, on a
|
|
55
|
+
* boundary test that is otherwise allocation-free, would be an allocation the
|
|
56
|
+
* interpreter does not pay. One implementation, three engines.
|
|
57
|
+
*/
|
|
58
|
+
export declare function adjacencyHolds(input: string, cur: number, ctx: ParseContext, negated: boolean, kinds: readonly string[] | undefined): boolean;
|
|
59
|
+
export declare function adjacencyFail(pos: number, def: AdjacencyDef): ParseFail;
|
|
60
|
+
/**
|
|
61
|
+
* The error a marker in a position with no boundary raises — the same sentence
|
|
62
|
+
* from every engine.
|
|
63
|
+
*
|
|
64
|
+
* The table drivers need it for the same reason the combinator does: an
|
|
65
|
+
* assertion reached anywhere but a sequence term has no gap to test, and
|
|
66
|
+
* silently answering "no trivia here" would make `notAdjacent()` a guaranteed
|
|
67
|
+
* failure and `adjacent()` a no-op, both invisible.
|
|
68
|
+
*/
|
|
69
|
+
export declare function adjacencyMisuse(polarity: 'adjacent' | 'notAdjacent'): TypeError;
|
|
70
|
+
/**
|
|
71
|
+
* Zero-width assertion: the previous term and this position are ADJACENT — no
|
|
72
|
+
* ambient trivia sat between them.
|
|
73
|
+
*
|
|
74
|
+
* The first-class spelling of what `noTrivia(...)` expresses today by clearing the
|
|
75
|
+
* trivia table around a glued run. Use it when only the JOIN is significant and the
|
|
76
|
+
* terms themselves are ordinary:
|
|
77
|
+
*
|
|
78
|
+
* sequence(number, adjacent(), unit) // `10px`, never `10 px`
|
|
79
|
+
*/
|
|
80
|
+
export declare function adjacent(): Combinator<null>;
|
|
81
|
+
/**
|
|
82
|
+
* Zero-width assertion: the previous term and this position are NOT adjacent —
|
|
83
|
+
* ambient trivia sat between them.
|
|
84
|
+
*
|
|
85
|
+
* `kinds` narrows it to trivia CATEGORIES declared by `classifiedTrivia({...})`, so
|
|
86
|
+
* the assertion can demand a category that survives tokenisation:
|
|
87
|
+
*
|
|
88
|
+
* // css-values-4 10.1: `a + b` yes; a comment in place of the space, no.
|
|
89
|
+
* sequence(operand, notAdjacent({ kinds: ['whitespace'] }), plusOrMinus,
|
|
90
|
+
* notAdjacent({ kinds: ['whitespace'] }), operand)
|
|
91
|
+
*
|
|
92
|
+
* A `kinds` list is checked against the ACTIVE trivia table the first time the
|
|
93
|
+
* assertion is reached (and at compile time for the compiled path). Unlabeled
|
|
94
|
+
* trivia, or a kind name the table does not declare, is a hard `TypeError` — never
|
|
95
|
+
* a silently-empty filter.
|
|
96
|
+
*/
|
|
97
|
+
export declare function notAdjacent(options?: {
|
|
98
|
+
kinds?: readonly string[];
|
|
99
|
+
}): Combinator<null>;
|
|
100
|
+
//# sourceMappingURL=adjacency.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adjacency.d.ts","sourceRoot":"","sources":["../../src/combinators/adjacency.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAc,MAAM,aAAa,CAAA;AAIlF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,MAAM,MAAM,YAAY,GAAG;IAAE,GAAG,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,UAAU,GAAG,aAAa,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;CAAE,CAAA;AAEhH,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,YAAY,GAAG,IAAI,CAEvE;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAG3D;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAExG;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,SAAS,GACpG,OAAO,CAQT;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GA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;AACrE,wBAAgB,eAAe,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAMhG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/combinators/completions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../../src/combinators/completions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,YAAY,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAInF;;2FAE2F;AAC3F,KAAK,iBAAiB,GAClB,UAAU,CAAC,OAAO,CAAC,GACnB;IAAE,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAA;CAAE,CAAA;AAE9F;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,iBAAiB,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,EACd,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAO,GACnC,MAAM,EAAE,CA0BV"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Combinator } from '../types.ts';
|
|
1
|
+
import type { Combinator, DispatchMatcherCase } from '../types.ts';
|
|
2
2
|
export type DispatchWhen<T> = {
|
|
3
3
|
readonly kind: 'when';
|
|
4
4
|
readonly keys: readonly string[];
|
|
@@ -40,6 +40,13 @@ type ArmValue<T> = T extends DispatchWhen<infer U> ? U : T extends DispatchWhenM
|
|
|
40
40
|
type UnionArms<T extends readonly DispatchArm<unknown>[]> = {
|
|
41
41
|
[K in keyof T]: ArmValue<T[K]>;
|
|
42
42
|
}[number];
|
|
43
|
+
export declare function parserUsesRouted(parser: Combinator<unknown>, seen?: Set<Combinator<unknown>>): boolean;
|
|
44
|
+
export declare function branchUsesRouted(branch: {
|
|
45
|
+
parser: Combinator<unknown>;
|
|
46
|
+
usesRouted?: boolean | undefined;
|
|
47
|
+
}): boolean;
|
|
48
|
+
export declare function asciiFoldKey(key: string): string;
|
|
49
|
+
export declare function matchesDispatchMatcher(value: string, matcher: DispatchMatcherCase): boolean;
|
|
43
50
|
export declare function startsWith(prefix: string): DispatchStringMatcher;
|
|
44
51
|
export declare function endsWith(suffix: string): DispatchStringMatcher;
|
|
45
52
|
export declare function matches(pattern: RegExp): DispatchStringMatcher;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/combinators/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../src/combinators/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAgB,mBAAmB,EAAyC,MAAM,aAAa,CAAA;AAIvH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;IAChC,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;IAC9B,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAA;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI;IACnC,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,qBAAqB,CAAA;IACvC,QAAQ,CAA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mBAAmB,GACzB,YAAY,CAAC,CAAC,CAAC,CAAA;AAClB,wBAAgB,IAAI,CAAC,CAAC,EACpB,OAAO,EAAE,qBAAqB,EAC9B,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,IAAI,CAAC,EAAE,mBAAmB,GACzB,mBAAmB,CAAC,CAAC,CAAC,CAAA;AAkBzB,wBAAgB,QAAQ,CAAC,IAAI,GAAE,mBAAwB,GAAG,mBAAmB,CAE5E;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,CAExE;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,MAAM,CAAC,CAAC,GAAG,MAAM,EAAE,QAAQ,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAyB1E;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,SAAS,WAAW,CAAC,OAAO,CAAC,EAAE,EAClF,QAAQ,EAAE,UAAU,CAAC,CAAC,CAAC,EACvB,GAAG,IAAI,EAAE,CAAC,GACT,UAAU,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAwH/B"}
|
|
@@ -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;AAKhG,YAAY,EAAE,UAAU,EAAE,CAAA;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAE/D;
|
|
1
|
+
{"version":3,"file":"expect.d.ts","sourceRoot":"","sources":["../../src/combinators/expect.ts"],"names":[],"m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AAO,CAAC,EACtB,IAAI,GAAE,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAa,EAC1C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAgDT;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAMpE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,OAAO,CAEnE;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,UAAU,CAAC,OAAO,CAAC,EAAE,GAAG,QAAQ,CAalF;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CACxB,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EACtB,IAAI,GAAE,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAa,EAC1C,OAAO,CAAC,EAAE,WAAW,GACpB,QAAQ,CAsDV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/combinators/gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/combinators/gate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,IAAI,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,UAAU,CAAC,IAAI,CAAC,CA0B7E"}
|
|
@@ -41,6 +41,28 @@ export interface ParsemanParser<T> extends Combinator<T> {
|
|
|
41
41
|
parse(input: string): ParseResult<T>;
|
|
42
42
|
parse(input: string, pos: number, ctx: ParseContext): ParseResult<T>;
|
|
43
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* A trivia scope.
|
|
46
|
+
*
|
|
47
|
+
* ── NO RULE MAY CONSULT AN OPTION WHILE IT PARSES ───────────────────────────
|
|
48
|
+
*
|
|
49
|
+
* `opts` is fixed when `parser(opts, root)` is called. That is LINK TIME — the
|
|
50
|
+
* same moment `assemble.ts` resolves `RunCfg` into a choice of piece, and the
|
|
51
|
+
* same rule (`RunCfg`'s header, `scripts/check-invariants.mjs` INV-6/INV-7).
|
|
52
|
+
* Everything below used to be read INSIDE `parse`, which a nested scope enters
|
|
53
|
+
* on every visit, so a grammar with a `parser({ trivia })` region paid nine
|
|
54
|
+
* option reads per entry for answers that could not change.
|
|
55
|
+
*
|
|
56
|
+
* They are now resolved once, here, and the parse path reads only the resolved
|
|
57
|
+
* values. Where the answer genuinely depends on the CALLER's context — an
|
|
58
|
+
* inherited `trackLines`, inherited trivia labels — a pre-written variant is
|
|
59
|
+
* SELECTED at link time rather than branched on per entry. Selecting costs one
|
|
60
|
+
* closure per scope in the grammar; branching cost one test per entry per parse.
|
|
61
|
+
*
|
|
62
|
+
* `_ctx.trivia`, `_ctx.captureTrivia` and the CST sinks stay where they are:
|
|
63
|
+
* those are per-scope RUNTIME state that `node()` opens and closes mid-parse,
|
|
64
|
+
* not configuration. Resolving them early would be wrong, not fast.
|
|
65
|
+
*/
|
|
44
66
|
export declare function parser<T>(opts: ParserOptions, root: Combinator<T>): ParsemanParser<T>;
|
|
45
67
|
/**
|
|
46
68
|
* Run `root` with the active trivia cleared — no trivia is skipped between its
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grammar.d.ts","sourceRoot":"","sources":["../../src/combinators/grammar.ts"],"names":[],"mappings":"A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AC,GAAG,cAAc,CAAC,CAAC,CAAC,CAElE;AAOD,wBAAgB,KAAK,CAAC,CAAC,EACrB,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,KAAK,EAAE,MAAM,EACb,IAAI,GAAE,YAAiB,GACtB,WAAW,CAAC,CAAC,CAAC,CAoChB"}
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
import type { Combinator } from '../types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* ASCII case-fold equality — the interpreter twin of the compiler's `foldEq`
|
|
4
|
+
* (and `/i`-flag regex lowering). Folds ASCII letters via bit 0x20, exact-matches
|
|
5
|
+
* everything else. Deliberately NOT `Intl.Collator` (measured ~9× slower, and its
|
|
6
|
+
* Unicode accent-folding is the wrong semantic for a parser). Keeps interpreter /
|
|
7
|
+
* compiled / macro output identical for case-insensitive `literal()`.
|
|
8
|
+
*/
|
|
9
|
+
export declare function asciiFoldEq(a: string, b: string): boolean;
|
|
2
10
|
export type LiteralOptions = {
|
|
3
11
|
caseInsensitive?: boolean;
|
|
4
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../../src/combinators/literal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"literal.d.ts","sourceRoot":"","sources":["../../src/combinators/literal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;AAMpF;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAUzD;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,cAAmB,GAAG,UAAU,CAAC,MAAM,CAAC,CAwEpF"}
|
|
@@ -3,7 +3,6 @@ export declare function transform<T, U>(combinator: Combinator<T>, fn: (value: T
|
|
|
3
3
|
start: number;
|
|
4
4
|
end: number;
|
|
5
5
|
}) => U): Combinator<U>;
|
|
6
|
-
export declare function skip<T, S>(main: Combinator<T>, skipped: Combinator<S>): Combinator<T>;
|
|
7
6
|
export declare function trivia<T>(combinator: Combinator<T>): Combinator<T>;
|
|
8
7
|
/**
|
|
9
8
|
* Build trivia whose category labels are part of its recognition structure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/combinators/map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAA6B,MAAM,aAAa,CAAA;AAMxE,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAC5B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,KAAK,CAAC,GACxD,UAAU,CAAC,CAAC,CAAC,CAWf;AAED,wBAAgB,
|
|
1
|
+
{"version":3,"file":"map.d.ts","sourceRoot":"","sources":["../../src/combinators/map.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAA6B,MAAM,aAAa,CAAA;AAMxE,wBAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,EAC5B,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,KAAK,CAAC,GACxD,UAAU,CAAC,CAAC,CAAC,CAWf;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAYlE;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,GAClD,UAAU,CAAC,OAAO,CAAC,CAqBrB;AAED;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAW/E;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC,CAY/E"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Combinator, FieldMap } from '../types.ts';
|
|
2
|
-
import { NODE_TAG, NODE_TYPE } from '../cst/reflection.ts';
|
|
2
|
+
import { NODE_TAG, NODE_TYPE } from '../cst/reflection-symbols.ts';
|
|
3
3
|
/**
|
|
4
4
|
* A CST/AST node rule. Runs `combinator` while collecting its terminals into
|
|
5
5
|
* `children` / `rawChildren` arrays and trivia spans into `triviaLog`, then
|
|
@@ -80,6 +80,16 @@ export type NodeProjectOptions<I extends number = number> = Omit<NodeOptions, 'p
|
|
|
80
80
|
unwrap?: never;
|
|
81
81
|
collapse?: never;
|
|
82
82
|
};
|
|
83
|
+
/** A captured child's value form: a leaf unwraps to its string value, else as-is. */
|
|
84
|
+
export declare function unwrapChild(child: unknown): unknown;
|
|
85
|
+
/**
|
|
86
|
+
* The authoring error for `node()` with no rules() key, raised IDENTICALLY by
|
|
87
|
+
* every engine. Exported because the table encoder used to answer it with
|
|
88
|
+
* `UnsupportedConstruct: no opcode for 'node(inferred type)'` — a message that
|
|
89
|
+
* reads as a table gap and names neither the mistake nor the fix.
|
|
90
|
+
*/
|
|
91
|
+
export declare function missingInferredType(): never;
|
|
92
|
+
export declare function projectChild(children: ReadonlyArray<unknown>, project: number, type: string): unknown;
|
|
83
93
|
export declare function node<P extends Combinator<unknown>, const I extends number, const Tags extends readonly string[] = readonly never[]>(combinator: P, opts: NodeProjectOptions<I> & {
|
|
84
94
|
tags?: Tags;
|
|
85
95
|
}): NodeCombinator<ProjectValue<P, I>, never, Tags[number]>;
|
|
@@ -88,7 +98,7 @@ export declare function node<N, const Tags extends readonly string[] = readonly
|
|
|
88
98
|
export declare function node<const Type extends string, P extends Combinator<unknown>, const I extends number, const Tags extends readonly string[] = readonly never[]>(type: Type, combinator: P, opts: NodeProjectOptions<I> & {
|
|
89
99
|
tags?: Tags;
|
|
90
100
|
}): NodeCombinator<ProjectValue<P, I>, Type, Tags[number]>;
|
|
91
|
-
export declare function node<N, const Type extends string, const Tags extends readonly string[] = readonly never[]>(type: Type, combinator: Combinator<unknown>, build?: BuildNode<N>, opts?: NodeOptions<Tags>): NodeCombinator<N, Type, Tags[number]>;
|
|
92
|
-
export declare function node<N, const Type extends string, const Tags extends readonly string[] = readonly never[]>(type: Type, combinator: Combinator<unknown>, opts?: NodeOptions<Tags>): NodeCombinator<N, Type, Tags[number]>;
|
|
101
|
+
export declare function node<N, const Type extends string = string, const Tags extends readonly string[] = readonly never[]>(type: Type, combinator: Combinator<unknown>, build?: BuildNode<N>, opts?: NodeOptions<Tags>): NodeCombinator<N, Type, Tags[number]>;
|
|
102
|
+
export declare function node<N, const Type extends string = string, const Tags extends readonly string[] = readonly never[]>(type: Type, combinator: Combinator<unknown>, opts?: NodeOptions<Tags>): NodeCombinator<N, Type, Tags[number]>;
|
|
93
103
|
export {};
|
|
94
104
|
//# 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,EAAE,QAAQ,EAAoD,MAAM,aAAa,CAAA;AA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EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AAejS,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,IAAI,SAAS,SAAS,MAAM,EAAE,GAAG,SAAS,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;AACxP,wBAAgB,IAAI,CAAC,CAAC,EAAE,KAAK,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,EAAE,KAAK,CAAC,IAAI,SAAS,SAAS,MAAM,EAAE,GAAG,SAAS,KAAK,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Combinator } from '../types.ts';
|
|
2
|
-
import type { HostMode } from '../
|
|
2
|
+
import type { HostMode } from '../cst/host-mode.ts';
|
|
3
3
|
import { NODE_TAG, NODE_TYPE, type GrammarWithReflection } from '../cst/reflection.ts';
|
|
4
4
|
/**
|
|
5
5
|
* Non-enumerable key on a `rules()` result holding the factory's declaration
|
|
@@ -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;AAC7C,OAAO,KAAK,EAAE,QAAQ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OAAO,CAAC,CAAC,IAAI;KACnE,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG,YAAY,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;CAC/C,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAA;AAEnB,KAAK,cAAc,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI;KAClE,CAAC,IAAI,MAAM,CAAC,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAC3C,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAA;AAEnB,KAAK,WAAW,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,IAC5D,CAAC,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAA;AAElE,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA;AAC/G,wBAAgB,KAAK,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../src/combinators/ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../src/combinators/ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;AAIpF;;;;;;;;;;;;GAYG;AACH,wBAAgB,GAAG,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG;IAAE,MAAM,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI,CAAA;CAAE,CA2F3E"}
|
|
@@ -1,18 +1,3 @@
|
|
|
1
|
-
import type { Combinator
|
|
2
|
-
/**
|
|
3
|
-
* Computes a regex terminal's first-set (for choice-dispatch fast paths). The
|
|
4
|
-
* implementation — `firstSetFromRegex` in `../regex/first-set.ts` — is a small,
|
|
5
|
-
* dependency-free hand-rolled regex parser, registered by the interpreter/library
|
|
6
|
-
* entry (`index.ts`) via `registerRegexAnalyzer`. It is injected rather than
|
|
7
|
-
* imported so that consumers who import `regex` directly from this subpath (no
|
|
8
|
-
* library entry) never pull the analyzer into their bundle at all. When no
|
|
9
|
-
* analyzer is registered, `regex()` uses the permissive fallback below — this
|
|
10
|
-
* 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;
|
|
1
|
+
import type { Combinator } from '../types.ts';
|
|
17
2
|
export declare function regex(pattern: string | RegExp, flags?: string): Combinator<string>;
|
|
18
3
|
//# sourceMappingURL=regex.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/combinators/regex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../../src/combinators/regex.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAmD,MAAM,aAAa,CAAA;AAiH9F,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,SAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAwD9E"}
|
|
@@ -41,7 +41,7 @@ export declare function optional<T>(combinator: Combinator<T>): Combinator<T | n
|
|
|
41
41
|
* rule. This form is non-nullable and keeps the item's first-set, so an arm led by
|
|
42
42
|
* it still gates.
|
|
43
43
|
*/
|
|
44
|
-
export declare function oneOrMoreSep<T, S>(combinator: Combinator<T>, separator: Combinator<S>, opts?: SepByOptions): Combinator<T[]>;
|
|
44
|
+
export declare function oneOrMoreSep<T, S>(combinator: Combinator<T>, separator: Combinator<S> | KeptSeparator<S>, opts?: SepByOptions): Combinator<T[]>;
|
|
45
45
|
/** How a separator with NO item after it is treated. */
|
|
46
46
|
export type TrailingSeparator =
|
|
47
47
|
/**
|
|
@@ -56,6 +56,34 @@ export type SepByOptions = RepeatOptions & {
|
|
|
56
56
|
/** What to do with a separator that has no item after it. Default `'forbid'`. */
|
|
57
57
|
trailing?: TrailingSeparator;
|
|
58
58
|
};
|
|
59
|
+
/** A separator the author asked to keep in `children`. Produced by `keepSeparator`. */
|
|
60
|
+
export type KeptSeparator<S> = {
|
|
61
|
+
readonly _keepSeparator: Combinator<S>;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Keep this list's separators in `children`, interleaved with the items.
|
|
65
|
+
*
|
|
66
|
+
* A list contributes its ITEMS and nothing else — that is the default and it is
|
|
67
|
+
* not negotiable, because a `children` array whose arity depends on a detail of
|
|
68
|
+
* the separator is the thing that made this defect invisible. But a combinator
|
|
69
|
+
* may collapse only what its CONSTRUCTION makes recoverable, and that is exactly
|
|
70
|
+
* the line this helper draws:
|
|
71
|
+
*
|
|
72
|
+
* sepBy(g.Value, literal(',')) // ',' is fixed here — recoverable, drop it
|
|
73
|
+
* sepBy(g.Track, keepSeparator(SLASH_OR_COMMA)) // could be '/' OR ',' — NOT recoverable, keep it
|
|
74
|
+
*
|
|
75
|
+
* Wrap the separator when it could have matched more than one thing: a `choice`,
|
|
76
|
+
* a regex with alternation or a quantifier, a rule reference. In CSS the
|
|
77
|
+
* separator carries meaning — `grid-area: 1 / 2` and `font: 12px/1.5` do not mean
|
|
78
|
+
* what `1, 2` means — and dropping it destroys information that exists nowhere
|
|
79
|
+
* else in the tree.
|
|
80
|
+
*
|
|
81
|
+
* The wrap is read at CONSTRUCTION, not per parse, and it is deliberately applied
|
|
82
|
+
* to the separator rather than passed as an option: the call site then STATES its
|
|
83
|
+
* own children arity, which is the failure being fixed. `keepSeparator` in the
|
|
84
|
+
* source is the only documentation that reaches an author who never reads docs.
|
|
85
|
+
*/
|
|
86
|
+
export declare function keepSeparator<S>(separator: Combinator<S>): KeptSeparator<S>;
|
|
59
87
|
/**
|
|
60
88
|
* Separated list: `(item (sep item)*)?` by default — note that it MATCHES THE
|
|
61
89
|
* EMPTY STRING, which makes it nullable and therefore un-gateable as a choice arm.
|
|
@@ -67,5 +95,5 @@ export type SepByOptions = RepeatOptions & {
|
|
|
67
95
|
*
|
|
68
96
|
* `min`/`max` count ITEMS, not separators.
|
|
69
97
|
*/
|
|
70
|
-
export declare function sepBy<T, S>(combinator: Combinator<T>,
|
|
98
|
+
export declare function sepBy<T, S>(combinator: Combinator<T>, separatorArg: Combinator<S> | KeptSeparator<S>, opts?: SepByOptions): Combinator<T[]>;
|
|
71
99
|
//# sourceMappingURL=repeat.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repeat.d.ts","sourceRoot":"","sources":["../../src/combinators/repeat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"repeat.d.ts","sourceRoot":"","sources":["../../src/combinators/repeat.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;AAwFpF,MAAM,MAA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,CAAC,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAE3E;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC,EACxB,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC,EACzB,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,EAC9C,IAAI,GAAE,YAAiB,GACtB,UAAU,CAAC,CAAC,EAAE,CAAC,CA+KjB"}
|
|
@@ -18,6 +18,26 @@ export type ScanToOptions = {
|
|
|
18
18
|
* everything consumed so far. Default false (fail at EOF).
|
|
19
19
|
*/
|
|
20
20
|
orEOF?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* `balanced()` only. Make an unmatched close a genuine FAILURE instead of a
|
|
23
|
+
* recovered one.
|
|
24
|
+
*
|
|
25
|
+
* By default `balanced()` wraps its close in `expect()`, which never fails: on
|
|
26
|
+
* a miss it returns a ParseError, records it on `ctx._errors`, and reports a
|
|
27
|
+
* zero-width span. So the combinator is UNFAILABLE once its opener is consumed
|
|
28
|
+
* — the rejection is computed and recorded, but a caller cannot branch on it.
|
|
29
|
+
* `choice()` cannot fall through to another arm, `not()` cannot negate it, and
|
|
30
|
+
* a `sequence()` around it proceeds as if the group closed.
|
|
31
|
+
*
|
|
32
|
+
* With `strict: true` the close is required, so an unmatched or missing close
|
|
33
|
+
* fails the whole group and rolls back to the opener — the ordinary combinator
|
|
34
|
+
* contract. Nested groups inherit strictness (the interior recurses into the
|
|
35
|
+
* same combinator).
|
|
36
|
+
*
|
|
37
|
+
* Opt-in: the default is unchanged, because recovery is what a tolerant
|
|
38
|
+
* document parse wants, and existing grammars are built on it.
|
|
39
|
+
*/
|
|
40
|
+
strict?: boolean;
|
|
21
41
|
};
|
|
22
42
|
/**
|
|
23
43
|
* Resolve the effective ordered skipper list for a scan, folding grammar-level
|
|
@@ -53,6 +73,52 @@ export type BalancedAmbient = Combinator<string> & {
|
|
|
53
73
|
open: string;
|
|
54
74
|
close: string;
|
|
55
75
|
ownSkip: Combinator<unknown>[];
|
|
76
|
+
strict?: boolean;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* Marker: this combinator IS a balanced interior — its delimiters, and the fact
|
|
81
|
+
* that everything between them is a scan rather than authored structure.
|
|
82
|
+
*
|
|
83
|
+
* Set by `buildBalancedInterior`, so EVERY balanced carries it: the ambient one,
|
|
84
|
+
* the `raw` one, and each interior the ambient cache rebuilds. `_balancedAmbient`
|
|
85
|
+
* cannot serve this purpose — it is absent on `raw`, and it means "re-resolve
|
|
86
|
+
* ambient scanSkip", which is a different claim.
|
|
87
|
+
*
|
|
88
|
+
* Read by the spec/railroad emitter, which renders a balanced as its delimiters
|
|
89
|
+
* around an opaque interior. That is not a simplification: the delimiters are
|
|
90
|
+
* FIXED at construction and the interior genuinely is a delimiter scan, so the
|
|
91
|
+
* rendering states exactly what the construct is. Expanding the lowered shape
|
|
92
|
+
* instead would print the content-run regex and the `self` back-edge, which are
|
|
93
|
+
* emitter machinery, not language.
|
|
94
|
+
*/
|
|
95
|
+
export type BalancedMarked = Combinator<string> & {
|
|
96
|
+
_balanced?: {
|
|
97
|
+
open: string;
|
|
98
|
+
close: string;
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* The table lowering's marker, on the object `balanced()` RETURNS.
|
|
103
|
+
*
|
|
104
|
+
* Deliberately not `_balancedAmbient`, and deliberately on the OUTER combinator.
|
|
105
|
+
* `_balancedAmbient` means "rebuild my interior with the ambient scanSkip", which
|
|
106
|
+
* is false for `raw`, and it sits on the INNER combinator because that is the one
|
|
107
|
+
* codegen's dedup and the interior `self` back-edge address. Reading `_def` (or
|
|
108
|
+
* the ambient marker) off the outer object gets the wrong thing — a structural
|
|
109
|
+
* encoder made exactly that mistake and lowered the wrong parser, silently.
|
|
110
|
+
*
|
|
111
|
+
* This marker instead records the CONSTRUCTOR ARGUMENTS, so an encoder can carry
|
|
112
|
+
* a `balanced()` as data and let `balanced()` itself rebuild it. It is present on
|
|
113
|
+
* every `balanced()`, `raw` included.
|
|
114
|
+
*/
|
|
115
|
+
export type BalancedSpec = Combinator<string> & {
|
|
116
|
+
_balancedSpec?: {
|
|
117
|
+
open: string;
|
|
118
|
+
close: string;
|
|
119
|
+
ownSkip: Combinator<unknown>[];
|
|
120
|
+
strict: boolean;
|
|
121
|
+
raw: boolean;
|
|
56
122
|
};
|
|
57
123
|
};
|
|
58
124
|
/**
|
|
@@ -65,8 +131,12 @@ export type BalancedAmbient = Combinator<string> & {
|
|
|
65
131
|
* `rules({ scanSkip })` consults that ambient opaque-unit set in its INTERIOR too,
|
|
66
132
|
* so a delimiter hidden inside a string/bracket run never closes the balance
|
|
67
133
|
* early — the same footgun closure `scanTo` gets. `raw: true` opts out.
|
|
134
|
+
*
|
|
135
|
+
* By DEFAULT an unmatched close is RECOVERED, not failed: the close is wrapped in
|
|
136
|
+
* `expect()`, so the group always succeeds and records a ParseError instead. Pass
|
|
137
|
+
* `strict: true` to make it fail and roll back — see `ScanToOptions.strict`.
|
|
68
138
|
*/
|
|
69
139
|
export declare function balanced(open: string, close: string, options?: ScanToOptions): Combinator<string>;
|
|
70
140
|
/** Build a balanced open/close interior for a FIXED skip set (no ambient). */
|
|
71
|
-
export declare function buildBalancedInterior(open: string, close: string, skips: Combinator<unknown>[]): Combinator<string>;
|
|
141
|
+
export declare function buildBalancedInterior(open: string, close: string, skips: Combinator<unknown>[], strict?: boolean): Combinator<string>;
|
|
72
142
|
//# sourceMappingURL=scanTo.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanTo.d.ts","sourceRoot":"","sources":["../../src/combinators/scanTo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAA2B,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"scanTo.d.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CAC5C,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,GAAG;IAC9C,aAAa,CAAC,EAAE;QACd,IAAI,EAAE,MAAM,CAAA;QACZ,KAAK,EAAE,MAAM,CAAA;QACb,OAAO,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,CAAA;QAC9B,MAAM,EAAE,OAAO,CAAA;QACf,GAAG,EAAE,OAAO,CAAA;KACb,CAAA;CACF,CAAA;AAUD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,OAAO,GAAE,aAAkB,GAC1B,UAAU,CAAC,MAAM,CAAC,CAwDpB;AAED,8EAA8E;AAC9E,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,EAC5B,MAAM,UAAQ,GACb,UAAU,CAAC,MAAM,CAAC,CA0DpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../../src/combinators/sequence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAoD,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"sequence.d.ts","sourceRoot":"","sources":["../../src/combinators/sequence.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAoD,MAAM,aAAa,CAAA;AAM/F,KAAK,aAAa,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI;KACnD,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,UAAU,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;CAC7D,CAAA;AAED,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,EAChF,GAAG,OAAO,EAAE,CAAC,GACZ,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAgN9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/combinators/token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;AAGpF;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../../src/combinators/token.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;AAGpF;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,UAAU,CAAC,MAAM,CAAC,CAuDnE;AAED;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,CAAC,EAAE,CAAC,EACvB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EACnB,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,KAAK,CAAC,GACxD,UAAU,CAAC,CAAC,CAAC,CAwCf"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Combinator } from '../types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Does this rule body have a position OF ITS OWN at which ambient trivia is
|
|
4
|
+
* consulted?
|
|
5
|
+
*
|
|
6
|
+
* This is the gate on re-establishing a rule's ambient trivia when it is
|
|
7
|
+
* referenced from a region that CLEARED it (`ref.ts` in the interpreter,
|
|
8
|
+
* `Encoder.scopedRef` in the table — both must ask the same question, or the two
|
|
9
|
+
* engines parse different languages again).
|
|
10
|
+
*
|
|
11
|
+
* A body with no such position — a bare alternation, a dispatch, a single
|
|
12
|
+
* terminal — cannot be repaired by installing a scanner, because it never
|
|
13
|
+
* consults one. Installing it there changes nothing about the rule and
|
|
14
|
+
* everything about what its arms delegate to, which is how a `noTrivia(...)`
|
|
15
|
+
* region stopped meaning anything two references down.
|
|
16
|
+
*
|
|
17
|
+
* `lazy` is deliberately false and is never followed: a reference is the
|
|
18
|
+
* delegation this question is about, so following it would both loop and answer
|
|
19
|
+
* for a different rule. `grammar` is false because it declares its own scope, so
|
|
20
|
+
* an outer install never reaches its body. `dispatch` is false because it is a
|
|
21
|
+
* ROUTE: its arms re-enter from the routed token and spell their own padding.
|
|
22
|
+
*
|
|
23
|
+
* Structural and pure — callers resolve it ONCE, not per parse.
|
|
24
|
+
*/
|
|
25
|
+
export declare function hasOwnTriviaBoundary(p: Combinator<unknown>, depth?: number): boolean;
|
|
26
|
+
//# sourceMappingURL=trivia-boundary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trivia-boundary.d.ts","sourceRoot":"","sources":["../../src/combinators/trivia-boundary.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAKxD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,KAAK,GAAE,MAAkB,GAAG,OAAO,CAmB/F"}
|