sh-ast 0.3.1 → 0.5.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 +199 -143
- package/dist/analyze/ansi-c-escapes.d.ts +1 -1
- package/dist/analyze/ansi-c-escapes.js +1 -1
- package/dist/analyze/enumerate-commands.d.ts +11 -16
- package/dist/analyze/enumerate-commands.d.ts.map +1 -1
- package/dist/analyze/enumerate-commands.js +82 -92
- package/dist/analyze/enumerate-commands.js.map +1 -1
- package/dist/analyze/index.d.ts +3 -2
- package/dist/analyze/index.d.ts.map +1 -1
- package/dist/analyze/index.js +1 -1
- package/dist/analyze/node-helpers.d.ts +10 -21
- package/dist/analyze/node-helpers.d.ts.map +1 -1
- package/dist/analyze/node-helpers.js +16 -27
- package/dist/analyze/node-helpers.js.map +1 -1
- package/dist/analyze/resolve-argv0.d.ts +6 -6
- package/dist/analyze/resolve-argv0.js +6 -6
- package/dist/analyze/resolve-word.d.ts +7 -10
- package/dist/analyze/resolve-word.d.ts.map +1 -1
- package/dist/analyze/resolve-word.js +39 -22
- package/dist/analyze/resolve-word.js.map +1 -1
- package/dist/analyze.d.ts +3780 -397
- package/dist/errors.d.ts +6 -79
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +5 -64
- package/dist/errors.js.map +1 -1
- package/dist/index.d.ts +20 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26 -4
- package/dist/index.js.map +1 -1
- package/dist/sh-ast.d.ts +3616 -1020
- package/dist/syntax-errors.d.ts +56 -0
- package/dist/syntax-errors.d.ts.map +1 -0
- package/dist/syntax-errors.js +80 -0
- package/dist/syntax-errors.js.map +1 -0
- package/dist/syntax-print-errors.d.ts +35 -0
- package/dist/syntax-print-errors.d.ts.map +1 -0
- package/dist/syntax-print-errors.js +37 -0
- package/dist/syntax-print-errors.js.map +1 -0
- package/dist/syntax-print.d.ts +49 -0
- package/dist/syntax-print.d.ts.map +1 -0
- package/dist/syntax-print.js +86 -0
- package/dist/syntax-print.js.map +1 -0
- package/dist/syntax-snapshot.d.ts +47 -0
- package/dist/syntax-snapshot.d.ts.map +1 -0
- package/dist/syntax-snapshot.js +121 -0
- package/dist/syntax-snapshot.js.map +1 -0
- package/dist/syntax-walk-bounds.d.ts +18 -0
- package/dist/syntax-walk-bounds.d.ts.map +1 -0
- package/dist/syntax-walk-bounds.js +188 -0
- package/dist/syntax-walk-bounds.js.map +1 -0
- package/dist/syntax-walk-errors.d.ts +19 -0
- package/dist/syntax-walk-errors.d.ts.map +1 -0
- package/dist/syntax-walk-errors.js +23 -0
- package/dist/syntax-walk-errors.js.map +1 -0
- package/dist/syntax-walk-license.d.ts +3 -0
- package/dist/syntax-walk-license.d.ts.map +1 -0
- package/dist/syntax-walk-license.js +37 -0
- package/dist/syntax-walk-license.js.map +1 -0
- package/dist/syntax-walk.d.ts +46 -0
- package/dist/syntax-walk.d.ts.map +1 -0
- package/dist/syntax-walk.js +322 -0
- package/dist/syntax-walk.js.map +1 -0
- package/dist/syntax-wire.d.ts +31 -0
- package/dist/syntax-wire.d.ts.map +1 -0
- package/dist/syntax-wire.js +202 -0
- package/dist/syntax-wire.js.map +1 -0
- package/dist/syntax.d.ts +65 -0
- package/dist/syntax.d.ts.map +1 -0
- package/dist/syntax.js +152 -0
- package/dist/syntax.js.map +1 -0
- package/dist/wasm-instance.d.ts +5 -8
- package/dist/wasm-instance.d.ts.map +1 -1
- package/dist/wasm-instance.js +44 -47
- package/dist/wasm-instance.js.map +1 -1
- package/generated/syntax-constants.d.ts +1652 -0
- package/generated/syntax-constants.js +1384 -0
- package/generated/syntax-schema.d.ts +60 -0
- package/generated/syntax-schema.js +1740 -0
- package/generated/syntax-types.d.ts +1977 -0
- package/package.json +2 -2
- package/shim/sh-ast.wasm +0 -0
- package/dist/normalize.d.ts +0 -52
- package/dist/normalize.d.ts.map +0 -1
- package/dist/normalize.js +0 -260
- package/dist/normalize.js.map +0 -1
- package/dist/parse.d.ts +0 -50
- package/dist/parse.d.ts.map +0 -1
- package/dist/parse.js +0 -125
- package/dist/parse.js.map +0 -1
- package/dist/types.d.ts +0 -74
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/visitor-keys.d.ts +0 -21
- package/dist/visitor-keys.d.ts.map +0 -1
- package/dist/visitor-keys.js +0 -23
- package/dist/visitor-keys.js.map +0 -1
- package/dist/walk.d.ts +0 -18
- package/dist/walk.d.ts.map +0 -1
- package/dist/walk.js +0 -40
- package/dist/walk.js.map +0 -1
- package/generated/child-type-schema.d.ts +0 -14
- package/generated/child-type-schema.js +0 -188
- package/generated/node-types.d.ts +0 -1002
- package/generated/position-fields.d.ts +0 -21
- package/generated/position-fields.js +0 -50
- package/generated/visitor-keys.d.ts +0 -11
- package/generated/visitor-keys.js +0 -50
package/dist/errors.d.ts
CHANGED
|
@@ -1,92 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
/** Shared failure classes for binding invariants, resource limits, and analysis contracts. */
|
|
2
2
|
/**
|
|
3
|
-
* Common base
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* {@link ShAnalyzeInvalidWrapperSpecError}). Provides a stable, documented
|
|
7
|
-
* `code` discriminator (e.g. `"SH_AST_PARSE_ERROR"`) alongside the usual
|
|
8
|
-
* `instanceof` narrowing, so consumers can branch on failure kind
|
|
9
|
-
* programmatically without parsing `.message` strings. Never thrown directly
|
|
10
|
-
* — only via its concrete subclasses
|
|
11
|
-
* ({@link sh-ast#ShParseError | ShParseError},
|
|
12
|
-
* {@link sh-ast#ShInvalidDialectError | ShInvalidDialectError},
|
|
13
|
-
* {@link sh-ast#ShInternalError | ShInternalError},
|
|
14
|
-
* {@link ShAnalyzeMaxDepthError},
|
|
15
|
-
* {@link sh-ast#ShParseMaxDepthError | ShParseMaxDepthError},
|
|
16
|
-
* {@link ShAnalyzeInvalidWrapperSpecError}).
|
|
17
|
-
*
|
|
18
|
-
* Re-exported from `sh-ast/analyze` as well as the root `sh-ast` entry
|
|
19
|
-
* point (see #23) — every subclass thrown by `sh-ast/analyze`'s own
|
|
20
|
-
* functions extends this, so a consumer of that subpath alone can
|
|
21
|
-
* `catch`/reference the base without also importing from root.
|
|
22
|
-
*
|
|
3
|
+
* Common base for every package failure, including upstream syntax errors and
|
|
4
|
+
* analysis errors. The stable code discriminator supports programmatic handling
|
|
5
|
+
* without interpreting display messages. Only concrete subclasses are thrown.
|
|
23
6
|
* @public
|
|
24
7
|
*/
|
|
25
8
|
export declare abstract class ShAstError extends Error {
|
|
26
|
-
/**
|
|
27
|
-
* Stable, machine-readable discriminator for this error kind. Distinct
|
|
28
|
-
* per subclass and will not change once published.
|
|
29
|
-
*/
|
|
9
|
+
/** Stable machine-readable identity of the concrete failure kind. */
|
|
30
10
|
abstract readonly code: string;
|
|
31
11
|
}
|
|
32
|
-
/**
|
|
33
|
-
* Position info attached to a {@link ShParseError}.
|
|
34
|
-
*
|
|
35
|
-
* @public
|
|
36
|
-
*/
|
|
37
|
-
export interface ShParseErrorInfo {
|
|
38
|
-
/** 1-based line number, exactly as reported by mvdan/sh. */
|
|
39
|
-
line: number;
|
|
40
|
-
/**
|
|
41
|
-
* 1-based column number, in **UTF-16 code units** — converted from
|
|
42
|
-
* mvdan/sh's own byte-counting column so it agrees with
|
|
43
|
-
* {@link ShNode.loc}'s columns (mvdan/sh reports `column` as a byte count
|
|
44
|
-
* on the source line, not a UTF-16 code unit count; see
|
|
45
|
-
* design/ARCHITECTURE.md's "Byte→UTF-16 conversion"). For ASCII-only
|
|
46
|
-
* source text this is numerically identical to mvdan/sh's own column.
|
|
47
|
-
*/
|
|
48
|
-
column: number;
|
|
49
|
-
/** The filename used for the parse (see {@link ParseOptions.filename}). */
|
|
50
|
-
filename: string;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Thrown by {@link parseSync} when shell source fails to parse. Carries the
|
|
54
|
-
* real position mvdan/sh reported — never 1:1 placeholders: `.line` is
|
|
55
|
-
* 1-based exactly as mvdan/sh reports it, and `.column` is converted to
|
|
56
|
-
* UTF-16 code units so it agrees with {@link ShNode.loc}'s columns (mvdan/sh
|
|
57
|
-
* itself reports `column` as a byte count on the source line — see
|
|
58
|
-
* {@link ShParseErrorInfo.column}). The unconverted, raw byte-column
|
|
59
|
-
* position appears only inside `.message`, mvdan/sh's own formatted string,
|
|
60
|
-
* verbatim.
|
|
61
|
-
*
|
|
62
|
-
* @public
|
|
63
|
-
*/
|
|
64
|
-
export declare class ShParseError extends ShAstError {
|
|
65
|
-
readonly code = "SH_AST_PARSE_ERROR";
|
|
66
|
-
readonly line: number;
|
|
67
|
-
readonly column: number;
|
|
68
|
-
readonly filename: string;
|
|
69
|
-
constructor(message: string, info: ShParseErrorInfo);
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Thrown by {@link parseSync} when {@link ParseOptions.dialect} is not one
|
|
73
|
-
* of the supported {@link ShellDialect} values. Carries the rejected value
|
|
74
|
-
* as `.dialect`; `.message` lists the supported dialects. A foreseeable,
|
|
75
|
-
* actionable user mistake — never an instance of {@link ShParseError}.
|
|
76
|
-
*
|
|
77
|
-
* @public
|
|
78
|
-
*/
|
|
79
|
-
export declare class ShInvalidDialectError extends ShAstError {
|
|
80
|
-
readonly code = "SH_AST_INVALID_DIALECT";
|
|
81
|
-
/** The rejected dialect value, exactly as passed to {@link parseSync}. */
|
|
82
|
-
readonly dialect: string;
|
|
83
|
-
constructor(dialect: string, supportedDialects: readonly ShellDialect[]);
|
|
84
|
-
}
|
|
85
12
|
/**
|
|
86
13
|
* Thrown by {@link parseSync} for failures that should never happen given a
|
|
87
14
|
* correctly-behaving WASM shim: a malformed result envelope, an unexpected
|
|
88
15
|
* root node type, or any other shim contract violation. Distinct from
|
|
89
|
-
* {@link
|
|
16
|
+
* {@link InputError} and {@link ParseError}, both of which
|
|
90
17
|
* indicate a foreseeable, actionable user mistake rather than an internal
|
|
91
18
|
* defect.
|
|
92
19
|
*
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F;;;;;GAKG;AACH,8BAAsB,UAAW,SAAQ,KAAK;IAC5C,qEAAqE;IACrE,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CAChC;AAED;;;;;;;;;GASG;AACH,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,QAAQ,CAAC,IAAI,qBAAqB;gBAEtB,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;IACpD,QAAQ,CAAC,IAAI,8BAA8B;IAC3C,mHAAmH;IACnH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,QAAQ,EAAE,MAAM;CAO7B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;IAClD,QAAQ,CAAC,IAAI,4BAA4B;IACzC,qHAAqH;IACrH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B;;;;OAIG;IACH,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;gBAEpB,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM;CAQrD;AAED;;;;;;;;;;GAUG;AACH,qBAAa,gCAAiC,SAAQ,UAAU;IAC9D,QAAQ,CAAC,IAAI,yCAAyC;gBAE1C,OAAO,EAAE,MAAM;CAI5B"}
|
package/dist/errors.js
CHANGED
|
@@ -1,76 +1,17 @@
|
|
|
1
|
+
/** Shared failure classes for binding invariants, resource limits, and analysis contracts. */
|
|
1
2
|
/**
|
|
2
|
-
* Common base
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* {@link ShAnalyzeInvalidWrapperSpecError}). Provides a stable, documented
|
|
6
|
-
* `code` discriminator (e.g. `"SH_AST_PARSE_ERROR"`) alongside the usual
|
|
7
|
-
* `instanceof` narrowing, so consumers can branch on failure kind
|
|
8
|
-
* programmatically without parsing `.message` strings. Never thrown directly
|
|
9
|
-
* — only via its concrete subclasses
|
|
10
|
-
* ({@link sh-ast#ShParseError | ShParseError},
|
|
11
|
-
* {@link sh-ast#ShInvalidDialectError | ShInvalidDialectError},
|
|
12
|
-
* {@link sh-ast#ShInternalError | ShInternalError},
|
|
13
|
-
* {@link ShAnalyzeMaxDepthError},
|
|
14
|
-
* {@link sh-ast#ShParseMaxDepthError | ShParseMaxDepthError},
|
|
15
|
-
* {@link ShAnalyzeInvalidWrapperSpecError}).
|
|
16
|
-
*
|
|
17
|
-
* Re-exported from `sh-ast/analyze` as well as the root `sh-ast` entry
|
|
18
|
-
* point (see #23) — every subclass thrown by `sh-ast/analyze`'s own
|
|
19
|
-
* functions extends this, so a consumer of that subpath alone can
|
|
20
|
-
* `catch`/reference the base without also importing from root.
|
|
21
|
-
*
|
|
3
|
+
* Common base for every package failure, including upstream syntax errors and
|
|
4
|
+
* analysis errors. The stable code discriminator supports programmatic handling
|
|
5
|
+
* without interpreting display messages. Only concrete subclasses are thrown.
|
|
22
6
|
* @public
|
|
23
7
|
*/
|
|
24
8
|
export class ShAstError extends Error {
|
|
25
9
|
}
|
|
26
|
-
/**
|
|
27
|
-
* Thrown by {@link parseSync} when shell source fails to parse. Carries the
|
|
28
|
-
* real position mvdan/sh reported — never 1:1 placeholders: `.line` is
|
|
29
|
-
* 1-based exactly as mvdan/sh reports it, and `.column` is converted to
|
|
30
|
-
* UTF-16 code units so it agrees with {@link ShNode.loc}'s columns (mvdan/sh
|
|
31
|
-
* itself reports `column` as a byte count on the source line — see
|
|
32
|
-
* {@link ShParseErrorInfo.column}). The unconverted, raw byte-column
|
|
33
|
-
* position appears only inside `.message`, mvdan/sh's own formatted string,
|
|
34
|
-
* verbatim.
|
|
35
|
-
*
|
|
36
|
-
* @public
|
|
37
|
-
*/
|
|
38
|
-
export class ShParseError extends ShAstError {
|
|
39
|
-
code = 'SH_AST_PARSE_ERROR';
|
|
40
|
-
line;
|
|
41
|
-
column;
|
|
42
|
-
filename;
|
|
43
|
-
constructor(message, info) {
|
|
44
|
-
super(message);
|
|
45
|
-
this.name = 'ShParseError';
|
|
46
|
-
this.line = info.line;
|
|
47
|
-
this.column = info.column;
|
|
48
|
-
this.filename = info.filename;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Thrown by {@link parseSync} when {@link ParseOptions.dialect} is not one
|
|
53
|
-
* of the supported {@link ShellDialect} values. Carries the rejected value
|
|
54
|
-
* as `.dialect`; `.message` lists the supported dialects. A foreseeable,
|
|
55
|
-
* actionable user mistake — never an instance of {@link ShParseError}.
|
|
56
|
-
*
|
|
57
|
-
* @public
|
|
58
|
-
*/
|
|
59
|
-
export class ShInvalidDialectError extends ShAstError {
|
|
60
|
-
code = 'SH_AST_INVALID_DIALECT';
|
|
61
|
-
/** The rejected dialect value, exactly as passed to {@link parseSync}. */
|
|
62
|
-
dialect;
|
|
63
|
-
constructor(dialect, supportedDialects) {
|
|
64
|
-
super(`bridge: unrecognized shell dialect "${dialect}"; supported dialects are: ${supportedDialects.join(', ')}`);
|
|
65
|
-
this.name = 'ShInvalidDialectError';
|
|
66
|
-
this.dialect = dialect;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
10
|
/**
|
|
70
11
|
* Thrown by {@link parseSync} for failures that should never happen given a
|
|
71
12
|
* correctly-behaving WASM shim: a malformed result envelope, an unexpected
|
|
72
13
|
* root node type, or any other shim contract violation. Distinct from
|
|
73
|
-
* {@link
|
|
14
|
+
* {@link InputError} and {@link ParseError}, both of which
|
|
74
15
|
* indicate a foreseeable, actionable user mistake rather than an internal
|
|
75
16
|
* defect.
|
|
76
17
|
*
|
package/dist/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAE9F;;;;;GAKG;AACH,MAAM,OAAgB,UAAW,SAAQ,KAAK;CAG7C;AAED;;;;;;;;;GASG;AACH,MAAM,OAAO,eAAgB,SAAQ,UAAU;IACpC,IAAI,GAAG,iBAAiB,CAAC;IAElC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,OAAO,sBAAuB,SAAQ,UAAU;IAC3C,IAAI,GAAG,0BAA0B,CAAC;IAC3C,mHAAmH;IAC1G,QAAQ,CAAS;IAE1B,YAAY,QAAgB;QAC1B,KAAK,CACH,+EAA+E,MAAM,CAAC,QAAQ,CAAC,uGAAuG,CACvM,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,wBAAwB,CAAC;QACrC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IACzC,IAAI,GAAG,wBAAwB,CAAC;IACzC,qHAAqH;IAC5G,QAAQ,CAAS;IAC1B;;;;OAIG;IACM,cAAc,CAAS;IAEhC,YAAY,QAAgB,EAAE,cAAsB;QAClD,KAAK,CACH,0DAA0D,MAAM,CAAC,cAAc,CAAC,sDAAsD,MAAM,CAAC,QAAQ,CAAC,kKAAkK,CACzT,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,cAAc,GAAG,cAAc,CAAC;IACvC,CAAC;CACF;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAO,gCAAiC,SAAQ,UAAU;IACrD,IAAI,GAAG,qCAAqC,CAAC;IAEtD,YAAY,OAAe;QACzB,KAAK,CAAC,qDAAqD,OAAO,EAAE,CAAC,CAAC;QACtE,IAAI,CAAC,IAAI,GAAG,kCAAkC,CAAC;IACjD,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
export { parseSync } from './
|
|
2
|
-
export {
|
|
3
|
-
export
|
|
4
|
-
export type {
|
|
5
|
-
export {
|
|
6
|
-
export { walk } from './walk.js';
|
|
1
|
+
export { InputError, LangError, ParseError, newPos, nodeEnd, nodePos, parseSync, parseWithPositionsSync, rawOperator, } from './syntax.js';
|
|
2
|
+
export type { ParseOptions, ParsedFile, PositionSnapshot, NodePositions } from './syntax.js';
|
|
3
|
+
export { printSync } from './syntax-print.js';
|
|
4
|
+
export type { PrintOptions } from './syntax-print.js';
|
|
5
|
+
export { PrintError, PrintPanicError } from './syntax-print-errors.js';
|
|
6
|
+
export { walk, WalkPanicError } from './syntax-walk.js';
|
|
7
|
+
export type * from '../generated/syntax-types.js';
|
|
8
|
+
export * from '../generated/syntax-constants.js';
|
|
9
|
+
export type { SyntaxFieldSchema, SyntaxRecordSchema } from '../generated/syntax-schema.js';
|
|
10
|
+
export { ShAnalyzeInvalidWrapperSpecError, ShAnalyzeMaxDepthError, ShAstError, ShInternalError, ShParseMaxDepthError, } from './errors.js';
|
|
7
11
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* hand-written"). {@link ShNode}'s index signature remains the base
|
|
12
|
-
* contract; these are an additive, opt-in stronger typing for consumers
|
|
13
|
-
* that want e.g. `ShNodes.ShCallExprNode` instead of a generic `ShNode`.
|
|
14
|
-
*
|
|
12
|
+
* Complete upstream field metadata for validating or adapting syntax records.
|
|
13
|
+
* Metadata order is not the upstream Walk visitation order. Shared records are
|
|
14
|
+
* deeply frozen even though the syntax values they describe are mutable.
|
|
15
15
|
* @public
|
|
16
16
|
*/
|
|
17
|
-
export
|
|
17
|
+
export declare const SYNTAX_SCHEMA: Readonly<Readonly<Record<string, import("../generated/syntax-schema.js").SyntaxRecordSchema>>>;
|
|
18
|
+
/**
|
|
19
|
+
* Concrete alternatives for upstream syntax interfaces. Auxiliary records are
|
|
20
|
+
* absent from Node; consumers must preserve that distinction in their adapters.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare const SYNTAX_INTERFACES: Readonly<Readonly<Record<string, readonly string[]>>>;
|
|
18
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,sBAAsB,EACtB,WAAW,GACZ,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,YAAY,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACxD,mBAAmB,8BAA8B,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EACL,gCAAgC,EAChC,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,eAAO,MAAM,aAAa,gGAAqB,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,uDAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A faithful synchronous interface to mvdan/sh syntax. The root exposes upstream
|
|
3
|
+
* records, constants, parser controls, traversal, printing and position operations. Consumer-specific
|
|
4
|
+
* source views and semantic analysis are separate responsibilities.
|
|
5
|
+
*/
|
|
6
|
+
import { SYNTAX_INTERFACES as interfaces, SYNTAX_SCHEMA as schema, } from '../generated/syntax-schema.js';
|
|
7
|
+
import { deepFreeze } from './deep-freeze.js';
|
|
8
|
+
export { InputError, LangError, ParseError, newPos, nodeEnd, nodePos, parseSync, parseWithPositionsSync, rawOperator, } from './syntax.js';
|
|
9
|
+
export { printSync } from './syntax-print.js';
|
|
10
|
+
export { PrintError, PrintPanicError } from './syntax-print-errors.js';
|
|
11
|
+
export { walk, WalkPanicError } from './syntax-walk.js';
|
|
12
|
+
export * from '../generated/syntax-constants.js';
|
|
13
|
+
export { ShAnalyzeInvalidWrapperSpecError, ShAnalyzeMaxDepthError, ShAstError, ShInternalError, ShParseMaxDepthError, } from './errors.js';
|
|
14
|
+
/**
|
|
15
|
+
* Complete upstream field metadata for validating or adapting syntax records.
|
|
16
|
+
* Metadata order is not the upstream Walk visitation order. Shared records are
|
|
17
|
+
* deeply frozen even though the syntax values they describe are mutable.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export const SYNTAX_SCHEMA = deepFreeze(schema);
|
|
21
|
+
/**
|
|
22
|
+
* Concrete alternatives for upstream syntax interfaces. Auxiliary records are
|
|
23
|
+
* absent from Node; consumers must preserve that distinction in their adapters.
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export const SYNTAX_INTERFACES = deepFreeze(interfaces);
|
|
5
27
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EACL,iBAAiB,IAAI,UAAU,EAC/B,aAAa,IAAI,MAAM,GACxB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,OAAO,EACL,UAAU,EACV,SAAS,EACT,UAAU,EACV,MAAM,EACN,OAAO,EACP,OAAO,EACP,SAAS,EACT,sBAAsB,EACtB,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExD,cAAc,kCAAkC,CAAC;AAEjD,OAAO,EACL,gCAAgC,EAChC,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,oBAAoB,GACrB,MAAM,aAAa,CAAC;AAErB;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;AAEhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC,UAAU,CAAC,CAAC"}
|