sh-ast 0.3.1 → 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 +116 -144
- 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
|
@@ -0,0 +1,1977 @@
|
|
|
1
|
+
// Code generated by tools/gen-visitor-keys from mvdan.cc/sh/v3 v3.13.1. DO NOT EDIT.
|
|
2
|
+
// Faithful syntax values; see design/ARCHITECTURE.md.
|
|
3
|
+
/*
|
|
4
|
+
Copyright (c) 2016, Daniel Martí. All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are
|
|
8
|
+
met:
|
|
9
|
+
|
|
10
|
+
* Redistributions of source code must retain the above copyright
|
|
11
|
+
notice, this list of conditions and the following disclaimer.
|
|
12
|
+
* Redistributions in binary form must reproduce the above
|
|
13
|
+
copyright notice, this list of conditions and the following disclaimer
|
|
14
|
+
in the documentation and/or other materials provided with the
|
|
15
|
+
distribution.
|
|
16
|
+
* Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
21
|
+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
22
|
+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
23
|
+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
24
|
+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
25
|
+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
26
|
+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
27
|
+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
28
|
+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
29
|
+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
30
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
import type {
|
|
34
|
+
BinAritOperator,
|
|
35
|
+
BinCmdOperator,
|
|
36
|
+
BinTestOperator,
|
|
37
|
+
CaseOperator,
|
|
38
|
+
GlobOperator,
|
|
39
|
+
ParExpOperator,
|
|
40
|
+
ParNamesOperator,
|
|
41
|
+
ProcOperator,
|
|
42
|
+
RedirOperator,
|
|
43
|
+
UnAritOperator,
|
|
44
|
+
UnTestOperator,
|
|
45
|
+
} from './syntax-constants.js';
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* 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.
|
|
49
|
+
*
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export type GoString = string | Uint8Array;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* 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.
|
|
56
|
+
*
|
|
57
|
+
* @public
|
|
58
|
+
*/
|
|
59
|
+
export interface SyntaxPos {
|
|
60
|
+
/**
|
|
61
|
+
* Zero-based source byte offset, including upstream saturation behavior.
|
|
62
|
+
*/
|
|
63
|
+
Offset: number;
|
|
64
|
+
/**
|
|
65
|
+
* One-based source line; zero retains upstream invalid or overflow information.
|
|
66
|
+
*/
|
|
67
|
+
Line: number;
|
|
68
|
+
/**
|
|
69
|
+
* One-based byte column; zero retains upstream invalid or overflow information.
|
|
70
|
+
*/
|
|
71
|
+
Col: number;
|
|
72
|
+
/**
|
|
73
|
+
* Whether upstream considers this position useful; recovered positions are not valid.
|
|
74
|
+
*/
|
|
75
|
+
IsValid: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Whether upstream synthesized this missing syntax position during error recovery.
|
|
78
|
+
*/
|
|
79
|
+
IsRecovered: boolean;
|
|
80
|
+
/**
|
|
81
|
+
* 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.
|
|
82
|
+
*/
|
|
83
|
+
OffsetOverflow: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* 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.
|
|
88
|
+
*
|
|
89
|
+
* @public
|
|
90
|
+
*/
|
|
91
|
+
export interface TypedNil<
|
|
92
|
+
ConcreteKind extends
|
|
93
|
+
| 'ArithmCmd'
|
|
94
|
+
| 'ArithmExp'
|
|
95
|
+
| 'ArrayElem'
|
|
96
|
+
| 'ArrayExpr'
|
|
97
|
+
| 'Assign'
|
|
98
|
+
| 'BinaryArithm'
|
|
99
|
+
| 'BinaryCmd'
|
|
100
|
+
| 'BinaryTest'
|
|
101
|
+
| 'Block'
|
|
102
|
+
| 'BraceExp'
|
|
103
|
+
| 'CStyleLoop'
|
|
104
|
+
| 'CallExpr'
|
|
105
|
+
| 'CaseClause'
|
|
106
|
+
| 'CaseItem'
|
|
107
|
+
| 'CmdSubst'
|
|
108
|
+
| 'Comment'
|
|
109
|
+
| 'CoprocClause'
|
|
110
|
+
| 'DblQuoted'
|
|
111
|
+
| 'DeclClause'
|
|
112
|
+
| 'ExtGlob'
|
|
113
|
+
| 'File'
|
|
114
|
+
| 'FlagsArithm'
|
|
115
|
+
| 'ForClause'
|
|
116
|
+
| 'FuncDecl'
|
|
117
|
+
| 'IfClause'
|
|
118
|
+
| 'LetClause'
|
|
119
|
+
| 'Lit'
|
|
120
|
+
| 'ParamExp'
|
|
121
|
+
| 'ParenArithm'
|
|
122
|
+
| 'ParenTest'
|
|
123
|
+
| 'ProcSubst'
|
|
124
|
+
| 'Redirect'
|
|
125
|
+
| 'SglQuoted'
|
|
126
|
+
| 'Stmt'
|
|
127
|
+
| 'Subshell'
|
|
128
|
+
| 'TestClause'
|
|
129
|
+
| 'TestDecl'
|
|
130
|
+
| 'TimeClause'
|
|
131
|
+
| 'UnaryArithm'
|
|
132
|
+
| 'UnaryTest'
|
|
133
|
+
| 'WhileClause'
|
|
134
|
+
| 'Word'
|
|
135
|
+
| 'WordIter',
|
|
136
|
+
> {
|
|
137
|
+
/**
|
|
138
|
+
* Distinguishes a typed nil interface value from a concrete syntax record.
|
|
139
|
+
*/
|
|
140
|
+
Type: 'TypedNil';
|
|
141
|
+
/**
|
|
142
|
+
* The concrete Go pointer type retained by the non-nil interface.
|
|
143
|
+
*/
|
|
144
|
+
Kind: ConcreteKind;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* ArithmCmd represents an arithmetic command.
|
|
149
|
+
*
|
|
150
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
151
|
+
*
|
|
152
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
153
|
+
*
|
|
154
|
+
* @public
|
|
155
|
+
*/
|
|
156
|
+
export interface ArithmCmd {
|
|
157
|
+
/**
|
|
158
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
159
|
+
*/
|
|
160
|
+
Type: 'ArithmCmd';
|
|
161
|
+
/**
|
|
162
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
163
|
+
*/
|
|
164
|
+
Left: SyntaxPos;
|
|
165
|
+
/**
|
|
166
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
167
|
+
*/
|
|
168
|
+
Right: SyntaxPos;
|
|
169
|
+
/**
|
|
170
|
+
* mksh's ((# expr))
|
|
171
|
+
*
|
|
172
|
+
* False is an explicit upstream value and is never omitted.
|
|
173
|
+
*/
|
|
174
|
+
Unsigned: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Null preserves the upstream absence of this component.
|
|
177
|
+
*/
|
|
178
|
+
X: ArithmExpr | null;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* ArithmExp represents an arithmetic expansion.
|
|
183
|
+
*
|
|
184
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
185
|
+
*
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
export interface ArithmExp {
|
|
189
|
+
/**
|
|
190
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
191
|
+
*/
|
|
192
|
+
Type: 'ArithmExp';
|
|
193
|
+
/**
|
|
194
|
+
* deprecated $`expr` form
|
|
195
|
+
*
|
|
196
|
+
* False is an explicit upstream value and is never omitted.
|
|
197
|
+
*/
|
|
198
|
+
Bracket: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
201
|
+
*/
|
|
202
|
+
Left: SyntaxPos;
|
|
203
|
+
/**
|
|
204
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
205
|
+
*/
|
|
206
|
+
Right: SyntaxPos;
|
|
207
|
+
/**
|
|
208
|
+
* mksh's $((# expr))
|
|
209
|
+
*
|
|
210
|
+
* False is an explicit upstream value and is never omitted.
|
|
211
|
+
*/
|
|
212
|
+
Unsigned: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Null preserves the upstream absence of this component.
|
|
215
|
+
*/
|
|
216
|
+
X: ArithmExpr | null;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* ArrayElem represents a Bash array element.
|
|
221
|
+
*
|
|
222
|
+
* Index can be nil; for example, declare -a x=(value).
|
|
223
|
+
* Value can be nil; for example, declare -A x=(`index`=).
|
|
224
|
+
* Finally, neither can be nil; for example, declare -A x=(`index`=value)
|
|
225
|
+
*
|
|
226
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
227
|
+
*
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
export interface ArrayElem {
|
|
231
|
+
/**
|
|
232
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
233
|
+
*/
|
|
234
|
+
Type: 'ArrayElem';
|
|
235
|
+
/**
|
|
236
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
237
|
+
*/
|
|
238
|
+
Comments: Comment[] | null;
|
|
239
|
+
/**
|
|
240
|
+
* Null preserves the upstream absence of this component.
|
|
241
|
+
*/
|
|
242
|
+
Index: ArithmExpr | null;
|
|
243
|
+
/**
|
|
244
|
+
* Null preserves the upstream absence of this component.
|
|
245
|
+
*/
|
|
246
|
+
Value: Word | null;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* ArrayExpr represents a Bash array expression.
|
|
251
|
+
*
|
|
252
|
+
* This node will only appear with `LangBash`.
|
|
253
|
+
*
|
|
254
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
255
|
+
*
|
|
256
|
+
* @public
|
|
257
|
+
*/
|
|
258
|
+
export interface ArrayExpr {
|
|
259
|
+
/**
|
|
260
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
261
|
+
*/
|
|
262
|
+
Type: 'ArrayExpr';
|
|
263
|
+
/**
|
|
264
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
265
|
+
*/
|
|
266
|
+
Elems: (ArrayElem | null)[] | null;
|
|
267
|
+
/**
|
|
268
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
269
|
+
*/
|
|
270
|
+
Last: Comment[] | null;
|
|
271
|
+
/**
|
|
272
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
273
|
+
*/
|
|
274
|
+
Lparen: SyntaxPos;
|
|
275
|
+
/**
|
|
276
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
277
|
+
*/
|
|
278
|
+
Rparen: SyntaxPos;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Assign represents an assignment to a variable.
|
|
283
|
+
*
|
|
284
|
+
* Here and elsewhere, Index can mean either an index expression into an indexed
|
|
285
|
+
* array, or a string key into an associative array.
|
|
286
|
+
*
|
|
287
|
+
* If Index is non-nil, the value will be a word and not an array as nested
|
|
288
|
+
* arrays are not allowed.
|
|
289
|
+
*
|
|
290
|
+
* If Naked is true and Name is nil, the assignment is part of a `DeclClause` and
|
|
291
|
+
* the argument (in the Value field) will be evaluated at run-time. This
|
|
292
|
+
* includes parameter expansions, which may expand to assignments or options.
|
|
293
|
+
*
|
|
294
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
295
|
+
*
|
|
296
|
+
* @public
|
|
297
|
+
*/
|
|
298
|
+
export interface Assign {
|
|
299
|
+
/**
|
|
300
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
301
|
+
*/
|
|
302
|
+
Type: 'Assign';
|
|
303
|
+
/**
|
|
304
|
+
* +=
|
|
305
|
+
*
|
|
306
|
+
* False is an explicit upstream value and is never omitted.
|
|
307
|
+
*/
|
|
308
|
+
Append: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* =(arr)
|
|
311
|
+
*
|
|
312
|
+
* Null preserves the upstream absence of this component.
|
|
313
|
+
*/
|
|
314
|
+
Array: ArrayExpr | null;
|
|
315
|
+
/**
|
|
316
|
+
* `i`, ["k"]
|
|
317
|
+
*
|
|
318
|
+
* Null preserves the upstream absence of this component.
|
|
319
|
+
*/
|
|
320
|
+
Index: ArithmExpr | null;
|
|
321
|
+
/**
|
|
322
|
+
* without '='
|
|
323
|
+
*
|
|
324
|
+
* False is an explicit upstream value and is never omitted.
|
|
325
|
+
*/
|
|
326
|
+
Naked: boolean;
|
|
327
|
+
/**
|
|
328
|
+
* must be a valid name
|
|
329
|
+
*
|
|
330
|
+
* Null preserves the upstream absence of this component.
|
|
331
|
+
*/
|
|
332
|
+
Name: Lit | null;
|
|
333
|
+
/**
|
|
334
|
+
* =val
|
|
335
|
+
*
|
|
336
|
+
* Null preserves the upstream absence of this component.
|
|
337
|
+
*/
|
|
338
|
+
Value: Word | null;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* BinaryArithm represents a binary arithmetic expression.
|
|
343
|
+
*
|
|
344
|
+
* If Op is any assign operator, X will be a word with a single `Lit` whose value
|
|
345
|
+
* is a valid name.
|
|
346
|
+
*
|
|
347
|
+
* Ternary operators like "a ? b : c" are fit into this structure. Thus, if
|
|
348
|
+
* Op==`TernQuest`, Y will be a `BinaryArithm` with Op==`TernColon`.
|
|
349
|
+
* `TernColon` does not appear in any other scenario.
|
|
350
|
+
*
|
|
351
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
352
|
+
*
|
|
353
|
+
* @public
|
|
354
|
+
*/
|
|
355
|
+
export interface BinaryArithm {
|
|
356
|
+
/**
|
|
357
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
358
|
+
*/
|
|
359
|
+
Type: 'BinaryArithm';
|
|
360
|
+
/**
|
|
361
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
362
|
+
*/
|
|
363
|
+
Op: BinAritOperator;
|
|
364
|
+
/**
|
|
365
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
366
|
+
*/
|
|
367
|
+
OpPos: SyntaxPos;
|
|
368
|
+
/**
|
|
369
|
+
* Null preserves the upstream absence of this component.
|
|
370
|
+
*/
|
|
371
|
+
X: ArithmExpr | null;
|
|
372
|
+
/**
|
|
373
|
+
* Null preserves the upstream absence of this component.
|
|
374
|
+
*/
|
|
375
|
+
Y: ArithmExpr | null;
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* BinaryCmd represents a binary expression between two statements.
|
|
380
|
+
*
|
|
381
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
382
|
+
*
|
|
383
|
+
* @public
|
|
384
|
+
*/
|
|
385
|
+
export interface BinaryCmd {
|
|
386
|
+
/**
|
|
387
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
388
|
+
*/
|
|
389
|
+
Type: 'BinaryCmd';
|
|
390
|
+
/**
|
|
391
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
392
|
+
*/
|
|
393
|
+
Op: BinCmdOperator;
|
|
394
|
+
/**
|
|
395
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
396
|
+
*/
|
|
397
|
+
OpPos: SyntaxPos;
|
|
398
|
+
/**
|
|
399
|
+
* Null preserves the upstream absence of this component.
|
|
400
|
+
*/
|
|
401
|
+
X: Stmt | null;
|
|
402
|
+
/**
|
|
403
|
+
* Null preserves the upstream absence of this component.
|
|
404
|
+
*/
|
|
405
|
+
Y: Stmt | null;
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* BinaryTest represents a binary test expression.
|
|
410
|
+
*
|
|
411
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
412
|
+
*
|
|
413
|
+
* @public
|
|
414
|
+
*/
|
|
415
|
+
export interface BinaryTest {
|
|
416
|
+
/**
|
|
417
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
418
|
+
*/
|
|
419
|
+
Type: 'BinaryTest';
|
|
420
|
+
/**
|
|
421
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
422
|
+
*/
|
|
423
|
+
Op: BinTestOperator;
|
|
424
|
+
/**
|
|
425
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
426
|
+
*/
|
|
427
|
+
OpPos: SyntaxPos;
|
|
428
|
+
/**
|
|
429
|
+
* Null preserves the upstream absence of this component.
|
|
430
|
+
*/
|
|
431
|
+
X: TestExpr | null;
|
|
432
|
+
/**
|
|
433
|
+
* Null preserves the upstream absence of this component.
|
|
434
|
+
*/
|
|
435
|
+
Y: TestExpr | null;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Block represents a series of commands that should be executed in a nested
|
|
440
|
+
* scope. It is essentially a list of statements within curly braces.
|
|
441
|
+
*
|
|
442
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
443
|
+
*
|
|
444
|
+
* @public
|
|
445
|
+
*/
|
|
446
|
+
export interface Block {
|
|
447
|
+
/**
|
|
448
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
449
|
+
*/
|
|
450
|
+
Type: 'Block';
|
|
451
|
+
/**
|
|
452
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
453
|
+
*/
|
|
454
|
+
Last: Comment[] | null;
|
|
455
|
+
/**
|
|
456
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
457
|
+
*/
|
|
458
|
+
Lbrace: SyntaxPos;
|
|
459
|
+
/**
|
|
460
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
461
|
+
*/
|
|
462
|
+
Rbrace: SyntaxPos;
|
|
463
|
+
/**
|
|
464
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
465
|
+
*/
|
|
466
|
+
Stmts: (Stmt | null)[] | null;
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* BraceExp represents a Bash brace expression, such as "\{a,f\}" or "\{1..10\}".
|
|
471
|
+
*
|
|
472
|
+
* This node will only appear as a result of `SplitBraces`.
|
|
473
|
+
*
|
|
474
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
475
|
+
*
|
|
476
|
+
* @public
|
|
477
|
+
*/
|
|
478
|
+
export interface BraceExp {
|
|
479
|
+
/**
|
|
480
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
481
|
+
*/
|
|
482
|
+
Type: 'BraceExp';
|
|
483
|
+
/**
|
|
484
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
485
|
+
*/
|
|
486
|
+
Elems: (Word | null)[] | null;
|
|
487
|
+
/**
|
|
488
|
+
* \{x..y[..incr]\} instead of \{x,y[,...]\}
|
|
489
|
+
*
|
|
490
|
+
* False is an explicit upstream value and is never omitted.
|
|
491
|
+
*/
|
|
492
|
+
Sequence: boolean;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* CStyleLoop represents the behavior of a for clause similar to the C
|
|
497
|
+
* language.
|
|
498
|
+
*
|
|
499
|
+
* This node will only appear with `LangBash`.
|
|
500
|
+
*
|
|
501
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
502
|
+
*
|
|
503
|
+
* @public
|
|
504
|
+
*/
|
|
505
|
+
export interface CStyleLoop {
|
|
506
|
+
/**
|
|
507
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
508
|
+
*/
|
|
509
|
+
Type: 'CStyleLoop';
|
|
510
|
+
/**
|
|
511
|
+
* Init, Cond, Post can each be nil, if the for loop construct omits it.
|
|
512
|
+
*
|
|
513
|
+
* Null preserves the upstream absence of this component.
|
|
514
|
+
*/
|
|
515
|
+
Cond: ArithmExpr | null;
|
|
516
|
+
/**
|
|
517
|
+
* Init, Cond, Post can each be nil, if the for loop construct omits it.
|
|
518
|
+
*
|
|
519
|
+
* Null preserves the upstream absence of this component.
|
|
520
|
+
*/
|
|
521
|
+
Init: ArithmExpr | null;
|
|
522
|
+
/**
|
|
523
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
524
|
+
*/
|
|
525
|
+
Lparen: SyntaxPos;
|
|
526
|
+
/**
|
|
527
|
+
* Init, Cond, Post can each be nil, if the for loop construct omits it.
|
|
528
|
+
*
|
|
529
|
+
* Null preserves the upstream absence of this component.
|
|
530
|
+
*/
|
|
531
|
+
Post: ArithmExpr | null;
|
|
532
|
+
/**
|
|
533
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
534
|
+
*/
|
|
535
|
+
Rparen: SyntaxPos;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* CallExpr represents a command execution or function call, otherwise known as
|
|
540
|
+
* a "simple command".
|
|
541
|
+
*
|
|
542
|
+
* If Args is empty, Assigns apply to the shell environment. Otherwise, they are
|
|
543
|
+
* variables that cannot be arrays and which only apply to the call.
|
|
544
|
+
*
|
|
545
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
546
|
+
*
|
|
547
|
+
* @public
|
|
548
|
+
*/
|
|
549
|
+
export interface CallExpr {
|
|
550
|
+
/**
|
|
551
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
552
|
+
*/
|
|
553
|
+
Type: 'CallExpr';
|
|
554
|
+
/**
|
|
555
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
556
|
+
*/
|
|
557
|
+
Args: (Word | null)[] | null;
|
|
558
|
+
/**
|
|
559
|
+
* a=x b=y args
|
|
560
|
+
*
|
|
561
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
562
|
+
*/
|
|
563
|
+
Assigns: (Assign | null)[] | null;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* CaseClause represents a case (switch) clause.
|
|
568
|
+
*
|
|
569
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
570
|
+
*
|
|
571
|
+
* @public
|
|
572
|
+
*/
|
|
573
|
+
export interface CaseClause {
|
|
574
|
+
/**
|
|
575
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
576
|
+
*/
|
|
577
|
+
Type: 'CaseClause';
|
|
578
|
+
/**
|
|
579
|
+
* deprecated mksh form with braces instead of in/esac
|
|
580
|
+
*
|
|
581
|
+
* False is an explicit upstream value and is never omitted.
|
|
582
|
+
*/
|
|
583
|
+
Braces: boolean;
|
|
584
|
+
/**
|
|
585
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
586
|
+
*/
|
|
587
|
+
Case: SyntaxPos;
|
|
588
|
+
/**
|
|
589
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
590
|
+
*/
|
|
591
|
+
Esac: SyntaxPos;
|
|
592
|
+
/**
|
|
593
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
594
|
+
*/
|
|
595
|
+
In: SyntaxPos;
|
|
596
|
+
/**
|
|
597
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
598
|
+
*/
|
|
599
|
+
Items: (CaseItem | null)[] | null;
|
|
600
|
+
/**
|
|
601
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
602
|
+
*/
|
|
603
|
+
Last: Comment[] | null;
|
|
604
|
+
/**
|
|
605
|
+
* Null preserves the upstream absence of this component.
|
|
606
|
+
*/
|
|
607
|
+
Word: Word | null;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* CaseItem represents a pattern list (case) within a `CaseClause`.
|
|
612
|
+
*
|
|
613
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
614
|
+
*
|
|
615
|
+
* @public
|
|
616
|
+
*/
|
|
617
|
+
export interface CaseItem {
|
|
618
|
+
/**
|
|
619
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
620
|
+
*/
|
|
621
|
+
Type: 'CaseItem';
|
|
622
|
+
/**
|
|
623
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
624
|
+
*/
|
|
625
|
+
Comments: Comment[] | null;
|
|
626
|
+
/**
|
|
627
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
628
|
+
*/
|
|
629
|
+
Last: Comment[] | null;
|
|
630
|
+
/**
|
|
631
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
632
|
+
*/
|
|
633
|
+
Op: CaseOperator;
|
|
634
|
+
/**
|
|
635
|
+
* unset if it was finished by "esac"
|
|
636
|
+
*
|
|
637
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
638
|
+
*/
|
|
639
|
+
OpPos: SyntaxPos;
|
|
640
|
+
/**
|
|
641
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
642
|
+
*/
|
|
643
|
+
Patterns: (Word | null)[] | null;
|
|
644
|
+
/**
|
|
645
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
646
|
+
*/
|
|
647
|
+
Stmts: (Stmt | null)[] | null;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* CmdSubst represents a command substitution.
|
|
652
|
+
*
|
|
653
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
654
|
+
*
|
|
655
|
+
* @public
|
|
656
|
+
*/
|
|
657
|
+
export interface CmdSubst {
|
|
658
|
+
/**
|
|
659
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
660
|
+
*/
|
|
661
|
+
Type: 'CmdSubst';
|
|
662
|
+
/**
|
|
663
|
+
* deprecated `foo`
|
|
664
|
+
*
|
|
665
|
+
* False is an explicit upstream value and is never omitted.
|
|
666
|
+
*/
|
|
667
|
+
Backquotes: boolean;
|
|
668
|
+
/**
|
|
669
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
670
|
+
*/
|
|
671
|
+
Last: Comment[] | null;
|
|
672
|
+
/**
|
|
673
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
674
|
+
*/
|
|
675
|
+
Left: SyntaxPos;
|
|
676
|
+
/**
|
|
677
|
+
* mksh's $\{|foo;\}
|
|
678
|
+
*
|
|
679
|
+
* False is an explicit upstream value and is never omitted.
|
|
680
|
+
*/
|
|
681
|
+
ReplyVar: boolean;
|
|
682
|
+
/**
|
|
683
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
684
|
+
*/
|
|
685
|
+
Right: SyntaxPos;
|
|
686
|
+
/**
|
|
687
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
688
|
+
*/
|
|
689
|
+
Stmts: (Stmt | null)[] | null;
|
|
690
|
+
/**
|
|
691
|
+
* mksh's $\{ foo;\}
|
|
692
|
+
*
|
|
693
|
+
* False is an explicit upstream value and is never omitted.
|
|
694
|
+
*/
|
|
695
|
+
TempFile: boolean;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Comment represents a single comment on a single line.
|
|
700
|
+
*
|
|
701
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
702
|
+
*
|
|
703
|
+
* @public
|
|
704
|
+
*/
|
|
705
|
+
export interface Comment {
|
|
706
|
+
/**
|
|
707
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
708
|
+
*/
|
|
709
|
+
Type: 'Comment';
|
|
710
|
+
/**
|
|
711
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
712
|
+
*/
|
|
713
|
+
Hash: SyntaxPos;
|
|
714
|
+
/**
|
|
715
|
+
* Upstream string bytes; non-UTF-8 values remain bytes rather than replacement text.
|
|
716
|
+
*/
|
|
717
|
+
Text: GoString;
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
/**
|
|
721
|
+
* CoprocClause represents a Bash coproc clause.
|
|
722
|
+
*
|
|
723
|
+
* This node will only appear with `LangBash`.
|
|
724
|
+
*
|
|
725
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
726
|
+
*
|
|
727
|
+
* @public
|
|
728
|
+
*/
|
|
729
|
+
export interface CoprocClause {
|
|
730
|
+
/**
|
|
731
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
732
|
+
*/
|
|
733
|
+
Type: 'CoprocClause';
|
|
734
|
+
/**
|
|
735
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
736
|
+
*/
|
|
737
|
+
Coproc: SyntaxPos;
|
|
738
|
+
/**
|
|
739
|
+
* Null preserves the upstream absence of this component.
|
|
740
|
+
*/
|
|
741
|
+
Name: Word | null;
|
|
742
|
+
/**
|
|
743
|
+
* Null preserves the upstream absence of this component.
|
|
744
|
+
*/
|
|
745
|
+
Stmt: Stmt | null;
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
/**
|
|
749
|
+
* DblQuoted represents a list of nodes within double quotes.
|
|
750
|
+
*
|
|
751
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
752
|
+
*
|
|
753
|
+
* @public
|
|
754
|
+
*/
|
|
755
|
+
export interface DblQuoted {
|
|
756
|
+
/**
|
|
757
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
758
|
+
*/
|
|
759
|
+
Type: 'DblQuoted';
|
|
760
|
+
/**
|
|
761
|
+
* $""
|
|
762
|
+
*
|
|
763
|
+
* False is an explicit upstream value and is never omitted.
|
|
764
|
+
*/
|
|
765
|
+
Dollar: boolean;
|
|
766
|
+
/**
|
|
767
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
768
|
+
*/
|
|
769
|
+
Left: SyntaxPos;
|
|
770
|
+
/**
|
|
771
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
772
|
+
*/
|
|
773
|
+
Parts: (WordPart | null)[] | null;
|
|
774
|
+
/**
|
|
775
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
776
|
+
*/
|
|
777
|
+
Right: SyntaxPos;
|
|
778
|
+
}
|
|
779
|
+
|
|
780
|
+
/**
|
|
781
|
+
* DeclClause represents a Bash declare clause.
|
|
782
|
+
*
|
|
783
|
+
* Args can contain a mix of regular and naked assignments. The naked
|
|
784
|
+
* assignments can represent either options or variable names.
|
|
785
|
+
*
|
|
786
|
+
* This node will only appear with `LangBash`.
|
|
787
|
+
*
|
|
788
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
789
|
+
*
|
|
790
|
+
* @public
|
|
791
|
+
*/
|
|
792
|
+
export interface DeclClause {
|
|
793
|
+
/**
|
|
794
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
795
|
+
*/
|
|
796
|
+
Type: 'DeclClause';
|
|
797
|
+
/**
|
|
798
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
799
|
+
*/
|
|
800
|
+
Args: (Assign | null)[] | null;
|
|
801
|
+
/**
|
|
802
|
+
* Variant is one of "declare", "local", "export", "readonly",
|
|
803
|
+
* "typeset", or "nameref".
|
|
804
|
+
*
|
|
805
|
+
* Null preserves the upstream absence of this component.
|
|
806
|
+
*/
|
|
807
|
+
Variant: Lit | null;
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
/**
|
|
811
|
+
* Expansion represents string manipulation in a `ParamExp` other than those
|
|
812
|
+
* covered by `Replace`.
|
|
813
|
+
*
|
|
814
|
+
* Auxiliary syntax data, not a syntax.Node; it has no independent source bounds.
|
|
815
|
+
*
|
|
816
|
+
* @public
|
|
817
|
+
*/
|
|
818
|
+
export interface Expansion {
|
|
819
|
+
/**
|
|
820
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
821
|
+
*/
|
|
822
|
+
Type: 'Expansion';
|
|
823
|
+
/**
|
|
824
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
825
|
+
*/
|
|
826
|
+
Op: ParExpOperator;
|
|
827
|
+
/**
|
|
828
|
+
* Null preserves the upstream absence of this component.
|
|
829
|
+
*/
|
|
830
|
+
Word: Word | null;
|
|
831
|
+
}
|
|
832
|
+
|
|
833
|
+
/**
|
|
834
|
+
* ExtGlob represents a Bash extended globbing expression. Note that these are
|
|
835
|
+
* parsed independently of whether or not `shopt -s extglob` has been used,
|
|
836
|
+
* as the parser runs statically and independently of any interpreter.
|
|
837
|
+
*
|
|
838
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
839
|
+
*
|
|
840
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
841
|
+
*
|
|
842
|
+
* @public
|
|
843
|
+
*/
|
|
844
|
+
export interface ExtGlob {
|
|
845
|
+
/**
|
|
846
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
847
|
+
*/
|
|
848
|
+
Type: 'ExtGlob';
|
|
849
|
+
/**
|
|
850
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
851
|
+
*/
|
|
852
|
+
Op: GlobOperator;
|
|
853
|
+
/**
|
|
854
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
855
|
+
*/
|
|
856
|
+
OpPos: SyntaxPos;
|
|
857
|
+
/**
|
|
858
|
+
* Null preserves the upstream absence of this component.
|
|
859
|
+
*/
|
|
860
|
+
Pattern: Lit | null;
|
|
861
|
+
}
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* File represents a shell source file.
|
|
865
|
+
*
|
|
866
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
867
|
+
*
|
|
868
|
+
* @public
|
|
869
|
+
*/
|
|
870
|
+
export interface File {
|
|
871
|
+
/**
|
|
872
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
873
|
+
*/
|
|
874
|
+
Type: 'File';
|
|
875
|
+
/**
|
|
876
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
877
|
+
*/
|
|
878
|
+
Last: Comment[] | null;
|
|
879
|
+
/**
|
|
880
|
+
* Upstream string bytes; non-UTF-8 values remain bytes rather than replacement text.
|
|
881
|
+
*/
|
|
882
|
+
Name: GoString;
|
|
883
|
+
/**
|
|
884
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
885
|
+
*/
|
|
886
|
+
Stmts: (Stmt | null)[] | null;
|
|
887
|
+
}
|
|
888
|
+
|
|
889
|
+
/**
|
|
890
|
+
* FlagsArithm represents zsh subscript flags attached to an arithmetic expression,
|
|
891
|
+
* such as $\{array[(flags)expr]\}.
|
|
892
|
+
*
|
|
893
|
+
* This node will only appear with `LangZsh`.
|
|
894
|
+
*
|
|
895
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
896
|
+
*
|
|
897
|
+
* @public
|
|
898
|
+
*/
|
|
899
|
+
export interface FlagsArithm {
|
|
900
|
+
/**
|
|
901
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
902
|
+
*/
|
|
903
|
+
Type: 'FlagsArithm';
|
|
904
|
+
/**
|
|
905
|
+
* Null preserves the upstream absence of this component.
|
|
906
|
+
*/
|
|
907
|
+
Flags: Lit | null;
|
|
908
|
+
/**
|
|
909
|
+
* Null preserves the upstream absence of this component.
|
|
910
|
+
*/
|
|
911
|
+
X: ArithmExpr | null;
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* ForClause represents a for or a select clause. The latter is only present in
|
|
916
|
+
* Bash.
|
|
917
|
+
*
|
|
918
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
919
|
+
*
|
|
920
|
+
* @public
|
|
921
|
+
*/
|
|
922
|
+
export interface ForClause {
|
|
923
|
+
/**
|
|
924
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
925
|
+
*/
|
|
926
|
+
Type: 'ForClause';
|
|
927
|
+
/**
|
|
928
|
+
* deprecated form with \{ \} instead of do/done
|
|
929
|
+
*
|
|
930
|
+
* False is an explicit upstream value and is never omitted.
|
|
931
|
+
*/
|
|
932
|
+
Braces: boolean;
|
|
933
|
+
/**
|
|
934
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
935
|
+
*/
|
|
936
|
+
Do: (Stmt | null)[] | null;
|
|
937
|
+
/**
|
|
938
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
939
|
+
*/
|
|
940
|
+
DoLast: Comment[] | null;
|
|
941
|
+
/**
|
|
942
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
943
|
+
*/
|
|
944
|
+
DoPos: SyntaxPos;
|
|
945
|
+
/**
|
|
946
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
947
|
+
*/
|
|
948
|
+
DonePos: SyntaxPos;
|
|
949
|
+
/**
|
|
950
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
951
|
+
*/
|
|
952
|
+
ForPos: SyntaxPos;
|
|
953
|
+
/**
|
|
954
|
+
* Null preserves the upstream absence of this component.
|
|
955
|
+
*/
|
|
956
|
+
Loop: Loop | null;
|
|
957
|
+
/**
|
|
958
|
+
* False is an explicit upstream value and is never omitted.
|
|
959
|
+
*/
|
|
960
|
+
Select: boolean;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
/**
|
|
964
|
+
* FuncDecl represents the declaration of a function.
|
|
965
|
+
*
|
|
966
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
967
|
+
*
|
|
968
|
+
* @public
|
|
969
|
+
*/
|
|
970
|
+
export interface FuncDecl {
|
|
971
|
+
/**
|
|
972
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
973
|
+
*/
|
|
974
|
+
Type: 'FuncDecl';
|
|
975
|
+
/**
|
|
976
|
+
* Null preserves the upstream absence of this component.
|
|
977
|
+
*/
|
|
978
|
+
Body: Stmt | null;
|
|
979
|
+
/**
|
|
980
|
+
* Only one of these is set at a time.
|
|
981
|
+
* Neither is set when declaring an anonymous func with `LangZsh`.
|
|
982
|
+
*
|
|
983
|
+
* Null preserves the upstream absence of this component.
|
|
984
|
+
*/
|
|
985
|
+
Name: Lit | null;
|
|
986
|
+
/**
|
|
987
|
+
* When declaring many func names with `LangZsh`.
|
|
988
|
+
*
|
|
989
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
990
|
+
*/
|
|
991
|
+
Names: (Lit | null)[] | null;
|
|
992
|
+
/**
|
|
993
|
+
* with () parentheses, can only be false when RsrvWord==true
|
|
994
|
+
*
|
|
995
|
+
* False is an explicit upstream value and is never omitted.
|
|
996
|
+
*/
|
|
997
|
+
Parens: boolean;
|
|
998
|
+
/**
|
|
999
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1000
|
+
*/
|
|
1001
|
+
Position: SyntaxPos;
|
|
1002
|
+
/**
|
|
1003
|
+
* non-posix "function f" style
|
|
1004
|
+
*
|
|
1005
|
+
* False is an explicit upstream value and is never omitted.
|
|
1006
|
+
*/
|
|
1007
|
+
RsrvWord: boolean;
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
/**
|
|
1011
|
+
* IfClause represents an if statement.
|
|
1012
|
+
*
|
|
1013
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1014
|
+
*
|
|
1015
|
+
* @public
|
|
1016
|
+
*/
|
|
1017
|
+
export interface IfClause {
|
|
1018
|
+
/**
|
|
1019
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1020
|
+
*/
|
|
1021
|
+
Type: 'IfClause';
|
|
1022
|
+
/**
|
|
1023
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1024
|
+
*/
|
|
1025
|
+
Cond: (Stmt | null)[] | null;
|
|
1026
|
+
/**
|
|
1027
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1028
|
+
*/
|
|
1029
|
+
CondLast: Comment[] | null;
|
|
1030
|
+
/**
|
|
1031
|
+
* if non-nil, an "elif" or an "else"
|
|
1032
|
+
*
|
|
1033
|
+
* Null preserves the upstream absence of this component.
|
|
1034
|
+
*/
|
|
1035
|
+
Else: IfClause | null;
|
|
1036
|
+
/**
|
|
1037
|
+
* position of "fi", shared with .Else if non-nil
|
|
1038
|
+
*
|
|
1039
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1040
|
+
*/
|
|
1041
|
+
FiPos: SyntaxPos;
|
|
1042
|
+
/**
|
|
1043
|
+
* comments on the first "elif", "else", or "fi"
|
|
1044
|
+
*
|
|
1045
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1046
|
+
*/
|
|
1047
|
+
Last: Comment[] | null;
|
|
1048
|
+
/**
|
|
1049
|
+
* position of the starting "if", "elif", or "else" token
|
|
1050
|
+
*
|
|
1051
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1052
|
+
*/
|
|
1053
|
+
Position: SyntaxPos;
|
|
1054
|
+
/**
|
|
1055
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1056
|
+
*/
|
|
1057
|
+
Then: (Stmt | null)[] | null;
|
|
1058
|
+
/**
|
|
1059
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1060
|
+
*/
|
|
1061
|
+
ThenLast: Comment[] | null;
|
|
1062
|
+
/**
|
|
1063
|
+
* position of "then", empty if this is an "else"
|
|
1064
|
+
*
|
|
1065
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1066
|
+
*/
|
|
1067
|
+
ThenPos: SyntaxPos;
|
|
1068
|
+
}
|
|
1069
|
+
|
|
1070
|
+
/**
|
|
1071
|
+
* LetClause represents a Bash let clause.
|
|
1072
|
+
*
|
|
1073
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
1074
|
+
*
|
|
1075
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1076
|
+
*
|
|
1077
|
+
* @public
|
|
1078
|
+
*/
|
|
1079
|
+
export interface LetClause {
|
|
1080
|
+
/**
|
|
1081
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1082
|
+
*/
|
|
1083
|
+
Type: 'LetClause';
|
|
1084
|
+
/**
|
|
1085
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1086
|
+
*/
|
|
1087
|
+
Exprs: (ArithmExpr | null)[] | null;
|
|
1088
|
+
/**
|
|
1089
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1090
|
+
*/
|
|
1091
|
+
Let: SyntaxPos;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* Lit represents a string literal.
|
|
1096
|
+
*
|
|
1097
|
+
* Note that a parsed string literal may not appear as-is in the original source
|
|
1098
|
+
* code, as it is possible to split literals by escaping newlines. The splitting
|
|
1099
|
+
* is lost, but the end position is not.
|
|
1100
|
+
*
|
|
1101
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1102
|
+
*
|
|
1103
|
+
* @public
|
|
1104
|
+
*/
|
|
1105
|
+
export interface Lit {
|
|
1106
|
+
/**
|
|
1107
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1108
|
+
*/
|
|
1109
|
+
Type: 'Lit';
|
|
1110
|
+
/**
|
|
1111
|
+
* Upstream string bytes; non-UTF-8 values remain bytes rather than replacement text.
|
|
1112
|
+
*/
|
|
1113
|
+
Value: GoString;
|
|
1114
|
+
/**
|
|
1115
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1116
|
+
*/
|
|
1117
|
+
ValueEnd: SyntaxPos;
|
|
1118
|
+
/**
|
|
1119
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1120
|
+
*/
|
|
1121
|
+
ValuePos: SyntaxPos;
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
/**
|
|
1125
|
+
* ParamExp represents a parameter expansion.
|
|
1126
|
+
*
|
|
1127
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1128
|
+
*
|
|
1129
|
+
* @public
|
|
1130
|
+
*/
|
|
1131
|
+
export interface ParamExp {
|
|
1132
|
+
/**
|
|
1133
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1134
|
+
*/
|
|
1135
|
+
Type: 'ParamExp';
|
|
1136
|
+
/**
|
|
1137
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1138
|
+
*/
|
|
1139
|
+
Dollar: SyntaxPos;
|
|
1140
|
+
/**
|
|
1141
|
+
* Only one of these is set at a time.
|
|
1142
|
+
* given how we've grown the number of booleans
|
|
1143
|
+
* $\{!a\}
|
|
1144
|
+
*
|
|
1145
|
+
* False is an explicit upstream value and is never omitted.
|
|
1146
|
+
*/
|
|
1147
|
+
Excl: boolean;
|
|
1148
|
+
/**
|
|
1149
|
+
* $\{a:-b\}, $\{a#b\}, etc
|
|
1150
|
+
*
|
|
1151
|
+
* Null preserves the upstream absence of this component.
|
|
1152
|
+
*/
|
|
1153
|
+
Exp: Expansion | null;
|
|
1154
|
+
/**
|
|
1155
|
+
* $\{(flags)a\} with `LangZsh`
|
|
1156
|
+
*
|
|
1157
|
+
* Null preserves the upstream absence of this component.
|
|
1158
|
+
*/
|
|
1159
|
+
Flags: Lit | null;
|
|
1160
|
+
/**
|
|
1161
|
+
* $\{a`i`\}, $\{a["k"]\}, or a $\{a[i,j]\} slice with `LangZsh`
|
|
1162
|
+
*
|
|
1163
|
+
* Null preserves the upstream absence of this component.
|
|
1164
|
+
*/
|
|
1165
|
+
Index: ArithmExpr | null;
|
|
1166
|
+
/**
|
|
1167
|
+
* $\{+a\} with `LangZsh`
|
|
1168
|
+
*
|
|
1169
|
+
* False is an explicit upstream value and is never omitted.
|
|
1170
|
+
*/
|
|
1171
|
+
IsSet: boolean;
|
|
1172
|
+
/**
|
|
1173
|
+
* $\{#a\}
|
|
1174
|
+
*
|
|
1175
|
+
* False is an explicit upstream value and is never omitted.
|
|
1176
|
+
*/
|
|
1177
|
+
Length: boolean;
|
|
1178
|
+
/**
|
|
1179
|
+
* Only one of these is set at a time.
|
|
1180
|
+
* because it should be impossible for multiple to be set at once,
|
|
1181
|
+
* and a flat structure like this takes up more space.
|
|
1182
|
+
* $\{a:h2\} with `LangZsh`
|
|
1183
|
+
*
|
|
1184
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1185
|
+
*/
|
|
1186
|
+
Modifiers: (Lit | null)[] | null;
|
|
1187
|
+
/**
|
|
1188
|
+
* $\{!prefix*\} or $\{!prefix\@\}
|
|
1189
|
+
*
|
|
1190
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
1191
|
+
*/
|
|
1192
|
+
Names: ParNamesOperator;
|
|
1193
|
+
/**
|
|
1194
|
+
* A nested parameter expression in the form of `ParamExp` or `CmdSubst`,
|
|
1195
|
+
* or either of those in a `DblQuoted`. Only possible with `LangZsh`.
|
|
1196
|
+
*
|
|
1197
|
+
* Null preserves the upstream absence of this component.
|
|
1198
|
+
*/
|
|
1199
|
+
NestedParam: WordPart | null;
|
|
1200
|
+
/**
|
|
1201
|
+
* Only one of these is set at a time,
|
|
1202
|
+
* or neither with `LangZsh` when the name is omitted.
|
|
1203
|
+
* even if that would be mildly annoying to non-Zsh users.
|
|
1204
|
+
*
|
|
1205
|
+
* Null preserves the upstream absence of this component.
|
|
1206
|
+
*/
|
|
1207
|
+
Param: Lit | null;
|
|
1208
|
+
/**
|
|
1209
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1210
|
+
*/
|
|
1211
|
+
Rbrace: SyntaxPos;
|
|
1212
|
+
/**
|
|
1213
|
+
* $\{a/x/y\}
|
|
1214
|
+
*
|
|
1215
|
+
* Null preserves the upstream absence of this component.
|
|
1216
|
+
*/
|
|
1217
|
+
Repl: Replace | null;
|
|
1218
|
+
/**
|
|
1219
|
+
* $a instead of $\{a\}
|
|
1220
|
+
*
|
|
1221
|
+
* False is an explicit upstream value and is never omitted.
|
|
1222
|
+
*/
|
|
1223
|
+
Short: boolean;
|
|
1224
|
+
/**
|
|
1225
|
+
* $\{a:x:y\}
|
|
1226
|
+
*
|
|
1227
|
+
* Null preserves the upstream absence of this component.
|
|
1228
|
+
*/
|
|
1229
|
+
Slice: Slice | null;
|
|
1230
|
+
/**
|
|
1231
|
+
* mksh's $\{%a\}
|
|
1232
|
+
*
|
|
1233
|
+
* False is an explicit upstream value and is never omitted.
|
|
1234
|
+
*/
|
|
1235
|
+
Width: boolean;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
/**
|
|
1239
|
+
* ParenArithm represents an arithmetic expression within parentheses.
|
|
1240
|
+
*
|
|
1241
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1242
|
+
*
|
|
1243
|
+
* @public
|
|
1244
|
+
*/
|
|
1245
|
+
export interface ParenArithm {
|
|
1246
|
+
/**
|
|
1247
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1248
|
+
*/
|
|
1249
|
+
Type: 'ParenArithm';
|
|
1250
|
+
/**
|
|
1251
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1252
|
+
*/
|
|
1253
|
+
Lparen: SyntaxPos;
|
|
1254
|
+
/**
|
|
1255
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1256
|
+
*/
|
|
1257
|
+
Rparen: SyntaxPos;
|
|
1258
|
+
/**
|
|
1259
|
+
* Null preserves the upstream absence of this component.
|
|
1260
|
+
*/
|
|
1261
|
+
X: ArithmExpr | null;
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* ParenTest represents a test expression within parentheses.
|
|
1266
|
+
*
|
|
1267
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1268
|
+
*
|
|
1269
|
+
* @public
|
|
1270
|
+
*/
|
|
1271
|
+
export interface ParenTest {
|
|
1272
|
+
/**
|
|
1273
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1274
|
+
*/
|
|
1275
|
+
Type: 'ParenTest';
|
|
1276
|
+
/**
|
|
1277
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1278
|
+
*/
|
|
1279
|
+
Lparen: SyntaxPos;
|
|
1280
|
+
/**
|
|
1281
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1282
|
+
*/
|
|
1283
|
+
Rparen: SyntaxPos;
|
|
1284
|
+
/**
|
|
1285
|
+
* Null preserves the upstream absence of this component.
|
|
1286
|
+
*/
|
|
1287
|
+
X: TestExpr | null;
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
/**
|
|
1291
|
+
* ProcSubst represents a Bash process substitution.
|
|
1292
|
+
*
|
|
1293
|
+
* This node will only appear with `LangBash`.
|
|
1294
|
+
*
|
|
1295
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1296
|
+
*
|
|
1297
|
+
* @public
|
|
1298
|
+
*/
|
|
1299
|
+
export interface ProcSubst {
|
|
1300
|
+
/**
|
|
1301
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1302
|
+
*/
|
|
1303
|
+
Type: 'ProcSubst';
|
|
1304
|
+
/**
|
|
1305
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1306
|
+
*/
|
|
1307
|
+
Last: Comment[] | null;
|
|
1308
|
+
/**
|
|
1309
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
1310
|
+
*/
|
|
1311
|
+
Op: ProcOperator;
|
|
1312
|
+
/**
|
|
1313
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1314
|
+
*/
|
|
1315
|
+
OpPos: SyntaxPos;
|
|
1316
|
+
/**
|
|
1317
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1318
|
+
*/
|
|
1319
|
+
Rparen: SyntaxPos;
|
|
1320
|
+
/**
|
|
1321
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1322
|
+
*/
|
|
1323
|
+
Stmts: (Stmt | null)[] | null;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
/**
|
|
1327
|
+
* Redirect represents an input/output redirection.
|
|
1328
|
+
*
|
|
1329
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1330
|
+
*
|
|
1331
|
+
* @public
|
|
1332
|
+
*/
|
|
1333
|
+
export interface Redirect {
|
|
1334
|
+
/**
|
|
1335
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1336
|
+
*/
|
|
1337
|
+
Type: 'Redirect';
|
|
1338
|
+
/**
|
|
1339
|
+
* here-document body
|
|
1340
|
+
*
|
|
1341
|
+
* Null preserves the upstream absence of this component.
|
|
1342
|
+
*/
|
|
1343
|
+
Hdoc: Word | null;
|
|
1344
|
+
/**
|
|
1345
|
+
* fd\>, or \{varname\}\> in Bash
|
|
1346
|
+
*
|
|
1347
|
+
* Null preserves the upstream absence of this component.
|
|
1348
|
+
*/
|
|
1349
|
+
N: Lit | null;
|
|
1350
|
+
/**
|
|
1351
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
1352
|
+
*/
|
|
1353
|
+
Op: RedirOperator;
|
|
1354
|
+
/**
|
|
1355
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1356
|
+
*/
|
|
1357
|
+
OpPos: SyntaxPos;
|
|
1358
|
+
/**
|
|
1359
|
+
* \>word
|
|
1360
|
+
*
|
|
1361
|
+
* Null preserves the upstream absence of this component.
|
|
1362
|
+
*/
|
|
1363
|
+
Word: Word | null;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* Replace represents a search and replace expression inside a `ParamExp`.
|
|
1368
|
+
*
|
|
1369
|
+
* Auxiliary syntax data, not a syntax.Node; it has no independent source bounds.
|
|
1370
|
+
*
|
|
1371
|
+
* @public
|
|
1372
|
+
*/
|
|
1373
|
+
export interface Replace {
|
|
1374
|
+
/**
|
|
1375
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1376
|
+
*/
|
|
1377
|
+
Type: 'Replace';
|
|
1378
|
+
/**
|
|
1379
|
+
* False is an explicit upstream value and is never omitted.
|
|
1380
|
+
*/
|
|
1381
|
+
All: boolean;
|
|
1382
|
+
/**
|
|
1383
|
+
* Null preserves the upstream absence of this component.
|
|
1384
|
+
*/
|
|
1385
|
+
Orig: Word | null;
|
|
1386
|
+
/**
|
|
1387
|
+
* Null preserves the upstream absence of this component.
|
|
1388
|
+
*/
|
|
1389
|
+
With: Word | null;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
/**
|
|
1393
|
+
* SglQuoted represents a string within single quotes.
|
|
1394
|
+
*
|
|
1395
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1396
|
+
*
|
|
1397
|
+
* @public
|
|
1398
|
+
*/
|
|
1399
|
+
export interface SglQuoted {
|
|
1400
|
+
/**
|
|
1401
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1402
|
+
*/
|
|
1403
|
+
Type: 'SglQuoted';
|
|
1404
|
+
/**
|
|
1405
|
+
* $''
|
|
1406
|
+
*
|
|
1407
|
+
* False is an explicit upstream value and is never omitted.
|
|
1408
|
+
*/
|
|
1409
|
+
Dollar: boolean;
|
|
1410
|
+
/**
|
|
1411
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1412
|
+
*/
|
|
1413
|
+
Left: SyntaxPos;
|
|
1414
|
+
/**
|
|
1415
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1416
|
+
*/
|
|
1417
|
+
Right: SyntaxPos;
|
|
1418
|
+
/**
|
|
1419
|
+
* Upstream string bytes; non-UTF-8 values remain bytes rather than replacement text.
|
|
1420
|
+
*/
|
|
1421
|
+
Value: GoString;
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
/**
|
|
1425
|
+
* Slice represents a character slicing expression inside a `ParamExp`.
|
|
1426
|
+
*
|
|
1427
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
1428
|
+
* `LangZsh` uses a `BinaryArithm` with `Comma` in `ParamExp.Index` instead.
|
|
1429
|
+
*
|
|
1430
|
+
* Auxiliary syntax data, not a syntax.Node; it has no independent source bounds.
|
|
1431
|
+
*
|
|
1432
|
+
* @public
|
|
1433
|
+
*/
|
|
1434
|
+
export interface Slice {
|
|
1435
|
+
/**
|
|
1436
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1437
|
+
*/
|
|
1438
|
+
Type: 'Slice';
|
|
1439
|
+
/**
|
|
1440
|
+
* Null preserves the upstream absence of this component.
|
|
1441
|
+
*/
|
|
1442
|
+
Length: ArithmExpr | null;
|
|
1443
|
+
/**
|
|
1444
|
+
* Null preserves the upstream absence of this component.
|
|
1445
|
+
*/
|
|
1446
|
+
Offset: ArithmExpr | null;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
/**
|
|
1450
|
+
* Stmt represents a statement, also known as a "complete command". It is
|
|
1451
|
+
* compromised of a command and other components that may come before or after
|
|
1452
|
+
* it.
|
|
1453
|
+
*
|
|
1454
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1455
|
+
*
|
|
1456
|
+
* @public
|
|
1457
|
+
*/
|
|
1458
|
+
export interface Stmt {
|
|
1459
|
+
/**
|
|
1460
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1461
|
+
*/
|
|
1462
|
+
Type: 'Stmt';
|
|
1463
|
+
/**
|
|
1464
|
+
* stmt &
|
|
1465
|
+
*
|
|
1466
|
+
* False is an explicit upstream value and is never omitted.
|
|
1467
|
+
*/
|
|
1468
|
+
Background: boolean;
|
|
1469
|
+
/**
|
|
1470
|
+
* Null preserves the upstream absence of this component.
|
|
1471
|
+
*/
|
|
1472
|
+
Cmd: Command | null;
|
|
1473
|
+
/**
|
|
1474
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1475
|
+
*/
|
|
1476
|
+
Comments: Comment[] | null;
|
|
1477
|
+
/**
|
|
1478
|
+
* mksh's |&
|
|
1479
|
+
*
|
|
1480
|
+
* False is an explicit upstream value and is never omitted.
|
|
1481
|
+
*/
|
|
1482
|
+
Coprocess: boolean;
|
|
1483
|
+
/**
|
|
1484
|
+
* zsh's &| or &!
|
|
1485
|
+
*
|
|
1486
|
+
* False is an explicit upstream value and is never omitted.
|
|
1487
|
+
*/
|
|
1488
|
+
Disown: boolean;
|
|
1489
|
+
/**
|
|
1490
|
+
* ! stmt
|
|
1491
|
+
*
|
|
1492
|
+
* False is an explicit upstream value and is never omitted.
|
|
1493
|
+
*/
|
|
1494
|
+
Negated: boolean;
|
|
1495
|
+
/**
|
|
1496
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1497
|
+
*/
|
|
1498
|
+
Position: SyntaxPos;
|
|
1499
|
+
/**
|
|
1500
|
+
* stmt \>a \<b
|
|
1501
|
+
*
|
|
1502
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1503
|
+
*/
|
|
1504
|
+
Redirs: (Redirect | null)[] | null;
|
|
1505
|
+
/**
|
|
1506
|
+
* position of ';', '&', or '|&', if any
|
|
1507
|
+
*
|
|
1508
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1509
|
+
*/
|
|
1510
|
+
Semicolon: SyntaxPos;
|
|
1511
|
+
}
|
|
1512
|
+
|
|
1513
|
+
/**
|
|
1514
|
+
* Subshell represents a series of commands that should be executed in a nested
|
|
1515
|
+
* shell environment.
|
|
1516
|
+
*
|
|
1517
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1518
|
+
*
|
|
1519
|
+
* @public
|
|
1520
|
+
*/
|
|
1521
|
+
export interface Subshell {
|
|
1522
|
+
/**
|
|
1523
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1524
|
+
*/
|
|
1525
|
+
Type: 'Subshell';
|
|
1526
|
+
/**
|
|
1527
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1528
|
+
*/
|
|
1529
|
+
Last: Comment[] | null;
|
|
1530
|
+
/**
|
|
1531
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1532
|
+
*/
|
|
1533
|
+
Lparen: SyntaxPos;
|
|
1534
|
+
/**
|
|
1535
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1536
|
+
*/
|
|
1537
|
+
Rparen: SyntaxPos;
|
|
1538
|
+
/**
|
|
1539
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1540
|
+
*/
|
|
1541
|
+
Stmts: (Stmt | null)[] | null;
|
|
1542
|
+
}
|
|
1543
|
+
|
|
1544
|
+
/**
|
|
1545
|
+
* TestClause represents a Bash extended test clause.
|
|
1546
|
+
*
|
|
1547
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
1548
|
+
*
|
|
1549
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1550
|
+
*
|
|
1551
|
+
* @public
|
|
1552
|
+
*/
|
|
1553
|
+
export interface TestClause {
|
|
1554
|
+
/**
|
|
1555
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1556
|
+
*/
|
|
1557
|
+
Type: 'TestClause';
|
|
1558
|
+
/**
|
|
1559
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1560
|
+
*/
|
|
1561
|
+
Left: SyntaxPos;
|
|
1562
|
+
/**
|
|
1563
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1564
|
+
*/
|
|
1565
|
+
Right: SyntaxPos;
|
|
1566
|
+
/**
|
|
1567
|
+
* Null preserves the upstream absence of this component.
|
|
1568
|
+
*/
|
|
1569
|
+
X: TestExpr | null;
|
|
1570
|
+
}
|
|
1571
|
+
|
|
1572
|
+
/**
|
|
1573
|
+
* TestDecl represents the declaration of a Bats test function.
|
|
1574
|
+
*
|
|
1575
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1576
|
+
*
|
|
1577
|
+
* @public
|
|
1578
|
+
*/
|
|
1579
|
+
export interface TestDecl {
|
|
1580
|
+
/**
|
|
1581
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1582
|
+
*/
|
|
1583
|
+
Type: 'TestDecl';
|
|
1584
|
+
/**
|
|
1585
|
+
* Null preserves the upstream absence of this component.
|
|
1586
|
+
*/
|
|
1587
|
+
Body: Stmt | null;
|
|
1588
|
+
/**
|
|
1589
|
+
* Null preserves the upstream absence of this component.
|
|
1590
|
+
*/
|
|
1591
|
+
Description: Word | null;
|
|
1592
|
+
/**
|
|
1593
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1594
|
+
*/
|
|
1595
|
+
Position: SyntaxPos;
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
/**
|
|
1599
|
+
* TimeClause represents a Bash time clause. PosixFormat corresponds to the -p
|
|
1600
|
+
* flag.
|
|
1601
|
+
*
|
|
1602
|
+
* This node will only appear with `LangBash` and `LangMirBSDKorn`.
|
|
1603
|
+
*
|
|
1604
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1605
|
+
*
|
|
1606
|
+
* @public
|
|
1607
|
+
*/
|
|
1608
|
+
export interface TimeClause {
|
|
1609
|
+
/**
|
|
1610
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1611
|
+
*/
|
|
1612
|
+
Type: 'TimeClause';
|
|
1613
|
+
/**
|
|
1614
|
+
* False is an explicit upstream value and is never omitted.
|
|
1615
|
+
*/
|
|
1616
|
+
PosixFormat: boolean;
|
|
1617
|
+
/**
|
|
1618
|
+
* Null preserves the upstream absence of this component.
|
|
1619
|
+
*/
|
|
1620
|
+
Stmt: Stmt | null;
|
|
1621
|
+
/**
|
|
1622
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1623
|
+
*/
|
|
1624
|
+
Time: SyntaxPos;
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
/**
|
|
1628
|
+
* UnaryArithm represents an unary arithmetic expression. The unary operator
|
|
1629
|
+
* may come before or after the sub-expression.
|
|
1630
|
+
*
|
|
1631
|
+
* If Op is `Inc` or `Dec`, X will be a word with a single `Lit` whose value is a
|
|
1632
|
+
* valid name.
|
|
1633
|
+
*
|
|
1634
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1635
|
+
*
|
|
1636
|
+
* @public
|
|
1637
|
+
*/
|
|
1638
|
+
export interface UnaryArithm {
|
|
1639
|
+
/**
|
|
1640
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1641
|
+
*/
|
|
1642
|
+
Type: 'UnaryArithm';
|
|
1643
|
+
/**
|
|
1644
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
1645
|
+
*/
|
|
1646
|
+
Op: UnAritOperator;
|
|
1647
|
+
/**
|
|
1648
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1649
|
+
*/
|
|
1650
|
+
OpPos: SyntaxPos;
|
|
1651
|
+
/**
|
|
1652
|
+
* False is an explicit upstream value and is never omitted.
|
|
1653
|
+
*/
|
|
1654
|
+
Post: boolean;
|
|
1655
|
+
/**
|
|
1656
|
+
* Null preserves the upstream absence of this component.
|
|
1657
|
+
*/
|
|
1658
|
+
X: ArithmExpr | null;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* UnaryTest represents a unary test expression. The unary operator may come
|
|
1663
|
+
* before or after the sub-expression.
|
|
1664
|
+
*
|
|
1665
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1666
|
+
*
|
|
1667
|
+
* @public
|
|
1668
|
+
*/
|
|
1669
|
+
export interface UnaryTest {
|
|
1670
|
+
/**
|
|
1671
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1672
|
+
*/
|
|
1673
|
+
Type: 'UnaryTest';
|
|
1674
|
+
/**
|
|
1675
|
+
* Upstream operator value, preserving named tokens, zero, and explicitly represented raw uint32 values.
|
|
1676
|
+
*/
|
|
1677
|
+
Op: UnTestOperator;
|
|
1678
|
+
/**
|
|
1679
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1680
|
+
*/
|
|
1681
|
+
OpPos: SyntaxPos;
|
|
1682
|
+
/**
|
|
1683
|
+
* Null preserves the upstream absence of this component.
|
|
1684
|
+
*/
|
|
1685
|
+
X: TestExpr | null;
|
|
1686
|
+
}
|
|
1687
|
+
|
|
1688
|
+
/**
|
|
1689
|
+
* WhileClause represents a while or an until clause.
|
|
1690
|
+
*
|
|
1691
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1692
|
+
*
|
|
1693
|
+
* @public
|
|
1694
|
+
*/
|
|
1695
|
+
export interface WhileClause {
|
|
1696
|
+
/**
|
|
1697
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1698
|
+
*/
|
|
1699
|
+
Type: 'WhileClause';
|
|
1700
|
+
/**
|
|
1701
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1702
|
+
*/
|
|
1703
|
+
Cond: (Stmt | null)[] | null;
|
|
1704
|
+
/**
|
|
1705
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1706
|
+
*/
|
|
1707
|
+
CondLast: Comment[] | null;
|
|
1708
|
+
/**
|
|
1709
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1710
|
+
*/
|
|
1711
|
+
Do: (Stmt | null)[] | null;
|
|
1712
|
+
/**
|
|
1713
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array.
|
|
1714
|
+
*/
|
|
1715
|
+
DoLast: Comment[] | null;
|
|
1716
|
+
/**
|
|
1717
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1718
|
+
*/
|
|
1719
|
+
DoPos: SyntaxPos;
|
|
1720
|
+
/**
|
|
1721
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1722
|
+
*/
|
|
1723
|
+
DonePos: SyntaxPos;
|
|
1724
|
+
/**
|
|
1725
|
+
* False is an explicit upstream value and is never omitted.
|
|
1726
|
+
*/
|
|
1727
|
+
Until: boolean;
|
|
1728
|
+
/**
|
|
1729
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1730
|
+
*/
|
|
1731
|
+
WhilePos: SyntaxPos;
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
/**
|
|
1735
|
+
* Word represents a shell word, containing one or more word parts contiguous to
|
|
1736
|
+
* each other. The word is delimited by word boundaries, such as spaces,
|
|
1737
|
+
* newlines, semicolons, or parentheses.
|
|
1738
|
+
*
|
|
1739
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1740
|
+
*
|
|
1741
|
+
* @public
|
|
1742
|
+
*/
|
|
1743
|
+
export interface Word {
|
|
1744
|
+
/**
|
|
1745
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1746
|
+
*/
|
|
1747
|
+
Type: 'Word';
|
|
1748
|
+
/**
|
|
1749
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1750
|
+
*/
|
|
1751
|
+
Parts: (WordPart | null)[] | null;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* WordIter represents the iteration of a variable over a series of words in a
|
|
1756
|
+
* for clause. If InPos is an invalid position, the "in" token was missing, so
|
|
1757
|
+
* the iteration is over the shell's positional parameters.
|
|
1758
|
+
*
|
|
1759
|
+
* A syntax node with mutable upstream fields. Its source bounds are derived from the current fields and children.
|
|
1760
|
+
*
|
|
1761
|
+
* @public
|
|
1762
|
+
*/
|
|
1763
|
+
export interface WordIter {
|
|
1764
|
+
/**
|
|
1765
|
+
* Identifies the upstream concrete record when carried through an interface union.
|
|
1766
|
+
*/
|
|
1767
|
+
Type: 'WordIter';
|
|
1768
|
+
/**
|
|
1769
|
+
* position of "in"
|
|
1770
|
+
*
|
|
1771
|
+
* Recorded source position; invalid and recovered states remain distinct.
|
|
1772
|
+
*/
|
|
1773
|
+
InPos: SyntaxPos;
|
|
1774
|
+
/**
|
|
1775
|
+
* Ordered upstream entries. Null preserves a nil slice and differs from an empty array. Null entries preserve nil elements.
|
|
1776
|
+
*/
|
|
1777
|
+
Items: (Word | null)[] | null;
|
|
1778
|
+
/**
|
|
1779
|
+
* Null preserves the upstream absence of this component.
|
|
1780
|
+
*/
|
|
1781
|
+
Name: Lit | null;
|
|
1782
|
+
}
|
|
1783
|
+
|
|
1784
|
+
/**
|
|
1785
|
+
* 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.
|
|
1786
|
+
*
|
|
1787
|
+
* @public
|
|
1788
|
+
*/
|
|
1789
|
+
export type ArithmExpr =
|
|
1790
|
+
| BinaryArithm
|
|
1791
|
+
| FlagsArithm
|
|
1792
|
+
| ParenArithm
|
|
1793
|
+
| UnaryArithm
|
|
1794
|
+
| Word
|
|
1795
|
+
| TypedNil<'BinaryArithm' | 'FlagsArithm' | 'ParenArithm' | 'UnaryArithm' | 'Word'>;
|
|
1796
|
+
|
|
1797
|
+
/**
|
|
1798
|
+
* 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.
|
|
1799
|
+
*
|
|
1800
|
+
* @public
|
|
1801
|
+
*/
|
|
1802
|
+
export type Command =
|
|
1803
|
+
| ArithmCmd
|
|
1804
|
+
| BinaryCmd
|
|
1805
|
+
| Block
|
|
1806
|
+
| CallExpr
|
|
1807
|
+
| CaseClause
|
|
1808
|
+
| CoprocClause
|
|
1809
|
+
| DeclClause
|
|
1810
|
+
| ForClause
|
|
1811
|
+
| FuncDecl
|
|
1812
|
+
| IfClause
|
|
1813
|
+
| LetClause
|
|
1814
|
+
| Subshell
|
|
1815
|
+
| TestClause
|
|
1816
|
+
| TestDecl
|
|
1817
|
+
| TimeClause
|
|
1818
|
+
| WhileClause
|
|
1819
|
+
| TypedNil<
|
|
1820
|
+
| 'ArithmCmd'
|
|
1821
|
+
| 'BinaryCmd'
|
|
1822
|
+
| 'Block'
|
|
1823
|
+
| 'CallExpr'
|
|
1824
|
+
| 'CaseClause'
|
|
1825
|
+
| 'CoprocClause'
|
|
1826
|
+
| 'DeclClause'
|
|
1827
|
+
| 'ForClause'
|
|
1828
|
+
| 'FuncDecl'
|
|
1829
|
+
| 'IfClause'
|
|
1830
|
+
| 'LetClause'
|
|
1831
|
+
| 'Subshell'
|
|
1832
|
+
| 'TestClause'
|
|
1833
|
+
| 'TestDecl'
|
|
1834
|
+
| 'TimeClause'
|
|
1835
|
+
| 'WhileClause'
|
|
1836
|
+
>;
|
|
1837
|
+
|
|
1838
|
+
/**
|
|
1839
|
+
* 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.
|
|
1840
|
+
*
|
|
1841
|
+
* @public
|
|
1842
|
+
*/
|
|
1843
|
+
export type Loop = CStyleLoop | WordIter | TypedNil<'CStyleLoop' | 'WordIter'>;
|
|
1844
|
+
|
|
1845
|
+
/**
|
|
1846
|
+
* 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.
|
|
1847
|
+
*
|
|
1848
|
+
* @public
|
|
1849
|
+
*/
|
|
1850
|
+
export type Node =
|
|
1851
|
+
| ArithmCmd
|
|
1852
|
+
| ArithmExp
|
|
1853
|
+
| ArrayElem
|
|
1854
|
+
| ArrayExpr
|
|
1855
|
+
| Assign
|
|
1856
|
+
| BinaryArithm
|
|
1857
|
+
| BinaryCmd
|
|
1858
|
+
| BinaryTest
|
|
1859
|
+
| Block
|
|
1860
|
+
| BraceExp
|
|
1861
|
+
| CStyleLoop
|
|
1862
|
+
| CallExpr
|
|
1863
|
+
| CaseClause
|
|
1864
|
+
| CaseItem
|
|
1865
|
+
| CmdSubst
|
|
1866
|
+
| Comment
|
|
1867
|
+
| CoprocClause
|
|
1868
|
+
| DblQuoted
|
|
1869
|
+
| DeclClause
|
|
1870
|
+
| ExtGlob
|
|
1871
|
+
| File
|
|
1872
|
+
| FlagsArithm
|
|
1873
|
+
| ForClause
|
|
1874
|
+
| FuncDecl
|
|
1875
|
+
| IfClause
|
|
1876
|
+
| LetClause
|
|
1877
|
+
| Lit
|
|
1878
|
+
| ParamExp
|
|
1879
|
+
| ParenArithm
|
|
1880
|
+
| ParenTest
|
|
1881
|
+
| ProcSubst
|
|
1882
|
+
| Redirect
|
|
1883
|
+
| SglQuoted
|
|
1884
|
+
| Stmt
|
|
1885
|
+
| Subshell
|
|
1886
|
+
| TestClause
|
|
1887
|
+
| TestDecl
|
|
1888
|
+
| TimeClause
|
|
1889
|
+
| UnaryArithm
|
|
1890
|
+
| UnaryTest
|
|
1891
|
+
| WhileClause
|
|
1892
|
+
| Word
|
|
1893
|
+
| WordIter
|
|
1894
|
+
| TypedNil<
|
|
1895
|
+
| 'ArithmCmd'
|
|
1896
|
+
| 'ArithmExp'
|
|
1897
|
+
| 'ArrayElem'
|
|
1898
|
+
| 'ArrayExpr'
|
|
1899
|
+
| 'Assign'
|
|
1900
|
+
| 'BinaryArithm'
|
|
1901
|
+
| 'BinaryCmd'
|
|
1902
|
+
| 'BinaryTest'
|
|
1903
|
+
| 'Block'
|
|
1904
|
+
| 'BraceExp'
|
|
1905
|
+
| 'CStyleLoop'
|
|
1906
|
+
| 'CallExpr'
|
|
1907
|
+
| 'CaseClause'
|
|
1908
|
+
| 'CaseItem'
|
|
1909
|
+
| 'CmdSubst'
|
|
1910
|
+
| 'Comment'
|
|
1911
|
+
| 'CoprocClause'
|
|
1912
|
+
| 'DblQuoted'
|
|
1913
|
+
| 'DeclClause'
|
|
1914
|
+
| 'ExtGlob'
|
|
1915
|
+
| 'File'
|
|
1916
|
+
| 'FlagsArithm'
|
|
1917
|
+
| 'ForClause'
|
|
1918
|
+
| 'FuncDecl'
|
|
1919
|
+
| 'IfClause'
|
|
1920
|
+
| 'LetClause'
|
|
1921
|
+
| 'Lit'
|
|
1922
|
+
| 'ParamExp'
|
|
1923
|
+
| 'ParenArithm'
|
|
1924
|
+
| 'ParenTest'
|
|
1925
|
+
| 'ProcSubst'
|
|
1926
|
+
| 'Redirect'
|
|
1927
|
+
| 'SglQuoted'
|
|
1928
|
+
| 'Stmt'
|
|
1929
|
+
| 'Subshell'
|
|
1930
|
+
| 'TestClause'
|
|
1931
|
+
| 'TestDecl'
|
|
1932
|
+
| 'TimeClause'
|
|
1933
|
+
| 'UnaryArithm'
|
|
1934
|
+
| 'UnaryTest'
|
|
1935
|
+
| 'WhileClause'
|
|
1936
|
+
| 'Word'
|
|
1937
|
+
| 'WordIter'
|
|
1938
|
+
>;
|
|
1939
|
+
|
|
1940
|
+
/**
|
|
1941
|
+
* 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.
|
|
1942
|
+
*
|
|
1943
|
+
* @public
|
|
1944
|
+
*/
|
|
1945
|
+
export type TestExpr =
|
|
1946
|
+
| BinaryTest
|
|
1947
|
+
| ParenTest
|
|
1948
|
+
| UnaryTest
|
|
1949
|
+
| Word
|
|
1950
|
+
| TypedNil<'BinaryTest' | 'ParenTest' | 'UnaryTest' | 'Word'>;
|
|
1951
|
+
|
|
1952
|
+
/**
|
|
1953
|
+
* 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.
|
|
1954
|
+
*
|
|
1955
|
+
* @public
|
|
1956
|
+
*/
|
|
1957
|
+
export type WordPart =
|
|
1958
|
+
| ArithmExp
|
|
1959
|
+
| BraceExp
|
|
1960
|
+
| CmdSubst
|
|
1961
|
+
| DblQuoted
|
|
1962
|
+
| ExtGlob
|
|
1963
|
+
| Lit
|
|
1964
|
+
| ParamExp
|
|
1965
|
+
| ProcSubst
|
|
1966
|
+
| SglQuoted
|
|
1967
|
+
| TypedNil<
|
|
1968
|
+
| 'ArithmExp'
|
|
1969
|
+
| 'BraceExp'
|
|
1970
|
+
| 'CmdSubst'
|
|
1971
|
+
| 'DblQuoted'
|
|
1972
|
+
| 'ExtGlob'
|
|
1973
|
+
| 'Lit'
|
|
1974
|
+
| 'ParamExp'
|
|
1975
|
+
| 'ProcSubst'
|
|
1976
|
+
| 'SglQuoted'
|
|
1977
|
+
>;
|