parseman 0.18.2 → 0.20.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 +7 -4
- package/dist/combinators/map.d.ts +5 -0
- package/dist/combinators/map.d.ts.map +1 -1
- package/dist/combinators/node.d.ts +14 -13
- package/dist/combinators/node.d.ts.map +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 +7 -7
- package/dist/combinators/regex.d.ts.map +1 -1
- package/dist/combinators/trivia-skip.d.ts +1 -0
- package/dist/combinators/trivia-skip.d.ts.map +1 -1
- package/dist/compiler/build-arity.d.ts +3 -3
- package/dist/compiler/codegen.d.ts.map +1 -1
- package/dist/compiler/fields.d.ts +16 -0
- package/dist/compiler/fields.d.ts.map +1 -0
- package/dist/compiler/inline-build.d.ts.map +1 -1
- package/dist/compiler/ir-serialize.d.ts.map +1 -1
- package/dist/compiler/linker.d.ts +17 -3
- package/dist/compiler/linker.d.ts.map +1 -1
- package/dist/compiler/scannable-run.d.ts +2 -10
- package/dist/compiler/scannable-run.d.ts.map +1 -1
- package/dist/compiler/value-usage.d.ts.map +1 -1
- package/dist/cst/capture-buffer.d.ts +1 -0
- package/dist/cst/capture-buffer.d.ts.map +1 -1
- package/dist/index.cjs +568 -262
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +568 -252
- package/dist/index.js.map +4 -4
- package/dist/plugin/evaluator.d.ts.map +1 -1
- package/dist/plugin/index.cjs +568 -260
- package/dist/plugin/index.cjs.map +4 -4
- package/dist/plugin/index.js +568 -260
- package/dist/plugin/index.js.map +4 -4
- package/dist/regex/classes.d.ts +40 -0
- package/dist/regex/classes.d.ts.map +1 -0
- package/dist/regex/first-set.d.ts +35 -0
- package/dist/regex/first-set.d.ts.map +1 -0
- package/dist/types.d.ts +31 -8
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -3
- package/dist/combinators/regex-analyze.d.ts +0 -6
- package/dist/combinators/regex-analyze.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Write parsers as TypeScript functions. Ship them like hand-written parsers.
|
|
8
8
|
|
|
9
|
-
Parséman is a TypeScript parser-combinator library with an optional compiler/macro path that turns your grammar into flat JavaScript. Use the same grammar interpreted in tests and REPLs, macro-compiled at build time in production, or
|
|
9
|
+
Parséman is a TypeScript parser-combinator library with an optional compiler/macro path that turns your grammar into flat JavaScript. Use the same grammar interpreted in tests and REPLs, macro-compiled at build time in production, or compiled on demand at runtime with `compile()`.
|
|
10
10
|
|
|
11
11
|
Use Parséman when you want:
|
|
12
12
|
|
|
@@ -36,6 +36,9 @@ npm install parseman
|
|
|
36
36
|
# pnpm add parseman
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
+
Parseman is pre-1.0. Minor versions may include breaking changes; check the
|
|
40
|
+
[changelog](./CHANGELOG.md) before upgrading.
|
|
41
|
+
|
|
39
42
|
## Quick start
|
|
40
43
|
|
|
41
44
|
```ts
|
|
@@ -60,7 +63,7 @@ The same combinator code runs three ways, with identical results:
|
|
|
60
63
|
|
|
61
64
|
- **Interpreter** — zero setup, works anywhere (tests, REPLs, dynamic grammars).
|
|
62
65
|
- **Macro build** — a [bundler plugin](https://matthew-dean.github.io/parseman/guide/macro-mode) evaluates your grammar at build time and replaces it with inline JS. Zero runtime cost; the `parseman` import disappears from the bundle.
|
|
63
|
-
-
|
|
66
|
+
- **`compile()`** — the same optimizer, run on demand at runtime.
|
|
64
67
|
|
|
65
68
|
```ts
|
|
66
69
|
// Add the plugin (vite.config.ts) and one import attribute — that's the whole change:
|
|
@@ -74,7 +77,7 @@ See **[The three modes](https://matthew-dean.github.io/parseman/guide/modes)** f
|
|
|
74
77
|
- **[Combinators](https://matthew-dean.github.io/parseman/guide/combinators)** — `literal`, `regex`, `sequence`, `choice`, `many`, `sepBy`, `token`, `not`, and more.
|
|
75
78
|
- **[Whitespace & trivia](https://matthew-dean.github.io/parseman/guide/trivia)** — grammar-defined filler skipping, with per-chunk kind capture.
|
|
76
79
|
- **[Recursive rules](https://matthew-dean.github.io/parseman/guide/recursive-rules)** — `rules()` for mutually recursive grammars; fully macro-compilable.
|
|
77
|
-
- **[CST / AST nodes](https://matthew-dean.github.io/parseman/guide/ast)** — `node()` captures terminals and trivia for you, with
|
|
80
|
+
- **[CST / AST nodes](https://matthew-dean.github.io/parseman/guide/ast)** — `node()` captures terminals, named `field()` values, and trivia for you, with `unwrap` for AST/value wrappers, `collapse` for grammar-local CST wrappers, and `cstBuildHost({ collapse })` for public CST policies.
|
|
78
81
|
- **[Incremental re-parsing](https://matthew-dean.github.io/parseman/guide/incremental)** — `parseDoc` re-parses just the edited subtree on each keystroke.
|
|
79
82
|
- **[Error recovery](https://matthew-dean.github.io/parseman/guide/error-recovery)** — `recover`, `expect`, and a `{ recover: true }` channel keep parsing broken input and report every error.
|
|
80
83
|
- **[Context-sensitive parsing](https://matthew-dean.github.io/parseman/guide/context)** — `withCtx` / `guard` without mutating shared state.
|
|
@@ -121,7 +124,7 @@ Compared parsers: **Parséman**, [Peggy](https://peggyjs.org/), [Parsimmon](http
|
|
|
121
124
|
|
|
122
125
|

|
|
123
126
|
|
|
124
|
-
Parséman has three modes — **interpreter** (zero setup, works anywhere), **macro build** (compiled by the bundler plugin at build time, zero runtime cost), and
|
|
127
|
+
Parséman has three modes — **interpreter** (zero setup, works anywhere), **macro build** (compiled by the bundler plugin at build time, zero runtime cost), and **`compile()`** (optional runtime JIT). Most production use lands on one of the first two. The initialization section only shows parsers with a nonzero setup cost: `compile()` costs 75–650 µs depending on grammar size; Chevrotain always costs 840–1,400 µs. Parsers not listed there start for free. (Init numbers are pinned on the charts — they're noisy run-to-run; warm-parse bars are the meaningful comparison.)
|
|
125
128
|
|
|
126
129
|
On JSON, CSV, and GraphQL, Parséman macro beats every other library at every fixture size in the charts above — e.g. GraphQL large **154 µs** vs Peggy **423 µs**, JSON large **125 µs** vs Peggy **472 µs** / Chevrotain **1,946 µs**. Native `JSON.parse` is the one thing faster on JSON (**45 µs** large). Even the zero-setup interpreter is highly competitive: on JSON and CSV it's the fastest option after the macro build — ahead of Peggy and every other generator — with Peggy edging it out only on GraphQL. On the CST chart, macro build beats Lezer at every size (**226 µs** vs **626 µs** large, parse-only). Full write-up and how to refresh the charts: **[benchmarks guide](https://matthew-dean.github.io/parseman/guide/benchmarks)**. Grammar-level speed levers: [performance guide](https://matthew-dean.github.io/parseman/guide/performance); library-level codegen: [PERF_IDEAS.md](./notes/PERF_IDEAS.md).
|
|
127
130
|
|
|
@@ -11,4 +11,9 @@ export declare function trivia<T>(combinator: Combinator<T>): Combinator<T>;
|
|
|
11
11
|
* trivia-kind capture (`'whitespace'`, `'blockComment'`, …).
|
|
12
12
|
*/
|
|
13
13
|
export declare function label<T>(name: string, combinator: Combinator<T>): Combinator<T>;
|
|
14
|
+
/**
|
|
15
|
+
* Capture a named parse result for the nearest enclosing node() builder.
|
|
16
|
+
* Parse behavior and the normal returned value are unchanged.
|
|
17
|
+
*/
|
|
18
|
+
export declare function field<T>(name: string, combinator: Combinator<T>): Combinator<T>;
|
|
14
19
|
//# sourceMappingURL=map.d.ts.map
|
|
@@ -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;AAGxE,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;AA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AAC,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,8 +1,8 @@
|
|
|
1
|
-
import type { Combinator } from '../types.ts';
|
|
1
|
+
import type { Combinator, FieldMap } from '../types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* A CST/AST node rule. Runs `combinator` while collecting its terminals into
|
|
4
4
|
* `children` / `rawChildren` arrays and trivia spans into `triviaLog`, then
|
|
5
|
-
* calls `build(children,
|
|
5
|
+
* calls `build(children, fields, span, rawChildren, triviaLog, state)` to produce the node.
|
|
6
6
|
*
|
|
7
7
|
* - `children` — structural items in source order: spanned CSTLeaf terminals
|
|
8
8
|
* and sub-nodes (whatever `build` returned for inner nodes).
|
|
@@ -12,26 +12,27 @@ import type { Combinator } from '../types.ts';
|
|
|
12
12
|
* before which the trivia was consumed. Use `buildTriviaIndex`
|
|
13
13
|
* to turn this into a before/after lookup table.
|
|
14
14
|
*
|
|
15
|
-
* If `build` returns a non-node value (e.g. a bare string for
|
|
15
|
+
* If `build` returns a non-node value (e.g. a bare string for an unwrapped rule),
|
|
16
16
|
* the parent records it as a spanned leaf so its source span is still recoverable.
|
|
17
17
|
*/
|
|
18
|
-
export type BuildNode<N> = (children: ReadonlyArray<unknown>,
|
|
18
|
+
export type BuildNode<N> = (children: ReadonlyArray<unknown>, fields: FieldMap | undefined, span: {
|
|
19
19
|
start: number;
|
|
20
20
|
end: number;
|
|
21
|
-
}, triviaLog: readonly number[], state: unknown) => N;
|
|
21
|
+
}, rawChildren: ReadonlyArray<unknown>, triviaLog: readonly number[], state: unknown) => N;
|
|
22
22
|
/**
|
|
23
23
|
* Options for `node()`.
|
|
24
|
-
* - `
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* `if (children.length === 1) return children[0]` in every wrapper builder.
|
|
24
|
+
* - `unwrap` — an AST/value wrapper rule that IS its single child when it
|
|
25
|
+
* captured exactly one. A leaf unwraps to its string value; a sub-node is
|
|
26
|
+
* returned as-is.
|
|
27
|
+
* - `collapse` — a structural wrapper rule that returns its single child exactly
|
|
28
|
+
* as captured. A leaf stays a CSTLeaf; a node stays a node.
|
|
29
|
+
* Both skip `build` only for a one-child match; zero or two-plus children go
|
|
30
|
+
* through `build` normally.
|
|
32
31
|
*/
|
|
33
32
|
export type NodeOptions = {
|
|
33
|
+
unwrap?: boolean;
|
|
34
34
|
collapse?: boolean;
|
|
35
35
|
};
|
|
36
|
+
export declare function node<N>(combinator: Combinator<unknown>, build?: BuildNode<N>, opts?: NodeOptions): Combinator<N>;
|
|
36
37
|
export declare function node<N>(type: string, combinator: Combinator<unknown>, build?: BuildNode<N>, opts?: NodeOptions): Combinator<N>;
|
|
37
38
|
//# 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;
|
|
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;AAKzG;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,CACzB,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,EAChC,MAAM,EAAE,QAAQ,GAAG,SAAS,EAC5B,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACpC,WAAW,EAAE,aAAa,CAAC,OAAO,CAAC,EACnC,SAAS,EAAE,SAAS,MAAM,EAAE,EAC5B,KAAK,EAAE,OAAO,KACX,CAAC,CAAA;AAEN;;;;;;;;;GASG;AACH,MAAM,MAAM,WAAW,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAAA;AAqBlE,wBAAgB,IAAI,CAAC,CAAC,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,CAAA;AACjH,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,CAAA"}
|
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/combinators/parser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAS7C;;;;;;;;;;;;;;;;;;;;;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,CAiDH"}
|
|
@@ -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;AAGpF;;;;;;;;;;;;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,
|
|
1
|
+
{"version":3,"file":"ref.d.ts","sourceRoot":"","sources":["../../src/combinators/ref.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAyC,MAAM,aAAa,CAAA;AAGpF;;;;;;;;;;;;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,CAqC3E"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { Combinator, FirstSet } from '../types.ts';
|
|
2
2
|
/**
|
|
3
3
|
* Computes a regex terminal's first-set (for choice-dispatch fast paths). The
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* (`index.ts`) via `registerRegexAnalyzer`. It is injected rather than
|
|
7
|
-
* so that consumers who
|
|
8
|
-
*
|
|
9
|
-
* analyzer is registered, `regex()` uses the permissive
|
|
10
|
-
*
|
|
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
11
|
*/
|
|
12
12
|
export type RegexFirstSetAnalyzer = (pattern: string) => {
|
|
13
13
|
firstSet: FirstSet;
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAM9F;;;;;;;;;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;AA2DD,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,SAAK,GAAG,UAAU,CAAC,MAAM,CAAC,CAmC9E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trivia-skip.d.ts","sourceRoot":"","sources":["../../src/combinators/trivia-skip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,aAAa,CAAA;AAc3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAAA;AAE5D,iEAAiE;AACjE,MAAM,MAAM,kBAAkB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;
|
|
1
|
+
{"version":3,"file":"trivia-skip.d.ts","sourceRoot":"","sources":["../../src/combinators/trivia-skip.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,YAAY,EAAE,MAAM,aAAa,CAAA;AAc3D;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAAA;AAE5D,iEAAiE;AACjE,MAAM,MAAM,kBAAkB,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAA;AAM3G,oFAAoF;AACpF,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAEpE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,kBAAkB,CAGpE;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,kBAAkB,GAAG,IAAI,CAGhF;AAiBD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,MAAM,CAWnF;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,UAAU,CAkCpF;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,GAAG,MAAM,CAKnF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ParserDef } from '../types.ts';
|
|
2
2
|
/**
|
|
3
|
-
* Per-node CST-trivia (
|
|
3
|
+
* Per-node CST-trivia (5th build arg) and state-clone (6th build arg) capture is
|
|
4
4
|
* dead work when the build never declares those formal params. This module derives
|
|
5
5
|
* a build's *confirmed* formal-parameter arity so all three eval paths (interpreter,
|
|
6
6
|
* compiler, macro) can elide that capture identically.
|
|
@@ -18,9 +18,9 @@ type NodeDef = Extract<ParserDef, {
|
|
|
18
18
|
* source can't be parsed into a plain identifier list (→ caller keeps full capture).
|
|
19
19
|
*/
|
|
20
20
|
export declare function confirmedBuildArity(src: string): number | null;
|
|
21
|
-
/** Build reads the
|
|
21
|
+
/** Build reads the 5th (triviaLog) arg? Unknown/unparseable → true (keep capture). */
|
|
22
22
|
export declare function buildReadsTrivia(def: NodeDef): boolean;
|
|
23
|
-
/** Build reads the
|
|
23
|
+
/** Build reads the 6th (state) arg? Unknown/unparseable → true (keep state clone). */
|
|
24
24
|
export declare function buildReadsState(def: NodeDef): boolean;
|
|
25
25
|
export {};
|
|
26
26
|
//# sourceMappingURL=build-arity.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,EAAa,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"codegen.d.ts","sourceRoot":"","sources":["../../src/compiler/codegen.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,UAAU,EAAa,QAAQ,EAAE,WAAW,EAAE,YAAY,EAAE,UAAU,EAA4B,MAAM,aAAa,CAAA;AA0BnI;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,uTAC0R,CAAA;AActT,8EAA8E;AAC9E,wBAAgB,oBAAoB,IAAI,IAAI,CAE3C;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAI7C;AA6bD,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,QAAQ,GAAG,MAAM,CAQlE;AAcD,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,CAA0B;AAs1DjF,MAA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,EAAE,MAAM,EAAE,CAAA;IACd,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC7B;;;;OAIG;IACH,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;IAChC,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;IAC3B,YAAY,EAAE,OAAO,CAAA;IACrB,cAAc,EAAE,OAAO,CAAA;IACvB;;;;;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,CAyKvB"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Combinator, FieldMap, ParserDef } from '../types.ts';
|
|
2
|
+
type NodeDef = Extract<ParserDef, {
|
|
3
|
+
tag: 'node';
|
|
4
|
+
}>;
|
|
5
|
+
export declare function buildReadsFields(def: NodeDef): boolean;
|
|
6
|
+
export declare function parserHasOwnFields(p: Combinator<unknown>, seen?: Set<Combinator<unknown>>): boolean;
|
|
7
|
+
export declare function buildFieldMap(captures: ReadonlyArray<{
|
|
8
|
+
name: string;
|
|
9
|
+
value: unknown;
|
|
10
|
+
span: {
|
|
11
|
+
start: number;
|
|
12
|
+
end: number;
|
|
13
|
+
};
|
|
14
|
+
}> | undefined): FieldMap | undefined;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../src/compiler/fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGlE,KAAK,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAAA;AAElD,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,OAAO,CAMtD;AAED,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,GAAE,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,CAAa,GAAG,OAAO,CA+B9G;AAED,wBAAgB,aAAa,CAAC,QAAQ,EAAE,aAAa,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,CAAC,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAW/J"}
|
|
@@ -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,
|
|
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,CAW5F;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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir-serialize.d.ts","sourceRoot":"","sources":["../../src/compiler/ir-serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAiBxD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"ir-serialize.d.ts","sourceRoot":"","sources":["../../src/compiler/ir-serialize.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAiBxD,KAAK,IAAI,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;AA4C/B,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,aAAa,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,GAC9C,MAAM,GAAG,IAAI,CAUf;AAED;;oFAEoF;AACpF,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAgC/D"}
|
|
@@ -1,17 +1,31 @@
|
|
|
1
1
|
import type { LinkablePieces } from './codegen.ts';
|
|
2
|
-
import type { Combinator } from '../types.ts';
|
|
2
|
+
import type { BuildHost, Combinator, CstCollapsePredicate } from '../types.ts';
|
|
3
3
|
export declare function linkable(rulesMap: Record<string, Combinator<unknown>>, ns?: string): LinkablePieces;
|
|
4
|
+
export type CstBuildHostOptions = {
|
|
5
|
+
/**
|
|
6
|
+
* Collapse transparent one-child CST wrapper nodes at build time.
|
|
7
|
+
* - `true`: collapse any one-child node whose rawChildren also has exactly one
|
|
8
|
+
* entry, so trivia/error boundaries are not silently dropped.
|
|
9
|
+
* - `string[]`: collapse only these grammar node types.
|
|
10
|
+
* - predicate: final policy hook for language-specific public CSTs.
|
|
11
|
+
*/
|
|
12
|
+
collapse?: boolean | readonly string[] | CstCollapsePredicate;
|
|
13
|
+
};
|
|
4
14
|
/**
|
|
5
15
|
* A generic positioned-CST build host (RULE_ABI_PLAN §7). Pass as `ctx.build`
|
|
6
16
|
* (or `parseDoc(..., { build: cstBuildHost })`) to make ANY linkable/fused
|
|
7
17
|
* grammar produce a uniform CST — `{ _tag:'node', type, span, state, children }`
|
|
8
18
|
* — instead of its own eval-AST builders. This is the host the linter and IDE
|
|
9
19
|
* drivers use; the eval driver leaves `ctx.build` unset (grammar's own builders).
|
|
20
|
+
*
|
|
21
|
+
* For public syntax trees, call `cstBuildHost({ collapse })`: Parseman will skip
|
|
22
|
+
* allocating wrapper CST nodes whose single child should stand in for the rule.
|
|
10
23
|
*/
|
|
11
|
-
export declare function cstBuildHost(
|
|
24
|
+
export declare function cstBuildHost(options?: CstBuildHostOptions): BuildHost;
|
|
25
|
+
export declare function cstBuildHost(type: string, children: ReadonlyArray<unknown>, fields: unknown, span: {
|
|
12
26
|
start: number;
|
|
13
27
|
end: number;
|
|
14
|
-
},
|
|
28
|
+
}, rawChildren?: ReadonlyArray<unknown>, triviaLog?: readonly number[], state?: unknown): unknown;
|
|
15
29
|
export type FusedRule = (input: string, pos: number, ctx: Record<string, unknown>) => {
|
|
16
30
|
ok: boolean;
|
|
17
31
|
value?: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../src/compiler/linker.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,UAAU,EAAY,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"linker.d.ts","sourceRoot":"","sources":["../../src/compiler/linker.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,oBAAoB,EAAY,MAAM,aAAa,CAAA;AAaxF,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC,EAC7C,EAAE,CAAC,EAAE,MAAM,GACV,cAAc,CAIhB;AAED,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,GAAG,oBAAoB,CAAA;CAC9D,CAAA;AAyBD;;;;;;;;;GASG;AACH,wBAAgB,YAAY,CAAC,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAA;AACtE,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,aAAa,CAAC,OAAO,CAAC,EAChC,MAAM,EAAE,OAAO,EACf,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACpC,WAAW,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,EACpC,SAAS,CAAC,EAAE,SAAS,MAAM,EAAE,EAC7B,KAAK,CAAC,EAAE,OAAO,GACd,OAAO,CAAA;AA2BV,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;AAoED;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;AAqBD;uEACuE;AACvE,MAAM,MAAM,OAAO,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAAA;AAQhD;qEACqE;AACrE,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,cAAc,GAAG,OAAO,GAAG,cAAc,CAK5E;AA0BD,wBAAgB,OAAO,CACrB,KAAK,EAAE,KAAK,CAAC,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GACrD,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAM3B"}
|
|
@@ -96,15 +96,8 @@ export type ScanShape = {
|
|
|
96
96
|
};
|
|
97
97
|
/** Backslash (`\`) code point — the escape lead char in string shapes. */
|
|
98
98
|
export declare const BACKSLASH = 92;
|
|
99
|
-
|
|
100
|
-
|
|
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;
|
|
99
|
+
import { SPACE_RANGES, parseClassRanges } from '../regex/classes.ts';
|
|
100
|
+
export { SPACE_RANGES, parseClassRanges };
|
|
108
101
|
/** ASCII case-insensitive letter check for `i`-flag literal lowering. */
|
|
109
102
|
export declare const foldEq: (cVar: string, cp: number) => string;
|
|
110
103
|
type CharSet = {
|
|
@@ -174,5 +167,4 @@ export declare function scanBranch(shape: ScanShape, mint: Mint): string;
|
|
|
174
167
|
* kindIndex] trivia chunk. Same completion semantics as scanBranch.
|
|
175
168
|
*/
|
|
176
169
|
export declare function scanBranchLabeled(shape: ScanShape, kindIndex: number, mint: Mint): string;
|
|
177
|
-
export {};
|
|
178
170
|
//# sourceMappingURL=scannable-run.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scannable-run.d.ts","sourceRoot":"","sources":["../../src/compiler/scannable-run.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,OAAO,GACf;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,GACjD;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,GAClG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC;IAAC,SAAS,EAAE,OAAO,CAAA;CAAE,CAAA;AAEv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;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAG/D;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,CAazF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"value-usage.d.ts","sourceRoot":"","sources":["../../src/compiler/value-usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"value-usage.d.ts","sourceRoot":"","sources":["../../src/compiler/value-usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,aAAa,CAAA;AAExD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,GAAG,IAAI,CA4GhE"}
|
|
@@ -37,6 +37,7 @@ export type CstRollbackMark = {
|
|
|
37
37
|
raw: number;
|
|
38
38
|
tlog: number;
|
|
39
39
|
leaves: number;
|
|
40
|
+
fields: number;
|
|
40
41
|
};
|
|
41
42
|
export declare function saveCstMark(ctx: ParseContext): CstRollbackMark;
|
|
42
43
|
export declare function rollbackCstCapture(ctx: ParseContext, mark: CstRollbackMark): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capture-buffer.d.ts","sourceRoot":"","sources":["../../src/cst/capture-buffer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAE/C,uEAAuE;AACvE,MAAM,MAAM,aAAa,GAAG;IAC1B,M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