parseman 0.57.0 → 0.58.1
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/dist/analysis/diagnostics.js +1800 -962
- package/dist/analysis/diagnostics.js.map +3 -3
- package/dist/cli/index.js +1929 -1091
- package/dist/cli/index.js.map +3 -3
- package/dist/combinators/dispatch.d.ts.map +1 -1
- package/dist/compiler/token-alphabet.d.ts +11 -1
- package/dist/compiler/token-alphabet.d.ts.map +1 -1
- package/dist/compiler/token-capability.js +69 -16
- package/dist/compiler/token-capability.js.map +2 -2
- package/dist/cst/capture-buffer.d.ts +6 -0
- package/dist/cst/capture-buffer.d.ts.map +1 -1
- package/dist/index.js +1017 -177
- package/dist/index.js.map +3 -3
- package/dist/plugin/index.d.ts +25 -1
- package/dist/plugin/index.d.ts.map +1 -1
- package/dist/plugin/index.js +1210 -236
- package/dist/plugin/index.js.map +3 -3
- package/dist/run/index.d.ts +2 -0
- package/dist/run/index.d.ts.map +1 -1
- package/dist/run/index.js +9 -0
- package/dist/run/index.js.map +1 -1
- package/dist/table/assemble.d.ts.map +1 -1
- package/dist/table/compile-rule-map.d.ts.map +1 -1
- package/dist/table/emit-assembly.d.ts +1 -1
- package/dist/table/emit-assembly.d.ts.map +1 -1
- package/dist/table/emit.d.ts.map +1 -1
- package/dist/table/encode.d.ts.map +1 -1
- package/dist/table/exec.d.ts.map +1 -1
- package/dist/table/factor-choice.d.ts +42 -0
- package/dist/table/factor-choice.d.ts.map +1 -0
- package/dist/table/fail-clean.d.ts +3 -0
- package/dist/table/fail-clean.d.ts.map +1 -0
- package/dist/table/hold-gap.d.ts +8 -0
- package/dist/table/hold-gap.d.ts.map +1 -0
- package/dist/table/index.js +1370 -259
- package/dist/table/index.js.map +3 -3
- package/dist/table/lex-program.d.ts +7 -3
- package/dist/table/lex-program.d.ts.map +1 -1
- package/dist/table/ops.d.ts +8 -0
- package/dist/table/ops.d.ts.map +1 -1
- package/dist/table/run-support.d.ts +19 -0
- package/dist/table/run-support.d.ts.map +1 -1
- package/dist/table/scalar-terminal.d.ts +2 -0
- package/dist/table/scalar-terminal.d.ts.map +1 -1
- package/dist/table/site-labels.d.ts +66 -0
- package/dist/table/site-labels.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/combinators/dispatch.ts +12 -3
- package/src/compiler/token-alphabet.ts +57 -17
- package/src/cst/capture-buffer.ts +25 -0
- package/src/plugin/index.ts +230 -35
- package/src/run/index.ts +5 -0
- package/src/table/assemble.ts +252 -62
- package/src/table/child-slots.ts +2 -2
- package/src/table/compile-rule-map.ts +14 -5
- package/src/table/emit-assembly.ts +112 -23
- package/src/table/emit.ts +3 -1
- package/src/table/encode.ts +83 -14
- package/src/table/exec.ts +27 -8
- package/src/table/factor-choice.ts +173 -0
- package/src/table/fail-clean.ts +130 -0
- package/src/table/hold-gap.ts +68 -0
- package/src/table/lex-program.ts +197 -43
- package/src/table/ops.ts +9 -1
- package/src/table/run-support.ts +35 -0
- package/src/table/scalar-terminal.ts +8 -0
- package/src/table/site-labels.ts +135 -4
- package/src/version.ts +1 -1
package/dist/plugin/index.d.ts
CHANGED
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import MagicString from 'magic-string';
|
|
2
|
+
import { type IRPiece } from '../compiler/linker.ts';
|
|
3
|
+
/**
|
|
4
|
+
* BUILD-ONLY CARRIED PIECES.
|
|
5
|
+
*
|
|
6
|
+
* Nothing at runtime reads a grammar's carried IR: `compose()` links live `rules()`
|
|
7
|
+
* maps, and every runtime reader treats an IR piece as opaque
|
|
8
|
+
* (docs/design/runtime-and-size-contract.md, rules 1 and 2). Only a downstream macro
|
|
9
|
+
* build reads it. Under a rollup-family bundler the macro therefore leaves the IR out
|
|
10
|
+
* of the artifact and writes each chunk's carried lists beside it, as
|
|
11
|
+
* `<chunk>.parseman.json`; `resolveModulePieces` reads that file before it looks for
|
|
12
|
+
* an inline literal. Inline, the IR is about a quarter of a composed grammar's
|
|
13
|
+
* artifact, and the runtime spread that forwards an ancestor's pieces keeps that
|
|
14
|
+
* ancestor's module in the import graph of every parse.
|
|
15
|
+
*
|
|
16
|
+
* An item is an IR piece, or a reference to an export of a package module, resolved
|
|
17
|
+
* from the artifact's own location.
|
|
18
|
+
*/
|
|
19
|
+
export type CarriedSidecarItem = IRPiece | {
|
|
20
|
+
from: string;
|
|
21
|
+
name: string;
|
|
22
|
+
};
|
|
23
|
+
/** One module's carried lists, by export name. */
|
|
24
|
+
export type CarriedSink = Map<string, CarriedSidecarItem[]>;
|
|
25
|
+
export declare const CARRIED_SIDECAR_SUFFIX = ".parseman.json";
|
|
2
26
|
export type ParsecraftPluginOptions = {
|
|
3
27
|
/** Extra module specifiers to treat as parseman re-exports */
|
|
4
28
|
moduleAliases?: string[];
|
|
@@ -76,5 +100,5 @@ export type TransformMacroResult = {
|
|
|
76
100
|
* printed rather than dropped — a degradation that was real before the abort is still
|
|
77
101
|
* real after it.
|
|
78
102
|
*/
|
|
79
|
-
export declare function transformMacro(code: string, id: string, moduleAliases?: Set<string>, warnUnloweredRegex?: boolean, recovery?: boolean, grammarCoverage?: boolean, assemblyProfile?: AssemblyProfile, assemblyBudget?: number): TransformMacroResult | null;
|
|
103
|
+
export declare function transformMacro(code: string, id: string, moduleAliases?: Set<string>, warnUnloweredRegex?: boolean, recovery?: boolean, grammarCoverage?: boolean, assemblyProfile?: AssemblyProfile, assemblyBudget?: number, carriedSink?: CarriedSink): TransformMacroResult | null;
|
|
80
104
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAwBA,OAAO,WAAW,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/plugin/index.ts"],"names":[],"mappings":"AAwBA,OAAO,WAAW,MAAM,cAAc,CAAA;AActC,OAAO,EAAmB,KA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