sh-ast 0.3.0 → 0.4.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 +165 -133
- 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 +16 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -4
- package/dist/index.js.map +1 -1
- package/dist/sh-ast.d.ts +3503 -1027
- 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-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-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/sh-ast.d.ts
CHANGED
|
@@ -1,873 +1,3517 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Upstream BinAritOperator constant Add. Its numeric value is preserved exactly.
|
|
3
3
|
*
|
|
4
|
+
* +
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare const Add: 81;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Upstream BinAritOperator constant AddAssgn. Its numeric value is preserved exactly.
|
|
12
|
+
*
|
|
13
|
+
* +=
|
|
14
|
+
*
|
|
15
|
+
* @public
|
|
16
|
+
*/
|
|
17
|
+
export declare const AddAssgn: 49;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Upstream ParExpOperator constant AlternateUnset. Its numeric value is preserved exactly.
|
|
21
|
+
*
|
|
22
|
+
* +
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export declare const AlternateUnset: 81;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Upstream ParExpOperator constant AlternateUnsetOrNull. Its numeric value is preserved exactly.
|
|
30
|
+
*
|
|
31
|
+
* :+
|
|
32
|
+
*
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare const AlternateUnsetOrNull: 82;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Upstream BinAritOperator constant And. Its numeric value is preserved exactly.
|
|
39
|
+
*
|
|
40
|
+
* &
|
|
41
|
+
*
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare const And: 10;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Upstream BinAritOperator constant AndArit. Its numeric value is preserved exactly.
|
|
48
|
+
*
|
|
49
|
+
* &&
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export declare const AndArit: 11;
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Upstream BinAritOperator constant AndAssgn. Its numeric value is preserved exactly.
|
|
57
|
+
*
|
|
58
|
+
* &=
|
|
59
|
+
*
|
|
60
|
+
* @public
|
|
61
|
+
*/
|
|
62
|
+
export declare const AndAssgn: 54;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Upstream BinAritOperator constant AndBoolAssgn. Its numeric value is preserved exactly.
|
|
66
|
+
*
|
|
67
|
+
* &&=
|
|
68
|
+
*
|
|
69
|
+
* @public
|
|
70
|
+
*/
|
|
71
|
+
export declare const AndBoolAssgn: 59;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Upstream BinCmdOperator constant AndStmt. Its numeric value is preserved exactly.
|
|
75
|
+
*
|
|
76
|
+
* &&
|
|
77
|
+
*
|
|
78
|
+
* @public
|
|
79
|
+
*/
|
|
80
|
+
export declare const AndStmt: 11;
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Upstream BinTestOperator constant AndTest. Its numeric value is preserved exactly.
|
|
84
|
+
*
|
|
85
|
+
* &&
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export declare const AndTest: 11;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Upstream RedirOperator constant AppAll. Its numeric value is preserved exactly.
|
|
93
|
+
*
|
|
94
|
+
* &\>\>
|
|
95
|
+
*
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export declare const AppAll: 76;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Upstream RedirOperator constant AppAllClob. Its numeric value is preserved exactly.
|
|
102
|
+
*
|
|
103
|
+
* &\>\>| with `LangZsh`
|
|
104
|
+
*
|
|
105
|
+
* @public
|
|
106
|
+
*/
|
|
107
|
+
export declare const AppAllClob: 77;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Upstream RedirOperator constant AppClob. Its numeric value is preserved exactly.
|
|
111
|
+
*
|
|
112
|
+
* \>\>| with `LangZsh`
|
|
113
|
+
*
|
|
114
|
+
* @public
|
|
115
|
+
*/
|
|
116
|
+
export declare const AppClob: 70;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Upstream RedirOperator constant AppOut. Its numeric value is preserved exactly.
|
|
120
|
+
*
|
|
121
|
+
* \>\>
|
|
122
|
+
*
|
|
123
|
+
* @public
|
|
124
|
+
*/
|
|
125
|
+
export declare const AppOut: 64;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* ArithmCmd represents an arithmetic command.
|
|
129
|
+
*
|
|
130
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
131
|
+
*
|
|
132
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
133
|
+
*
|
|
134
|
+
* @public
|
|
135
|
+
*/
|
|
136
|
+
export declare interface ArithmCmd {
|
|
137
|
+
/**
|
|
138
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
139
|
+
*/
|
|
140
|
+
Type: 'ArithmCmd';
|
|
141
|
+
/**
|
|
142
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
143
|
+
*/
|
|
144
|
+
Left: SyntaxPos;
|
|
145
|
+
/**
|
|
146
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
147
|
+
*/
|
|
148
|
+
Right: SyntaxPos;
|
|
149
|
+
/**
|
|
150
|
+
* mksh's ((# expr))
|
|
151
|
+
*
|
|
152
|
+
* False is an explicit upstream value and is never omitted.
|
|
153
|
+
*/
|
|
154
|
+
Unsigned: boolean;
|
|
155
|
+
/**
|
|
156
|
+
* Null preserves the upstream absence of this component.
|
|
157
|
+
*/
|
|
158
|
+
X: ArithmExpr | null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* ArithmExp represents an arithmetic expansion.
|
|
163
|
+
*
|
|
164
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
165
|
+
*
|
|
166
|
+
* @public
|
|
167
|
+
*/
|
|
168
|
+
export declare interface ArithmExp {
|
|
169
|
+
/**
|
|
170
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
171
|
+
*/
|
|
172
|
+
Type: 'ArithmExp';
|
|
173
|
+
/**
|
|
174
|
+
* deprecated $`expr` form
|
|
175
|
+
*
|
|
176
|
+
* False is an explicit upstream value and is never omitted.
|
|
177
|
+
*/
|
|
178
|
+
Bracket: boolean;
|
|
179
|
+
/**
|
|
180
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
181
|
+
*/
|
|
182
|
+
Left: SyntaxPos;
|
|
183
|
+
/**
|
|
184
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
185
|
+
*/
|
|
186
|
+
Right: SyntaxPos;
|
|
187
|
+
/**
|
|
188
|
+
* mksh's $((# expr))
|
|
189
|
+
*
|
|
190
|
+
* False is an explicit upstream value and is never omitted.
|
|
191
|
+
*/
|
|
192
|
+
Unsigned: boolean;
|
|
193
|
+
/**
|
|
194
|
+
* Null preserves the upstream absence of this component.
|
|
195
|
+
*/
|
|
196
|
+
X: ArithmExpr | null;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The concrete records and typed nil pointers accepted by upstream syntax.ArithmExpr. Typed nil kinds are limited to this interface's actual implementers; auxiliary records are excluded.
|
|
201
|
+
*
|
|
202
|
+
* @public
|
|
203
|
+
*/
|
|
204
|
+
export declare type ArithmExpr =
|
|
205
|
+
| BinaryArithm
|
|
206
|
+
| FlagsArithm
|
|
207
|
+
| ParenArithm
|
|
208
|
+
| UnaryArithm
|
|
209
|
+
| Word
|
|
210
|
+
| TypedNil<'BinaryArithm' | 'FlagsArithm' | 'ParenArithm' | 'UnaryArithm' | 'Word'>;
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* ArrayElem represents a Bash array element.
|
|
214
|
+
*
|
|
215
|
+
* Index can be nil; for example, declare -a x=(value).
|
|
216
|
+
* Value can be nil; for example, declare -A x=(`index`=).
|
|
217
|
+
* Finally, neither can be nil; for example, declare -A x=(`index`=value)
|
|
218
|
+
*
|
|
219
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
220
|
+
*
|
|
221
|
+
* @public
|
|
222
|
+
*/
|
|
223
|
+
export declare interface ArrayElem {
|
|
224
|
+
/**
|
|
225
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
226
|
+
*/
|
|
227
|
+
Type: 'ArrayElem';
|
|
228
|
+
/**
|
|
229
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
230
|
+
*/
|
|
231
|
+
Comments: Comment_2[] | null;
|
|
232
|
+
/**
|
|
233
|
+
* Null preserves the upstream absence of this component.
|
|
234
|
+
*/
|
|
235
|
+
Index: ArithmExpr | null;
|
|
236
|
+
/**
|
|
237
|
+
* Null preserves the upstream absence of this component.
|
|
238
|
+
*/
|
|
239
|
+
Value: Word | null;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Upstream ParExpOperator constant ArrayExclude. Its numeric value is preserved exactly.
|
|
244
|
+
*
|
|
245
|
+
* :| with `LangZsh`
|
|
246
|
+
*
|
|
247
|
+
* @public
|
|
248
|
+
*/
|
|
249
|
+
export declare const ArrayExclude: 94;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* ArrayExpr represents a Bash array expression.
|
|
253
|
+
*
|
|
254
|
+
* This node will only appear with `LangBash`.
|
|
255
|
+
*
|
|
256
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
257
|
+
*
|
|
258
|
+
* @public
|
|
259
|
+
*/
|
|
260
|
+
export declare interface ArrayExpr {
|
|
261
|
+
/**
|
|
262
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
263
|
+
*/
|
|
264
|
+
Type: 'ArrayExpr';
|
|
265
|
+
/**
|
|
266
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
267
|
+
*/
|
|
268
|
+
Elems: (ArrayElem | null)[] | null;
|
|
269
|
+
/**
|
|
270
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
271
|
+
*/
|
|
272
|
+
Last: Comment_2[] | null;
|
|
273
|
+
/**
|
|
274
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
275
|
+
*/
|
|
276
|
+
Lparen: SyntaxPos;
|
|
277
|
+
/**
|
|
278
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
279
|
+
*/
|
|
280
|
+
Rparen: SyntaxPos;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* Upstream ParExpOperator constant ArrayIntersect. Its numeric value is preserved exactly.
|
|
285
|
+
*
|
|
286
|
+
* :* with `LangZsh`
|
|
287
|
+
*
|
|
288
|
+
* @public
|
|
289
|
+
*/
|
|
290
|
+
export declare const ArrayIntersect: 95;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Upstream BinAritOperator constant Assgn. Its numeric value is preserved exactly.
|
|
294
|
+
*
|
|
295
|
+
* =
|
|
296
|
+
*
|
|
297
|
+
* @public
|
|
298
|
+
*/
|
|
299
|
+
export declare const Assgn: 87;
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Assign represents an assignment to a variable.
|
|
303
|
+
*
|
|
304
|
+
* Here and elsewhere, Index can mean either an index expression into an indexed
|
|
305
|
+
* array, or a string key into an associative array.
|
|
306
|
+
*
|
|
307
|
+
* If Index is non-nil, the value will be a word and not an array as nested
|
|
308
|
+
* arrays are not allowed.
|
|
309
|
+
*
|
|
310
|
+
* If Naked is true and Name is nil, the assignment is part of a `DeclClause` and
|
|
311
|
+
* the argument (in the Value field) will be evaluated at run-time. This
|
|
312
|
+
* includes parameter expansions, which may expand to assignments or options.
|
|
313
|
+
*
|
|
314
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
315
|
+
*
|
|
316
|
+
* @public
|
|
317
|
+
*/
|
|
318
|
+
export declare interface Assign {
|
|
319
|
+
/**
|
|
320
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
321
|
+
*/
|
|
322
|
+
Type: 'Assign';
|
|
323
|
+
/**
|
|
324
|
+
* +=
|
|
325
|
+
*
|
|
326
|
+
* False is an explicit upstream value and is never omitted.
|
|
327
|
+
*/
|
|
328
|
+
Append: boolean;
|
|
329
|
+
/**
|
|
330
|
+
* =(arr)
|
|
331
|
+
*
|
|
332
|
+
* Null preserves the upstream absence of this component.
|
|
333
|
+
*/
|
|
334
|
+
Array: ArrayExpr | null;
|
|
335
|
+
/**
|
|
336
|
+
* `i`, ["k"]
|
|
337
|
+
*
|
|
338
|
+
* Null preserves the upstream absence of this component.
|
|
339
|
+
*/
|
|
340
|
+
Index: ArithmExpr | null;
|
|
341
|
+
/**
|
|
342
|
+
* without '='
|
|
343
|
+
*
|
|
344
|
+
* False is an explicit upstream value and is never omitted.
|
|
345
|
+
*/
|
|
346
|
+
Naked: boolean;
|
|
347
|
+
/**
|
|
348
|
+
* must be a valid name
|
|
349
|
+
*
|
|
350
|
+
* Null preserves the upstream absence of this component.
|
|
351
|
+
*/
|
|
352
|
+
Name: Lit | null;
|
|
353
|
+
/**
|
|
354
|
+
* =val
|
|
355
|
+
*
|
|
356
|
+
* Null preserves the upstream absence of this component.
|
|
357
|
+
*/
|
|
358
|
+
Value: Word | null;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Upstream ParExpOperator constant AssignUnset. Its numeric value is preserved exactly.
|
|
363
|
+
*
|
|
364
|
+
* =
|
|
365
|
+
*
|
|
366
|
+
* @public
|
|
367
|
+
*/
|
|
368
|
+
export declare const AssignUnset: 87;
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Upstream ParExpOperator constant AssignUnsetOrNull. Its numeric value is preserved exactly.
|
|
372
|
+
*
|
|
373
|
+
* :=
|
|
374
|
+
*
|
|
375
|
+
* @public
|
|
376
|
+
*/
|
|
377
|
+
export declare const AssignUnsetOrNull: 88;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* The upstream BinAritOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
381
|
+
*
|
|
382
|
+
* @public
|
|
383
|
+
*/
|
|
384
|
+
export declare type BinAritOperator =
|
|
385
|
+
| 0
|
|
386
|
+
| typeof Add
|
|
387
|
+
| typeof AddAssgn
|
|
388
|
+
| typeof And
|
|
389
|
+
| typeof AndArit
|
|
390
|
+
| typeof AndAssgn
|
|
391
|
+
| typeof AndBoolAssgn
|
|
392
|
+
| typeof Assgn
|
|
393
|
+
| typeof Comma
|
|
394
|
+
| typeof Eql
|
|
395
|
+
| typeof Geq
|
|
396
|
+
| typeof Gtr
|
|
397
|
+
| typeof Leq
|
|
398
|
+
| typeof Lss
|
|
399
|
+
| typeof Mul
|
|
400
|
+
| typeof MulAssgn
|
|
401
|
+
| typeof Neq
|
|
402
|
+
| typeof Or
|
|
403
|
+
| typeof OrArit
|
|
404
|
+
| typeof OrAssgn
|
|
405
|
+
| typeof OrBoolAssgn
|
|
406
|
+
| typeof Pow
|
|
407
|
+
| typeof PowAssgn
|
|
408
|
+
| typeof Quo
|
|
409
|
+
| typeof QuoAssgn
|
|
410
|
+
| typeof Rem
|
|
411
|
+
| typeof RemAssgn
|
|
412
|
+
| typeof Shl
|
|
413
|
+
| typeof ShlAssgn
|
|
414
|
+
| typeof Shr
|
|
415
|
+
| typeof ShrAssgn
|
|
416
|
+
| typeof Sub
|
|
417
|
+
| typeof SubAssgn
|
|
418
|
+
| typeof TernColon
|
|
419
|
+
| typeof TernQuest
|
|
420
|
+
| typeof Xor
|
|
421
|
+
| typeof XorAssgn
|
|
422
|
+
| typeof XorBool
|
|
423
|
+
| typeof XorBoolAssgn
|
|
424
|
+
| RawOperator<'BinAritOperator'>;
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* BinaryArithm represents a binary arithmetic expression.
|
|
428
|
+
*
|
|
429
|
+
* If Op is any assign operator, X will be a word with a single `Lit` whose value
|
|
430
|
+
* is a valid name.
|
|
431
|
+
*
|
|
432
|
+
* Ternary operators like "a ? b : c" are fit into this structure. Thus, if
|
|
433
|
+
* Op==`TernQuest`, Y will be a `BinaryArithm` with Op==`TernColon`.
|
|
434
|
+
* `TernColon` does not appear in any other scenario.
|
|
435
|
+
*
|
|
436
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
437
|
+
*
|
|
438
|
+
* @public
|
|
439
|
+
*/
|
|
440
|
+
export declare interface BinaryArithm {
|
|
441
|
+
/**
|
|
442
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
443
|
+
*/
|
|
444
|
+
Type: 'BinaryArithm';
|
|
445
|
+
/**
|
|
446
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
447
|
+
*/
|
|
448
|
+
Op: BinAritOperator;
|
|
449
|
+
/**
|
|
450
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
451
|
+
*/
|
|
452
|
+
OpPos: SyntaxPos;
|
|
453
|
+
/**
|
|
454
|
+
* Null preserves the upstream absence of this component.
|
|
455
|
+
*/
|
|
456
|
+
X: ArithmExpr | null;
|
|
457
|
+
/**
|
|
458
|
+
* Null preserves the upstream absence of this component.
|
|
459
|
+
*/
|
|
460
|
+
Y: ArithmExpr | null;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* BinaryCmd represents a binary expression between two statements.
|
|
465
|
+
*
|
|
466
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
467
|
+
*
|
|
468
|
+
* @public
|
|
469
|
+
*/
|
|
470
|
+
export declare interface BinaryCmd {
|
|
471
|
+
/**
|
|
472
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
473
|
+
*/
|
|
474
|
+
Type: 'BinaryCmd';
|
|
475
|
+
/**
|
|
476
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
477
|
+
*/
|
|
478
|
+
Op: BinCmdOperator;
|
|
479
|
+
/**
|
|
480
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
481
|
+
*/
|
|
482
|
+
OpPos: SyntaxPos;
|
|
483
|
+
/**
|
|
484
|
+
* Null preserves the upstream absence of this component.
|
|
485
|
+
*/
|
|
486
|
+
X: Stmt | null;
|
|
487
|
+
/**
|
|
488
|
+
* Null preserves the upstream absence of this component.
|
|
489
|
+
*/
|
|
490
|
+
Y: Stmt | null;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* BinaryTest represents a binary test expression.
|
|
495
|
+
*
|
|
496
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
497
|
+
*
|
|
498
|
+
* @public
|
|
499
|
+
*/
|
|
500
|
+
export declare interface BinaryTest {
|
|
501
|
+
/**
|
|
502
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
503
|
+
*/
|
|
504
|
+
Type: 'BinaryTest';
|
|
505
|
+
/**
|
|
506
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
507
|
+
*/
|
|
508
|
+
Op: BinTestOperator;
|
|
509
|
+
/**
|
|
510
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
511
|
+
*/
|
|
512
|
+
OpPos: SyntaxPos;
|
|
513
|
+
/**
|
|
514
|
+
* Null preserves the upstream absence of this component.
|
|
515
|
+
*/
|
|
516
|
+
X: TestExpr | null;
|
|
517
|
+
/**
|
|
518
|
+
* Null preserves the upstream absence of this component.
|
|
519
|
+
*/
|
|
520
|
+
Y: TestExpr | null;
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
/**
|
|
524
|
+
* The upstream BinCmdOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
525
|
+
*
|
|
526
|
+
* @public
|
|
527
|
+
*/
|
|
528
|
+
export declare type BinCmdOperator =
|
|
529
|
+
0 | typeof AndStmt | typeof OrStmt | typeof Pipe | typeof PipeAll | RawOperator<'BinCmdOperator'>;
|
|
530
|
+
|
|
531
|
+
/**
|
|
532
|
+
* The upstream BinTestOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
533
|
+
*
|
|
534
|
+
* @public
|
|
535
|
+
*/
|
|
536
|
+
export declare type BinTestOperator =
|
|
537
|
+
| 0
|
|
538
|
+
| typeof AndTest
|
|
539
|
+
| typeof OrTest
|
|
540
|
+
| typeof TsAfter
|
|
541
|
+
| typeof TsBefore
|
|
542
|
+
| typeof TsDevIno
|
|
543
|
+
| typeof TsEql
|
|
544
|
+
| typeof TsGeq
|
|
545
|
+
| typeof TsGtr
|
|
546
|
+
| typeof TsLeq
|
|
547
|
+
| typeof TsLss
|
|
548
|
+
| typeof TsMatch
|
|
549
|
+
| typeof TsMatchShort
|
|
550
|
+
| typeof TsNeq
|
|
551
|
+
| typeof TsNewer
|
|
552
|
+
| typeof TsNoMatch
|
|
553
|
+
| typeof TsOlder
|
|
554
|
+
| typeof TsReMatch
|
|
555
|
+
| RawOperator<'BinTestOperator'>;
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* Upstream UnAritOperator constant BitNegation. Its numeric value is preserved exactly.
|
|
559
|
+
*
|
|
560
|
+
* ~
|
|
561
|
+
*
|
|
562
|
+
* @public
|
|
563
|
+
*/
|
|
564
|
+
export declare const BitNegation: 40;
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* Block represents a series of commands that should be executed in a nested
|
|
568
|
+
* scope. It is essentially a list of statements within curly braces.
|
|
569
|
+
*
|
|
570
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
571
|
+
*
|
|
572
|
+
* @public
|
|
573
|
+
*/
|
|
574
|
+
export declare interface Block {
|
|
575
|
+
/**
|
|
576
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
577
|
+
*/
|
|
578
|
+
Type: 'Block';
|
|
579
|
+
/**
|
|
580
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
581
|
+
*/
|
|
582
|
+
Last: Comment_2[] | null;
|
|
583
|
+
/**
|
|
584
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
585
|
+
*/
|
|
586
|
+
Lbrace: SyntaxPos;
|
|
587
|
+
/**
|
|
588
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
589
|
+
*/
|
|
590
|
+
Rbrace: SyntaxPos;
|
|
591
|
+
/**
|
|
592
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
593
|
+
*/
|
|
594
|
+
Stmts: (Stmt | null)[] | null;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
/**
|
|
598
|
+
* BraceExp represents a Bash brace expression, such as "\{a,f\}" or "\{1..10\}".
|
|
599
|
+
*
|
|
600
|
+
* This node will only appear as a result of `SplitBraces`.
|
|
601
|
+
*
|
|
602
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
603
|
+
*
|
|
604
|
+
* @public
|
|
605
|
+
*/
|
|
606
|
+
export declare interface BraceExp {
|
|
607
|
+
/**
|
|
608
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
609
|
+
*/
|
|
610
|
+
Type: 'BraceExp';
|
|
611
|
+
/**
|
|
612
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
613
|
+
*/
|
|
614
|
+
Elems: (Word | null)[] | null;
|
|
615
|
+
/**
|
|
616
|
+
* \{x..y[..incr]\} instead of \{x,y[,...]\}
|
|
617
|
+
*
|
|
618
|
+
* False is an explicit upstream value and is never omitted.
|
|
619
|
+
*/
|
|
620
|
+
Sequence: boolean;
|
|
621
|
+
}
|
|
622
|
+
|
|
623
|
+
/**
|
|
624
|
+
* Upstream CaseOperator constant Break. Its numeric value is preserved exactly.
|
|
625
|
+
*
|
|
626
|
+
* ;;
|
|
627
|
+
*
|
|
628
|
+
* @public
|
|
629
|
+
*/
|
|
630
|
+
export declare const Break: 35;
|
|
631
|
+
|
|
632
|
+
/**
|
|
633
|
+
* CallExpr represents a command execution or function call, otherwise known as
|
|
634
|
+
* a "simple command".
|
|
635
|
+
*
|
|
636
|
+
* If Args is empty, Assigns apply to the shell environment. Otherwise, they are
|
|
637
|
+
* variables that cannot be arrays and which only apply to the call.
|
|
638
|
+
*
|
|
639
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
640
|
+
*
|
|
641
|
+
* @public
|
|
642
|
+
*/
|
|
643
|
+
export declare interface CallExpr {
|
|
644
|
+
/**
|
|
645
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
646
|
+
*/
|
|
647
|
+
Type: 'CallExpr';
|
|
648
|
+
/**
|
|
649
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
650
|
+
*/
|
|
651
|
+
Args: (Word | null)[] | null;
|
|
652
|
+
/**
|
|
653
|
+
* a=x b=y args
|
|
654
|
+
*
|
|
655
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
656
|
+
*/
|
|
657
|
+
Assigns: (Assign | null)[] | null;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* CaseClause represents a case (switch) clause.
|
|
662
|
+
*
|
|
663
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
664
|
+
*
|
|
665
|
+
* @public
|
|
666
|
+
*/
|
|
667
|
+
export declare interface CaseClause {
|
|
668
|
+
/**
|
|
669
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
670
|
+
*/
|
|
671
|
+
Type: 'CaseClause';
|
|
672
|
+
/**
|
|
673
|
+
* deprecated mksh form with braces instead of in/esac
|
|
674
|
+
*
|
|
675
|
+
* False is an explicit upstream value and is never omitted.
|
|
676
|
+
*/
|
|
677
|
+
Braces: boolean;
|
|
678
|
+
/**
|
|
679
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
680
|
+
*/
|
|
681
|
+
Case: SyntaxPos;
|
|
682
|
+
/**
|
|
683
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
684
|
+
*/
|
|
685
|
+
Esac: SyntaxPos;
|
|
686
|
+
/**
|
|
687
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
688
|
+
*/
|
|
689
|
+
In: SyntaxPos;
|
|
690
|
+
/**
|
|
691
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
692
|
+
*/
|
|
693
|
+
Items: (CaseItem | null)[] | null;
|
|
694
|
+
/**
|
|
695
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
696
|
+
*/
|
|
697
|
+
Last: Comment_2[] | null;
|
|
698
|
+
/**
|
|
699
|
+
* Null preserves the upstream absence of this component.
|
|
700
|
+
*/
|
|
701
|
+
Word: Word | null;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
/**
|
|
705
|
+
* CaseItem represents a pattern list (case) within a `CaseClause`.
|
|
706
|
+
*
|
|
707
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
708
|
+
*
|
|
709
|
+
* @public
|
|
710
|
+
*/
|
|
711
|
+
export declare interface CaseItem {
|
|
712
|
+
/**
|
|
713
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
714
|
+
*/
|
|
715
|
+
Type: 'CaseItem';
|
|
716
|
+
/**
|
|
717
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
718
|
+
*/
|
|
719
|
+
Comments: Comment_2[] | null;
|
|
720
|
+
/**
|
|
721
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
722
|
+
*/
|
|
723
|
+
Last: Comment_2[] | null;
|
|
724
|
+
/**
|
|
725
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
726
|
+
*/
|
|
727
|
+
Op: CaseOperator;
|
|
728
|
+
/**
|
|
729
|
+
* unset if it was finished by "esac"
|
|
730
|
+
*
|
|
731
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
732
|
+
*/
|
|
733
|
+
OpPos: SyntaxPos;
|
|
734
|
+
/**
|
|
735
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
736
|
+
*/
|
|
737
|
+
Patterns: (Word | null)[] | null;
|
|
738
|
+
/**
|
|
739
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
740
|
+
*/
|
|
741
|
+
Stmts: (Stmt | null)[] | null;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* The upstream CaseOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
746
|
+
*
|
|
747
|
+
* @public
|
|
748
|
+
*/
|
|
749
|
+
export declare type CaseOperator =
|
|
750
|
+
| 0
|
|
751
|
+
| typeof Break
|
|
752
|
+
| typeof Fallthrough
|
|
753
|
+
| typeof Resume
|
|
754
|
+
| typeof ResumeKorn
|
|
755
|
+
| RawOperator<'CaseOperator'>;
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Upstream RedirOperator constant ClbOut. Its numeric value is preserved exactly.
|
|
759
|
+
*
|
|
760
|
+
* Deprecated: use `RdrClob`
|
|
761
|
+
*
|
|
762
|
+
* @public
|
|
763
|
+
*/
|
|
764
|
+
export declare const ClbOut: 69;
|
|
765
|
+
|
|
766
|
+
/**
|
|
767
|
+
* Upstream ProcOperator constant CmdIn. Its numeric value is preserved exactly.
|
|
768
|
+
*
|
|
769
|
+
* \<(
|
|
770
|
+
*
|
|
771
|
+
* @public
|
|
772
|
+
*/
|
|
773
|
+
export declare const CmdIn: 78;
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Upstream ProcOperator constant CmdInTemp. Its numeric value is preserved exactly.
|
|
777
|
+
*
|
|
778
|
+
* =(
|
|
779
|
+
*
|
|
780
|
+
* @public
|
|
781
|
+
*/
|
|
782
|
+
export declare const CmdInTemp: 79;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* Upstream ProcOperator constant CmdOut. Its numeric value is preserved exactly.
|
|
786
|
+
*
|
|
787
|
+
* \>(
|
|
788
|
+
*
|
|
789
|
+
* @public
|
|
790
|
+
*/
|
|
791
|
+
export declare const CmdOut: 80;
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* CmdSubst represents a command substitution.
|
|
795
|
+
*
|
|
796
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
797
|
+
*
|
|
798
|
+
* @public
|
|
799
|
+
*/
|
|
800
|
+
export declare interface CmdSubst {
|
|
801
|
+
/**
|
|
802
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
803
|
+
*/
|
|
804
|
+
Type: 'CmdSubst';
|
|
805
|
+
/**
|
|
806
|
+
* deprecated `foo`
|
|
807
|
+
*
|
|
808
|
+
* False is an explicit upstream value and is never omitted.
|
|
809
|
+
*/
|
|
810
|
+
Backquotes: boolean;
|
|
811
|
+
/**
|
|
812
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
813
|
+
*/
|
|
814
|
+
Last: Comment_2[] | null;
|
|
815
|
+
/**
|
|
816
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
817
|
+
*/
|
|
818
|
+
Left: SyntaxPos;
|
|
819
|
+
/**
|
|
820
|
+
* mksh's $\{|foo;\}
|
|
821
|
+
*
|
|
822
|
+
* False is an explicit upstream value and is never omitted.
|
|
823
|
+
*/
|
|
824
|
+
ReplyVar: boolean;
|
|
825
|
+
/**
|
|
826
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
827
|
+
*/
|
|
828
|
+
Right: SyntaxPos;
|
|
829
|
+
/**
|
|
830
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
831
|
+
*/
|
|
832
|
+
Stmts: (Stmt | null)[] | null;
|
|
833
|
+
/**
|
|
834
|
+
* mksh's $\{ foo;\}
|
|
835
|
+
*
|
|
836
|
+
* False is an explicit upstream value and is never omitted.
|
|
837
|
+
*/
|
|
838
|
+
TempFile: boolean;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* Upstream BinAritOperator constant Comma. Its numeric value is preserved exactly.
|
|
843
|
+
*
|
|
844
|
+
* ,
|
|
845
|
+
*
|
|
846
|
+
* @public
|
|
847
|
+
*/
|
|
848
|
+
export declare const Comma: 98;
|
|
849
|
+
|
|
850
|
+
/**
|
|
851
|
+
* The concrete records and typed nil pointers accepted by upstream syntax.Command. Typed nil kinds are limited to this interface's actual implementers; auxiliary records are excluded.
|
|
852
|
+
*
|
|
853
|
+
* @public
|
|
854
|
+
*/
|
|
855
|
+
export declare type Command =
|
|
856
|
+
| ArithmCmd
|
|
857
|
+
| BinaryCmd
|
|
858
|
+
| Block
|
|
859
|
+
| CallExpr
|
|
860
|
+
| CaseClause
|
|
861
|
+
| CoprocClause
|
|
862
|
+
| DeclClause
|
|
863
|
+
| ForClause
|
|
864
|
+
| FuncDecl
|
|
865
|
+
| IfClause
|
|
866
|
+
| LetClause
|
|
867
|
+
| Subshell
|
|
868
|
+
| TestClause
|
|
869
|
+
| TestDecl
|
|
870
|
+
| TimeClause
|
|
871
|
+
| WhileClause
|
|
872
|
+
| TypedNil<
|
|
873
|
+
| 'ArithmCmd'
|
|
874
|
+
| 'BinaryCmd'
|
|
875
|
+
| 'Block'
|
|
876
|
+
| 'CallExpr'
|
|
877
|
+
| 'CaseClause'
|
|
878
|
+
| 'CoprocClause'
|
|
879
|
+
| 'DeclClause'
|
|
880
|
+
| 'ForClause'
|
|
881
|
+
| 'FuncDecl'
|
|
882
|
+
| 'IfClause'
|
|
883
|
+
| 'LetClause'
|
|
884
|
+
| 'Subshell'
|
|
885
|
+
| 'TestClause'
|
|
886
|
+
| 'TestDecl'
|
|
887
|
+
| 'TimeClause'
|
|
888
|
+
| 'WhileClause'
|
|
889
|
+
>;
|
|
890
|
+
|
|
891
|
+
/**
|
|
892
|
+
* Comment represents a single comment on a single line.
|
|
893
|
+
*
|
|
894
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
895
|
+
*
|
|
896
|
+
* @public
|
|
897
|
+
*/
|
|
898
|
+
declare interface Comment_2 {
|
|
899
|
+
/**
|
|
900
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
901
|
+
*/
|
|
902
|
+
Type: 'Comment';
|
|
903
|
+
/**
|
|
904
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
905
|
+
*/
|
|
906
|
+
Hash: SyntaxPos;
|
|
907
|
+
/**
|
|
908
|
+
* Upstream string bytes; non-UTF-8 values remain bytes rather than replacement text.
|
|
909
|
+
*/
|
|
910
|
+
Text: GoString;
|
|
911
|
+
}
|
|
912
|
+
export { Comment_2 as Comment }
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* CoprocClause represents a Bash coproc clause.
|
|
916
|
+
*
|
|
917
|
+
* This node will only appear with `LangBash`.
|
|
918
|
+
*
|
|
919
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
920
|
+
*
|
|
921
|
+
* @public
|
|
922
|
+
*/
|
|
923
|
+
export declare interface CoprocClause {
|
|
924
|
+
/**
|
|
925
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
926
|
+
*/
|
|
927
|
+
Type: 'CoprocClause';
|
|
928
|
+
/**
|
|
929
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
930
|
+
*/
|
|
931
|
+
Coproc: SyntaxPos;
|
|
932
|
+
/**
|
|
933
|
+
* Null preserves the upstream absence of this component.
|
|
934
|
+
*/
|
|
935
|
+
Name: Word | null;
|
|
936
|
+
/**
|
|
937
|
+
* Null preserves the upstream absence of this component.
|
|
938
|
+
*/
|
|
939
|
+
Stmt: Stmt | null;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
/**
|
|
943
|
+
* CStyleLoop represents the behavior of a for clause similar to the C
|
|
944
|
+
* language.
|
|
945
|
+
*
|
|
946
|
+
* This node will only appear with `LangBash`.
|
|
947
|
+
*
|
|
948
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
949
|
+
*
|
|
950
|
+
* @public
|
|
951
|
+
*/
|
|
952
|
+
export declare interface CStyleLoop {
|
|
953
|
+
/**
|
|
954
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
955
|
+
*/
|
|
956
|
+
Type: 'CStyleLoop';
|
|
957
|
+
/**
|
|
958
|
+
* Init, Cond, Post can each be nil, if the for loop construct omits it.
|
|
959
|
+
*
|
|
960
|
+
* Null preserves the upstream absence of this component.
|
|
961
|
+
*/
|
|
962
|
+
Cond: ArithmExpr | null;
|
|
963
|
+
/**
|
|
964
|
+
* Init, Cond, Post can each be nil, if the for loop construct omits it.
|
|
965
|
+
*
|
|
966
|
+
* Null preserves the upstream absence of this component.
|
|
967
|
+
*/
|
|
968
|
+
Init: ArithmExpr | null;
|
|
969
|
+
/**
|
|
970
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
971
|
+
*/
|
|
972
|
+
Lparen: SyntaxPos;
|
|
973
|
+
/**
|
|
974
|
+
* Init, Cond, Post can each be nil, if the for loop construct omits it.
|
|
975
|
+
*
|
|
976
|
+
* Null preserves the upstream absence of this component.
|
|
977
|
+
*/
|
|
978
|
+
Post: ArithmExpr | null;
|
|
979
|
+
/**
|
|
980
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
981
|
+
*/
|
|
982
|
+
Rparen: SyntaxPos;
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* Upstream RedirOperator constant DashHdoc. Its numeric value is preserved exactly.
|
|
987
|
+
*
|
|
988
|
+
* \<\<-
|
|
989
|
+
*
|
|
990
|
+
* @public
|
|
991
|
+
*/
|
|
992
|
+
export declare const DashHdoc: 72;
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* DblQuoted represents a list of nodes within double quotes.
|
|
996
|
+
*
|
|
997
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
998
|
+
*
|
|
999
|
+
* @public
|
|
1000
|
+
*/
|
|
1001
|
+
export declare interface DblQuoted {
|
|
1002
|
+
/**
|
|
1003
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1004
|
+
*/
|
|
1005
|
+
Type: 'DblQuoted';
|
|
1006
|
+
/**
|
|
1007
|
+
* $""
|
|
1008
|
+
*
|
|
1009
|
+
* False is an explicit upstream value and is never omitted.
|
|
1010
|
+
*/
|
|
1011
|
+
Dollar: boolean;
|
|
1012
|
+
/**
|
|
1013
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1014
|
+
*/
|
|
1015
|
+
Left: SyntaxPos;
|
|
1016
|
+
/**
|
|
1017
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1018
|
+
*/
|
|
1019
|
+
Parts: (WordPart | null)[] | null;
|
|
1020
|
+
/**
|
|
1021
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1022
|
+
*/
|
|
1023
|
+
Right: SyntaxPos;
|
|
1024
|
+
}
|
|
1025
|
+
|
|
1026
|
+
/**
|
|
1027
|
+
* Upstream UnAritOperator constant Dec. Its numeric value is preserved exactly.
|
|
1028
|
+
*
|
|
1029
|
+
* --
|
|
1030
|
+
*
|
|
1031
|
+
* @public
|
|
1032
|
+
*/
|
|
1033
|
+
export declare const Dec: 42;
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* DeclClause represents a Bash declare clause.
|
|
1037
|
+
*
|
|
1038
|
+
* Args can contain a mix of regular and naked assignments. The naked
|
|
1039
|
+
* assignments can represent either options or variable names.
|
|
1040
|
+
*
|
|
1041
|
+
* This node will only appear with `LangBash`.
|
|
1042
|
+
*
|
|
1043
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1044
|
+
*
|
|
1045
|
+
* @public
|
|
1046
|
+
*/
|
|
1047
|
+
export declare interface DeclClause {
|
|
1048
|
+
/**
|
|
1049
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1050
|
+
*/
|
|
1051
|
+
Type: 'DeclClause';
|
|
1052
|
+
/**
|
|
1053
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1054
|
+
*/
|
|
1055
|
+
Args: (Assign | null)[] | null;
|
|
1056
|
+
/**
|
|
1057
|
+
* Variant is one of "declare", "local", "export", "readonly",
|
|
1058
|
+
* "typeset", or "nameref".
|
|
1059
|
+
*
|
|
1060
|
+
* Null preserves the upstream absence of this component.
|
|
1061
|
+
*/
|
|
1062
|
+
Variant: Lit | null;
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
/**
|
|
1066
|
+
* Upstream ParExpOperator constant DefaultUnset. Its numeric value is preserved exactly.
|
|
1067
|
+
*
|
|
1068
|
+
* -
|
|
1069
|
+
*
|
|
1070
|
+
* @public
|
|
1071
|
+
*/
|
|
1072
|
+
export declare const DefaultUnset: 83;
|
|
1073
|
+
|
|
1074
|
+
/**
|
|
1075
|
+
* Upstream ParExpOperator constant DefaultUnsetOrNull. Its numeric value is preserved exactly.
|
|
1076
|
+
*
|
|
1077
|
+
* :-
|
|
1078
|
+
*
|
|
1079
|
+
* @public
|
|
1080
|
+
*/
|
|
1081
|
+
export declare const DefaultUnsetOrNull: 84;
|
|
1082
|
+
|
|
1083
|
+
/**
|
|
1084
|
+
* Upstream RedirOperator constant DplIn. Its numeric value is preserved exactly.
|
|
1085
|
+
*
|
|
1086
|
+
* \<&
|
|
1087
|
+
*
|
|
1088
|
+
* @public
|
|
1089
|
+
*/
|
|
1090
|
+
export declare const DplIn: 67;
|
|
1091
|
+
|
|
1092
|
+
/**
|
|
1093
|
+
* Upstream RedirOperator constant DplOut. Its numeric value is preserved exactly.
|
|
1094
|
+
*
|
|
1095
|
+
* \>&
|
|
1096
|
+
*
|
|
1097
|
+
* @public
|
|
1098
|
+
*/
|
|
1099
|
+
export declare const DplOut: 68;
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Upstream BinAritOperator constant Eql. Its numeric value is preserved exactly.
|
|
1103
|
+
*
|
|
1104
|
+
* ==
|
|
1105
|
+
*
|
|
1106
|
+
* @public
|
|
1107
|
+
*/
|
|
1108
|
+
export declare const Eql: 45;
|
|
1109
|
+
|
|
1110
|
+
/**
|
|
1111
|
+
* Upstream ParExpOperator constant ErrorUnset. Its numeric value is preserved exactly.
|
|
1112
|
+
*
|
|
1113
|
+
* ?
|
|
1114
|
+
*
|
|
1115
|
+
* @public
|
|
1116
|
+
*/
|
|
1117
|
+
export declare const ErrorUnset: 85;
|
|
1118
|
+
|
|
1119
|
+
/**
|
|
1120
|
+
* Upstream ParExpOperator constant ErrorUnsetOrNull. Its numeric value is preserved exactly.
|
|
1121
|
+
*
|
|
1122
|
+
* :?
|
|
1123
|
+
*
|
|
1124
|
+
* @public
|
|
1125
|
+
*/
|
|
1126
|
+
export declare const ErrorUnsetOrNull: 86;
|
|
1127
|
+
|
|
1128
|
+
/**
|
|
1129
|
+
* Expansion represents string manipulation in a `ParamExp` other than those
|
|
1130
|
+
* covered by `Replace`.
|
|
1131
|
+
*
|
|
1132
|
+
* Auxiliary syntax data, not a syntax.Node; it has no independent source bounds.
|
|
1133
|
+
*
|
|
1134
|
+
* @public
|
|
1135
|
+
*/
|
|
1136
|
+
export declare interface Expansion {
|
|
1137
|
+
/**
|
|
1138
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1139
|
+
*/
|
|
1140
|
+
Type: 'Expansion';
|
|
1141
|
+
/**
|
|
1142
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
1143
|
+
*/
|
|
1144
|
+
Op: ParExpOperator;
|
|
1145
|
+
/**
|
|
1146
|
+
* Null preserves the upstream absence of this component.
|
|
1147
|
+
*/
|
|
1148
|
+
Word: Word | null;
|
|
1149
|
+
}
|
|
1150
|
+
|
|
1151
|
+
/**
|
|
1152
|
+
* ExtGlob represents a Bash extended globbing expression. Note that these are
|
|
1153
|
+
* parsed independently of whether or not `shopt -s extglob` has been used,
|
|
1154
|
+
* as the parser runs statically and independently of any interpreter.
|
|
1155
|
+
*
|
|
1156
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
1157
|
+
*
|
|
1158
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1159
|
+
*
|
|
1160
|
+
* @public
|
|
1161
|
+
*/
|
|
1162
|
+
export declare interface ExtGlob {
|
|
1163
|
+
/**
|
|
1164
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1165
|
+
*/
|
|
1166
|
+
Type: 'ExtGlob';
|
|
1167
|
+
/**
|
|
1168
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
1169
|
+
*/
|
|
1170
|
+
Op: GlobOperator;
|
|
1171
|
+
/**
|
|
1172
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1173
|
+
*/
|
|
1174
|
+
OpPos: SyntaxPos;
|
|
1175
|
+
/**
|
|
1176
|
+
* Null preserves the upstream absence of this component.
|
|
1177
|
+
*/
|
|
1178
|
+
Pattern: Lit | null;
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Upstream CaseOperator constant Fallthrough. Its numeric value is preserved exactly.
|
|
1183
|
+
*
|
|
1184
|
+
* ;&
|
|
1185
|
+
*
|
|
1186
|
+
* @public
|
|
1187
|
+
*/
|
|
1188
|
+
export declare const Fallthrough: 36;
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* File represents a shell source file.
|
|
1192
|
+
*
|
|
1193
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1194
|
+
*
|
|
1195
|
+
* @public
|
|
1196
|
+
*/
|
|
1197
|
+
declare interface File_2 {
|
|
1198
|
+
/**
|
|
1199
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1200
|
+
*/
|
|
1201
|
+
Type: 'File';
|
|
1202
|
+
/**
|
|
1203
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1204
|
+
*/
|
|
1205
|
+
Last: Comment_2[] | null;
|
|
1206
|
+
/**
|
|
1207
|
+
* Upstream string bytes; non-UTF-8 values remain bytes rather than replacement text.
|
|
1208
|
+
*/
|
|
1209
|
+
Name: GoString;
|
|
1210
|
+
/**
|
|
1211
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1212
|
+
*/
|
|
1213
|
+
Stmts: (Stmt | null)[] | null;
|
|
1214
|
+
}
|
|
1215
|
+
export { File_2 as File }
|
|
1216
|
+
|
|
1217
|
+
/**
|
|
1218
|
+
* FlagsArithm represents zsh subscript flags attached to an arithmetic expression,
|
|
1219
|
+
* such as $\{array[(flags)expr]\}.
|
|
1220
|
+
*
|
|
1221
|
+
* This node will only appear with `LangZsh`.
|
|
1222
|
+
*
|
|
1223
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1224
|
+
*
|
|
1225
|
+
* @public
|
|
1226
|
+
*/
|
|
1227
|
+
export declare interface FlagsArithm {
|
|
1228
|
+
/**
|
|
1229
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1230
|
+
*/
|
|
1231
|
+
Type: 'FlagsArithm';
|
|
1232
|
+
/**
|
|
1233
|
+
* Null preserves the upstream absence of this component.
|
|
1234
|
+
*/
|
|
1235
|
+
Flags: Lit | null;
|
|
1236
|
+
/**
|
|
1237
|
+
* Null preserves the upstream absence of this component.
|
|
1238
|
+
*/
|
|
1239
|
+
X: ArithmExpr | null;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* ForClause represents a for or a select clause. The latter is only present in
|
|
1244
|
+
* Bash.
|
|
1245
|
+
*
|
|
1246
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1247
|
+
*
|
|
1248
|
+
* @public
|
|
1249
|
+
*/
|
|
1250
|
+
export declare interface ForClause {
|
|
1251
|
+
/**
|
|
1252
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1253
|
+
*/
|
|
1254
|
+
Type: 'ForClause';
|
|
1255
|
+
/**
|
|
1256
|
+
* deprecated form with \{ \} instead of do/done
|
|
1257
|
+
*
|
|
1258
|
+
* False is an explicit upstream value and is never omitted.
|
|
1259
|
+
*/
|
|
1260
|
+
Braces: boolean;
|
|
1261
|
+
/**
|
|
1262
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1263
|
+
*/
|
|
1264
|
+
Do: (Stmt | null)[] | null;
|
|
1265
|
+
/**
|
|
1266
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1267
|
+
*/
|
|
1268
|
+
DoLast: Comment_2[] | null;
|
|
1269
|
+
/**
|
|
1270
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1271
|
+
*/
|
|
1272
|
+
DoPos: SyntaxPos;
|
|
1273
|
+
/**
|
|
1274
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1275
|
+
*/
|
|
1276
|
+
DonePos: SyntaxPos;
|
|
1277
|
+
/**
|
|
1278
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1279
|
+
*/
|
|
1280
|
+
ForPos: SyntaxPos;
|
|
1281
|
+
/**
|
|
1282
|
+
* Null preserves the upstream absence of this component.
|
|
1283
|
+
*/
|
|
1284
|
+
Loop: Loop | null;
|
|
1285
|
+
/**
|
|
1286
|
+
* False is an explicit upstream value and is never omitted.
|
|
1287
|
+
*/
|
|
1288
|
+
Select: boolean;
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
/**
|
|
1292
|
+
* FuncDecl represents the declaration of a function.
|
|
1293
|
+
*
|
|
1294
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1295
|
+
*
|
|
1296
|
+
* @public
|
|
1297
|
+
*/
|
|
1298
|
+
export declare interface FuncDecl {
|
|
1299
|
+
/**
|
|
1300
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1301
|
+
*/
|
|
1302
|
+
Type: 'FuncDecl';
|
|
1303
|
+
/**
|
|
1304
|
+
* Null preserves the upstream absence of this component.
|
|
1305
|
+
*/
|
|
1306
|
+
Body: Stmt | null;
|
|
1307
|
+
/**
|
|
1308
|
+
* Only one of these is set at a time.
|
|
1309
|
+
* Neither is set when declaring an anonymous func with `LangZsh`.
|
|
1310
|
+
*
|
|
1311
|
+
* Null preserves the upstream absence of this component.
|
|
1312
|
+
*/
|
|
1313
|
+
Name: Lit | null;
|
|
1314
|
+
/**
|
|
1315
|
+
* When declaring many func names with `LangZsh`.
|
|
1316
|
+
*
|
|
1317
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1318
|
+
*/
|
|
1319
|
+
Names: (Lit | null)[] | null;
|
|
1320
|
+
/**
|
|
1321
|
+
* with () parentheses, can only be false when RsrvWord==true
|
|
1322
|
+
*
|
|
1323
|
+
* False is an explicit upstream value and is never omitted.
|
|
1324
|
+
*/
|
|
1325
|
+
Parens: boolean;
|
|
1326
|
+
/**
|
|
1327
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1328
|
+
*/
|
|
1329
|
+
Position: SyntaxPos;
|
|
1330
|
+
/**
|
|
1331
|
+
* non-posix "function f" style
|
|
1332
|
+
*
|
|
1333
|
+
* False is an explicit upstream value and is never omitted.
|
|
1334
|
+
*/
|
|
1335
|
+
RsrvWord: boolean;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
/**
|
|
1339
|
+
* Upstream BinAritOperator constant Geq. Its numeric value is preserved exactly.
|
|
1340
|
+
*
|
|
1341
|
+
* \>=
|
|
1342
|
+
*
|
|
1343
|
+
* @public
|
|
1344
|
+
*/
|
|
1345
|
+
export declare const Geq: 48;
|
|
1346
|
+
|
|
1347
|
+
/**
|
|
1348
|
+
* Upstream GlobOperator constant GlobExcept. Its numeric value is preserved exactly.
|
|
1349
|
+
*
|
|
1350
|
+
* !(
|
|
1351
|
+
*
|
|
1352
|
+
* @public
|
|
1353
|
+
*/
|
|
1354
|
+
export declare const GlobExcept: 143;
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* Upstream GlobOperator constant GlobOne. Its numeric value is preserved exactly.
|
|
1358
|
+
*
|
|
1359
|
+
* \@(
|
|
1360
|
+
*
|
|
1361
|
+
* @public
|
|
1362
|
+
*/
|
|
1363
|
+
export declare const GlobOne: 142;
|
|
1364
|
+
|
|
1365
|
+
/**
|
|
1366
|
+
* Upstream GlobOperator constant GlobOneOrMore. Its numeric value is preserved exactly.
|
|
1367
|
+
*
|
|
1368
|
+
* +(
|
|
1369
|
+
*
|
|
1370
|
+
* @public
|
|
1371
|
+
*/
|
|
1372
|
+
export declare const GlobOneOrMore: 141;
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* The upstream GlobOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
1376
|
+
*
|
|
1377
|
+
* @public
|
|
1378
|
+
*/
|
|
1379
|
+
export declare type GlobOperator =
|
|
1380
|
+
| 0
|
|
1381
|
+
| typeof GlobExcept
|
|
1382
|
+
| typeof GlobOne
|
|
1383
|
+
| typeof GlobOneOrMore
|
|
1384
|
+
| typeof GlobZeroOrMore
|
|
1385
|
+
| typeof GlobZeroOrOne
|
|
1386
|
+
| RawOperator<'GlobOperator'>;
|
|
1387
|
+
|
|
1388
|
+
/**
|
|
1389
|
+
* Upstream GlobOperator constant GlobZeroOrMore. Its numeric value is preserved exactly.
|
|
1390
|
+
*
|
|
1391
|
+
* *(
|
|
1392
|
+
*
|
|
1393
|
+
* @public
|
|
1394
|
+
*/
|
|
1395
|
+
export declare const GlobZeroOrMore: 140;
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Upstream GlobOperator constant GlobZeroOrOne. Its numeric value is preserved exactly.
|
|
1399
|
+
*
|
|
1400
|
+
* ?(
|
|
1401
|
+
*
|
|
1402
|
+
* @public
|
|
1403
|
+
*/
|
|
1404
|
+
export declare const GlobZeroOrOne: 139;
|
|
1405
|
+
|
|
1406
|
+
/**
|
|
1407
|
+
* A Go string's exact bytes. Valid UTF-8 is represented as a JavaScript string; other bytes use Uint8Array. String inputs must not contain unpaired surrogates, which have no faithful UTF-8 representation.
|
|
1408
|
+
*
|
|
1409
|
+
* @public
|
|
1410
|
+
*/
|
|
1411
|
+
export declare type GoString = string | Uint8Array;
|
|
1412
|
+
|
|
1413
|
+
/**
|
|
1414
|
+
* Upstream BinAritOperator constant Gtr. Its numeric value is preserved exactly.
|
|
1415
|
+
*
|
|
1416
|
+
* \>
|
|
1417
|
+
*
|
|
1418
|
+
* @public
|
|
1419
|
+
*/
|
|
1420
|
+
export declare const Gtr: 63;
|
|
1421
|
+
|
|
1422
|
+
/**
|
|
1423
|
+
* Upstream RedirOperator constant Hdoc. Its numeric value is preserved exactly.
|
|
1424
|
+
*
|
|
1425
|
+
* \<\<
|
|
1426
|
+
*
|
|
1427
|
+
* @public
|
|
1428
|
+
*/
|
|
1429
|
+
export declare const Hdoc: 71;
|
|
1430
|
+
|
|
1431
|
+
/**
|
|
1432
|
+
* IfClause represents an if statement.
|
|
1433
|
+
*
|
|
1434
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1435
|
+
*
|
|
1436
|
+
* @public
|
|
1437
|
+
*/
|
|
1438
|
+
export declare interface IfClause {
|
|
1439
|
+
/**
|
|
1440
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1441
|
+
*/
|
|
1442
|
+
Type: 'IfClause';
|
|
1443
|
+
/**
|
|
1444
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1445
|
+
*/
|
|
1446
|
+
Cond: (Stmt | null)[] | null;
|
|
1447
|
+
/**
|
|
1448
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1449
|
+
*/
|
|
1450
|
+
CondLast: Comment_2[] | null;
|
|
1451
|
+
/**
|
|
1452
|
+
* if non-nil, an "elif" or an "else"
|
|
1453
|
+
*
|
|
1454
|
+
* Null preserves the upstream absence of this component.
|
|
1455
|
+
*/
|
|
1456
|
+
Else: IfClause | null;
|
|
1457
|
+
/**
|
|
1458
|
+
* position of "fi", shared with .Else if non-nil
|
|
1459
|
+
*
|
|
1460
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1461
|
+
*/
|
|
1462
|
+
FiPos: SyntaxPos;
|
|
1463
|
+
/**
|
|
1464
|
+
* comments on the first "elif", "else", or "fi"
|
|
1465
|
+
*
|
|
1466
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1467
|
+
*/
|
|
1468
|
+
Last: Comment_2[] | null;
|
|
1469
|
+
/**
|
|
1470
|
+
* position of the starting "if", "elif", or "else" token
|
|
1471
|
+
*
|
|
1472
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1473
|
+
*/
|
|
1474
|
+
Position: SyntaxPos;
|
|
1475
|
+
/**
|
|
1476
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1477
|
+
*/
|
|
1478
|
+
Then: (Stmt | null)[] | null;
|
|
1479
|
+
/**
|
|
1480
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1481
|
+
*/
|
|
1482
|
+
ThenLast: Comment_2[] | null;
|
|
1483
|
+
/**
|
|
1484
|
+
* position of "then", empty if this is an "else"
|
|
1485
|
+
*
|
|
1486
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1487
|
+
*/
|
|
1488
|
+
ThenPos: SyntaxPos;
|
|
1489
|
+
}
|
|
1490
|
+
|
|
1491
|
+
/**
|
|
1492
|
+
* Upstream UnAritOperator constant Inc. Its numeric value is preserved exactly.
|
|
1493
|
+
*
|
|
1494
|
+
* ++
|
|
1495
|
+
*
|
|
1496
|
+
* @public
|
|
1497
|
+
*/
|
|
1498
|
+
export declare const Inc: 41;
|
|
1499
|
+
|
|
1500
|
+
/**
|
|
1501
|
+
* An argument cannot be represented by the binding or violates an upstream
|
|
1502
|
+
* operation's input constraint. It is distinct from malformed shell source.
|
|
1503
|
+
* @public
|
|
1504
|
+
*/
|
|
1505
|
+
export declare class InputError extends ShAstError {
|
|
1506
|
+
readonly Message: GoString;
|
|
1507
|
+
/** Identifies caller input that cannot be passed faithfully to the operation. */
|
|
1508
|
+
readonly code = "SH_AST_SYNTAX_INPUT";
|
|
1509
|
+
/** Retains exact upstream message bytes even when Error.message needs text. */
|
|
1510
|
+
constructor(Message: GoString);
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* Upstream LangVariant constant LangAuto. Its numeric value is preserved exactly.
|
|
1515
|
+
*
|
|
1516
|
+
* LangAuto corresponds to automatic language detection,
|
|
1517
|
+
* commonly used by end-user applications like shfmt,
|
|
1518
|
+
* which can guess a file's language variant given its filename or shebang.
|
|
1519
|
+
*
|
|
1520
|
+
* At this time, `Variant` does not support LangAuto.
|
|
1521
|
+
*
|
|
1522
|
+
* @public
|
|
1523
|
+
*/
|
|
1524
|
+
export declare const LangAuto: 32;
|
|
1525
|
+
|
|
1526
|
+
/**
|
|
1527
|
+
* Upstream LangVariant constant LangBash. Its numeric value is preserved exactly.
|
|
1528
|
+
*
|
|
1529
|
+
* LangBash corresponds to the GNU Bash language, as described in its
|
|
1530
|
+
* manual at https://www.gnu.org/software/bash/manual/bash.html.
|
|
1531
|
+
*
|
|
1532
|
+
* We currently follow Bash version 5.2.
|
|
1533
|
+
*
|
|
1534
|
+
* Its string representation is "bash".
|
|
1535
|
+
*
|
|
1536
|
+
* @public
|
|
1537
|
+
*/
|
|
1538
|
+
export declare const LangBash: 1;
|
|
1539
|
+
|
|
1540
|
+
/**
|
|
1541
|
+
* Upstream LangVariant constant LangBats. Its numeric value is preserved exactly.
|
|
1542
|
+
*
|
|
1543
|
+
* LangBats corresponds to the Bash Automated Testing System language,
|
|
1544
|
+
* as described at https://github.com/bats-core/bats-core. Note that
|
|
1545
|
+
* it's just a small extension of the Bash language.
|
|
1546
|
+
*
|
|
1547
|
+
* Its string representation is "bats".
|
|
1548
|
+
*
|
|
1549
|
+
* @public
|
|
1550
|
+
*/
|
|
1551
|
+
export declare const LangBats: 8;
|
|
1552
|
+
|
|
1553
|
+
/**
|
|
1554
|
+
* A syntax feature rejected for the selected upstream language variant.
|
|
1555
|
+
* @public
|
|
1556
|
+
*/
|
|
1557
|
+
export declare class LangError extends ShAstError {
|
|
1558
|
+
readonly Message: GoString;
|
|
1559
|
+
readonly Filename: GoString;
|
|
1560
|
+
readonly Pos: SyntaxPos;
|
|
1561
|
+
readonly Feature: GoString;
|
|
1562
|
+
readonly Langs: readonly number[];
|
|
1563
|
+
readonly LangUsed: number;
|
|
1564
|
+
readonly File: File_2 | null;
|
|
1565
|
+
/** Identifies a dialect-specific syntax failure. */
|
|
1566
|
+
readonly code = "SH_AST_SYNTAX_LANG";
|
|
1567
|
+
/** Preserves the feature, permitted variants, actual variant and partial tree. */
|
|
1568
|
+
constructor(Message: GoString, Filename: GoString, Pos: SyntaxPos, Feature: GoString, Langs: readonly number[], LangUsed: number, File: File_2 | null);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
/**
|
|
1572
|
+
* Upstream LangVariant constant LangMirBSDKorn. Its numeric value is preserved exactly.
|
|
1573
|
+
*
|
|
1574
|
+
* LangMirBSDKorn corresponds to the MirBSD Korn Shell, also known as
|
|
1575
|
+
* mksh, as described at http://www.mirbsd.org/htman/i386/man1/mksh.htm.
|
|
1576
|
+
* Note that it shares some features with Bash, due to the shared
|
|
1577
|
+
* ancestry that is ksh.
|
|
1578
|
+
*
|
|
1579
|
+
* We currently follow mksh version 59.
|
|
1580
|
+
*
|
|
1581
|
+
* Its string representation is "mksh".
|
|
1582
|
+
*
|
|
1583
|
+
* @public
|
|
1584
|
+
*/
|
|
1585
|
+
export declare const LangMirBSDKorn: 4;
|
|
1586
|
+
|
|
1587
|
+
/**
|
|
1588
|
+
* Upstream LangVariant constant LangPOSIX. Its numeric value is preserved exactly.
|
|
1589
|
+
*
|
|
1590
|
+
* LangPOSIX corresponds to the POSIX Shell language, as described at
|
|
1591
|
+
* https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html.
|
|
1592
|
+
*
|
|
1593
|
+
* Its string representation is "posix" or "sh".
|
|
1594
|
+
*
|
|
1595
|
+
* @public
|
|
1596
|
+
*/
|
|
1597
|
+
export declare const LangPOSIX: 2;
|
|
1598
|
+
|
|
1599
|
+
/**
|
|
1600
|
+
* Known upstream language variant values, including legacy zero and LangAuto. Each operation retains its own constraints: the parser Variant option rejects LangAuto even though the language-value type includes it.
|
|
1601
|
+
*
|
|
1602
|
+
* @public
|
|
1603
|
+
*/
|
|
1604
|
+
export declare type LangVariant =
|
|
1605
|
+
| 0
|
|
1606
|
+
| typeof LangAuto
|
|
1607
|
+
| typeof LangBash
|
|
1608
|
+
| typeof LangBats
|
|
1609
|
+
| typeof LangMirBSDKorn
|
|
1610
|
+
| typeof LangPOSIX
|
|
1611
|
+
| typeof LangZsh;
|
|
1612
|
+
|
|
1613
|
+
/**
|
|
1614
|
+
* Upstream LangVariant constant LangZsh. Its numeric value is preserved exactly.
|
|
1615
|
+
*
|
|
1616
|
+
* LangZsh corresponds to the Z shell, as described at https://www.zsh.org/.
|
|
1617
|
+
*
|
|
1618
|
+
* Note that its support in the syntax package is experimental and
|
|
1619
|
+
* incomplete for now. See https://github.com/mvdan/sh/issues/120.
|
|
1620
|
+
*
|
|
1621
|
+
* We currently follow Zsh version 5.9.
|
|
1622
|
+
*
|
|
1623
|
+
* Its string representation is "zsh".
|
|
1624
|
+
*
|
|
1625
|
+
* @public
|
|
1626
|
+
*/
|
|
1627
|
+
export declare const LangZsh: 16;
|
|
1628
|
+
|
|
1629
|
+
/**
|
|
1630
|
+
* Upstream BinAritOperator constant Leq. Its numeric value is preserved exactly.
|
|
1631
|
+
*
|
|
1632
|
+
* \<=
|
|
1633
|
+
*
|
|
1634
|
+
* @public
|
|
1635
|
+
*/
|
|
1636
|
+
export declare const Leq: 47;
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* LetClause represents a Bash let clause.
|
|
1640
|
+
*
|
|
1641
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
1642
|
+
*
|
|
1643
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1644
|
+
*
|
|
1645
|
+
* @public
|
|
1646
|
+
*/
|
|
1647
|
+
export declare interface LetClause {
|
|
1648
|
+
/**
|
|
1649
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1650
|
+
*/
|
|
1651
|
+
Type: 'LetClause';
|
|
1652
|
+
/**
|
|
1653
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1654
|
+
*/
|
|
1655
|
+
Exprs: (ArithmExpr | null)[] | null;
|
|
1656
|
+
/**
|
|
1657
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1658
|
+
*/
|
|
1659
|
+
Let: SyntaxPos;
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
/**
|
|
1663
|
+
* Lit represents a string literal.
|
|
1664
|
+
*
|
|
1665
|
+
* Note that a parsed string literal may not appear as-is in the original source
|
|
1666
|
+
* code, as it is possible to split literals by escaping newlines. The splitting
|
|
1667
|
+
* is lost, but the end position is not.
|
|
1668
|
+
*
|
|
1669
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1670
|
+
*
|
|
1671
|
+
* @public
|
|
1672
|
+
*/
|
|
1673
|
+
export declare interface Lit {
|
|
1674
|
+
/**
|
|
1675
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1676
|
+
*/
|
|
1677
|
+
Type: 'Lit';
|
|
1678
|
+
/**
|
|
1679
|
+
* Upstream string bytes; non-UTF-8 values remain bytes rather than replacement text.
|
|
1680
|
+
*/
|
|
1681
|
+
Value: GoString;
|
|
1682
|
+
/**
|
|
1683
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1684
|
+
*/
|
|
1685
|
+
ValueEnd: SyntaxPos;
|
|
1686
|
+
/**
|
|
1687
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1688
|
+
*/
|
|
1689
|
+
ValuePos: SyntaxPos;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* The concrete records and typed nil pointers accepted by upstream syntax.Loop. Typed nil kinds are limited to this interface's actual implementers; auxiliary records are excluded.
|
|
1694
|
+
*
|
|
1695
|
+
* @public
|
|
1696
|
+
*/
|
|
1697
|
+
export declare type Loop = CStyleLoop | WordIter | TypedNil<'CStyleLoop' | 'WordIter'>;
|
|
1698
|
+
|
|
1699
|
+
/**
|
|
1700
|
+
* Upstream ParExpOperator constant LowerAll. Its numeric value is preserved exactly.
|
|
1701
|
+
*
|
|
1702
|
+
* ,,
|
|
1703
|
+
*
|
|
1704
|
+
* @public
|
|
1705
|
+
*/
|
|
1706
|
+
export declare const LowerAll: 99;
|
|
1707
|
+
|
|
1708
|
+
/**
|
|
1709
|
+
* Upstream ParExpOperator constant LowerFirst. Its numeric value is preserved exactly.
|
|
1710
|
+
*
|
|
1711
|
+
* ,
|
|
1712
|
+
*
|
|
1713
|
+
* @public
|
|
1714
|
+
*/
|
|
1715
|
+
export declare const LowerFirst: 98;
|
|
1716
|
+
|
|
1717
|
+
/**
|
|
1718
|
+
* Upstream BinAritOperator constant Lss. Its numeric value is preserved exactly.
|
|
1719
|
+
*
|
|
1720
|
+
* \<
|
|
1721
|
+
*
|
|
1722
|
+
* @public
|
|
1723
|
+
*/
|
|
1724
|
+
export declare const Lss: 65;
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* Upstream ParExpOperator constant MatchEmpty. Its numeric value is preserved exactly.
|
|
1728
|
+
*
|
|
1729
|
+
* :# with `LangZsh`
|
|
1730
|
+
*
|
|
1731
|
+
* @public
|
|
1732
|
+
*/
|
|
1733
|
+
export declare const MatchEmpty: 93;
|
|
1734
|
+
|
|
1735
|
+
/**
|
|
1736
|
+
* Upstream UnAritOperator constant Minus. Its numeric value is preserved exactly.
|
|
1737
|
+
*
|
|
1738
|
+
* -
|
|
1739
|
+
*
|
|
1740
|
+
* @public
|
|
1741
|
+
*/
|
|
1742
|
+
export declare const Minus: 83;
|
|
1743
|
+
|
|
1744
|
+
/**
|
|
1745
|
+
* Upstream BinAritOperator constant Mul. Its numeric value is preserved exactly.
|
|
1746
|
+
*
|
|
1747
|
+
* *
|
|
1748
|
+
*
|
|
1749
|
+
* @public
|
|
1750
|
+
*/
|
|
1751
|
+
export declare const Mul: 43;
|
|
1752
|
+
|
|
1753
|
+
/**
|
|
1754
|
+
* Upstream BinAritOperator constant MulAssgn. Its numeric value is preserved exactly.
|
|
1755
|
+
*
|
|
1756
|
+
* *=
|
|
1757
|
+
*
|
|
1758
|
+
* @public
|
|
1759
|
+
*/
|
|
1760
|
+
export declare const MulAssgn: 51;
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* Upstream ParNamesOperator constant NamesPrefix. Its numeric value is preserved exactly.
|
|
1764
|
+
*
|
|
1765
|
+
* *
|
|
1766
|
+
*
|
|
1767
|
+
* @public
|
|
1768
|
+
*/
|
|
1769
|
+
export declare const NamesPrefix: 43;
|
|
1770
|
+
|
|
1771
|
+
/**
|
|
1772
|
+
* Upstream ParNamesOperator constant NamesPrefixWords. Its numeric value is preserved exactly.
|
|
1773
|
+
*
|
|
1774
|
+
* \@
|
|
1775
|
+
*
|
|
1776
|
+
* @public
|
|
1777
|
+
*/
|
|
1778
|
+
export declare const NamesPrefixWords: 100;
|
|
1779
|
+
|
|
1780
|
+
/**
|
|
1781
|
+
* Upstream BinAritOperator constant Neq. Its numeric value is preserved exactly.
|
|
1782
|
+
*
|
|
1783
|
+
* !=
|
|
1784
|
+
*
|
|
1785
|
+
* @public
|
|
1786
|
+
*/
|
|
1787
|
+
export declare const Neq: 46;
|
|
1788
|
+
|
|
1789
|
+
/**
|
|
1790
|
+
* Constructs an upstream position. uint64 arguments use bigint when outside the
|
|
1791
|
+
* safe-number range; upstream clamps offsets and zeroes overflowing line/column
|
|
1792
|
+
* values. The binding does not replace those rules with its own range policy.
|
|
1793
|
+
* @public
|
|
1794
|
+
*/
|
|
1795
|
+
export declare function newPos(offset: number | bigint, line: number | bigint, column: number | bigint): SyntaxPos;
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* The concrete records and typed nil pointers accepted by upstream syntax.Node. Typed nil kinds are limited to this interface's actual implementers; auxiliary records are excluded.
|
|
1799
|
+
*
|
|
1800
|
+
* @public
|
|
1801
|
+
*/
|
|
1802
|
+
declare type Node_2 =
|
|
1803
|
+
| ArithmCmd
|
|
1804
|
+
| ArithmExp
|
|
1805
|
+
| ArrayElem
|
|
1806
|
+
| ArrayExpr
|
|
1807
|
+
| Assign
|
|
1808
|
+
| BinaryArithm
|
|
1809
|
+
| BinaryCmd
|
|
1810
|
+
| BinaryTest
|
|
1811
|
+
| Block
|
|
1812
|
+
| BraceExp
|
|
1813
|
+
| CStyleLoop
|
|
1814
|
+
| CallExpr
|
|
1815
|
+
| CaseClause
|
|
1816
|
+
| CaseItem
|
|
1817
|
+
| CmdSubst
|
|
1818
|
+
| Comment_2
|
|
1819
|
+
| CoprocClause
|
|
1820
|
+
| DblQuoted
|
|
1821
|
+
| DeclClause
|
|
1822
|
+
| ExtGlob
|
|
1823
|
+
| File_2
|
|
1824
|
+
| FlagsArithm
|
|
1825
|
+
| ForClause
|
|
1826
|
+
| FuncDecl
|
|
1827
|
+
| IfClause
|
|
1828
|
+
| LetClause
|
|
1829
|
+
| Lit
|
|
1830
|
+
| ParamExp
|
|
1831
|
+
| ParenArithm
|
|
1832
|
+
| ParenTest
|
|
1833
|
+
| ProcSubst
|
|
1834
|
+
| Redirect
|
|
1835
|
+
| SglQuoted
|
|
1836
|
+
| Stmt
|
|
1837
|
+
| Subshell
|
|
1838
|
+
| TestClause
|
|
1839
|
+
| TestDecl
|
|
1840
|
+
| TimeClause
|
|
1841
|
+
| UnaryArithm
|
|
1842
|
+
| UnaryTest
|
|
1843
|
+
| WhileClause
|
|
1844
|
+
| Word
|
|
1845
|
+
| WordIter
|
|
1846
|
+
| TypedNil<
|
|
1847
|
+
| 'ArithmCmd'
|
|
1848
|
+
| 'ArithmExp'
|
|
1849
|
+
| 'ArrayElem'
|
|
1850
|
+
| 'ArrayExpr'
|
|
1851
|
+
| 'Assign'
|
|
1852
|
+
| 'BinaryArithm'
|
|
1853
|
+
| 'BinaryCmd'
|
|
1854
|
+
| 'BinaryTest'
|
|
1855
|
+
| 'Block'
|
|
1856
|
+
| 'BraceExp'
|
|
1857
|
+
| 'CStyleLoop'
|
|
1858
|
+
| 'CallExpr'
|
|
1859
|
+
| 'CaseClause'
|
|
1860
|
+
| 'CaseItem'
|
|
1861
|
+
| 'CmdSubst'
|
|
1862
|
+
| 'Comment'
|
|
1863
|
+
| 'CoprocClause'
|
|
1864
|
+
| 'DblQuoted'
|
|
1865
|
+
| 'DeclClause'
|
|
1866
|
+
| 'ExtGlob'
|
|
1867
|
+
| 'File'
|
|
1868
|
+
| 'FlagsArithm'
|
|
1869
|
+
| 'ForClause'
|
|
1870
|
+
| 'FuncDecl'
|
|
1871
|
+
| 'IfClause'
|
|
1872
|
+
| 'LetClause'
|
|
1873
|
+
| 'Lit'
|
|
1874
|
+
| 'ParamExp'
|
|
1875
|
+
| 'ParenArithm'
|
|
1876
|
+
| 'ParenTest'
|
|
1877
|
+
| 'ProcSubst'
|
|
1878
|
+
| 'Redirect'
|
|
1879
|
+
| 'SglQuoted'
|
|
1880
|
+
| 'Stmt'
|
|
1881
|
+
| 'Subshell'
|
|
1882
|
+
| 'TestClause'
|
|
1883
|
+
| 'TestDecl'
|
|
1884
|
+
| 'TimeClause'
|
|
1885
|
+
| 'UnaryArithm'
|
|
1886
|
+
| 'UnaryTest'
|
|
1887
|
+
| 'WhileClause'
|
|
1888
|
+
| 'Word'
|
|
1889
|
+
| 'WordIter'
|
|
1890
|
+
>;
|
|
1891
|
+
export { Node_2 as Node }
|
|
1892
|
+
|
|
1893
|
+
/**
|
|
1894
|
+
* Computes a node's ending position using upstream's End method, including
|
|
1895
|
+
* recovered/invalid behavior and changes to text or child nodes.
|
|
1896
|
+
* @public
|
|
1897
|
+
*/
|
|
1898
|
+
export declare function nodeEnd(node: Node_2): SyntaxPos;
|
|
1899
|
+
|
|
1900
|
+
/**
|
|
1901
|
+
* Computes a node's starting position from its current fields using upstream's
|
|
1902
|
+
* Pos method. No cached parse-time position can override subsequent tree edits.
|
|
1903
|
+
* @public
|
|
1904
|
+
*/
|
|
1905
|
+
export declare function nodePos(node: Node_2): SyntaxPos;
|
|
1906
|
+
|
|
1907
|
+
/**
|
|
1908
|
+
* A node's upstream bounds as observed during parsing. These values refer to the
|
|
1909
|
+
* original source, even when the corresponding syntax record is later edited.
|
|
1910
|
+
* @public
|
|
1911
|
+
*/
|
|
1912
|
+
export declare interface NodePositions {
|
|
1913
|
+
/** Starting byte position observed for the original parsed node. */
|
|
1914
|
+
readonly Pos: Readonly<SyntaxPos>;
|
|
1915
|
+
/** Exclusive ending byte position observed for the original parsed node. */
|
|
1916
|
+
readonly End: Readonly<SyntaxPos>;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
/**
|
|
1920
|
+
* Upstream UnAritOperator constant Not. Its numeric value is preserved exactly.
|
|
1921
|
+
*
|
|
1922
|
+
* !
|
|
1923
|
+
*
|
|
1924
|
+
* @public
|
|
1925
|
+
*/
|
|
1926
|
+
export declare const Not: 39;
|
|
1927
|
+
|
|
1928
|
+
/**
|
|
1929
|
+
* The upstream uint32 operator families. A family name identifies the Go named type, not the spelling of one token.
|
|
1930
|
+
*
|
|
1931
|
+
* @public
|
|
1932
|
+
*/
|
|
1933
|
+
export declare type OperatorFamily =
|
|
1934
|
+
| 'BinAritOperator'
|
|
1935
|
+
| 'BinCmdOperator'
|
|
1936
|
+
| 'BinTestOperator'
|
|
1937
|
+
| 'CaseOperator'
|
|
1938
|
+
| 'GlobOperator'
|
|
1939
|
+
| 'ParExpOperator'
|
|
1940
|
+
| 'ParNamesOperator'
|
|
1941
|
+
| 'ProcOperator'
|
|
1942
|
+
| 'RedirOperator'
|
|
1943
|
+
| 'UnAritOperator'
|
|
1944
|
+
| 'UnTestOperator';
|
|
1945
|
+
|
|
1946
|
+
/**
|
|
1947
|
+
* Upstream BinAritOperator constant Or. Its numeric value is preserved exactly.
|
|
1948
|
+
*
|
|
1949
|
+
* |
|
|
1950
|
+
*
|
|
1951
|
+
* @public
|
|
1952
|
+
*/
|
|
1953
|
+
export declare const Or: 13;
|
|
1954
|
+
|
|
1955
|
+
/**
|
|
1956
|
+
* Upstream BinAritOperator constant OrArit. Its numeric value is preserved exactly.
|
|
1957
|
+
*
|
|
1958
|
+
* ||
|
|
1959
|
+
*
|
|
1960
|
+
* @public
|
|
1961
|
+
*/
|
|
1962
|
+
export declare const OrArit: 12;
|
|
1963
|
+
|
|
1964
|
+
/**
|
|
1965
|
+
* Upstream BinAritOperator constant OrAssgn. Its numeric value is preserved exactly.
|
|
1966
|
+
*
|
|
1967
|
+
* |=
|
|
1968
|
+
*
|
|
1969
|
+
* @public
|
|
1970
|
+
*/
|
|
1971
|
+
export declare const OrAssgn: 55;
|
|
1972
|
+
|
|
1973
|
+
/**
|
|
1974
|
+
* Upstream BinAritOperator constant OrBoolAssgn. Its numeric value is preserved exactly.
|
|
1975
|
+
*
|
|
1976
|
+
* ||=
|
|
1977
|
+
*
|
|
1978
|
+
* @public
|
|
1979
|
+
*/
|
|
1980
|
+
export declare const OrBoolAssgn: 60;
|
|
1981
|
+
|
|
1982
|
+
/**
|
|
1983
|
+
* Upstream BinCmdOperator constant OrStmt. Its numeric value is preserved exactly.
|
|
1984
|
+
*
|
|
1985
|
+
* ||
|
|
1986
|
+
*
|
|
1987
|
+
* @public
|
|
1988
|
+
*/
|
|
1989
|
+
export declare const OrStmt: 12;
|
|
1990
|
+
|
|
1991
|
+
/**
|
|
1992
|
+
* Upstream BinTestOperator constant OrTest. Its numeric value is preserved exactly.
|
|
1993
|
+
*
|
|
1994
|
+
* ||
|
|
1995
|
+
*
|
|
1996
|
+
* @public
|
|
1997
|
+
*/
|
|
1998
|
+
export declare const OrTest: 12;
|
|
1999
|
+
|
|
2000
|
+
/**
|
|
2001
|
+
* Upstream ParExpOperator constant OtherParamOps. Its numeric value is preserved exactly.
|
|
2002
|
+
*
|
|
2003
|
+
* \@
|
|
2004
|
+
*
|
|
2005
|
+
* @public
|
|
2006
|
+
*/
|
|
2007
|
+
export declare const OtherParamOps: 100;
|
|
2008
|
+
|
|
2009
|
+
/**
|
|
2010
|
+
* ParamExp represents a parameter expansion.
|
|
2011
|
+
*
|
|
2012
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
2013
|
+
*
|
|
2014
|
+
* @public
|
|
2015
|
+
*/
|
|
2016
|
+
export declare interface ParamExp {
|
|
2017
|
+
/**
|
|
2018
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2019
|
+
*/
|
|
2020
|
+
Type: 'ParamExp';
|
|
2021
|
+
/**
|
|
2022
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2023
|
+
*/
|
|
2024
|
+
Dollar: SyntaxPos;
|
|
2025
|
+
/**
|
|
2026
|
+
* Only one of these is set at a time.
|
|
2027
|
+
* given how we've grown the number of booleans
|
|
2028
|
+
* $\{!a\}
|
|
2029
|
+
*
|
|
2030
|
+
* False is an explicit upstream value and is never omitted.
|
|
2031
|
+
*/
|
|
2032
|
+
Excl: boolean;
|
|
2033
|
+
/**
|
|
2034
|
+
* $\{a:-b\}, $\{a#b\}, etc
|
|
2035
|
+
*
|
|
2036
|
+
* Null preserves the upstream absence of this component.
|
|
2037
|
+
*/
|
|
2038
|
+
Exp: Expansion | null;
|
|
2039
|
+
/**
|
|
2040
|
+
* $\{(flags)a\} with `LangZsh`
|
|
2041
|
+
*
|
|
2042
|
+
* Null preserves the upstream absence of this component.
|
|
2043
|
+
*/
|
|
2044
|
+
Flags: Lit | null;
|
|
2045
|
+
/**
|
|
2046
|
+
* $\{a`i`\}, $\{a["k"]\}, or a $\{a[i,j]\} slice with `LangZsh`
|
|
2047
|
+
*
|
|
2048
|
+
* Null preserves the upstream absence of this component.
|
|
2049
|
+
*/
|
|
2050
|
+
Index: ArithmExpr | null;
|
|
2051
|
+
/**
|
|
2052
|
+
* $\{+a\} with `LangZsh`
|
|
2053
|
+
*
|
|
2054
|
+
* False is an explicit upstream value and is never omitted.
|
|
2055
|
+
*/
|
|
2056
|
+
IsSet: boolean;
|
|
2057
|
+
/**
|
|
2058
|
+
* $\{#a\}
|
|
2059
|
+
*
|
|
2060
|
+
* False is an explicit upstream value and is never omitted.
|
|
2061
|
+
*/
|
|
2062
|
+
Length: boolean;
|
|
2063
|
+
/**
|
|
2064
|
+
* Only one of these is set at a time.
|
|
2065
|
+
* because it should be impossible for multiple to be set at once,
|
|
2066
|
+
* and a flat structure like this takes up more space.
|
|
2067
|
+
* $\{a:h2\} with `LangZsh`
|
|
2068
|
+
*
|
|
2069
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
2070
|
+
*/
|
|
2071
|
+
Modifiers: (Lit | null)[] | null;
|
|
2072
|
+
/**
|
|
2073
|
+
* $\{!prefix*\} or $\{!prefix\@\}
|
|
2074
|
+
*
|
|
2075
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
2076
|
+
*/
|
|
2077
|
+
Names: ParNamesOperator;
|
|
2078
|
+
/**
|
|
2079
|
+
* A nested parameter expression in the form of `ParamExp` or `CmdSubst`,
|
|
2080
|
+
* or either of those in a `DblQuoted`. Only possible with `LangZsh`.
|
|
2081
|
+
*
|
|
2082
|
+
* Null preserves the upstream absence of this component.
|
|
2083
|
+
*/
|
|
2084
|
+
NestedParam: WordPart | null;
|
|
2085
|
+
/**
|
|
2086
|
+
* Only one of these is set at a time,
|
|
2087
|
+
* or neither with `LangZsh` when the name is omitted.
|
|
2088
|
+
* even if that would be mildly annoying to non-Zsh users.
|
|
2089
|
+
*
|
|
2090
|
+
* Null preserves the upstream absence of this component.
|
|
2091
|
+
*/
|
|
2092
|
+
Param: Lit | null;
|
|
2093
|
+
/**
|
|
2094
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2095
|
+
*/
|
|
2096
|
+
Rbrace: SyntaxPos;
|
|
2097
|
+
/**
|
|
2098
|
+
* $\{a/x/y\}
|
|
2099
|
+
*
|
|
2100
|
+
* Null preserves the upstream absence of this component.
|
|
2101
|
+
*/
|
|
2102
|
+
Repl: Replace | null;
|
|
2103
|
+
/**
|
|
2104
|
+
* $a instead of $\{a\}
|
|
2105
|
+
*
|
|
2106
|
+
* False is an explicit upstream value and is never omitted.
|
|
2107
|
+
*/
|
|
2108
|
+
Short: boolean;
|
|
2109
|
+
/**
|
|
2110
|
+
* $\{a:x:y\}
|
|
2111
|
+
*
|
|
2112
|
+
* Null preserves the upstream absence of this component.
|
|
2113
|
+
*/
|
|
2114
|
+
Slice: Slice | null;
|
|
2115
|
+
/**
|
|
2116
|
+
* mksh's $\{%a\}
|
|
2117
|
+
*
|
|
2118
|
+
* False is an explicit upstream value and is never omitted.
|
|
2119
|
+
*/
|
|
2120
|
+
Width: boolean;
|
|
2121
|
+
}
|
|
2122
|
+
|
|
2123
|
+
/**
|
|
2124
|
+
* ParenArithm represents an arithmetic expression within parentheses.
|
|
2125
|
+
*
|
|
2126
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
2127
|
+
*
|
|
2128
|
+
* @public
|
|
2129
|
+
*/
|
|
2130
|
+
export declare interface ParenArithm {
|
|
2131
|
+
/**
|
|
2132
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2133
|
+
*/
|
|
2134
|
+
Type: 'ParenArithm';
|
|
2135
|
+
/**
|
|
2136
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2137
|
+
*/
|
|
2138
|
+
Lparen: SyntaxPos;
|
|
2139
|
+
/**
|
|
2140
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2141
|
+
*/
|
|
2142
|
+
Rparen: SyntaxPos;
|
|
2143
|
+
/**
|
|
2144
|
+
* Null preserves the upstream absence of this component.
|
|
2145
|
+
*/
|
|
2146
|
+
X: ArithmExpr | null;
|
|
2147
|
+
}
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* ParenTest represents a test expression within parentheses.
|
|
2151
|
+
*
|
|
2152
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
2153
|
+
*
|
|
2154
|
+
* @public
|
|
2155
|
+
*/
|
|
2156
|
+
export declare interface ParenTest {
|
|
2157
|
+
/**
|
|
2158
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2159
|
+
*/
|
|
2160
|
+
Type: 'ParenTest';
|
|
2161
|
+
/**
|
|
2162
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2163
|
+
*/
|
|
2164
|
+
Lparen: SyntaxPos;
|
|
2165
|
+
/**
|
|
2166
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2167
|
+
*/
|
|
2168
|
+
Rparen: SyntaxPos;
|
|
2169
|
+
/**
|
|
2170
|
+
* Null preserves the upstream absence of this component.
|
|
2171
|
+
*/
|
|
2172
|
+
X: TestExpr | null;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2175
|
+
/**
|
|
2176
|
+
* The upstream ParExpOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
2177
|
+
*
|
|
2178
|
+
* @public
|
|
2179
|
+
*/
|
|
2180
|
+
export declare type ParExpOperator =
|
|
2181
|
+
| 0
|
|
2182
|
+
| typeof AlternateUnset
|
|
2183
|
+
| typeof AlternateUnsetOrNull
|
|
2184
|
+
| typeof ArrayExclude
|
|
2185
|
+
| typeof ArrayIntersect
|
|
2186
|
+
| typeof AssignUnset
|
|
2187
|
+
| typeof AssignUnsetOrNull
|
|
2188
|
+
| typeof DefaultUnset
|
|
2189
|
+
| typeof DefaultUnsetOrNull
|
|
2190
|
+
| typeof ErrorUnset
|
|
2191
|
+
| typeof ErrorUnsetOrNull
|
|
2192
|
+
| typeof LowerAll
|
|
2193
|
+
| typeof LowerFirst
|
|
2194
|
+
| typeof MatchEmpty
|
|
2195
|
+
| typeof OtherParamOps
|
|
2196
|
+
| typeof RemLargePrefix
|
|
2197
|
+
| typeof RemLargeSuffix
|
|
2198
|
+
| typeof RemSmallPrefix
|
|
2199
|
+
| typeof RemSmallSuffix
|
|
2200
|
+
| typeof UpperAll
|
|
2201
|
+
| typeof UpperFirst
|
|
2202
|
+
| RawOperator<'ParExpOperator'>;
|
|
2203
|
+
|
|
2204
|
+
/**
|
|
2205
|
+
* The upstream ParNamesOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
2206
|
+
*
|
|
2207
|
+
* @public
|
|
2208
|
+
*/
|
|
2209
|
+
export declare type ParNamesOperator =
|
|
2210
|
+
0 | typeof NamesPrefix | typeof NamesPrefixWords | RawOperator<'ParNamesOperator'>;
|
|
2211
|
+
|
|
2212
|
+
/**
|
|
2213
|
+
* Mutable upstream syntax together with a separate source-bound position view.
|
|
2214
|
+
* Editing File never updates Positions; source consumers can retain original
|
|
2215
|
+
* spans while transformations query live nodePos/nodeEnd as needed.
|
|
2216
|
+
* @public
|
|
2217
|
+
*/
|
|
2218
|
+
export declare interface ParsedFile {
|
|
2219
|
+
/** The complete mutable upstream File; no bounds or consumer fields are added. */
|
|
2220
|
+
readonly File: File_2;
|
|
2221
|
+
/** Immutable original observations, keyed by this File's node identities. */
|
|
2222
|
+
readonly Positions: PositionSnapshot;
|
|
2223
|
+
}
|
|
2224
|
+
|
|
2225
|
+
/**
|
|
2226
|
+
* A source grammar error reported by mvdan/sh, with the partial parsed file.
|
|
2227
|
+
* @public
|
|
2228
|
+
*/
|
|
2229
|
+
export declare class ParseError extends ShAstError {
|
|
2230
|
+
readonly Message: GoString;
|
|
2231
|
+
readonly Filename: GoString;
|
|
2232
|
+
readonly Pos: SyntaxPos;
|
|
2233
|
+
readonly Text: GoString;
|
|
2234
|
+
readonly Incomplete: boolean;
|
|
2235
|
+
readonly File: File_2 | null;
|
|
2236
|
+
/** Identifies a source grammar failure independently of its display text. */
|
|
2237
|
+
readonly code = "SH_AST_SYNTAX_PARSE";
|
|
2238
|
+
/**
|
|
2239
|
+
* Keeps the original Go fields. Message is the formatted upstream error;
|
|
2240
|
+
* Text is its unformatted diagnostic, and File is the result returned with it.
|
|
2241
|
+
*/
|
|
2242
|
+
constructor(Message: GoString, Filename: GoString, Pos: SyntaxPos, Text: GoString, Incomplete: boolean, File: File_2 | null);
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
/**
|
|
2246
|
+
* Whole-file parser inputs corresponding to upstream controls. Defaults match
|
|
2247
|
+
* NewParser; in particular comments are retained only when KeepComments is true.
|
|
2248
|
+
* Numeric int arguments accept bigint because Go's WASM int is signed 64-bit.
|
|
2249
|
+
* @public
|
|
2250
|
+
*/
|
|
2251
|
+
export declare interface ParseOptions {
|
|
2252
|
+
/** Source identity carried by File/errors; no file is opened by the binding. */
|
|
2253
|
+
Filename?: GoString;
|
|
2254
|
+
/** Retains comment nodes when true; upstream defaults to false. */
|
|
2255
|
+
KeepComments?: boolean;
|
|
2256
|
+
/** Upstream LangVariant value. Variant rejects unsupported values, including LangAuto. */
|
|
2257
|
+
Variant?: number | bigint;
|
|
2258
|
+
/** Lexer delimiter with upstream byte-length, whitespace and prefix semantics. */
|
|
2259
|
+
StopAt?: GoString;
|
|
2260
|
+
/** Maximum number of recoverable missing grammar tokens, using upstream behavior. */
|
|
2261
|
+
RecoverErrors?: number | bigint;
|
|
2262
|
+
}
|
|
2263
|
+
|
|
2264
|
+
/**
|
|
2265
|
+
* Parses exact source bytes, or well-formed Unicode text encoded as UTF-8. First
|
|
2266
|
+
* use synchronously initializes WASM. The existing conservative nesting guard is
|
|
2267
|
+
* an explicit binding resource limit, not an upstream grammar restriction.
|
|
2268
|
+
* @public
|
|
2269
|
+
*/
|
|
2270
|
+
export declare function parseSync(source: string | Uint8Array, options?: ParseOptions): File_2;
|
|
2271
|
+
|
|
2272
|
+
/**
|
|
2273
|
+
* Parses once while observing every real node's upstream bounds in Go. The
|
|
2274
|
+
* separate immutable lookup describes this original parse; it never replaces
|
|
2275
|
+
* live nodePos/nodeEnd or tracks edits. Source adapters avoid reconstructing
|
|
2276
|
+
* each descendant subtree just to display the original source locations.
|
|
2277
|
+
* @public
|
|
2278
|
+
*/
|
|
2279
|
+
export declare function parseWithPositionsSync(source: string | Uint8Array, options?: ParseOptions): ParsedFile;
|
|
2280
|
+
|
|
2281
|
+
/**
|
|
2282
|
+
* Upstream BinCmdOperator constant Pipe. Its numeric value is preserved exactly.
|
|
2283
|
+
*
|
|
2284
|
+
* |
|
|
2285
|
+
*
|
|
2286
|
+
* @public
|
|
2287
|
+
*/
|
|
2288
|
+
export declare const Pipe: 13;
|
|
2289
|
+
|
|
2290
|
+
/**
|
|
2291
|
+
* Upstream BinCmdOperator constant PipeAll. Its numeric value is preserved exactly.
|
|
2292
|
+
*
|
|
2293
|
+
* |&
|
|
2294
|
+
*
|
|
2295
|
+
* @public
|
|
2296
|
+
*/
|
|
2297
|
+
export declare const PipeAll: 14;
|
|
2298
|
+
|
|
2299
|
+
/**
|
|
2300
|
+
* Upstream UnAritOperator constant Plus. Its numeric value is preserved exactly.
|
|
2301
|
+
*
|
|
2302
|
+
* +
|
|
2303
|
+
*
|
|
2304
|
+
* @public
|
|
2305
|
+
*/
|
|
2306
|
+
export declare const Plus: 81;
|
|
2307
|
+
|
|
2308
|
+
/**
|
|
2309
|
+
* Identity-based lookup of the original parse's bounds. A new or copied node has
|
|
2310
|
+
* no observation. The index never calls WASM or recalculates edited node bounds.
|
|
2311
|
+
* @public
|
|
2312
|
+
*/
|
|
2313
|
+
export declare interface PositionSnapshot {
|
|
2314
|
+
/**
|
|
2315
|
+
* Returns the captured pair for a node from this parse, or undefined for a
|
|
2316
|
+
* foreign node. If either upstream observation failed, throws the captured
|
|
2317
|
+
* InputError without changing the successfully parsed File. Use nodePos or
|
|
2318
|
+
* nodeEnd to request a live, independent bound from current edited fields.
|
|
2319
|
+
*/
|
|
2320
|
+
get(node: Node_2): NodePositions | undefined;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
/**
|
|
2324
|
+
* Upstream BinAritOperator constant Pow. Its numeric value is preserved exactly.
|
|
2325
|
+
*
|
|
2326
|
+
* **
|
|
2327
|
+
*
|
|
2328
|
+
* @public
|
|
2329
|
+
*/
|
|
2330
|
+
export declare const Pow: 44;
|
|
2331
|
+
|
|
2332
|
+
/**
|
|
2333
|
+
* Upstream BinAritOperator constant PowAssgn. Its numeric value is preserved exactly.
|
|
2334
|
+
*
|
|
2335
|
+
* **=
|
|
2336
|
+
*
|
|
2337
|
+
* @public
|
|
2338
|
+
*/
|
|
2339
|
+
export declare const PowAssgn: 62;
|
|
2340
|
+
|
|
2341
|
+
/**
|
|
2342
|
+
* The upstream ProcOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
2343
|
+
*
|
|
2344
|
+
* @public
|
|
2345
|
+
*/
|
|
2346
|
+
export declare type ProcOperator =
|
|
2347
|
+
0 | typeof CmdIn | typeof CmdInTemp | typeof CmdOut | RawOperator<'ProcOperator'>;
|
|
2348
|
+
|
|
2349
|
+
/**
|
|
2350
|
+
* ProcSubst represents a Bash process substitution.
|
|
2351
|
+
*
|
|
2352
|
+
* This node will only appear with `LangBash`.
|
|
2353
|
+
*
|
|
2354
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
2355
|
+
*
|
|
2356
|
+
* @public
|
|
2357
|
+
*/
|
|
2358
|
+
export declare interface ProcSubst {
|
|
2359
|
+
/**
|
|
2360
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2361
|
+
*/
|
|
2362
|
+
Type: 'ProcSubst';
|
|
2363
|
+
/**
|
|
2364
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
2365
|
+
*/
|
|
2366
|
+
Last: Comment_2[] | null;
|
|
2367
|
+
/**
|
|
2368
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
2369
|
+
*/
|
|
2370
|
+
Op: ProcOperator;
|
|
2371
|
+
/**
|
|
2372
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2373
|
+
*/
|
|
2374
|
+
OpPos: SyntaxPos;
|
|
2375
|
+
/**
|
|
2376
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2377
|
+
*/
|
|
2378
|
+
Rparen: SyntaxPos;
|
|
2379
|
+
/**
|
|
2380
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
2381
|
+
*/
|
|
2382
|
+
Stmts: (Stmt | null)[] | null;
|
|
2383
|
+
}
|
|
2384
|
+
|
|
2385
|
+
/**
|
|
2386
|
+
* Upstream BinAritOperator constant Quo. Its numeric value is preserved exactly.
|
|
2387
|
+
*
|
|
2388
|
+
* /
|
|
2389
|
+
*
|
|
2390
|
+
* @public
|
|
2391
|
+
*/
|
|
2392
|
+
export declare const Quo: 101;
|
|
2393
|
+
|
|
2394
|
+
/**
|
|
2395
|
+
* Upstream BinAritOperator constant QuoAssgn. Its numeric value is preserved exactly.
|
|
2396
|
+
*
|
|
2397
|
+
* /=
|
|
2398
|
+
*
|
|
2399
|
+
* @public
|
|
2400
|
+
*/
|
|
2401
|
+
export declare const QuoAssgn: 52;
|
|
2402
|
+
|
|
2403
|
+
/**
|
|
2404
|
+
* An explicitly represented unnamed uint32 value in one upstream operator family. The runtime constructor checks integer range; this type does not claim that every value is meaningful to every parser or printer operation. The structural family marker remains interoperable across package entry points while preventing accidental cross-family assignment.
|
|
2405
|
+
*
|
|
2406
|
+
* @public
|
|
2407
|
+
*/
|
|
2408
|
+
export declare type RawOperator<Family extends OperatorFamily> = number & {
|
|
2409
|
+
readonly __shAstOperatorFamily: Family;
|
|
2410
|
+
};
|
|
2411
|
+
|
|
2412
|
+
/**
|
|
2413
|
+
* Represents an unnamed value in an upstream uint32 operator family. Named
|
|
2414
|
+
* constants remain precise literal unions; this explicit path preserves other Go
|
|
2415
|
+
* values without claiming an operation such as Print accepts them.
|
|
2416
|
+
* @public
|
|
2417
|
+
*/
|
|
2418
|
+
export declare function rawOperator<Family extends OperatorFamily>(family: Family, value: number): RawOperator<Family>;
|
|
2419
|
+
|
|
2420
|
+
/**
|
|
2421
|
+
* Upstream RedirOperator constant RdrAll. Its numeric value is preserved exactly.
|
|
2422
|
+
*
|
|
2423
|
+
* &\>
|
|
2424
|
+
*
|
|
2425
|
+
* @public
|
|
2426
|
+
*/
|
|
2427
|
+
export declare const RdrAll: 74;
|
|
2428
|
+
|
|
2429
|
+
/**
|
|
2430
|
+
* Upstream RedirOperator constant RdrAllClob. Its numeric value is preserved exactly.
|
|
2431
|
+
*
|
|
2432
|
+
* &\>| with `LangZsh`
|
|
2433
|
+
*
|
|
2434
|
+
* @public
|
|
2435
|
+
*/
|
|
2436
|
+
export declare const RdrAllClob: 75;
|
|
2437
|
+
|
|
2438
|
+
/**
|
|
2439
|
+
* Upstream RedirOperator constant RdrClob. Its numeric value is preserved exactly.
|
|
2440
|
+
*
|
|
2441
|
+
* \>|
|
|
2442
|
+
*
|
|
2443
|
+
* @public
|
|
2444
|
+
*/
|
|
2445
|
+
export declare const RdrClob: 69;
|
|
2446
|
+
|
|
2447
|
+
/**
|
|
2448
|
+
* Upstream RedirOperator constant RdrIn. Its numeric value is preserved exactly.
|
|
2449
|
+
*
|
|
2450
|
+
* \<
|
|
2451
|
+
*
|
|
2452
|
+
* @public
|
|
2453
|
+
*/
|
|
2454
|
+
export declare const RdrIn: 65;
|
|
2455
|
+
|
|
2456
|
+
/**
|
|
2457
|
+
* Upstream RedirOperator constant RdrInOut. Its numeric value is preserved exactly.
|
|
2458
|
+
*
|
|
2459
|
+
* \<\>
|
|
2460
|
+
*
|
|
2461
|
+
* @public
|
|
2462
|
+
*/
|
|
2463
|
+
export declare const RdrInOut: 66;
|
|
2464
|
+
|
|
2465
|
+
/**
|
|
2466
|
+
* Upstream RedirOperator constant RdrOut. Its numeric value is preserved exactly.
|
|
2467
|
+
*
|
|
2468
|
+
* \>
|
|
2469
|
+
*
|
|
2470
|
+
* @public
|
|
2471
|
+
*/
|
|
2472
|
+
export declare const RdrOut: 63;
|
|
2473
|
+
|
|
2474
|
+
/**
|
|
2475
|
+
* Redirect represents an input/output redirection.
|
|
2476
|
+
*
|
|
2477
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
2478
|
+
*
|
|
2479
|
+
* @public
|
|
2480
|
+
*/
|
|
2481
|
+
export declare interface Redirect {
|
|
2482
|
+
/**
|
|
2483
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2484
|
+
*/
|
|
2485
|
+
Type: 'Redirect';
|
|
2486
|
+
/**
|
|
2487
|
+
* here-document body
|
|
2488
|
+
*
|
|
2489
|
+
* Null preserves the upstream absence of this component.
|
|
2490
|
+
*/
|
|
2491
|
+
Hdoc: Word | null;
|
|
2492
|
+
/**
|
|
2493
|
+
* fd\>, or \{varname\}\> in Bash
|
|
2494
|
+
*
|
|
2495
|
+
* Null preserves the upstream absence of this component.
|
|
2496
|
+
*/
|
|
2497
|
+
N: Lit | null;
|
|
2498
|
+
/**
|
|
2499
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
2500
|
+
*/
|
|
2501
|
+
Op: RedirOperator;
|
|
2502
|
+
/**
|
|
2503
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2504
|
+
*/
|
|
2505
|
+
OpPos: SyntaxPos;
|
|
2506
|
+
/**
|
|
2507
|
+
* \>word
|
|
2508
|
+
*
|
|
2509
|
+
* Null preserves the upstream absence of this component.
|
|
2510
|
+
*/
|
|
2511
|
+
Word: Word | null;
|
|
2512
|
+
}
|
|
2513
|
+
|
|
2514
|
+
/**
|
|
2515
|
+
* The upstream RedirOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
2516
|
+
*
|
|
2517
|
+
* @public
|
|
2518
|
+
*/
|
|
2519
|
+
export declare type RedirOperator =
|
|
2520
|
+
| 0
|
|
2521
|
+
| typeof AppAll
|
|
2522
|
+
| typeof AppAllClob
|
|
2523
|
+
| typeof AppClob
|
|
2524
|
+
| typeof AppOut
|
|
2525
|
+
| typeof DashHdoc
|
|
2526
|
+
| typeof DplIn
|
|
2527
|
+
| typeof DplOut
|
|
2528
|
+
| typeof Hdoc
|
|
2529
|
+
| typeof RdrAll
|
|
2530
|
+
| typeof RdrAllClob
|
|
2531
|
+
| typeof RdrClob
|
|
2532
|
+
| typeof RdrIn
|
|
2533
|
+
| typeof RdrInOut
|
|
2534
|
+
| typeof RdrOut
|
|
2535
|
+
| typeof WordHdoc
|
|
2536
|
+
| RawOperator<'RedirOperator'>;
|
|
2537
|
+
|
|
2538
|
+
/**
|
|
2539
|
+
* Upstream BinAritOperator constant Rem. Its numeric value is preserved exactly.
|
|
2540
|
+
*
|
|
2541
|
+
* %
|
|
2542
|
+
*
|
|
2543
|
+
* @public
|
|
2544
|
+
*/
|
|
2545
|
+
export declare const Rem: 89;
|
|
2546
|
+
|
|
2547
|
+
/**
|
|
2548
|
+
* Upstream BinAritOperator constant RemAssgn. Its numeric value is preserved exactly.
|
|
2549
|
+
*
|
|
2550
|
+
* %=
|
|
2551
|
+
*
|
|
2552
|
+
* @public
|
|
2553
|
+
*/
|
|
2554
|
+
export declare const RemAssgn: 53;
|
|
2555
|
+
|
|
2556
|
+
/**
|
|
2557
|
+
* Upstream ParExpOperator constant RemLargePrefix. Its numeric value is preserved exactly.
|
|
2558
|
+
*
|
|
2559
|
+
* ##
|
|
2560
|
+
*
|
|
2561
|
+
* @public
|
|
2562
|
+
*/
|
|
2563
|
+
export declare const RemLargePrefix: 92;
|
|
2564
|
+
|
|
2565
|
+
/**
|
|
2566
|
+
* Upstream ParExpOperator constant RemLargeSuffix. Its numeric value is preserved exactly.
|
|
2567
|
+
*
|
|
2568
|
+
* %%
|
|
2569
|
+
*
|
|
2570
|
+
* @public
|
|
2571
|
+
*/
|
|
2572
|
+
export declare const RemLargeSuffix: 90;
|
|
2573
|
+
|
|
2574
|
+
/**
|
|
2575
|
+
* Upstream ParExpOperator constant RemSmallPrefix. Its numeric value is preserved exactly.
|
|
2576
|
+
*
|
|
2577
|
+
* #
|
|
2578
|
+
*
|
|
2579
|
+
* @public
|
|
2580
|
+
*/
|
|
2581
|
+
export declare const RemSmallPrefix: 91;
|
|
2582
|
+
|
|
2583
|
+
/**
|
|
2584
|
+
* Upstream ParExpOperator constant RemSmallSuffix. Its numeric value is preserved exactly.
|
|
2585
|
+
*
|
|
2586
|
+
* %
|
|
2587
|
+
*
|
|
2588
|
+
* @public
|
|
2589
|
+
*/
|
|
2590
|
+
export declare const RemSmallSuffix: 89;
|
|
2591
|
+
|
|
2592
|
+
/**
|
|
2593
|
+
* Replace represents a search and replace expression inside a `ParamExp`.
|
|
2594
|
+
*
|
|
2595
|
+
* Auxiliary syntax data, not a syntax.Node; it has no independent source bounds.
|
|
2596
|
+
*
|
|
2597
|
+
* @public
|
|
2598
|
+
*/
|
|
2599
|
+
export declare interface Replace {
|
|
2600
|
+
/**
|
|
2601
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2602
|
+
*/
|
|
2603
|
+
Type: 'Replace';
|
|
2604
|
+
/**
|
|
2605
|
+
* False is an explicit upstream value and is never omitted.
|
|
2606
|
+
*/
|
|
2607
|
+
All: boolean;
|
|
2608
|
+
/**
|
|
2609
|
+
* Null preserves the upstream absence of this component.
|
|
2610
|
+
*/
|
|
2611
|
+
Orig: Word | null;
|
|
2612
|
+
/**
|
|
2613
|
+
* Null preserves the upstream absence of this component.
|
|
2614
|
+
*/
|
|
2615
|
+
With: Word | null;
|
|
2616
|
+
}
|
|
2617
|
+
|
|
2618
|
+
/**
|
|
2619
|
+
* Upstream CaseOperator constant Resume. Its numeric value is preserved exactly.
|
|
2620
|
+
*
|
|
2621
|
+
* ;;&
|
|
2622
|
+
*
|
|
2623
|
+
* @public
|
|
2624
|
+
*/
|
|
2625
|
+
export declare const Resume: 37;
|
|
2626
|
+
|
|
2627
|
+
/**
|
|
2628
|
+
* Upstream CaseOperator constant ResumeKorn. Its numeric value is preserved exactly.
|
|
2629
|
+
*
|
|
2630
|
+
* ;|
|
|
2631
|
+
*
|
|
2632
|
+
* @public
|
|
2633
|
+
*/
|
|
2634
|
+
export declare const ResumeKorn: 38;
|
|
2635
|
+
|
|
2636
|
+
/**
|
|
2637
|
+
* SglQuoted represents a string within single quotes.
|
|
2638
|
+
*
|
|
2639
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
2640
|
+
*
|
|
2641
|
+
* @public
|
|
2642
|
+
*/
|
|
2643
|
+
export declare interface SglQuoted {
|
|
2644
|
+
/**
|
|
2645
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2646
|
+
*/
|
|
2647
|
+
Type: 'SglQuoted';
|
|
2648
|
+
/**
|
|
2649
|
+
* $''
|
|
2650
|
+
*
|
|
2651
|
+
* False is an explicit upstream value and is never omitted.
|
|
2652
|
+
*/
|
|
2653
|
+
Dollar: boolean;
|
|
2654
|
+
/**
|
|
2655
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2656
|
+
*/
|
|
2657
|
+
Left: SyntaxPos;
|
|
2658
|
+
/**
|
|
2659
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2660
|
+
*/
|
|
2661
|
+
Right: SyntaxPos;
|
|
2662
|
+
/**
|
|
2663
|
+
* Upstream string bytes; non-UTF-8 values remain bytes rather than replacement text.
|
|
2664
|
+
*/
|
|
2665
|
+
Value: GoString;
|
|
2666
|
+
}
|
|
2667
|
+
|
|
2668
|
+
/**
|
|
2669
|
+
* Thrown by `sh-ast/analyze`'s `resolveArgv0` when a caller-supplied
|
|
2670
|
+
* `options.transparentWrappers` array contains a malformed `WrapperSpec`
|
|
2671
|
+
* entry — e.g. a non-array or empty `names`, or a flag field that isn't an
|
|
2672
|
+
* array of strings. Fails closed with a clear, specific message at the
|
|
2673
|
+
* point the malformed table is supplied, rather than letting the bad shape
|
|
2674
|
+
* reach flag-matching logic and surface as a confusing native `TypeError`
|
|
2675
|
+
* (or, worse, a silently wrong match) far from its actual cause.
|
|
2676
|
+
*
|
|
2677
|
+
* @public
|
|
2678
|
+
*/
|
|
2679
|
+
export declare class ShAnalyzeInvalidWrapperSpecError extends ShAstError {
|
|
2680
|
+
readonly code = "SH_AST_ANALYZE_INVALID_WRAPPER_SPEC";
|
|
2681
|
+
constructor(message: string);
|
|
2682
|
+
}
|
|
2683
|
+
|
|
2684
|
+
/**
|
|
2685
|
+
* Thrown by `sh-ast/analyze`'s `enumerateCommands` when a tree's genuinely
|
|
2686
|
+
* nested structure — subshells within subshells, chained command/process
|
|
2687
|
+
* substitutions, deeply nested `if`/`case`/loop/function/`time`/`{ }`
|
|
2688
|
+
* bodies, deeply chained `elif` — exceeds its defensive recursion-depth
|
|
2689
|
+
* guard. **Not** thrown for a long *linear* chain (`|`/`|&`/`&&`/`||` of
|
|
2690
|
+
* any realistic length): `enumerateCommands` traverses those iteratively,
|
|
2691
|
+
* so chain length alone never grows this guard's depth counter — only
|
|
2692
|
+
* genuine tree nesting does.
|
|
2693
|
+
*
|
|
2694
|
+
* `enumerateCommands` deliberately fails closed here rather than returning
|
|
2695
|
+
* a truncated, partial result: a partial `CommandSite[]` silently omits
|
|
2696
|
+
* real command sites, which is a false negative for a permission-hook-style
|
|
2697
|
+
* consumer that treats "command not found in the enumeration" as "nothing
|
|
2698
|
+
* to worry about" — an explicit, documented throw is safer than a silent
|
|
2699
|
+
* under-report. Gate-style consumers should treat this error as `deny`,
|
|
2700
|
+
* not fall back to "no commands found, so allow".
|
|
2701
|
+
*
|
|
2702
|
+
* @public
|
|
2703
|
+
*/
|
|
2704
|
+
export declare class ShAnalyzeMaxDepthError extends ShAstError {
|
|
2705
|
+
readonly code = "SH_AST_ANALYZE_MAX_DEPTH";
|
|
2706
|
+
/** The maximum nesting depth `enumerateCommands` supports; the same value every time (not caller-configurable). */
|
|
2707
|
+
readonly maxDepth: number;
|
|
2708
|
+
constructor(maxDepth: number);
|
|
2709
|
+
}
|
|
2710
|
+
|
|
2711
|
+
/** Shared failure classes for binding invariants, resource limits, and analysis contracts. */
|
|
2712
|
+
/**
|
|
2713
|
+
* Common base for every package failure, including upstream syntax errors and
|
|
2714
|
+
* analysis errors. The stable code discriminator supports programmatic handling
|
|
2715
|
+
* without interpreting display messages. Only concrete subclasses are thrown.
|
|
4
2716
|
* @public
|
|
5
2717
|
*/
|
|
6
|
-
export declare
|
|
2718
|
+
export declare abstract class ShAstError extends Error {
|
|
2719
|
+
/** Stable machine-readable identity of the concrete failure kind. */
|
|
2720
|
+
abstract readonly code: string;
|
|
2721
|
+
}
|
|
2722
|
+
|
|
2723
|
+
/**
|
|
2724
|
+
* Thrown by {@link parseSync} for failures that should never happen given a
|
|
2725
|
+
* correctly-behaving WASM shim: a malformed result envelope, an unexpected
|
|
2726
|
+
* root node type, or any other shim contract violation. Distinct from
|
|
2727
|
+
* {@link InputError} and {@link ParseError}, both of which
|
|
2728
|
+
* indicate a foreseeable, actionable user mistake rather than an internal
|
|
2729
|
+
* defect.
|
|
2730
|
+
*
|
|
2731
|
+
* @public
|
|
2732
|
+
*/
|
|
2733
|
+
export declare class ShInternalError extends ShAstError {
|
|
2734
|
+
readonly code = "SH_AST_INTERNAL";
|
|
2735
|
+
constructor(message: string);
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2738
|
+
/**
|
|
2739
|
+
* Upstream BinAritOperator constant Shl. Its numeric value is preserved exactly.
|
|
2740
|
+
*
|
|
2741
|
+
* \<\<
|
|
2742
|
+
*
|
|
2743
|
+
* @public
|
|
2744
|
+
*/
|
|
2745
|
+
export declare const Shl: 71;
|
|
2746
|
+
|
|
2747
|
+
/**
|
|
2748
|
+
* Upstream BinAritOperator constant ShlAssgn. Its numeric value is preserved exactly.
|
|
2749
|
+
*
|
|
2750
|
+
* \<\<=
|
|
2751
|
+
*
|
|
2752
|
+
* @public
|
|
2753
|
+
*/
|
|
2754
|
+
export declare const ShlAssgn: 57;
|
|
2755
|
+
|
|
2756
|
+
/**
|
|
2757
|
+
* Thrown by {@link parseSync} when `text`'s conservatively estimated
|
|
2758
|
+
* structural nesting depth (subshells, command/process substitutions,
|
|
2759
|
+
* `if`/`case`/loop/function bodies, `{ }` blocks, backtick or `$(...)`
|
|
2760
|
+
* command substitution, `$((...))` arithmetic — see
|
|
2761
|
+
* `parse-depth-guard.ts`'s module doc for the exact heuristic) exceeds the
|
|
2762
|
+
* limit `parseSync` accepts. Thrown *before* `text` is ever handed to the
|
|
2763
|
+
* WASM shim: mvdan/sh's own recursive-descent parser has no recovery path
|
|
2764
|
+
* for exhausting its call stack on pathologically deep input (a stack
|
|
2765
|
+
* overflow deep inside the shared WASM instance is not a normal, catchable
|
|
2766
|
+
* JS error the way a parse syntax error is), so this bridge estimates the
|
|
2767
|
+
* risk up front and fails closed with a typed error instead of ever making
|
|
2768
|
+
* that call — the shared WASM instance is therefore never put at risk of
|
|
2769
|
+
* wedging on this class of input; a `parseSync` call right after catching
|
|
2770
|
+
* this error works exactly as it would if this input had never been
|
|
2771
|
+
* attempted.
|
|
2772
|
+
*
|
|
2773
|
+
* Like {@link ShAnalyzeMaxDepthError}, this is pathological-input
|
|
2774
|
+
* protection, not a normal-usage ceiling: a legitimately deep (but
|
|
2775
|
+
* realistic) script parses fine. The estimate can *over*-count relative to
|
|
2776
|
+
* mvdan/sh's real grammar (rejecting some legitimate-but-unusually-deep
|
|
2777
|
+
* input) but is designed to never *under*-count relative to it — see
|
|
2778
|
+
* `parse-depth-guard.ts` for the documented false-positive sources this
|
|
2779
|
+
* trades off against ever letting a genuinely crash-inducing input
|
|
2780
|
+
* through.
|
|
2781
|
+
*
|
|
2782
|
+
* @public
|
|
2783
|
+
*/
|
|
2784
|
+
export declare class ShParseMaxDepthError extends ShAstError {
|
|
2785
|
+
readonly code = "SH_AST_PARSE_MAX_DEPTH";
|
|
2786
|
+
/** The maximum structural nesting depth `parseSync` accepts; the same value every time (not caller-configurable). */
|
|
2787
|
+
readonly maxDepth: number;
|
|
2788
|
+
/**
|
|
2789
|
+
* The conservatively estimated nesting depth that tripped the guard.
|
|
2790
|
+
* Not necessarily `text`'s "true" nesting depth under a real parse — see
|
|
2791
|
+
* {@link ShParseMaxDepthError}'s doc comment — only ever `> maxDepth`.
|
|
2792
|
+
*/
|
|
2793
|
+
readonly estimatedDepth: number;
|
|
2794
|
+
constructor(maxDepth: number, estimatedDepth: number);
|
|
2795
|
+
}
|
|
2796
|
+
|
|
2797
|
+
/**
|
|
2798
|
+
* Upstream BinAritOperator constant Shr. Its numeric value is preserved exactly.
|
|
2799
|
+
*
|
|
2800
|
+
* \>\>
|
|
2801
|
+
*
|
|
2802
|
+
* @public
|
|
2803
|
+
*/
|
|
2804
|
+
export declare const Shr: 64;
|
|
2805
|
+
|
|
2806
|
+
/**
|
|
2807
|
+
* Upstream BinAritOperator constant ShrAssgn. Its numeric value is preserved exactly.
|
|
2808
|
+
*
|
|
2809
|
+
* \>\>=
|
|
2810
|
+
*
|
|
2811
|
+
* @public
|
|
2812
|
+
*/
|
|
2813
|
+
export declare const ShrAssgn: 58;
|
|
2814
|
+
|
|
2815
|
+
/**
|
|
2816
|
+
* Slice represents a character slicing expression inside a `ParamExp`.
|
|
2817
|
+
*
|
|
2818
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
2819
|
+
* `LangZsh` uses a `BinaryArithm` with `Comma` in `ParamExp.Index` instead.
|
|
2820
|
+
*
|
|
2821
|
+
* Auxiliary syntax data, not a syntax.Node; it has no independent source bounds.
|
|
2822
|
+
*
|
|
2823
|
+
* @public
|
|
2824
|
+
*/
|
|
2825
|
+
export declare interface Slice {
|
|
2826
|
+
/**
|
|
2827
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2828
|
+
*/
|
|
2829
|
+
Type: 'Slice';
|
|
2830
|
+
/**
|
|
2831
|
+
* Null preserves the upstream absence of this component.
|
|
2832
|
+
*/
|
|
2833
|
+
Length: ArithmExpr | null;
|
|
2834
|
+
/**
|
|
2835
|
+
* Null preserves the upstream absence of this component.
|
|
2836
|
+
*/
|
|
2837
|
+
Offset: ArithmExpr | null;
|
|
2838
|
+
}
|
|
2839
|
+
|
|
2840
|
+
/**
|
|
2841
|
+
* Stmt represents a statement, also known as a "complete command". It is
|
|
2842
|
+
* compromised of a command and other components that may come before or after
|
|
2843
|
+
* it.
|
|
2844
|
+
*
|
|
2845
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
2846
|
+
*
|
|
2847
|
+
* @public
|
|
2848
|
+
*/
|
|
2849
|
+
export declare interface Stmt {
|
|
2850
|
+
/**
|
|
2851
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2852
|
+
*/
|
|
2853
|
+
Type: 'Stmt';
|
|
2854
|
+
/**
|
|
2855
|
+
* stmt &
|
|
2856
|
+
*
|
|
2857
|
+
* False is an explicit upstream value and is never omitted.
|
|
2858
|
+
*/
|
|
2859
|
+
Background: boolean;
|
|
2860
|
+
/**
|
|
2861
|
+
* Null preserves the upstream absence of this component.
|
|
2862
|
+
*/
|
|
2863
|
+
Cmd: Command | null;
|
|
2864
|
+
/**
|
|
2865
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
2866
|
+
*/
|
|
2867
|
+
Comments: Comment_2[] | null;
|
|
2868
|
+
/**
|
|
2869
|
+
* mksh's |&
|
|
2870
|
+
*
|
|
2871
|
+
* False is an explicit upstream value and is never omitted.
|
|
2872
|
+
*/
|
|
2873
|
+
Coprocess: boolean;
|
|
2874
|
+
/**
|
|
2875
|
+
* zsh's &| or &!
|
|
2876
|
+
*
|
|
2877
|
+
* False is an explicit upstream value and is never omitted.
|
|
2878
|
+
*/
|
|
2879
|
+
Disown: boolean;
|
|
2880
|
+
/**
|
|
2881
|
+
* ! stmt
|
|
2882
|
+
*
|
|
2883
|
+
* False is an explicit upstream value and is never omitted.
|
|
2884
|
+
*/
|
|
2885
|
+
Negated: boolean;
|
|
2886
|
+
/**
|
|
2887
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2888
|
+
*/
|
|
2889
|
+
Position: SyntaxPos;
|
|
2890
|
+
/**
|
|
2891
|
+
* stmt \>a \<b
|
|
2892
|
+
*
|
|
2893
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
2894
|
+
*/
|
|
2895
|
+
Redirs: (Redirect | null)[] | null;
|
|
7
2896
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
2897
|
+
* position of ';', '&', or '|&', if any
|
|
2898
|
+
*
|
|
2899
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
10
2900
|
*/
|
|
11
|
-
|
|
2901
|
+
Semicolon: SyntaxPos;
|
|
2902
|
+
}
|
|
2903
|
+
|
|
2904
|
+
/**
|
|
2905
|
+
* Upstream BinAritOperator constant Sub. Its numeric value is preserved exactly.
|
|
2906
|
+
*
|
|
2907
|
+
* -
|
|
2908
|
+
*
|
|
2909
|
+
* @public
|
|
2910
|
+
*/
|
|
2911
|
+
export declare const Sub: 83;
|
|
2912
|
+
|
|
2913
|
+
/**
|
|
2914
|
+
* Upstream BinAritOperator constant SubAssgn. Its numeric value is preserved exactly.
|
|
2915
|
+
*
|
|
2916
|
+
* -=
|
|
2917
|
+
*
|
|
2918
|
+
* @public
|
|
2919
|
+
*/
|
|
2920
|
+
export declare const SubAssgn: 50;
|
|
2921
|
+
|
|
2922
|
+
/**
|
|
2923
|
+
* Subshell represents a series of commands that should be executed in a nested
|
|
2924
|
+
* shell environment.
|
|
2925
|
+
*
|
|
2926
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
2927
|
+
*
|
|
2928
|
+
* @public
|
|
2929
|
+
*/
|
|
2930
|
+
export declare interface Subshell {
|
|
2931
|
+
/**
|
|
2932
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
2933
|
+
*/
|
|
2934
|
+
Type: 'Subshell';
|
|
2935
|
+
/**
|
|
2936
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
2937
|
+
*/
|
|
2938
|
+
Last: Comment_2[] | null;
|
|
2939
|
+
/**
|
|
2940
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2941
|
+
*/
|
|
2942
|
+
Lparen: SyntaxPos;
|
|
2943
|
+
/**
|
|
2944
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
2945
|
+
*/
|
|
2946
|
+
Rparen: SyntaxPos;
|
|
2947
|
+
/**
|
|
2948
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
2949
|
+
*/
|
|
2950
|
+
Stmts: (Stmt | null)[] | null;
|
|
2951
|
+
}
|
|
2952
|
+
|
|
2953
|
+
/**
|
|
2954
|
+
* Concrete alternatives for upstream syntax interfaces. Auxiliary records are
|
|
2955
|
+
* absent from Node; consumers must preserve that distinction in their adapters.
|
|
2956
|
+
* @public
|
|
2957
|
+
*/
|
|
2958
|
+
export declare const SYNTAX_INTERFACES: Readonly<Readonly<Record<string, readonly string[]>>>;
|
|
2959
|
+
|
|
2960
|
+
/**
|
|
2961
|
+
* Complete upstream field metadata for validating or adapting syntax records.
|
|
2962
|
+
* Metadata order is not the upstream Walk visitation order. Shared records are
|
|
2963
|
+
* deeply frozen even though the syntax values they describe are mutable.
|
|
2964
|
+
* @public
|
|
2965
|
+
*/
|
|
2966
|
+
export declare const SYNTAX_SCHEMA: Readonly<Readonly<Record<string, SyntaxRecordSchema>>>;
|
|
2967
|
+
|
|
2968
|
+
/**
|
|
2969
|
+
* A field's upstream value kind and nil-bearing boundaries. Null type names
|
|
2970
|
+
* identify scalar/position kinds; other names identify concrete Go types.
|
|
2971
|
+
* @public
|
|
2972
|
+
*/
|
|
2973
|
+
export declare interface SyntaxFieldSchema {
|
|
2974
|
+
/** The upstream value domain, independent of a field's current value. */
|
|
2975
|
+
readonly kind: 'boolean' | 'string' | 'position' | 'operator' | 'struct' | 'interface';
|
|
2976
|
+
/** Named operator, record, or interface domain; null for scalar/position data. */
|
|
2977
|
+
readonly type: string | null;
|
|
2978
|
+
/** Whether the entire field may hold the upstream nil value. */
|
|
2979
|
+
readonly nullable: boolean;
|
|
2980
|
+
/** Whether the field is an ordered Go slice, preserving nil versus empty. */
|
|
2981
|
+
readonly slice: boolean;
|
|
2982
|
+
/** Whether a slice element may independently hold a nil pointer/interface. */
|
|
2983
|
+
readonly elementNullable: boolean;
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
/**
|
|
2987
|
+
* The observable value of an upstream syntax.Pos. Offset and Col count bytes; Line and Col use upstream numbering and overflow behavior. IsValid, IsRecovered, and OffsetOverflow retain distinctions that coordinates alone cannot express. Token positions are data; node bounds are derived operations.
|
|
2988
|
+
*
|
|
2989
|
+
* @public
|
|
2990
|
+
*/
|
|
2991
|
+
export declare interface SyntaxPos {
|
|
2992
|
+
/**
|
|
2993
|
+
* Zero-based source byte offset, including upstream saturation behavior.
|
|
2994
|
+
*/
|
|
2995
|
+
Offset: number;
|
|
2996
|
+
/**
|
|
2997
|
+
* One-based source line; zero retains upstream invalid or overflow information.
|
|
2998
|
+
*/
|
|
2999
|
+
Line: number;
|
|
3000
|
+
/**
|
|
3001
|
+
* One-based byte column; zero retains upstream invalid or overflow information.
|
|
3002
|
+
*/
|
|
3003
|
+
Col: number;
|
|
3004
|
+
/**
|
|
3005
|
+
* Whether upstream considers this position useful; recovered positions are not valid.
|
|
3006
|
+
*/
|
|
3007
|
+
IsValid: boolean;
|
|
3008
|
+
/**
|
|
3009
|
+
* Whether upstream synthesized this missing syntax position during error recovery.
|
|
3010
|
+
*/
|
|
3011
|
+
IsRecovered: boolean;
|
|
3012
|
+
/**
|
|
3013
|
+
* Whether the stored upstream offset exceeds its representable source-offset maximum, including the recovered sentinel. This preserves ordering distinctions even when Offset() reports zero; ordinary zero-invalid positions have false here.
|
|
3014
|
+
*/
|
|
3015
|
+
OffsetOverflow: boolean;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
3018
|
+
/** Complete data fields and real syntax.Node membership. @public */
|
|
3019
|
+
export declare interface SyntaxRecordSchema {
|
|
3020
|
+
/** Whether the actual upstream type implements syntax.Node. */
|
|
3021
|
+
readonly node: boolean;
|
|
3022
|
+
/** Every exported upstream field, retaining its original spelling. */
|
|
3023
|
+
readonly fields: Readonly<Record<string, SyntaxFieldSchema>>;
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
/**
|
|
3027
|
+
* Upstream BinAritOperator constant TernColon. Its numeric value is preserved exactly.
|
|
3028
|
+
*
|
|
3029
|
+
* :
|
|
3030
|
+
*
|
|
3031
|
+
* @public
|
|
3032
|
+
*/
|
|
3033
|
+
export declare const TernColon: 104;
|
|
3034
|
+
|
|
3035
|
+
/**
|
|
3036
|
+
* Upstream BinAritOperator constant TernQuest. Its numeric value is preserved exactly.
|
|
3037
|
+
*
|
|
3038
|
+
* ?
|
|
3039
|
+
*
|
|
3040
|
+
* @public
|
|
3041
|
+
*/
|
|
3042
|
+
export declare const TernQuest: 85;
|
|
3043
|
+
|
|
3044
|
+
/**
|
|
3045
|
+
* TestClause represents a Bash extended test clause.
|
|
3046
|
+
*
|
|
3047
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
3048
|
+
*
|
|
3049
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
3050
|
+
*
|
|
3051
|
+
* @public
|
|
3052
|
+
*/
|
|
3053
|
+
export declare interface TestClause {
|
|
3054
|
+
/**
|
|
3055
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
3056
|
+
*/
|
|
3057
|
+
Type: 'TestClause';
|
|
3058
|
+
/**
|
|
3059
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3060
|
+
*/
|
|
3061
|
+
Left: SyntaxPos;
|
|
3062
|
+
/**
|
|
3063
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3064
|
+
*/
|
|
3065
|
+
Right: SyntaxPos;
|
|
12
3066
|
/**
|
|
13
|
-
*
|
|
14
|
-
* is never read from disk.
|
|
15
|
-
* @defaultValue `"input.sh"`
|
|
3067
|
+
* Null preserves the upstream absence of this component.
|
|
16
3068
|
*/
|
|
17
|
-
|
|
3069
|
+
X: TestExpr | null;
|
|
18
3070
|
}
|
|
19
3071
|
|
|
20
3072
|
/**
|
|
21
|
-
*
|
|
3073
|
+
* TestDecl represents the declaration of a Bats test function.
|
|
22
3074
|
*
|
|
23
|
-
*
|
|
24
|
-
* instance is reused across subsequent calls, so repeated calls do not
|
|
25
|
-
* re-instantiate (see design/ARCHITECTURE.md).
|
|
3075
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
26
3076
|
*
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
3077
|
+
* @public
|
|
3078
|
+
*/
|
|
3079
|
+
export declare interface TestDecl {
|
|
3080
|
+
/**
|
|
3081
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
3082
|
+
*/
|
|
3083
|
+
Type: 'TestDecl';
|
|
3084
|
+
/**
|
|
3085
|
+
* Null preserves the upstream absence of this component.
|
|
3086
|
+
*/
|
|
3087
|
+
Body: Stmt | null;
|
|
3088
|
+
/**
|
|
3089
|
+
* Null preserves the upstream absence of this component.
|
|
3090
|
+
*/
|
|
3091
|
+
Description: Word | null;
|
|
3092
|
+
/**
|
|
3093
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3094
|
+
*/
|
|
3095
|
+
Position: SyntaxPos;
|
|
3096
|
+
}
|
|
3097
|
+
|
|
3098
|
+
/**
|
|
3099
|
+
* The concrete records and typed nil pointers accepted by upstream syntax.TestExpr. Typed nil kinds are limited to this interface's actual implementers; auxiliary records are excluded.
|
|
43
3100
|
*
|
|
44
3101
|
* @public
|
|
45
3102
|
*/
|
|
46
|
-
export declare
|
|
3103
|
+
export declare type TestExpr =
|
|
3104
|
+
| BinaryTest
|
|
3105
|
+
| ParenTest
|
|
3106
|
+
| UnaryTest
|
|
3107
|
+
| Word
|
|
3108
|
+
| TypedNil<'BinaryTest' | 'ParenTest' | 'UnaryTest' | 'Word'>;
|
|
47
3109
|
|
|
48
3110
|
/**
|
|
49
|
-
*
|
|
50
|
-
*
|
|
3111
|
+
* TimeClause represents a Bash time clause. PosixFormat corresponds to the -p
|
|
3112
|
+
* flag.
|
|
3113
|
+
*
|
|
3114
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
3115
|
+
*
|
|
3116
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
51
3117
|
*
|
|
52
3118
|
* @public
|
|
53
3119
|
*/
|
|
54
|
-
export declare interface
|
|
55
|
-
|
|
56
|
-
|
|
3120
|
+
export declare interface TimeClause {
|
|
3121
|
+
/**
|
|
3122
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
3123
|
+
*/
|
|
3124
|
+
Type: 'TimeClause';
|
|
3125
|
+
/**
|
|
3126
|
+
* False is an explicit upstream value and is never omitted.
|
|
3127
|
+
*/
|
|
3128
|
+
PosixFormat: boolean;
|
|
3129
|
+
/**
|
|
3130
|
+
* Null preserves the upstream absence of this component.
|
|
3131
|
+
*/
|
|
3132
|
+
Stmt: Stmt | null;
|
|
3133
|
+
/**
|
|
3134
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3135
|
+
*/
|
|
3136
|
+
Time: SyntaxPos;
|
|
57
3137
|
}
|
|
58
3138
|
|
|
59
3139
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
|
|
66
|
-
|
|
3140
|
+
* Upstream BinTestOperator constant TsAfter. Its numeric value is preserved exactly.
|
|
3141
|
+
*
|
|
3142
|
+
* \>
|
|
3143
|
+
*
|
|
3144
|
+
* @public
|
|
3145
|
+
*/
|
|
3146
|
+
export declare const TsAfter: 63;
|
|
3147
|
+
|
|
3148
|
+
/**
|
|
3149
|
+
* Upstream BinTestOperator constant TsBefore. Its numeric value is preserved exactly.
|
|
3150
|
+
*
|
|
3151
|
+
* \<
|
|
3152
|
+
*
|
|
3153
|
+
* @public
|
|
3154
|
+
*/
|
|
3155
|
+
export declare const TsBefore: 65;
|
|
3156
|
+
|
|
3157
|
+
/**
|
|
3158
|
+
* Upstream UnTestOperator constant TsBlckSp. Its numeric value is preserved exactly.
|
|
3159
|
+
*
|
|
3160
|
+
* -b
|
|
67
3161
|
*
|
|
68
3162
|
* @public
|
|
69
3163
|
*/
|
|
70
|
-
export declare
|
|
71
|
-
readonly code = "SH_AST_ANALYZE_INVALID_WRAPPER_SPEC";
|
|
72
|
-
constructor(message: string);
|
|
73
|
-
}
|
|
3164
|
+
export declare const TsBlckSp: 109;
|
|
74
3165
|
|
|
75
3166
|
/**
|
|
76
|
-
*
|
|
77
|
-
* nested structure — subshells within subshells, chained command/process
|
|
78
|
-
* substitutions, deeply nested `if`/`case`/loop/function/`time`/`{ }`
|
|
79
|
-
* bodies, deeply chained `elif` — exceeds its defensive recursion-depth
|
|
80
|
-
* guard. **Not** thrown for a long *linear* chain (`|`/`|&`/`&&`/`||` of
|
|
81
|
-
* any realistic length): `enumerateCommands` traverses those iteratively,
|
|
82
|
-
* so chain length alone never grows this guard's depth counter — only
|
|
83
|
-
* genuine tree nesting does.
|
|
3167
|
+
* Upstream UnTestOperator constant TsCharSp. Its numeric value is preserved exactly.
|
|
84
3168
|
*
|
|
85
|
-
*
|
|
86
|
-
* a truncated, partial result: a partial `CommandSite[]` silently omits
|
|
87
|
-
* real command sites, which is a false negative for a permission-hook-style
|
|
88
|
-
* consumer that treats "command not found in the enumeration" as "nothing
|
|
89
|
-
* to worry about" — an explicit, documented throw is safer than a silent
|
|
90
|
-
* under-report. Gate-style consumers should treat this error as `deny`,
|
|
91
|
-
* not fall back to "no commands found, so allow".
|
|
3169
|
+
* -c
|
|
92
3170
|
*
|
|
93
3171
|
* @public
|
|
94
3172
|
*/
|
|
95
|
-
export declare
|
|
96
|
-
readonly code = "SH_AST_ANALYZE_MAX_DEPTH";
|
|
97
|
-
/** The maximum nesting depth `enumerateCommands` supports; the same value every time (not caller-configurable). */
|
|
98
|
-
readonly maxDepth: number;
|
|
99
|
-
constructor(maxDepth: number);
|
|
100
|
-
}
|
|
3173
|
+
export declare const TsCharSp: 108;
|
|
101
3174
|
|
|
102
3175
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
| ShArrayElemNode
|
|
111
|
-
| ShArrayExprNode
|
|
112
|
-
| ShAssignNode
|
|
113
|
-
| ShBinaryArithmNode
|
|
114
|
-
| ShBinaryCmdNode
|
|
115
|
-
| ShBinaryTestNode
|
|
116
|
-
| ShBlockNode
|
|
117
|
-
| ShBraceExpNode
|
|
118
|
-
| ShCStyleLoopNode
|
|
119
|
-
| ShCallExprNode
|
|
120
|
-
| ShCaseClauseNode
|
|
121
|
-
| ShCaseItemNode
|
|
122
|
-
| ShCmdSubstNode
|
|
123
|
-
| ShCommentNode
|
|
124
|
-
| ShCoprocClauseNode
|
|
125
|
-
| ShDblQuotedNode
|
|
126
|
-
| ShDeclClauseNode
|
|
127
|
-
| ShExpansionNode
|
|
128
|
-
| ShExtGlobNode
|
|
129
|
-
| ShFileNode
|
|
130
|
-
| ShFlagsArithmNode
|
|
131
|
-
| ShForClauseNode
|
|
132
|
-
| ShFuncDeclNode
|
|
133
|
-
| ShIfClauseNode
|
|
134
|
-
| ShLetClauseNode
|
|
135
|
-
| ShLitNode
|
|
136
|
-
| ShParamExpNode
|
|
137
|
-
| ShParenArithmNode
|
|
138
|
-
| ShParenTestNode
|
|
139
|
-
| ShProcSubstNode
|
|
140
|
-
| ShRedirectNode
|
|
141
|
-
| ShReplaceNode
|
|
142
|
-
| ShSglQuotedNode
|
|
143
|
-
| ShSliceNode
|
|
144
|
-
| ShStmtNode
|
|
145
|
-
| ShSubshellNode
|
|
146
|
-
| ShTestClauseNode
|
|
147
|
-
| ShTestDeclNode
|
|
148
|
-
| ShTimeClauseNode
|
|
149
|
-
| ShUnaryArithmNode
|
|
150
|
-
| ShUnaryTestNode
|
|
151
|
-
| ShWhileClauseNode
|
|
152
|
-
| ShWordNode
|
|
153
|
-
| ShWordIterNode;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* mvdan/sh's `syntax.ArithmCmd`, normalized.
|
|
157
|
-
*
|
|
158
|
-
* @public
|
|
159
|
-
*/
|
|
160
|
-
declare interface ShArithmCmdNode {
|
|
161
|
-
readonly type: 'ArithmCmd';
|
|
162
|
-
readonly range: readonly [number, number];
|
|
163
|
-
readonly loc: {
|
|
164
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
165
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
166
|
-
};
|
|
167
|
-
[field: string]: unknown;
|
|
168
|
-
readonly unsigned?: boolean;
|
|
169
|
-
readonly x?: ShArithmExprNode;
|
|
170
|
-
}
|
|
3176
|
+
* Upstream BinTestOperator constant TsDevIno. Its numeric value is preserved exactly.
|
|
3177
|
+
*
|
|
3178
|
+
* -ef
|
|
3179
|
+
*
|
|
3180
|
+
* @public
|
|
3181
|
+
*/
|
|
3182
|
+
export declare const TsDevIno: 132;
|
|
171
3183
|
|
|
172
3184
|
/**
|
|
173
|
-
*
|
|
3185
|
+
* Upstream UnTestOperator constant TsDirect. Its numeric value is preserved exactly.
|
|
3186
|
+
*
|
|
3187
|
+
* -d
|
|
174
3188
|
*
|
|
175
3189
|
* @public
|
|
176
3190
|
*/
|
|
177
|
-
declare
|
|
178
|
-
readonly type: 'ArithmExp';
|
|
179
|
-
readonly range: readonly [number, number];
|
|
180
|
-
readonly loc: {
|
|
181
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
182
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
183
|
-
};
|
|
184
|
-
[field: string]: unknown;
|
|
185
|
-
readonly bracket?: boolean;
|
|
186
|
-
readonly unsigned?: boolean;
|
|
187
|
-
readonly x?: ShArithmExprNode;
|
|
188
|
-
}
|
|
3191
|
+
export declare const TsDirect: 107;
|
|
189
3192
|
|
|
190
3193
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
3194
|
+
* Upstream UnTestOperator constant TsEmpStr. Its numeric value is preserved exactly.
|
|
3195
|
+
*
|
|
3196
|
+
* -z
|
|
193
3197
|
*
|
|
194
3198
|
* @public
|
|
195
3199
|
*/
|
|
196
|
-
declare
|
|
197
|
-
ShBinaryArithmNode | ShFlagsArithmNode | ShParenArithmNode | ShUnaryArithmNode | ShWordNode;
|
|
3200
|
+
export declare const TsEmpStr: 124;
|
|
198
3201
|
|
|
199
3202
|
/**
|
|
200
|
-
*
|
|
3203
|
+
* Upstream BinTestOperator constant TsEql. Its numeric value is preserved exactly.
|
|
3204
|
+
*
|
|
3205
|
+
* -eq
|
|
201
3206
|
*
|
|
202
3207
|
* @public
|
|
203
3208
|
*/
|
|
204
|
-
declare
|
|
205
|
-
readonly type: 'ArrayElem';
|
|
206
|
-
readonly range: readonly [number, number];
|
|
207
|
-
readonly loc: {
|
|
208
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
209
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
210
|
-
};
|
|
211
|
-
[field: string]: unknown;
|
|
212
|
-
readonly comments: readonly ShCommentNode[];
|
|
213
|
-
readonly index?: ShArithmExprNode;
|
|
214
|
-
readonly value?: ShWordNode;
|
|
215
|
-
}
|
|
3209
|
+
export declare const TsEql: 133;
|
|
216
3210
|
|
|
217
3211
|
/**
|
|
218
|
-
*
|
|
3212
|
+
* Upstream UnTestOperator constant TsExec. Its numeric value is preserved exactly.
|
|
3213
|
+
*
|
|
3214
|
+
* -x
|
|
219
3215
|
*
|
|
220
3216
|
* @public
|
|
221
3217
|
*/
|
|
222
|
-
declare
|
|
223
|
-
readonly type: 'ArrayExpr';
|
|
224
|
-
readonly range: readonly [number, number];
|
|
225
|
-
readonly loc: {
|
|
226
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
227
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
228
|
-
};
|
|
229
|
-
[field: string]: unknown;
|
|
230
|
-
readonly elems: readonly ShArrayElemNode[];
|
|
231
|
-
readonly last: readonly ShCommentNode[];
|
|
232
|
-
}
|
|
3218
|
+
export declare const TsExec: 121;
|
|
233
3219
|
|
|
234
3220
|
/**
|
|
235
|
-
*
|
|
3221
|
+
* Upstream UnTestOperator constant TsExists. Its numeric value is preserved exactly.
|
|
3222
|
+
*
|
|
3223
|
+
* -e
|
|
236
3224
|
*
|
|
237
3225
|
* @public
|
|
238
3226
|
*/
|
|
239
|
-
declare
|
|
240
|
-
readonly type: 'Assign';
|
|
241
|
-
readonly range: readonly [number, number];
|
|
242
|
-
readonly loc: {
|
|
243
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
244
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
245
|
-
};
|
|
246
|
-
[field: string]: unknown;
|
|
247
|
-
readonly append?: boolean;
|
|
248
|
-
readonly array?: ShArrayExprNode;
|
|
249
|
-
readonly index?: ShArithmExprNode;
|
|
250
|
-
readonly naked?: boolean;
|
|
251
|
-
readonly name?: ShLitNode;
|
|
252
|
-
readonly value?: ShWordNode;
|
|
253
|
-
}
|
|
3227
|
+
export declare const TsExists: 105;
|
|
254
3228
|
|
|
255
3229
|
/**
|
|
256
|
-
*
|
|
257
|
-
* {@link sh-ast#parseSync | parseSync}'s errors, now also the
|
|
258
|
-
* `sh-ast/analyze` layer's (see {@link ShAnalyzeMaxDepthError},
|
|
259
|
-
* {@link ShAnalyzeInvalidWrapperSpecError}). Provides a stable, documented
|
|
260
|
-
* `code` discriminator (e.g. `"SH_AST_PARSE_ERROR"`) alongside the usual
|
|
261
|
-
* `instanceof` narrowing, so consumers can branch on failure kind
|
|
262
|
-
* programmatically without parsing `.message` strings. Never thrown directly
|
|
263
|
-
* — only via its concrete subclasses
|
|
264
|
-
* ({@link sh-ast#ShParseError | ShParseError},
|
|
265
|
-
* {@link sh-ast#ShInvalidDialectError | ShInvalidDialectError},
|
|
266
|
-
* {@link sh-ast#ShInternalError | ShInternalError},
|
|
267
|
-
* {@link ShAnalyzeMaxDepthError},
|
|
268
|
-
* {@link sh-ast#ShParseMaxDepthError | ShParseMaxDepthError},
|
|
269
|
-
* {@link ShAnalyzeInvalidWrapperSpecError}).
|
|
3230
|
+
* Upstream UnTestOperator constant TsFdTerm. Its numeric value is preserved exactly.
|
|
270
3231
|
*
|
|
271
|
-
*
|
|
272
|
-
* point (see #23) — every subclass thrown by `sh-ast/analyze`'s own
|
|
273
|
-
* functions extends this, so a consumer of that subpath alone can
|
|
274
|
-
* `catch`/reference the base without also importing from root.
|
|
3232
|
+
* -t
|
|
275
3233
|
*
|
|
276
3234
|
* @public
|
|
277
3235
|
*/
|
|
278
|
-
export declare
|
|
279
|
-
/**
|
|
280
|
-
* Stable, machine-readable discriminator for this error kind. Distinct
|
|
281
|
-
* per subclass and will not change once published.
|
|
282
|
-
*/
|
|
283
|
-
abstract readonly code: string;
|
|
284
|
-
}
|
|
3236
|
+
export declare const TsFdTerm: 123;
|
|
285
3237
|
|
|
286
3238
|
/**
|
|
287
|
-
*
|
|
3239
|
+
* Upstream BinTestOperator constant TsGeq. Its numeric value is preserved exactly.
|
|
3240
|
+
*
|
|
3241
|
+
* -ge
|
|
288
3242
|
*
|
|
289
3243
|
* @public
|
|
290
3244
|
*/
|
|
291
|
-
declare
|
|
292
|
-
readonly type: 'BinaryArithm';
|
|
293
|
-
readonly range: readonly [number, number];
|
|
294
|
-
readonly loc: {
|
|
295
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
296
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
297
|
-
};
|
|
298
|
-
[field: string]: unknown;
|
|
299
|
-
readonly op?: number;
|
|
300
|
-
readonly x?: ShArithmExprNode;
|
|
301
|
-
readonly y?: ShArithmExprNode;
|
|
302
|
-
}
|
|
3245
|
+
export declare const TsGeq: 136;
|
|
303
3246
|
|
|
304
3247
|
/**
|
|
305
|
-
*
|
|
3248
|
+
* Upstream UnTestOperator constant TsGIDSet. Its numeric value is preserved exactly.
|
|
3249
|
+
*
|
|
3250
|
+
* -g
|
|
306
3251
|
*
|
|
307
3252
|
* @public
|
|
308
3253
|
*/
|
|
309
|
-
declare
|
|
310
|
-
readonly type: 'BinaryCmd';
|
|
311
|
-
readonly range: readonly [number, number];
|
|
312
|
-
readonly loc: {
|
|
313
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
314
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
315
|
-
};
|
|
316
|
-
[field: string]: unknown;
|
|
317
|
-
readonly op?: number;
|
|
318
|
-
readonly x?: ShStmtNode;
|
|
319
|
-
readonly y?: ShStmtNode;
|
|
320
|
-
}
|
|
3254
|
+
export declare const TsGIDSet: 114;
|
|
321
3255
|
|
|
322
3256
|
/**
|
|
323
|
-
*
|
|
3257
|
+
* Upstream UnTestOperator constant TsGrpOwn. Its numeric value is preserved exactly.
|
|
3258
|
+
*
|
|
3259
|
+
* -G
|
|
324
3260
|
*
|
|
325
3261
|
* @public
|
|
326
3262
|
*/
|
|
327
|
-
declare
|
|
328
|
-
readonly type: 'BinaryTest';
|
|
329
|
-
readonly range: readonly [number, number];
|
|
330
|
-
readonly loc: {
|
|
331
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
332
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
333
|
-
};
|
|
334
|
-
[field: string]: unknown;
|
|
335
|
-
readonly op?: number;
|
|
336
|
-
readonly x?: ShTestExprNode;
|
|
337
|
-
readonly y?: ShTestExprNode;
|
|
338
|
-
}
|
|
3263
|
+
export declare const TsGrpOwn: 116;
|
|
339
3264
|
|
|
340
3265
|
/**
|
|
341
|
-
*
|
|
3266
|
+
* Upstream BinTestOperator constant TsGtr. Its numeric value is preserved exactly.
|
|
3267
|
+
*
|
|
3268
|
+
* -gt
|
|
342
3269
|
*
|
|
343
3270
|
* @public
|
|
344
3271
|
*/
|
|
345
|
-
declare
|
|
346
|
-
readonly type: 'Block';
|
|
347
|
-
readonly range: readonly [number, number];
|
|
348
|
-
readonly loc: {
|
|
349
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
350
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
351
|
-
};
|
|
352
|
-
[field: string]: unknown;
|
|
353
|
-
readonly last: readonly ShCommentNode[];
|
|
354
|
-
readonly stmts: readonly ShStmtNode[];
|
|
355
|
-
}
|
|
3272
|
+
export declare const TsGtr: 138;
|
|
356
3273
|
|
|
357
3274
|
/**
|
|
358
|
-
*
|
|
3275
|
+
* Upstream BinTestOperator constant TsLeq. Its numeric value is preserved exactly.
|
|
3276
|
+
*
|
|
3277
|
+
* -le
|
|
359
3278
|
*
|
|
360
3279
|
* @public
|
|
361
3280
|
*/
|
|
362
|
-
declare
|
|
363
|
-
readonly type: 'BraceExp';
|
|
364
|
-
readonly range: readonly [number, number];
|
|
365
|
-
readonly loc: {
|
|
366
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
367
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
368
|
-
};
|
|
369
|
-
[field: string]: unknown;
|
|
370
|
-
readonly elems: readonly ShWordNode[];
|
|
371
|
-
readonly sequence?: boolean;
|
|
372
|
-
}
|
|
3281
|
+
export declare const TsLeq: 135;
|
|
373
3282
|
|
|
374
3283
|
/**
|
|
375
|
-
*
|
|
3284
|
+
* Upstream BinTestOperator constant TsLss. Its numeric value is preserved exactly.
|
|
3285
|
+
*
|
|
3286
|
+
* -lt
|
|
376
3287
|
*
|
|
377
3288
|
* @public
|
|
378
3289
|
*/
|
|
379
|
-
declare
|
|
380
|
-
readonly type: 'CallExpr';
|
|
381
|
-
readonly range: readonly [number, number];
|
|
382
|
-
readonly loc: {
|
|
383
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
384
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
385
|
-
};
|
|
386
|
-
[field: string]: unknown;
|
|
387
|
-
readonly args: readonly ShWordNode[];
|
|
388
|
-
readonly assigns: readonly ShAssignNode[];
|
|
389
|
-
}
|
|
3290
|
+
export declare const TsLss: 137;
|
|
390
3291
|
|
|
391
3292
|
/**
|
|
392
|
-
*
|
|
3293
|
+
* Upstream BinTestOperator constant TsMatch. Its numeric value is preserved exactly.
|
|
3294
|
+
*
|
|
3295
|
+
* ==
|
|
393
3296
|
*
|
|
394
3297
|
* @public
|
|
395
3298
|
*/
|
|
396
|
-
declare
|
|
397
|
-
readonly type: 'CaseClause';
|
|
398
|
-
readonly range: readonly [number, number];
|
|
399
|
-
readonly loc: {
|
|
400
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
401
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
402
|
-
};
|
|
403
|
-
[field: string]: unknown;
|
|
404
|
-
readonly braces?: boolean;
|
|
405
|
-
readonly items: readonly ShCaseItemNode[];
|
|
406
|
-
readonly last: readonly ShCommentNode[];
|
|
407
|
-
readonly word?: ShWordNode;
|
|
408
|
-
}
|
|
3299
|
+
export declare const TsMatch: 45;
|
|
409
3300
|
|
|
410
3301
|
/**
|
|
411
|
-
*
|
|
3302
|
+
* Upstream BinTestOperator constant TsMatchShort. Its numeric value is preserved exactly.
|
|
3303
|
+
*
|
|
3304
|
+
* =
|
|
412
3305
|
*
|
|
413
3306
|
* @public
|
|
414
3307
|
*/
|
|
415
|
-
declare
|
|
416
|
-
readonly type: 'CaseItem';
|
|
417
|
-
readonly range: readonly [number, number];
|
|
418
|
-
readonly loc: {
|
|
419
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
420
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
421
|
-
};
|
|
422
|
-
[field: string]: unknown;
|
|
423
|
-
readonly comments: readonly ShCommentNode[];
|
|
424
|
-
readonly last: readonly ShCommentNode[];
|
|
425
|
-
readonly op?: number;
|
|
426
|
-
readonly patterns: readonly ShWordNode[];
|
|
427
|
-
readonly stmts: readonly ShStmtNode[];
|
|
428
|
-
}
|
|
3308
|
+
export declare const TsMatchShort: 87;
|
|
429
3309
|
|
|
430
3310
|
/**
|
|
431
|
-
*
|
|
3311
|
+
* Upstream UnTestOperator constant TsModif. Its numeric value is preserved exactly.
|
|
3312
|
+
*
|
|
3313
|
+
* -N
|
|
432
3314
|
*
|
|
433
3315
|
* @public
|
|
434
3316
|
*/
|
|
435
|
-
declare
|
|
436
|
-
readonly type: 'CmdSubst';
|
|
437
|
-
readonly range: readonly [number, number];
|
|
438
|
-
readonly loc: {
|
|
439
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
440
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
441
|
-
};
|
|
442
|
-
[field: string]: unknown;
|
|
443
|
-
readonly backquotes?: boolean;
|
|
444
|
-
readonly last: readonly ShCommentNode[];
|
|
445
|
-
readonly replyvar?: boolean;
|
|
446
|
-
readonly stmts: readonly ShStmtNode[];
|
|
447
|
-
readonly tempfile?: boolean;
|
|
448
|
-
}
|
|
3317
|
+
export declare const TsModif: 118;
|
|
449
3318
|
|
|
450
3319
|
/**
|
|
451
|
-
*
|
|
452
|
-
*
|
|
3320
|
+
* Upstream UnTestOperator constant TsNempStr. Its numeric value is preserved exactly.
|
|
3321
|
+
*
|
|
3322
|
+
* -n
|
|
453
3323
|
*
|
|
454
3324
|
* @public
|
|
455
3325
|
*/
|
|
456
|
-
declare
|
|
457
|
-
| ShArithmCmdNode
|
|
458
|
-
| ShBinaryCmdNode
|
|
459
|
-
| ShBlockNode
|
|
460
|
-
| ShCallExprNode
|
|
461
|
-
| ShCaseClauseNode
|
|
462
|
-
| ShCoprocClauseNode
|
|
463
|
-
| ShDeclClauseNode
|
|
464
|
-
| ShForClauseNode
|
|
465
|
-
| ShFuncDeclNode
|
|
466
|
-
| ShIfClauseNode
|
|
467
|
-
| ShLetClauseNode
|
|
468
|
-
| ShSubshellNode
|
|
469
|
-
| ShTestClauseNode
|
|
470
|
-
| ShTestDeclNode
|
|
471
|
-
| ShTimeClauseNode
|
|
472
|
-
| ShWhileClauseNode;
|
|
3326
|
+
export declare const TsNempStr: 125;
|
|
473
3327
|
|
|
474
3328
|
/**
|
|
475
|
-
*
|
|
3329
|
+
* Upstream BinTestOperator constant TsNeq. Its numeric value is preserved exactly.
|
|
3330
|
+
*
|
|
3331
|
+
* -ne
|
|
476
3332
|
*
|
|
477
3333
|
* @public
|
|
478
3334
|
*/
|
|
479
|
-
declare
|
|
480
|
-
readonly type: 'Comment';
|
|
481
|
-
readonly range: readonly [number, number];
|
|
482
|
-
readonly loc: {
|
|
483
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
484
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
485
|
-
};
|
|
486
|
-
[field: string]: unknown;
|
|
487
|
-
readonly text?: string;
|
|
488
|
-
}
|
|
3335
|
+
export declare const TsNeq: 134;
|
|
489
3336
|
|
|
490
3337
|
/**
|
|
491
|
-
*
|
|
3338
|
+
* Upstream BinTestOperator constant TsNewer. Its numeric value is preserved exactly.
|
|
3339
|
+
*
|
|
3340
|
+
* -nt
|
|
492
3341
|
*
|
|
493
3342
|
* @public
|
|
494
3343
|
*/
|
|
495
|
-
declare
|
|
496
|
-
readonly type: 'CoprocClause';
|
|
497
|
-
readonly range: readonly [number, number];
|
|
498
|
-
readonly loc: {
|
|
499
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
500
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
501
|
-
};
|
|
502
|
-
[field: string]: unknown;
|
|
503
|
-
readonly name?: ShWordNode;
|
|
504
|
-
readonly stmt?: ShStmtNode;
|
|
505
|
-
}
|
|
3344
|
+
export declare const TsNewer: 130;
|
|
506
3345
|
|
|
507
3346
|
/**
|
|
508
|
-
*
|
|
3347
|
+
* Upstream UnTestOperator constant TsNmPipe. Its numeric value is preserved exactly.
|
|
3348
|
+
*
|
|
3349
|
+
* -p
|
|
509
3350
|
*
|
|
510
3351
|
* @public
|
|
511
3352
|
*/
|
|
512
|
-
declare
|
|
513
|
-
readonly type: 'CStyleLoop';
|
|
514
|
-
readonly range: readonly [number, number];
|
|
515
|
-
readonly loc: {
|
|
516
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
517
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
518
|
-
};
|
|
519
|
-
[field: string]: unknown;
|
|
520
|
-
readonly cond?: ShArithmExprNode;
|
|
521
|
-
readonly init?: ShArithmExprNode;
|
|
522
|
-
readonly post?: ShArithmExprNode;
|
|
523
|
-
}
|
|
3353
|
+
export declare const TsNmPipe: 110;
|
|
524
3354
|
|
|
525
3355
|
/**
|
|
526
|
-
*
|
|
3356
|
+
* Upstream UnTestOperator constant TsNoEmpty. Its numeric value is preserved exactly.
|
|
3357
|
+
*
|
|
3358
|
+
* -s
|
|
527
3359
|
*
|
|
528
3360
|
* @public
|
|
529
3361
|
*/
|
|
530
|
-
declare
|
|
531
|
-
readonly type: 'DblQuoted';
|
|
532
|
-
readonly range: readonly [number, number];
|
|
533
|
-
readonly loc: {
|
|
534
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
535
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
536
|
-
};
|
|
537
|
-
[field: string]: unknown;
|
|
538
|
-
readonly dollar?: boolean;
|
|
539
|
-
readonly parts: readonly ShWordPartNode[];
|
|
540
|
-
}
|
|
3362
|
+
export declare const TsNoEmpty: 122;
|
|
541
3363
|
|
|
542
3364
|
/**
|
|
543
|
-
*
|
|
3365
|
+
* Upstream BinTestOperator constant TsNoMatch. Its numeric value is preserved exactly.
|
|
3366
|
+
*
|
|
3367
|
+
* !=
|
|
544
3368
|
*
|
|
545
3369
|
* @public
|
|
546
3370
|
*/
|
|
547
|
-
declare
|
|
548
|
-
readonly type: 'DeclClause';
|
|
549
|
-
readonly range: readonly [number, number];
|
|
550
|
-
readonly loc: {
|
|
551
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
552
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
553
|
-
};
|
|
554
|
-
[field: string]: unknown;
|
|
555
|
-
readonly args: readonly ShAssignNode[];
|
|
556
|
-
readonly variant?: ShLitNode;
|
|
557
|
-
}
|
|
3371
|
+
export declare const TsNoMatch: 46;
|
|
558
3372
|
|
|
559
3373
|
/**
|
|
560
|
-
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
* contract across mvdan/sh versions. See design/ARCHITECTURE.md, "Parse
|
|
564
|
-
* errors and dialects".
|
|
3374
|
+
* Upstream UnTestOperator constant TsNot. Its numeric value is preserved exactly.
|
|
3375
|
+
*
|
|
3376
|
+
* !
|
|
565
3377
|
*
|
|
566
3378
|
* @public
|
|
567
3379
|
*/
|
|
568
|
-
export declare
|
|
3380
|
+
export declare const TsNot: 39;
|
|
569
3381
|
|
|
570
3382
|
/**
|
|
571
|
-
*
|
|
3383
|
+
* Upstream BinTestOperator constant TsOlder. Its numeric value is preserved exactly.
|
|
3384
|
+
*
|
|
3385
|
+
* -ot
|
|
572
3386
|
*
|
|
573
3387
|
* @public
|
|
574
3388
|
*/
|
|
575
|
-
declare
|
|
576
|
-
readonly type: 'Expansion';
|
|
577
|
-
readonly range: readonly [number, number];
|
|
578
|
-
readonly loc: {
|
|
579
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
580
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
581
|
-
};
|
|
582
|
-
[field: string]: unknown;
|
|
583
|
-
readonly op?: number;
|
|
584
|
-
readonly word?: ShWordNode;
|
|
585
|
-
}
|
|
3389
|
+
export declare const TsOlder: 131;
|
|
586
3390
|
|
|
587
3391
|
/**
|
|
588
|
-
*
|
|
3392
|
+
* Upstream UnTestOperator constant TsOptSet. Its numeric value is preserved exactly.
|
|
3393
|
+
*
|
|
3394
|
+
* -o
|
|
589
3395
|
*
|
|
590
3396
|
* @public
|
|
591
3397
|
*/
|
|
592
|
-
declare
|
|
593
|
-
readonly type: 'ExtGlob';
|
|
594
|
-
readonly range: readonly [number, number];
|
|
595
|
-
readonly loc: {
|
|
596
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
597
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
598
|
-
};
|
|
599
|
-
[field: string]: unknown;
|
|
600
|
-
readonly op?: number;
|
|
601
|
-
readonly pattern?: ShLitNode;
|
|
602
|
-
}
|
|
3398
|
+
export declare const TsOptSet: 126;
|
|
603
3399
|
|
|
604
3400
|
/**
|
|
605
|
-
*
|
|
3401
|
+
* Upstream UnTestOperator constant TsParen. Its numeric value is preserved exactly.
|
|
3402
|
+
*
|
|
3403
|
+
* (
|
|
606
3404
|
*
|
|
607
3405
|
* @public
|
|
608
3406
|
*/
|
|
609
|
-
export declare
|
|
610
|
-
readonly type: 'File';
|
|
611
|
-
readonly stmts: readonly ShNode[];
|
|
612
|
-
}
|
|
3407
|
+
export declare const TsParen: 27;
|
|
613
3408
|
|
|
614
3409
|
/**
|
|
615
|
-
*
|
|
3410
|
+
* Upstream UnTestOperator constant TsRead. Its numeric value is preserved exactly.
|
|
3411
|
+
*
|
|
3412
|
+
* -r
|
|
616
3413
|
*
|
|
617
3414
|
* @public
|
|
618
3415
|
*/
|
|
619
|
-
declare
|
|
620
|
-
readonly type: 'File';
|
|
621
|
-
readonly range: readonly [number, number];
|
|
622
|
-
readonly loc: {
|
|
623
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
624
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
625
|
-
};
|
|
626
|
-
[field: string]: unknown;
|
|
627
|
-
readonly last: readonly ShCommentNode[];
|
|
628
|
-
readonly name?: string;
|
|
629
|
-
readonly stmts: readonly ShStmtNode[];
|
|
630
|
-
}
|
|
3416
|
+
export declare const TsRead: 119;
|
|
631
3417
|
|
|
632
3418
|
/**
|
|
633
|
-
*
|
|
3419
|
+
* Upstream UnTestOperator constant TsRefVar. Its numeric value is preserved exactly.
|
|
3420
|
+
*
|
|
3421
|
+
* -R
|
|
634
3422
|
*
|
|
635
3423
|
* @public
|
|
636
3424
|
*/
|
|
637
|
-
declare
|
|
638
|
-
readonly type: 'FlagsArithm';
|
|
639
|
-
readonly range: readonly [number, number];
|
|
640
|
-
readonly loc: {
|
|
641
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
642
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
643
|
-
};
|
|
644
|
-
[field: string]: unknown;
|
|
645
|
-
readonly flags?: ShLitNode;
|
|
646
|
-
readonly x?: ShArithmExprNode;
|
|
647
|
-
}
|
|
3425
|
+
export declare const TsRefVar: 128;
|
|
648
3426
|
|
|
649
3427
|
/**
|
|
650
|
-
*
|
|
3428
|
+
* Upstream UnTestOperator constant TsRegFile. Its numeric value is preserved exactly.
|
|
3429
|
+
*
|
|
3430
|
+
* -f
|
|
651
3431
|
*
|
|
652
3432
|
* @public
|
|
653
3433
|
*/
|
|
654
|
-
declare
|
|
655
|
-
readonly type: 'ForClause';
|
|
656
|
-
readonly range: readonly [number, number];
|
|
657
|
-
readonly loc: {
|
|
658
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
659
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
660
|
-
};
|
|
661
|
-
[field: string]: unknown;
|
|
662
|
-
readonly braces?: boolean;
|
|
663
|
-
readonly do: readonly ShStmtNode[];
|
|
664
|
-
readonly dolast: readonly ShCommentNode[];
|
|
665
|
-
readonly loop?: ShLoopNode;
|
|
666
|
-
readonly select?: boolean;
|
|
667
|
-
}
|
|
3434
|
+
export declare const TsRegFile: 106;
|
|
668
3435
|
|
|
669
3436
|
/**
|
|
670
|
-
*
|
|
3437
|
+
* Upstream BinTestOperator constant TsReMatch. Its numeric value is preserved exactly.
|
|
3438
|
+
*
|
|
3439
|
+
* =~
|
|
671
3440
|
*
|
|
672
3441
|
* @public
|
|
673
3442
|
*/
|
|
674
|
-
declare
|
|
675
|
-
readonly type: 'FuncDecl';
|
|
676
|
-
readonly range: readonly [number, number];
|
|
677
|
-
readonly loc: {
|
|
678
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
679
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
680
|
-
};
|
|
681
|
-
[field: string]: unknown;
|
|
682
|
-
readonly body?: ShStmtNode;
|
|
683
|
-
readonly name?: ShLitNode;
|
|
684
|
-
readonly names: readonly ShLitNode[];
|
|
685
|
-
readonly parens?: boolean;
|
|
686
|
-
readonly rsrvword?: boolean;
|
|
687
|
-
}
|
|
3443
|
+
export declare const TsReMatch: 129;
|
|
688
3444
|
|
|
689
3445
|
/**
|
|
690
|
-
*
|
|
3446
|
+
* Upstream UnTestOperator constant TsSmbLink. Its numeric value is preserved exactly.
|
|
3447
|
+
*
|
|
3448
|
+
* -L
|
|
691
3449
|
*
|
|
692
3450
|
* @public
|
|
693
3451
|
*/
|
|
694
|
-
declare
|
|
695
|
-
readonly type: 'IfClause';
|
|
696
|
-
readonly range: readonly [number, number];
|
|
697
|
-
readonly loc: {
|
|
698
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
699
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
700
|
-
};
|
|
701
|
-
[field: string]: unknown;
|
|
702
|
-
readonly cond: readonly ShStmtNode[];
|
|
703
|
-
readonly condlast: readonly ShCommentNode[];
|
|
704
|
-
readonly else?: ShIfClauseNode;
|
|
705
|
-
readonly last: readonly ShCommentNode[];
|
|
706
|
-
readonly then: readonly ShStmtNode[];
|
|
707
|
-
readonly thenlast: readonly ShCommentNode[];
|
|
708
|
-
}
|
|
3452
|
+
export declare const TsSmbLink: 112;
|
|
709
3453
|
|
|
710
3454
|
/**
|
|
711
|
-
*
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
* {@link ShInvalidDialectError} and {@link ShParseError}, both of which
|
|
715
|
-
* indicate a foreseeable, actionable user mistake rather than an internal
|
|
716
|
-
* defect.
|
|
3455
|
+
* Upstream UnTestOperator constant TsSocket. Its numeric value is preserved exactly.
|
|
3456
|
+
*
|
|
3457
|
+
* -S
|
|
717
3458
|
*
|
|
718
3459
|
* @public
|
|
719
3460
|
*/
|
|
720
|
-
export declare
|
|
721
|
-
readonly code = "SH_AST_INTERNAL";
|
|
722
|
-
constructor(message: string);
|
|
723
|
-
}
|
|
3461
|
+
export declare const TsSocket: 111;
|
|
724
3462
|
|
|
725
3463
|
/**
|
|
726
|
-
*
|
|
727
|
-
*
|
|
728
|
-
*
|
|
729
|
-
* actionable user mistake — never an instance of {@link ShParseError}.
|
|
3464
|
+
* Upstream UnTestOperator constant TsSticky. Its numeric value is preserved exactly.
|
|
3465
|
+
*
|
|
3466
|
+
* -k
|
|
730
3467
|
*
|
|
731
3468
|
* @public
|
|
732
3469
|
*/
|
|
733
|
-
export declare
|
|
734
|
-
readonly code = "SH_AST_INVALID_DIALECT";
|
|
735
|
-
/** The rejected dialect value, exactly as passed to {@link parseSync}. */
|
|
736
|
-
readonly dialect: string;
|
|
737
|
-
constructor(dialect: string, supportedDialects: readonly ShellDialect[]);
|
|
738
|
-
}
|
|
3470
|
+
export declare const TsSticky: 113;
|
|
739
3471
|
|
|
740
3472
|
/**
|
|
741
|
-
*
|
|
3473
|
+
* Upstream UnTestOperator constant TsUIDSet. Its numeric value is preserved exactly.
|
|
3474
|
+
*
|
|
3475
|
+
* -u
|
|
742
3476
|
*
|
|
743
3477
|
* @public
|
|
744
3478
|
*/
|
|
745
|
-
declare
|
|
746
|
-
readonly type: 'LetClause';
|
|
747
|
-
readonly range: readonly [number, number];
|
|
748
|
-
readonly loc: {
|
|
749
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
750
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
751
|
-
};
|
|
752
|
-
[field: string]: unknown;
|
|
753
|
-
readonly exprs: readonly ShArithmExprNode[];
|
|
754
|
-
}
|
|
3479
|
+
export declare const TsUIDSet: 115;
|
|
755
3480
|
|
|
756
3481
|
/**
|
|
757
|
-
*
|
|
3482
|
+
* Upstream UnTestOperator constant TsUsrOwn. Its numeric value is preserved exactly.
|
|
3483
|
+
*
|
|
3484
|
+
* -O
|
|
758
3485
|
*
|
|
759
3486
|
* @public
|
|
760
3487
|
*/
|
|
761
|
-
declare
|
|
762
|
-
readonly type: 'Lit';
|
|
763
|
-
readonly range: readonly [number, number];
|
|
764
|
-
readonly loc: {
|
|
765
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
766
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
767
|
-
};
|
|
768
|
-
[field: string]: unknown;
|
|
769
|
-
readonly value?: string;
|
|
770
|
-
}
|
|
3488
|
+
export declare const TsUsrOwn: 117;
|
|
771
3489
|
|
|
772
3490
|
/**
|
|
773
|
-
*
|
|
774
|
-
*
|
|
3491
|
+
* Upstream UnTestOperator constant TsVarSet. Its numeric value is preserved exactly.
|
|
3492
|
+
*
|
|
3493
|
+
* -v
|
|
775
3494
|
*
|
|
776
3495
|
* @public
|
|
777
3496
|
*/
|
|
778
|
-
declare
|
|
3497
|
+
export declare const TsVarSet: 127;
|
|
779
3498
|
|
|
780
3499
|
/**
|
|
781
|
-
*
|
|
3500
|
+
* Upstream UnTestOperator constant TsWrite. Its numeric value is preserved exactly.
|
|
782
3501
|
*
|
|
783
|
-
*
|
|
784
|
-
* `code.slice(node.range[0], node.range[1])` reproduces the node's exact
|
|
785
|
-
* source text — even though mvdan/sh itself reports byte offsets and
|
|
786
|
-
* byte-counting columns internally (see design/ARCHITECTURE.md's
|
|
787
|
-
* "Serialization contract"). Every other field copied over from mvdan/sh's
|
|
788
|
-
* typedjson tree keeps its original value but with the field name
|
|
789
|
-
* lowercased (`Stmts` becomes `stmts`, `CondLast` becomes `condlast`, etc.).
|
|
790
|
-
*
|
|
791
|
-
* Also re-exported from `sh-ast/analyze` (see #23) — the subpath's public
|
|
792
|
-
* surface consumes and exposes `ShNode`, so a consumer can reference the type
|
|
793
|
-
* without also importing from the root `sh-ast` entry point.
|
|
3502
|
+
* -w
|
|
794
3503
|
*
|
|
795
3504
|
* @public
|
|
796
3505
|
*/
|
|
797
|
-
export declare
|
|
798
|
-
readonly type: string;
|
|
799
|
-
readonly range: readonly [number, number];
|
|
800
|
-
readonly loc: {
|
|
801
|
-
readonly start: Position;
|
|
802
|
-
readonly end: Position;
|
|
803
|
-
};
|
|
804
|
-
[field: string]: unknown;
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
export declare namespace ShNodes {
|
|
808
|
-
export {
|
|
809
|
-
ShArithmCmdNode,
|
|
810
|
-
ShArithmExpNode,
|
|
811
|
-
ShArrayElemNode,
|
|
812
|
-
ShArrayExprNode,
|
|
813
|
-
ShAssignNode,
|
|
814
|
-
ShBinaryArithmNode,
|
|
815
|
-
ShBinaryCmdNode,
|
|
816
|
-
ShBinaryTestNode,
|
|
817
|
-
ShBlockNode,
|
|
818
|
-
ShBraceExpNode,
|
|
819
|
-
ShCStyleLoopNode,
|
|
820
|
-
ShCallExprNode,
|
|
821
|
-
ShCaseClauseNode,
|
|
822
|
-
ShCaseItemNode,
|
|
823
|
-
ShCmdSubstNode,
|
|
824
|
-
ShCommentNode,
|
|
825
|
-
ShCoprocClauseNode,
|
|
826
|
-
ShDblQuotedNode,
|
|
827
|
-
ShDeclClauseNode,
|
|
828
|
-
ShExpansionNode,
|
|
829
|
-
ShExtGlobNode,
|
|
830
|
-
ShFileNode,
|
|
831
|
-
ShFlagsArithmNode,
|
|
832
|
-
ShForClauseNode,
|
|
833
|
-
ShFuncDeclNode,
|
|
834
|
-
ShIfClauseNode,
|
|
835
|
-
ShLetClauseNode,
|
|
836
|
-
ShLitNode,
|
|
837
|
-
ShParamExpNode,
|
|
838
|
-
ShParenArithmNode,
|
|
839
|
-
ShParenTestNode,
|
|
840
|
-
ShProcSubstNode,
|
|
841
|
-
ShRedirectNode,
|
|
842
|
-
ShReplaceNode,
|
|
843
|
-
ShSglQuotedNode,
|
|
844
|
-
ShSliceNode,
|
|
845
|
-
ShStmtNode,
|
|
846
|
-
ShSubshellNode,
|
|
847
|
-
ShTestClauseNode,
|
|
848
|
-
ShTestDeclNode,
|
|
849
|
-
ShTimeClauseNode,
|
|
850
|
-
ShUnaryArithmNode,
|
|
851
|
-
ShUnaryTestNode,
|
|
852
|
-
ShWhileClauseNode,
|
|
853
|
-
ShWordNode,
|
|
854
|
-
ShWordIterNode,
|
|
855
|
-
ShArithmExprNode,
|
|
856
|
-
ShCommandNode,
|
|
857
|
-
ShLoopNode,
|
|
858
|
-
ShTestExprNode,
|
|
859
|
-
ShWordPartNode,
|
|
860
|
-
ShAnyNode,
|
|
861
|
-
ShNodeTypeName
|
|
862
|
-
}
|
|
863
|
-
}
|
|
3506
|
+
export declare const TsWrite: 120;
|
|
864
3507
|
|
|
865
3508
|
/**
|
|
866
|
-
*
|
|
3509
|
+
* An upstream interface containing a nil pointer of a concrete syntax.Node kind. This differs from a nil interface (null): the concrete Go type remains observable and can affect operations. Only interface-valued positions admit this tag; concrete pointer fields use null. No record fields or node bounds are stored on the tag.
|
|
867
3510
|
*
|
|
868
3511
|
* @public
|
|
869
3512
|
*/
|
|
870
|
-
declare
|
|
3513
|
+
export declare interface TypedNil<
|
|
3514
|
+
ConcreteKind extends
|
|
871
3515
|
| 'ArithmCmd'
|
|
872
3516
|
| 'ArithmExp'
|
|
873
3517
|
| 'ArrayElem'
|
|
@@ -887,7 +3531,6 @@ declare type ShNodeTypeName =
|
|
|
887
3531
|
| 'CoprocClause'
|
|
888
3532
|
| 'DblQuoted'
|
|
889
3533
|
| 'DeclClause'
|
|
890
|
-
| 'Expansion'
|
|
891
3534
|
| 'ExtGlob'
|
|
892
3535
|
| 'File'
|
|
893
3536
|
| 'FlagsArithm'
|
|
@@ -901,9 +3544,7 @@ declare type ShNodeTypeName =
|
|
|
901
3544
|
| 'ParenTest'
|
|
902
3545
|
| 'ProcSubst'
|
|
903
3546
|
| 'Redirect'
|
|
904
|
-
| 'Replace'
|
|
905
3547
|
| 'SglQuoted'
|
|
906
|
-
| 'Slice'
|
|
907
3548
|
| 'Stmt'
|
|
908
3549
|
| 'Subshell'
|
|
909
3550
|
| 'TestClause'
|
|
@@ -913,478 +3554,313 @@ declare type ShNodeTypeName =
|
|
|
913
3554
|
| 'UnaryTest'
|
|
914
3555
|
| 'WhileClause'
|
|
915
3556
|
| 'Word'
|
|
916
|
-
| 'WordIter'
|
|
917
|
-
|
|
918
|
-
/**
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
readonly loc: {
|
|
927
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
928
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
929
|
-
};
|
|
930
|
-
[field: string]: unknown;
|
|
931
|
-
readonly excl?: boolean;
|
|
932
|
-
readonly exp?: ShExpansionNode;
|
|
933
|
-
readonly flags?: ShLitNode;
|
|
934
|
-
readonly index?: ShArithmExprNode;
|
|
935
|
-
readonly isset?: boolean;
|
|
936
|
-
readonly length?: boolean;
|
|
937
|
-
readonly modifiers: readonly ShLitNode[];
|
|
938
|
-
readonly names?: number;
|
|
939
|
-
readonly nestedparam?: ShWordPartNode;
|
|
940
|
-
readonly param?: ShLitNode;
|
|
941
|
-
readonly repl?: ShReplaceNode;
|
|
942
|
-
readonly short?: boolean;
|
|
943
|
-
readonly slice?: ShSliceNode;
|
|
944
|
-
readonly width?: boolean;
|
|
3557
|
+
| 'WordIter',
|
|
3558
|
+
> {
|
|
3559
|
+
/**
|
|
3560
|
+
* Distinguishes a typed nil interface value from a concrete syntax record.
|
|
3561
|
+
*/
|
|
3562
|
+
Type: 'TypedNil';
|
|
3563
|
+
/**
|
|
3564
|
+
* The concrete Go pointer type retained by the non-nil interface.
|
|
3565
|
+
*/
|
|
3566
|
+
Kind: ConcreteKind;
|
|
945
3567
|
}
|
|
946
3568
|
|
|
947
3569
|
/**
|
|
948
|
-
*
|
|
3570
|
+
* The upstream UnAritOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
949
3571
|
*
|
|
950
3572
|
* @public
|
|
951
3573
|
*/
|
|
952
|
-
declare
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
}
|
|
3574
|
+
export declare type UnAritOperator =
|
|
3575
|
+
| 0
|
|
3576
|
+
| typeof BitNegation
|
|
3577
|
+
| typeof Dec
|
|
3578
|
+
| typeof Inc
|
|
3579
|
+
| typeof Minus
|
|
3580
|
+
| typeof Not
|
|
3581
|
+
| typeof Plus
|
|
3582
|
+
| RawOperator<'UnAritOperator'>;
|
|
962
3583
|
|
|
963
3584
|
/**
|
|
964
|
-
*
|
|
3585
|
+
* UnaryArithm represents an unary arithmetic expression. The unary operator
|
|
3586
|
+
* may come before or after the sub-expression.
|
|
965
3587
|
*
|
|
966
|
-
*
|
|
967
|
-
|
|
968
|
-
declare interface ShParenTestNode {
|
|
969
|
-
readonly type: 'ParenTest';
|
|
970
|
-
readonly range: readonly [number, number];
|
|
971
|
-
readonly loc: {
|
|
972
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
973
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
974
|
-
};
|
|
975
|
-
[field: string]: unknown;
|
|
976
|
-
readonly x?: ShTestExprNode;
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* Thrown by {@link parseSync} when shell source fails to parse. Carries the
|
|
981
|
-
* real position mvdan/sh reported — never 1:1 placeholders: `.line` is
|
|
982
|
-
* 1-based exactly as mvdan/sh reports it, and `.column` is converted to
|
|
983
|
-
* UTF-16 code units so it agrees with {@link ShNode.loc}'s columns (mvdan/sh
|
|
984
|
-
* itself reports `column` as a byte count on the source line — see
|
|
985
|
-
* {@link ShParseErrorInfo.column}). The unconverted, raw byte-column
|
|
986
|
-
* position appears only inside `.message`, mvdan/sh's own formatted string,
|
|
987
|
-
* verbatim.
|
|
3588
|
+
* If Op is `Inc` or `Dec`, X will be a word with a single `Lit` whose value is a
|
|
3589
|
+
* valid name.
|
|
988
3590
|
*
|
|
989
|
-
*
|
|
990
|
-
*/
|
|
991
|
-
export declare class ShParseError extends ShAstError {
|
|
992
|
-
readonly code = "SH_AST_PARSE_ERROR";
|
|
993
|
-
readonly line: number;
|
|
994
|
-
readonly column: number;
|
|
995
|
-
readonly filename: string;
|
|
996
|
-
constructor(message: string, info: ShParseErrorInfo);
|
|
997
|
-
}
|
|
998
|
-
|
|
999
|
-
/**
|
|
1000
|
-
* Position info attached to a {@link ShParseError}.
|
|
3591
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1001
3592
|
*
|
|
1002
3593
|
* @public
|
|
1003
3594
|
*/
|
|
1004
|
-
export declare interface
|
|
1005
|
-
/**
|
|
1006
|
-
|
|
3595
|
+
export declare interface UnaryArithm {
|
|
3596
|
+
/**
|
|
3597
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
3598
|
+
*/
|
|
3599
|
+
Type: 'UnaryArithm';
|
|
3600
|
+
/**
|
|
3601
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
3602
|
+
*/
|
|
3603
|
+
Op: UnAritOperator;
|
|
3604
|
+
/**
|
|
3605
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3606
|
+
*/
|
|
3607
|
+
OpPos: SyntaxPos;
|
|
3608
|
+
/**
|
|
3609
|
+
* False is an explicit upstream value and is never omitted.
|
|
3610
|
+
*/
|
|
3611
|
+
Post: boolean;
|
|
1007
3612
|
/**
|
|
1008
|
-
*
|
|
1009
|
-
* mvdan/sh's own byte-counting column so it agrees with
|
|
1010
|
-
* {@link ShNode.loc}'s columns (mvdan/sh reports `column` as a byte count
|
|
1011
|
-
* on the source line, not a UTF-16 code unit count; see
|
|
1012
|
-
* design/ARCHITECTURE.md's "Byte→UTF-16 conversion"). For ASCII-only
|
|
1013
|
-
* source text this is numerically identical to mvdan/sh's own column.
|
|
3613
|
+
* Null preserves the upstream absence of this component.
|
|
1014
3614
|
*/
|
|
1015
|
-
|
|
1016
|
-
/** The filename used for the parse (see {@link ParseOptions.filename}). */
|
|
1017
|
-
filename: string;
|
|
3615
|
+
X: ArithmExpr | null;
|
|
1018
3616
|
}
|
|
1019
3617
|
|
|
1020
3618
|
/**
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1023
|
-
* `if`/`case`/loop/function bodies, `{ }` blocks, backtick or `$(...)`
|
|
1024
|
-
* command substitution, `$((...))` arithmetic — see
|
|
1025
|
-
* `parse-depth-guard.ts`'s module doc for the exact heuristic) exceeds the
|
|
1026
|
-
* limit `parseSync` accepts. Thrown *before* `text` is ever handed to the
|
|
1027
|
-
* WASM shim: mvdan/sh's own recursive-descent parser has no recovery path
|
|
1028
|
-
* for exhausting its call stack on pathologically deep input (a stack
|
|
1029
|
-
* overflow deep inside the shared WASM instance is not a normal, catchable
|
|
1030
|
-
* JS error the way a parse syntax error is), so this bridge estimates the
|
|
1031
|
-
* risk up front and fails closed with a typed error instead of ever making
|
|
1032
|
-
* that call — the shared WASM instance is therefore never put at risk of
|
|
1033
|
-
* wedging on this class of input; a `parseSync` call right after catching
|
|
1034
|
-
* this error works exactly as it would if this input had never been
|
|
1035
|
-
* attempted.
|
|
3619
|
+
* UnaryTest represents a unary test expression. The unary operator may come
|
|
3620
|
+
* before or after the sub-expression.
|
|
1036
3621
|
*
|
|
1037
|
-
*
|
|
1038
|
-
* protection, not a normal-usage ceiling: a legitimately deep (but
|
|
1039
|
-
* realistic) script parses fine. The estimate can *over*-count relative to
|
|
1040
|
-
* mvdan/sh's real grammar (rejecting some legitimate-but-unusually-deep
|
|
1041
|
-
* input) but is designed to never *under*-count relative to it — see
|
|
1042
|
-
* `parse-depth-guard.ts` for the documented false-positive sources this
|
|
1043
|
-
* trades off against ever letting a genuinely crash-inducing input
|
|
1044
|
-
* through.
|
|
3622
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1045
3623
|
*
|
|
1046
3624
|
* @public
|
|
1047
3625
|
*/
|
|
1048
|
-
export declare
|
|
1049
|
-
readonly code = "SH_AST_PARSE_MAX_DEPTH";
|
|
1050
|
-
/** The maximum structural nesting depth `parseSync` accepts; the same value every time (not caller-configurable). */
|
|
1051
|
-
readonly maxDepth: number;
|
|
3626
|
+
export declare interface UnaryTest {
|
|
1052
3627
|
/**
|
|
1053
|
-
*
|
|
1054
|
-
* Not necessarily `text`'s "true" nesting depth under a real parse — see
|
|
1055
|
-
* {@link ShParseMaxDepthError}'s doc comment — only ever `> maxDepth`.
|
|
3628
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1056
3629
|
*/
|
|
1057
|
-
|
|
1058
|
-
|
|
3630
|
+
Type: 'UnaryTest';
|
|
3631
|
+
/**
|
|
3632
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
3633
|
+
*/
|
|
3634
|
+
Op: UnTestOperator;
|
|
3635
|
+
/**
|
|
3636
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3637
|
+
*/
|
|
3638
|
+
OpPos: SyntaxPos;
|
|
3639
|
+
/**
|
|
3640
|
+
* Null preserves the upstream absence of this component.
|
|
3641
|
+
*/
|
|
3642
|
+
X: TestExpr | null;
|
|
1059
3643
|
}
|
|
1060
3644
|
|
|
1061
3645
|
/**
|
|
1062
|
-
*
|
|
3646
|
+
* The upstream UnTestOperator domain: exact named tokens, the Go zero value, and explicitly validated unnamed uint32 values. Constants shared by upstream families retain their shared numeric identity.
|
|
1063
3647
|
*
|
|
1064
3648
|
* @public
|
|
1065
3649
|
*/
|
|
1066
|
-
declare
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
3650
|
+
export declare type UnTestOperator =
|
|
3651
|
+
| 0
|
|
3652
|
+
| typeof TsBlckSp
|
|
3653
|
+
| typeof TsCharSp
|
|
3654
|
+
| typeof TsDirect
|
|
3655
|
+
| typeof TsEmpStr
|
|
3656
|
+
| typeof TsExec
|
|
3657
|
+
| typeof TsExists
|
|
3658
|
+
| typeof TsFdTerm
|
|
3659
|
+
| typeof TsGIDSet
|
|
3660
|
+
| typeof TsGrpOwn
|
|
3661
|
+
| typeof TsModif
|
|
3662
|
+
| typeof TsNempStr
|
|
3663
|
+
| typeof TsNmPipe
|
|
3664
|
+
| typeof TsNoEmpty
|
|
3665
|
+
| typeof TsNot
|
|
3666
|
+
| typeof TsOptSet
|
|
3667
|
+
| typeof TsParen
|
|
3668
|
+
| typeof TsRead
|
|
3669
|
+
| typeof TsRefVar
|
|
3670
|
+
| typeof TsRegFile
|
|
3671
|
+
| typeof TsSmbLink
|
|
3672
|
+
| typeof TsSocket
|
|
3673
|
+
| typeof TsSticky
|
|
3674
|
+
| typeof TsUIDSet
|
|
3675
|
+
| typeof TsUsrOwn
|
|
3676
|
+
| typeof TsVarSet
|
|
3677
|
+
| typeof TsWrite
|
|
3678
|
+
| RawOperator<'UnTestOperator'>;
|
|
1078
3679
|
|
|
1079
3680
|
/**
|
|
1080
|
-
*
|
|
3681
|
+
* Upstream ParExpOperator constant UpperAll. Its numeric value is preserved exactly.
|
|
1081
3682
|
*
|
|
1082
|
-
*
|
|
1083
|
-
*/
|
|
1084
|
-
declare interface ShRedirectNode {
|
|
1085
|
-
readonly type: 'Redirect';
|
|
1086
|
-
readonly range: readonly [number, number];
|
|
1087
|
-
readonly loc: {
|
|
1088
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1089
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1090
|
-
};
|
|
1091
|
-
[field: string]: unknown;
|
|
1092
|
-
readonly hdoc?: ShWordNode;
|
|
1093
|
-
readonly n?: ShLitNode;
|
|
1094
|
-
readonly op?: number;
|
|
1095
|
-
readonly word?: ShWordNode;
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
/**
|
|
1099
|
-
* mvdan/sh's `syntax.Replace`, normalized.
|
|
3683
|
+
* ^^
|
|
1100
3684
|
*
|
|
1101
3685
|
* @public
|
|
1102
3686
|
*/
|
|
1103
|
-
declare
|
|
1104
|
-
readonly type: 'Replace';
|
|
1105
|
-
readonly range: readonly [number, number];
|
|
1106
|
-
readonly loc: {
|
|
1107
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1108
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1109
|
-
};
|
|
1110
|
-
[field: string]: unknown;
|
|
1111
|
-
readonly all?: boolean;
|
|
1112
|
-
readonly orig?: ShWordNode;
|
|
1113
|
-
readonly with?: ShWordNode;
|
|
1114
|
-
}
|
|
3687
|
+
export declare const UpperAll: 97;
|
|
1115
3688
|
|
|
1116
3689
|
/**
|
|
1117
|
-
*
|
|
3690
|
+
* Upstream ParExpOperator constant UpperFirst. Its numeric value is preserved exactly.
|
|
1118
3691
|
*
|
|
1119
|
-
*
|
|
1120
|
-
*/
|
|
1121
|
-
declare interface ShSglQuotedNode {
|
|
1122
|
-
readonly type: 'SglQuoted';
|
|
1123
|
-
readonly range: readonly [number, number];
|
|
1124
|
-
readonly loc: {
|
|
1125
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1126
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1127
|
-
};
|
|
1128
|
-
[field: string]: unknown;
|
|
1129
|
-
readonly dollar?: boolean;
|
|
1130
|
-
readonly value?: string;
|
|
1131
|
-
}
|
|
1132
|
-
|
|
1133
|
-
/**
|
|
1134
|
-
* mvdan/sh's `syntax.Slice`, normalized.
|
|
3692
|
+
* ^
|
|
1135
3693
|
*
|
|
1136
3694
|
* @public
|
|
1137
3695
|
*/
|
|
1138
|
-
declare
|
|
1139
|
-
readonly type: 'Slice';
|
|
1140
|
-
readonly range: readonly [number, number];
|
|
1141
|
-
readonly loc: {
|
|
1142
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1143
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1144
|
-
};
|
|
1145
|
-
[field: string]: unknown;
|
|
1146
|
-
readonly length?: ShArithmExprNode;
|
|
1147
|
-
readonly offset?: ShArithmExprNode;
|
|
1148
|
-
}
|
|
3696
|
+
export declare const UpperFirst: 96;
|
|
1149
3697
|
|
|
1150
3698
|
/**
|
|
1151
|
-
*
|
|
3699
|
+
* WhileClause represents a while or an until clause.
|
|
1152
3700
|
*
|
|
1153
|
-
*
|
|
1154
|
-
*/
|
|
1155
|
-
declare interface ShStmtNode {
|
|
1156
|
-
readonly type: 'Stmt';
|
|
1157
|
-
readonly range: readonly [number, number];
|
|
1158
|
-
readonly loc: {
|
|
1159
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1160
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1161
|
-
};
|
|
1162
|
-
[field: string]: unknown;
|
|
1163
|
-
readonly background?: boolean;
|
|
1164
|
-
readonly cmd?: ShCommandNode;
|
|
1165
|
-
readonly comments: readonly ShCommentNode[];
|
|
1166
|
-
readonly coprocess?: boolean;
|
|
1167
|
-
readonly disown?: boolean;
|
|
1168
|
-
readonly negated?: boolean;
|
|
1169
|
-
readonly redirs: readonly ShRedirectNode[];
|
|
1170
|
-
}
|
|
1171
|
-
|
|
1172
|
-
/**
|
|
1173
|
-
* mvdan/sh's `syntax.Subshell`, normalized.
|
|
3701
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1174
3702
|
*
|
|
1175
3703
|
* @public
|
|
1176
3704
|
*/
|
|
1177
|
-
declare interface
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
3705
|
+
export declare interface WhileClause {
|
|
3706
|
+
/**
|
|
3707
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
3708
|
+
*/
|
|
3709
|
+
Type: 'WhileClause';
|
|
3710
|
+
/**
|
|
3711
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
3712
|
+
*/
|
|
3713
|
+
Cond: (Stmt | null)[] | null;
|
|
3714
|
+
/**
|
|
3715
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
3716
|
+
*/
|
|
3717
|
+
CondLast: Comment_2[] | null;
|
|
3718
|
+
/**
|
|
3719
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
3720
|
+
*/
|
|
3721
|
+
Do: (Stmt | null)[] | null;
|
|
3722
|
+
/**
|
|
3723
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
3724
|
+
*/
|
|
3725
|
+
DoLast: Comment_2[] | null;
|
|
3726
|
+
/**
|
|
3727
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3728
|
+
*/
|
|
3729
|
+
DoPos: SyntaxPos;
|
|
3730
|
+
/**
|
|
3731
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3732
|
+
*/
|
|
3733
|
+
DonePos: SyntaxPos;
|
|
3734
|
+
/**
|
|
3735
|
+
* False is an explicit upstream value and is never omitted.
|
|
3736
|
+
*/
|
|
3737
|
+
Until: boolean;
|
|
3738
|
+
/**
|
|
3739
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3740
|
+
*/
|
|
3741
|
+
WhilePos: SyntaxPos;
|
|
1187
3742
|
}
|
|
1188
3743
|
|
|
1189
3744
|
/**
|
|
1190
|
-
*
|
|
3745
|
+
* Word represents a shell word, containing one or more word parts contiguous to
|
|
3746
|
+
* each other. The word is delimited by word boundaries, such as spaces,
|
|
3747
|
+
* newlines, semicolons, or parentheses.
|
|
1191
3748
|
*
|
|
1192
|
-
*
|
|
1193
|
-
*/
|
|
1194
|
-
declare interface ShTestClauseNode {
|
|
1195
|
-
readonly type: 'TestClause';
|
|
1196
|
-
readonly range: readonly [number, number];
|
|
1197
|
-
readonly loc: {
|
|
1198
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1199
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1200
|
-
};
|
|
1201
|
-
[field: string]: unknown;
|
|
1202
|
-
readonly x?: ShTestExprNode;
|
|
1203
|
-
}
|
|
1204
|
-
|
|
1205
|
-
/**
|
|
1206
|
-
* mvdan/sh's `syntax.TestDecl`, normalized.
|
|
3749
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1207
3750
|
*
|
|
1208
3751
|
* @public
|
|
1209
3752
|
*/
|
|
1210
|
-
declare interface
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
readonly description?: ShWordNode;
|
|
3753
|
+
export declare interface Word {
|
|
3754
|
+
/**
|
|
3755
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
3756
|
+
*/
|
|
3757
|
+
Type: 'Word';
|
|
3758
|
+
/**
|
|
3759
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
3760
|
+
*/
|
|
3761
|
+
Parts: (WordPart | null)[] | null;
|
|
1220
3762
|
}
|
|
1221
3763
|
|
|
1222
3764
|
/**
|
|
1223
|
-
*
|
|
1224
|
-
* hold.
|
|
3765
|
+
* Upstream RedirOperator constant WordHdoc. Its numeric value is preserved exactly.
|
|
1225
3766
|
*
|
|
1226
|
-
*
|
|
1227
|
-
*/
|
|
1228
|
-
declare type ShTestExprNode = ShBinaryTestNode | ShParenTestNode | ShUnaryTestNode | ShWordNode;
|
|
1229
|
-
|
|
1230
|
-
/**
|
|
1231
|
-
* mvdan/sh's `syntax.TimeClause`, normalized.
|
|
3767
|
+
* \<\<\<
|
|
1232
3768
|
*
|
|
1233
3769
|
* @public
|
|
1234
3770
|
*/
|
|
1235
|
-
declare
|
|
1236
|
-
readonly type: 'TimeClause';
|
|
1237
|
-
readonly range: readonly [number, number];
|
|
1238
|
-
readonly loc: {
|
|
1239
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1240
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1241
|
-
};
|
|
1242
|
-
[field: string]: unknown;
|
|
1243
|
-
readonly posixformat?: boolean;
|
|
1244
|
-
readonly stmt?: ShStmtNode;
|
|
1245
|
-
}
|
|
3771
|
+
export declare const WordHdoc: 73;
|
|
1246
3772
|
|
|
1247
3773
|
/**
|
|
1248
|
-
*
|
|
3774
|
+
* WordIter represents the iteration of a variable over a series of words in a
|
|
3775
|
+
* for clause. If InPos is an invalid position, the "in" token was missing, so
|
|
3776
|
+
* the iteration is over the shell's positional parameters.
|
|
1249
3777
|
*
|
|
1250
|
-
*
|
|
1251
|
-
*/
|
|
1252
|
-
declare interface ShUnaryArithmNode {
|
|
1253
|
-
readonly type: 'UnaryArithm';
|
|
1254
|
-
readonly range: readonly [number, number];
|
|
1255
|
-
readonly loc: {
|
|
1256
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1257
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1258
|
-
};
|
|
1259
|
-
[field: string]: unknown;
|
|
1260
|
-
readonly op?: number;
|
|
1261
|
-
readonly post?: boolean;
|
|
1262
|
-
readonly x?: ShArithmExprNode;
|
|
1263
|
-
}
|
|
1264
|
-
|
|
1265
|
-
/**
|
|
1266
|
-
* mvdan/sh's `syntax.UnaryTest`, normalized.
|
|
3778
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1267
3779
|
*
|
|
1268
3780
|
* @public
|
|
1269
3781
|
*/
|
|
1270
|
-
declare interface
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
3782
|
+
export declare interface WordIter {
|
|
3783
|
+
/**
|
|
3784
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
3785
|
+
*/
|
|
3786
|
+
Type: 'WordIter';
|
|
3787
|
+
/**
|
|
3788
|
+
* position of "in"
|
|
3789
|
+
*
|
|
3790
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
3791
|
+
*/
|
|
3792
|
+
InPos: SyntaxPos;
|
|
3793
|
+
/**
|
|
3794
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
3795
|
+
*/
|
|
3796
|
+
Items: (Word | null)[] | null;
|
|
3797
|
+
/**
|
|
3798
|
+
* Null preserves the upstream absence of this component.
|
|
3799
|
+
*/
|
|
3800
|
+
Name: Lit | null;
|
|
1280
3801
|
}
|
|
1281
3802
|
|
|
1282
3803
|
/**
|
|
1283
|
-
*
|
|
3804
|
+
* The concrete records and typed nil pointers accepted by upstream syntax.WordPart. Typed nil kinds are limited to this interface's actual implementers; auxiliary records are excluded.
|
|
1284
3805
|
*
|
|
1285
3806
|
* @public
|
|
1286
3807
|
*/
|
|
1287
|
-
declare
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
3808
|
+
export declare type WordPart =
|
|
3809
|
+
| ArithmExp
|
|
3810
|
+
| BraceExp
|
|
3811
|
+
| CmdSubst
|
|
3812
|
+
| DblQuoted
|
|
3813
|
+
| ExtGlob
|
|
3814
|
+
| Lit
|
|
3815
|
+
| ParamExp
|
|
3816
|
+
| ProcSubst
|
|
3817
|
+
| SglQuoted
|
|
3818
|
+
| TypedNil<
|
|
3819
|
+
| 'ArithmExp'
|
|
3820
|
+
| 'BraceExp'
|
|
3821
|
+
| 'CmdSubst'
|
|
3822
|
+
| 'DblQuoted'
|
|
3823
|
+
| 'ExtGlob'
|
|
3824
|
+
| 'Lit'
|
|
3825
|
+
| 'ParamExp'
|
|
3826
|
+
| 'ProcSubst'
|
|
3827
|
+
| 'SglQuoted'
|
|
3828
|
+
>;
|
|
1301
3829
|
|
|
1302
3830
|
/**
|
|
1303
|
-
*
|
|
3831
|
+
* Upstream BinAritOperator constant Xor. Its numeric value is preserved exactly.
|
|
1304
3832
|
*
|
|
1305
|
-
*
|
|
1306
|
-
*/
|
|
1307
|
-
declare interface ShWordIterNode {
|
|
1308
|
-
readonly type: 'WordIter';
|
|
1309
|
-
readonly range: readonly [number, number];
|
|
1310
|
-
readonly loc: {
|
|
1311
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1312
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1313
|
-
};
|
|
1314
|
-
[field: string]: unknown;
|
|
1315
|
-
readonly items: readonly ShWordNode[];
|
|
1316
|
-
readonly name?: ShLitNode;
|
|
1317
|
-
}
|
|
1318
|
-
|
|
1319
|
-
/**
|
|
1320
|
-
* mvdan/sh's `syntax.Word`, normalized.
|
|
3833
|
+
* ^
|
|
1321
3834
|
*
|
|
1322
3835
|
* @public
|
|
1323
3836
|
*/
|
|
1324
|
-
declare
|
|
1325
|
-
readonly type: 'Word';
|
|
1326
|
-
readonly range: readonly [number, number];
|
|
1327
|
-
readonly loc: {
|
|
1328
|
-
readonly start: { readonly line: number; readonly column: number };
|
|
1329
|
-
readonly end: { readonly line: number; readonly column: number };
|
|
1330
|
-
};
|
|
1331
|
-
[field: string]: unknown;
|
|
1332
|
-
readonly parts: readonly ShWordPartNode[];
|
|
1333
|
-
}
|
|
3837
|
+
export declare const Xor: 96;
|
|
1334
3838
|
|
|
1335
3839
|
/**
|
|
1336
|
-
*
|
|
1337
|
-
*
|
|
3840
|
+
* Upstream BinAritOperator constant XorAssgn. Its numeric value is preserved exactly.
|
|
3841
|
+
*
|
|
3842
|
+
* ^=
|
|
1338
3843
|
*
|
|
1339
3844
|
* @public
|
|
1340
3845
|
*/
|
|
1341
|
-
declare
|
|
1342
|
-
| ShArithmExpNode
|
|
1343
|
-
| ShBraceExpNode
|
|
1344
|
-
| ShCmdSubstNode
|
|
1345
|
-
| ShDblQuotedNode
|
|
1346
|
-
| ShExtGlobNode
|
|
1347
|
-
| ShLitNode
|
|
1348
|
-
| ShParamExpNode
|
|
1349
|
-
| ShProcSubstNode
|
|
1350
|
-
| ShSglQuotedNode;
|
|
3846
|
+
export declare const XorAssgn: 56;
|
|
1351
3847
|
|
|
1352
3848
|
/**
|
|
1353
|
-
*
|
|
1354
|
-
* the normalized node shape produced by `normalize`) whose values hold child
|
|
1355
|
-
* nodes.
|
|
1356
|
-
*
|
|
1357
|
-
* Generated from mvdan/sh's `syntax` package struct definitions by
|
|
1358
|
-
* `tools/gen-visitor-keys` (see design/ARCHITECTURE.md, "The schema table is
|
|
1359
|
-
* generated, not hand-written") — this module only re-exports the generated
|
|
1360
|
-
* table under the public name, frozen. {@link walk} does not depend on this
|
|
1361
|
-
* table for correctness — it discovers children structurally — so any gap
|
|
1362
|
-
* here (there shouldn't be one; the kitchen-sink golden test guards it)
|
|
1363
|
-
* affects only external consumers that choose to traverse via this table.
|
|
3849
|
+
* Upstream BinAritOperator constant XorBool. Its numeric value is preserved exactly.
|
|
1364
3850
|
*
|
|
1365
|
-
*
|
|
1366
|
-
* shared, module-scoped table is a contract, not just a convention any
|
|
1367
|
-
* importer happens to honor.
|
|
3851
|
+
* ^^
|
|
1368
3852
|
*
|
|
1369
3853
|
* @public
|
|
1370
3854
|
*/
|
|
1371
|
-
export declare const
|
|
3855
|
+
export declare const XorBool: 97;
|
|
1372
3856
|
|
|
1373
3857
|
/**
|
|
1374
|
-
*
|
|
1375
|
-
* children), starting at `node`.
|
|
3858
|
+
* Upstream BinAritOperator constant XorBoolAssgn. Its numeric value is preserved exactly.
|
|
1376
3859
|
*
|
|
1377
|
-
*
|
|
1378
|
-
* value is itself a normalized node (or an array of normalized nodes) is
|
|
1379
|
-
* treated as a child. This is deliberately not driven off {@link
|
|
1380
|
-
* visitorKeys} — the spike's hand-written visitor-keys table missed
|
|
1381
|
-
* `DeclClause.Variant` (see design/ARCHITECTURE.md) and silently
|
|
1382
|
-
* under-walked the tree, and `visitorKeys` remains hand-maintained pending a
|
|
1383
|
-
* schema generator (tracked separately). Walking structurally means this
|
|
1384
|
-
* function's completeness never depends on that table's accuracy.
|
|
3860
|
+
* ^^=
|
|
1385
3861
|
*
|
|
1386
3862
|
* @public
|
|
1387
3863
|
*/
|
|
1388
|
-
export declare
|
|
3864
|
+
export declare const XorBoolAssgn: 61;
|
|
1389
3865
|
|
|
1390
3866
|
export { }
|