sh-ast 0.0.0 → 0.2.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.
Files changed (81) hide show
  1. package/README.md +147 -0
  2. package/dist/analyze/ansi-c-escapes.d.ts +53 -0
  3. package/dist/analyze/ansi-c-escapes.d.ts.map +1 -0
  4. package/dist/analyze/ansi-c-escapes.js +255 -0
  5. package/dist/analyze/ansi-c-escapes.js.map +1 -0
  6. package/dist/analyze/decode-lit.d.ts +74 -0
  7. package/dist/analyze/decode-lit.d.ts.map +1 -0
  8. package/dist/analyze/decode-lit.js +114 -0
  9. package/dist/analyze/decode-lit.js.map +1 -0
  10. package/dist/analyze/enumerate-commands.d.ts +165 -0
  11. package/dist/analyze/enumerate-commands.d.ts.map +1 -0
  12. package/dist/analyze/enumerate-commands.js +396 -0
  13. package/dist/analyze/enumerate-commands.js.map +1 -0
  14. package/dist/analyze/index.d.ts +26 -0
  15. package/dist/analyze/index.d.ts.map +1 -0
  16. package/dist/analyze/index.js +30 -0
  17. package/dist/analyze/index.js.map +1 -0
  18. package/dist/analyze/node-helpers.d.ts +28 -0
  19. package/dist/analyze/node-helpers.d.ts.map +1 -0
  20. package/dist/analyze/node-helpers.js +37 -0
  21. package/dist/analyze/node-helpers.js.map +1 -0
  22. package/dist/analyze/resolve-argv0.d.ts +335 -0
  23. package/dist/analyze/resolve-argv0.d.ts.map +1 -0
  24. package/dist/analyze/resolve-argv0.js +510 -0
  25. package/dist/analyze/resolve-argv0.js.map +1 -0
  26. package/dist/analyze/resolve-word.d.ts +151 -0
  27. package/dist/analyze/resolve-word.d.ts.map +1 -0
  28. package/dist/analyze/resolve-word.js +207 -0
  29. package/dist/analyze/resolve-word.js.map +1 -0
  30. package/dist/analyze.d.ts +771 -0
  31. package/dist/deep-freeze.d.ts +14 -0
  32. package/dist/deep-freeze.d.ts.map +1 -0
  33. package/dist/deep-freeze.js +25 -0
  34. package/dist/deep-freeze.js.map +1 -0
  35. package/dist/errors.d.ts +180 -0
  36. package/dist/errors.d.ts.map +1 -0
  37. package/dist/errors.js +179 -0
  38. package/dist/errors.js.map +1 -0
  39. package/dist/index.d.ts +18 -0
  40. package/dist/index.d.ts.map +1 -0
  41. package/dist/index.js +5 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/normalize.d.ts +52 -0
  44. package/dist/normalize.d.ts.map +1 -0
  45. package/dist/normalize.js +260 -0
  46. package/dist/normalize.js.map +1 -0
  47. package/dist/parse-depth-guard.d.ts +11 -0
  48. package/dist/parse-depth-guard.d.ts.map +1 -0
  49. package/dist/parse-depth-guard.js +633 -0
  50. package/dist/parse-depth-guard.js.map +1 -0
  51. package/dist/parse.d.ts +50 -0
  52. package/dist/parse.d.ts.map +1 -0
  53. package/dist/parse.js +125 -0
  54. package/dist/parse.js.map +1 -0
  55. package/dist/sh-ast.d.ts +1346 -0
  56. package/dist/types.d.ts +74 -0
  57. package/dist/types.d.ts.map +1 -0
  58. package/dist/types.js +2 -0
  59. package/dist/types.js.map +1 -0
  60. package/dist/visitor-keys.d.ts +21 -0
  61. package/dist/visitor-keys.d.ts.map +1 -0
  62. package/dist/visitor-keys.js +23 -0
  63. package/dist/visitor-keys.js.map +1 -0
  64. package/dist/walk.d.ts +18 -0
  65. package/dist/walk.d.ts.map +1 -0
  66. package/dist/walk.js +40 -0
  67. package/dist/walk.js.map +1 -0
  68. package/dist/wasm-instance.d.ts +13 -0
  69. package/dist/wasm-instance.d.ts.map +1 -0
  70. package/dist/wasm-instance.js +88 -0
  71. package/dist/wasm-instance.js.map +1 -0
  72. package/generated/child-type-schema.d.ts +14 -0
  73. package/generated/child-type-schema.js +188 -0
  74. package/generated/node-types.d.ts +958 -0
  75. package/generated/position-fields.d.ts +21 -0
  76. package/generated/position-fields.js +50 -0
  77. package/generated/visitor-keys.d.ts +11 -0
  78. package/generated/visitor-keys.js +50 -0
  79. package/package.json +93 -10
  80. package/shim/sh-ast.wasm +0 -0
  81. package/shim/wasm_exec.js +654 -0
@@ -0,0 +1,958 @@
1
+ // Code generated by tools/gen-visitor-keys from mvdan.cc/sh/v3 v3.13.1. DO NOT EDIT.
2
+ // See design/ARCHITECTURE.md, "The schema table is generated, not hand-written".
3
+ /**
4
+ * mvdan/sh's `syntax.ArithmCmd`, normalized.
5
+ *
6
+ * @public
7
+ */
8
+ export interface ShArithmCmdNode {
9
+ readonly type: 'ArithmCmd';
10
+ readonly range: readonly [number, number];
11
+ readonly loc: {
12
+ readonly start: { readonly line: number; readonly column: number };
13
+ readonly end: { readonly line: number; readonly column: number };
14
+ };
15
+ [field: string]: unknown;
16
+ readonly x?: ShArithmExprNode;
17
+ }
18
+
19
+ /**
20
+ * mvdan/sh's `syntax.ArithmExp`, normalized.
21
+ *
22
+ * @public
23
+ */
24
+ export interface ShArithmExpNode {
25
+ readonly type: 'ArithmExp';
26
+ readonly range: readonly [number, number];
27
+ readonly loc: {
28
+ readonly start: { readonly line: number; readonly column: number };
29
+ readonly end: { readonly line: number; readonly column: number };
30
+ };
31
+ [field: string]: unknown;
32
+ readonly x?: ShArithmExprNode;
33
+ }
34
+
35
+ /**
36
+ * mvdan/sh's `syntax.ArrayElem`, normalized.
37
+ *
38
+ * @public
39
+ */
40
+ export interface ShArrayElemNode {
41
+ readonly type: 'ArrayElem';
42
+ readonly range: readonly [number, number];
43
+ readonly loc: {
44
+ readonly start: { readonly line: number; readonly column: number };
45
+ readonly end: { readonly line: number; readonly column: number };
46
+ };
47
+ [field: string]: unknown;
48
+ readonly comments: readonly ShCommentNode[];
49
+ readonly index?: ShArithmExprNode;
50
+ readonly value?: ShWordNode;
51
+ }
52
+
53
+ /**
54
+ * mvdan/sh's `syntax.ArrayExpr`, normalized.
55
+ *
56
+ * @public
57
+ */
58
+ export interface ShArrayExprNode {
59
+ readonly type: 'ArrayExpr';
60
+ readonly range: readonly [number, number];
61
+ readonly loc: {
62
+ readonly start: { readonly line: number; readonly column: number };
63
+ readonly end: { readonly line: number; readonly column: number };
64
+ };
65
+ [field: string]: unknown;
66
+ readonly elems: readonly ShArrayElemNode[];
67
+ readonly last: readonly ShCommentNode[];
68
+ }
69
+
70
+ /**
71
+ * mvdan/sh's `syntax.Assign`, normalized.
72
+ *
73
+ * @public
74
+ */
75
+ export interface ShAssignNode {
76
+ readonly type: 'Assign';
77
+ readonly range: readonly [number, number];
78
+ readonly loc: {
79
+ readonly start: { readonly line: number; readonly column: number };
80
+ readonly end: { readonly line: number; readonly column: number };
81
+ };
82
+ [field: string]: unknown;
83
+ readonly array?: ShArrayExprNode;
84
+ readonly index?: ShArithmExprNode;
85
+ readonly name?: ShLitNode;
86
+ readonly value?: ShWordNode;
87
+ }
88
+
89
+ /**
90
+ * mvdan/sh's `syntax.BinaryArithm`, normalized.
91
+ *
92
+ * @public
93
+ */
94
+ export interface ShBinaryArithmNode {
95
+ readonly type: 'BinaryArithm';
96
+ readonly range: readonly [number, number];
97
+ readonly loc: {
98
+ readonly start: { readonly line: number; readonly column: number };
99
+ readonly end: { readonly line: number; readonly column: number };
100
+ };
101
+ [field: string]: unknown;
102
+ readonly x?: ShArithmExprNode;
103
+ readonly y?: ShArithmExprNode;
104
+ }
105
+
106
+ /**
107
+ * mvdan/sh's `syntax.BinaryCmd`, normalized.
108
+ *
109
+ * @public
110
+ */
111
+ export interface ShBinaryCmdNode {
112
+ readonly type: 'BinaryCmd';
113
+ readonly range: readonly [number, number];
114
+ readonly loc: {
115
+ readonly start: { readonly line: number; readonly column: number };
116
+ readonly end: { readonly line: number; readonly column: number };
117
+ };
118
+ [field: string]: unknown;
119
+ readonly x?: ShStmtNode;
120
+ readonly y?: ShStmtNode;
121
+ }
122
+
123
+ /**
124
+ * mvdan/sh's `syntax.BinaryTest`, normalized.
125
+ *
126
+ * @public
127
+ */
128
+ export interface ShBinaryTestNode {
129
+ readonly type: 'BinaryTest';
130
+ readonly range: readonly [number, number];
131
+ readonly loc: {
132
+ readonly start: { readonly line: number; readonly column: number };
133
+ readonly end: { readonly line: number; readonly column: number };
134
+ };
135
+ [field: string]: unknown;
136
+ readonly x?: ShTestExprNode;
137
+ readonly y?: ShTestExprNode;
138
+ }
139
+
140
+ /**
141
+ * mvdan/sh's `syntax.Block`, normalized.
142
+ *
143
+ * @public
144
+ */
145
+ export interface ShBlockNode {
146
+ readonly type: 'Block';
147
+ readonly range: readonly [number, number];
148
+ readonly loc: {
149
+ readonly start: { readonly line: number; readonly column: number };
150
+ readonly end: { readonly line: number; readonly column: number };
151
+ };
152
+ [field: string]: unknown;
153
+ readonly last: readonly ShCommentNode[];
154
+ readonly stmts: readonly ShStmtNode[];
155
+ }
156
+
157
+ /**
158
+ * mvdan/sh's `syntax.BraceExp`, normalized.
159
+ *
160
+ * @public
161
+ */
162
+ export interface ShBraceExpNode {
163
+ readonly type: 'BraceExp';
164
+ readonly range: readonly [number, number];
165
+ readonly loc: {
166
+ readonly start: { readonly line: number; readonly column: number };
167
+ readonly end: { readonly line: number; readonly column: number };
168
+ };
169
+ [field: string]: unknown;
170
+ readonly elems: readonly ShWordNode[];
171
+ }
172
+
173
+ /**
174
+ * mvdan/sh's `syntax.CStyleLoop`, normalized.
175
+ *
176
+ * @public
177
+ */
178
+ export interface ShCStyleLoopNode {
179
+ readonly type: 'CStyleLoop';
180
+ readonly range: readonly [number, number];
181
+ readonly loc: {
182
+ readonly start: { readonly line: number; readonly column: number };
183
+ readonly end: { readonly line: number; readonly column: number };
184
+ };
185
+ [field: string]: unknown;
186
+ readonly cond?: ShArithmExprNode;
187
+ readonly init?: ShArithmExprNode;
188
+ readonly post?: ShArithmExprNode;
189
+ }
190
+
191
+ /**
192
+ * mvdan/sh's `syntax.CallExpr`, normalized.
193
+ *
194
+ * @public
195
+ */
196
+ export interface ShCallExprNode {
197
+ readonly type: 'CallExpr';
198
+ readonly range: readonly [number, number];
199
+ readonly loc: {
200
+ readonly start: { readonly line: number; readonly column: number };
201
+ readonly end: { readonly line: number; readonly column: number };
202
+ };
203
+ [field: string]: unknown;
204
+ readonly args: readonly ShWordNode[];
205
+ readonly assigns: readonly ShAssignNode[];
206
+ }
207
+
208
+ /**
209
+ * mvdan/sh's `syntax.CaseClause`, normalized.
210
+ *
211
+ * @public
212
+ */
213
+ export interface ShCaseClauseNode {
214
+ readonly type: 'CaseClause';
215
+ readonly range: readonly [number, number];
216
+ readonly loc: {
217
+ readonly start: { readonly line: number; readonly column: number };
218
+ readonly end: { readonly line: number; readonly column: number };
219
+ };
220
+ [field: string]: unknown;
221
+ readonly items: readonly ShCaseItemNode[];
222
+ readonly last: readonly ShCommentNode[];
223
+ readonly word?: ShWordNode;
224
+ }
225
+
226
+ /**
227
+ * mvdan/sh's `syntax.CaseItem`, normalized.
228
+ *
229
+ * @public
230
+ */
231
+ export interface ShCaseItemNode {
232
+ readonly type: 'CaseItem';
233
+ readonly range: readonly [number, number];
234
+ readonly loc: {
235
+ readonly start: { readonly line: number; readonly column: number };
236
+ readonly end: { readonly line: number; readonly column: number };
237
+ };
238
+ [field: string]: unknown;
239
+ readonly comments: readonly ShCommentNode[];
240
+ readonly last: readonly ShCommentNode[];
241
+ readonly patterns: readonly ShWordNode[];
242
+ readonly stmts: readonly ShStmtNode[];
243
+ }
244
+
245
+ /**
246
+ * mvdan/sh's `syntax.CmdSubst`, normalized.
247
+ *
248
+ * @public
249
+ */
250
+ export interface ShCmdSubstNode {
251
+ readonly type: 'CmdSubst';
252
+ readonly range: readonly [number, number];
253
+ readonly loc: {
254
+ readonly start: { readonly line: number; readonly column: number };
255
+ readonly end: { readonly line: number; readonly column: number };
256
+ };
257
+ [field: string]: unknown;
258
+ readonly last: readonly ShCommentNode[];
259
+ readonly stmts: readonly ShStmtNode[];
260
+ }
261
+
262
+ /**
263
+ * mvdan/sh's `syntax.Comment`, normalized.
264
+ *
265
+ * @public
266
+ */
267
+ export interface ShCommentNode {
268
+ readonly type: 'Comment';
269
+ readonly range: readonly [number, number];
270
+ readonly loc: {
271
+ readonly start: { readonly line: number; readonly column: number };
272
+ readonly end: { readonly line: number; readonly column: number };
273
+ };
274
+ [field: string]: unknown;
275
+ }
276
+
277
+ /**
278
+ * mvdan/sh's `syntax.CoprocClause`, normalized.
279
+ *
280
+ * @public
281
+ */
282
+ export interface ShCoprocClauseNode {
283
+ readonly type: 'CoprocClause';
284
+ readonly range: readonly [number, number];
285
+ readonly loc: {
286
+ readonly start: { readonly line: number; readonly column: number };
287
+ readonly end: { readonly line: number; readonly column: number };
288
+ };
289
+ [field: string]: unknown;
290
+ readonly name?: ShWordNode;
291
+ readonly stmt?: ShStmtNode;
292
+ }
293
+
294
+ /**
295
+ * mvdan/sh's `syntax.DblQuoted`, normalized.
296
+ *
297
+ * @public
298
+ */
299
+ export interface ShDblQuotedNode {
300
+ readonly type: 'DblQuoted';
301
+ readonly range: readonly [number, number];
302
+ readonly loc: {
303
+ readonly start: { readonly line: number; readonly column: number };
304
+ readonly end: { readonly line: number; readonly column: number };
305
+ };
306
+ [field: string]: unknown;
307
+ readonly parts: readonly ShWordPartNode[];
308
+ }
309
+
310
+ /**
311
+ * mvdan/sh's `syntax.DeclClause`, normalized.
312
+ *
313
+ * @public
314
+ */
315
+ export interface ShDeclClauseNode {
316
+ readonly type: 'DeclClause';
317
+ readonly range: readonly [number, number];
318
+ readonly loc: {
319
+ readonly start: { readonly line: number; readonly column: number };
320
+ readonly end: { readonly line: number; readonly column: number };
321
+ };
322
+ [field: string]: unknown;
323
+ readonly args: readonly ShAssignNode[];
324
+ readonly variant?: ShLitNode;
325
+ }
326
+
327
+ /**
328
+ * mvdan/sh's `syntax.Expansion`, normalized.
329
+ *
330
+ * @public
331
+ */
332
+ export interface ShExpansionNode {
333
+ readonly type: 'Expansion';
334
+ readonly range: readonly [number, number];
335
+ readonly loc: {
336
+ readonly start: { readonly line: number; readonly column: number };
337
+ readonly end: { readonly line: number; readonly column: number };
338
+ };
339
+ [field: string]: unknown;
340
+ readonly word?: ShWordNode;
341
+ }
342
+
343
+ /**
344
+ * mvdan/sh's `syntax.ExtGlob`, normalized.
345
+ *
346
+ * @public
347
+ */
348
+ export interface ShExtGlobNode {
349
+ readonly type: 'ExtGlob';
350
+ readonly range: readonly [number, number];
351
+ readonly loc: {
352
+ readonly start: { readonly line: number; readonly column: number };
353
+ readonly end: { readonly line: number; readonly column: number };
354
+ };
355
+ [field: string]: unknown;
356
+ readonly pattern?: ShLitNode;
357
+ }
358
+
359
+ /**
360
+ * mvdan/sh's `syntax.File`, normalized.
361
+ *
362
+ * @public
363
+ */
364
+ export interface ShFileNode {
365
+ readonly type: 'File';
366
+ readonly range: readonly [number, number];
367
+ readonly loc: {
368
+ readonly start: { readonly line: number; readonly column: number };
369
+ readonly end: { readonly line: number; readonly column: number };
370
+ };
371
+ [field: string]: unknown;
372
+ readonly last: readonly ShCommentNode[];
373
+ readonly stmts: readonly ShStmtNode[];
374
+ }
375
+
376
+ /**
377
+ * mvdan/sh's `syntax.FlagsArithm`, normalized.
378
+ *
379
+ * @public
380
+ */
381
+ export interface ShFlagsArithmNode {
382
+ readonly type: 'FlagsArithm';
383
+ readonly range: readonly [number, number];
384
+ readonly loc: {
385
+ readonly start: { readonly line: number; readonly column: number };
386
+ readonly end: { readonly line: number; readonly column: number };
387
+ };
388
+ [field: string]: unknown;
389
+ readonly flags?: ShLitNode;
390
+ readonly x?: ShArithmExprNode;
391
+ }
392
+
393
+ /**
394
+ * mvdan/sh's `syntax.ForClause`, normalized.
395
+ *
396
+ * @public
397
+ */
398
+ export interface ShForClauseNode {
399
+ readonly type: 'ForClause';
400
+ readonly range: readonly [number, number];
401
+ readonly loc: {
402
+ readonly start: { readonly line: number; readonly column: number };
403
+ readonly end: { readonly line: number; readonly column: number };
404
+ };
405
+ [field: string]: unknown;
406
+ readonly do: readonly ShStmtNode[];
407
+ readonly dolast: readonly ShCommentNode[];
408
+ readonly loop?: ShLoopNode;
409
+ }
410
+
411
+ /**
412
+ * mvdan/sh's `syntax.FuncDecl`, normalized.
413
+ *
414
+ * @public
415
+ */
416
+ export interface ShFuncDeclNode {
417
+ readonly type: 'FuncDecl';
418
+ readonly range: readonly [number, number];
419
+ readonly loc: {
420
+ readonly start: { readonly line: number; readonly column: number };
421
+ readonly end: { readonly line: number; readonly column: number };
422
+ };
423
+ [field: string]: unknown;
424
+ readonly body?: ShStmtNode;
425
+ readonly name?: ShLitNode;
426
+ readonly names: readonly ShLitNode[];
427
+ }
428
+
429
+ /**
430
+ * mvdan/sh's `syntax.IfClause`, normalized.
431
+ *
432
+ * @public
433
+ */
434
+ export interface ShIfClauseNode {
435
+ readonly type: 'IfClause';
436
+ readonly range: readonly [number, number];
437
+ readonly loc: {
438
+ readonly start: { readonly line: number; readonly column: number };
439
+ readonly end: { readonly line: number; readonly column: number };
440
+ };
441
+ [field: string]: unknown;
442
+ readonly cond: readonly ShStmtNode[];
443
+ readonly condlast: readonly ShCommentNode[];
444
+ readonly else?: ShIfClauseNode;
445
+ readonly last: readonly ShCommentNode[];
446
+ readonly then: readonly ShStmtNode[];
447
+ readonly thenlast: readonly ShCommentNode[];
448
+ }
449
+
450
+ /**
451
+ * mvdan/sh's `syntax.LetClause`, normalized.
452
+ *
453
+ * @public
454
+ */
455
+ export interface ShLetClauseNode {
456
+ readonly type: 'LetClause';
457
+ readonly range: readonly [number, number];
458
+ readonly loc: {
459
+ readonly start: { readonly line: number; readonly column: number };
460
+ readonly end: { readonly line: number; readonly column: number };
461
+ };
462
+ [field: string]: unknown;
463
+ readonly exprs: readonly ShArithmExprNode[];
464
+ }
465
+
466
+ /**
467
+ * mvdan/sh's `syntax.Lit`, normalized.
468
+ *
469
+ * @public
470
+ */
471
+ export interface ShLitNode {
472
+ readonly type: 'Lit';
473
+ readonly range: readonly [number, number];
474
+ readonly loc: {
475
+ readonly start: { readonly line: number; readonly column: number };
476
+ readonly end: { readonly line: number; readonly column: number };
477
+ };
478
+ [field: string]: unknown;
479
+ }
480
+
481
+ /**
482
+ * mvdan/sh's `syntax.ParamExp`, normalized.
483
+ *
484
+ * @public
485
+ */
486
+ export interface ShParamExpNode {
487
+ readonly type: 'ParamExp';
488
+ readonly range: readonly [number, number];
489
+ readonly loc: {
490
+ readonly start: { readonly line: number; readonly column: number };
491
+ readonly end: { readonly line: number; readonly column: number };
492
+ };
493
+ [field: string]: unknown;
494
+ readonly exp?: ShExpansionNode;
495
+ readonly flags?: ShLitNode;
496
+ readonly index?: ShArithmExprNode;
497
+ readonly modifiers: readonly ShLitNode[];
498
+ readonly nestedparam?: ShWordPartNode;
499
+ readonly param?: ShLitNode;
500
+ readonly repl?: ShReplaceNode;
501
+ readonly slice?: ShSliceNode;
502
+ }
503
+
504
+ /**
505
+ * mvdan/sh's `syntax.ParenArithm`, normalized.
506
+ *
507
+ * @public
508
+ */
509
+ export interface ShParenArithmNode {
510
+ readonly type: 'ParenArithm';
511
+ readonly range: readonly [number, number];
512
+ readonly loc: {
513
+ readonly start: { readonly line: number; readonly column: number };
514
+ readonly end: { readonly line: number; readonly column: number };
515
+ };
516
+ [field: string]: unknown;
517
+ readonly x?: ShArithmExprNode;
518
+ }
519
+
520
+ /**
521
+ * mvdan/sh's `syntax.ParenTest`, normalized.
522
+ *
523
+ * @public
524
+ */
525
+ export interface ShParenTestNode {
526
+ readonly type: 'ParenTest';
527
+ readonly range: readonly [number, number];
528
+ readonly loc: {
529
+ readonly start: { readonly line: number; readonly column: number };
530
+ readonly end: { readonly line: number; readonly column: number };
531
+ };
532
+ [field: string]: unknown;
533
+ readonly x?: ShTestExprNode;
534
+ }
535
+
536
+ /**
537
+ * mvdan/sh's `syntax.ProcSubst`, normalized.
538
+ *
539
+ * @public
540
+ */
541
+ export interface ShProcSubstNode {
542
+ readonly type: 'ProcSubst';
543
+ readonly range: readonly [number, number];
544
+ readonly loc: {
545
+ readonly start: { readonly line: number; readonly column: number };
546
+ readonly end: { readonly line: number; readonly column: number };
547
+ };
548
+ [field: string]: unknown;
549
+ readonly last: readonly ShCommentNode[];
550
+ readonly stmts: readonly ShStmtNode[];
551
+ }
552
+
553
+ /**
554
+ * mvdan/sh's `syntax.Redirect`, normalized.
555
+ *
556
+ * @public
557
+ */
558
+ export interface ShRedirectNode {
559
+ readonly type: 'Redirect';
560
+ readonly range: readonly [number, number];
561
+ readonly loc: {
562
+ readonly start: { readonly line: number; readonly column: number };
563
+ readonly end: { readonly line: number; readonly column: number };
564
+ };
565
+ [field: string]: unknown;
566
+ readonly hdoc?: ShWordNode;
567
+ readonly n?: ShLitNode;
568
+ readonly word?: ShWordNode;
569
+ }
570
+
571
+ /**
572
+ * mvdan/sh's `syntax.Replace`, normalized.
573
+ *
574
+ * @public
575
+ */
576
+ export interface ShReplaceNode {
577
+ readonly type: 'Replace';
578
+ readonly range: readonly [number, number];
579
+ readonly loc: {
580
+ readonly start: { readonly line: number; readonly column: number };
581
+ readonly end: { readonly line: number; readonly column: number };
582
+ };
583
+ [field: string]: unknown;
584
+ readonly orig?: ShWordNode;
585
+ readonly with?: ShWordNode;
586
+ }
587
+
588
+ /**
589
+ * mvdan/sh's `syntax.SglQuoted`, normalized.
590
+ *
591
+ * @public
592
+ */
593
+ export interface ShSglQuotedNode {
594
+ readonly type: 'SglQuoted';
595
+ readonly range: readonly [number, number];
596
+ readonly loc: {
597
+ readonly start: { readonly line: number; readonly column: number };
598
+ readonly end: { readonly line: number; readonly column: number };
599
+ };
600
+ [field: string]: unknown;
601
+ }
602
+
603
+ /**
604
+ * mvdan/sh's `syntax.Slice`, normalized.
605
+ *
606
+ * @public
607
+ */
608
+ export interface ShSliceNode {
609
+ readonly type: 'Slice';
610
+ readonly range: readonly [number, number];
611
+ readonly loc: {
612
+ readonly start: { readonly line: number; readonly column: number };
613
+ readonly end: { readonly line: number; readonly column: number };
614
+ };
615
+ [field: string]: unknown;
616
+ readonly length?: ShArithmExprNode;
617
+ readonly offset?: ShArithmExprNode;
618
+ }
619
+
620
+ /**
621
+ * mvdan/sh's `syntax.Stmt`, normalized.
622
+ *
623
+ * @public
624
+ */
625
+ export interface ShStmtNode {
626
+ readonly type: 'Stmt';
627
+ readonly range: readonly [number, number];
628
+ readonly loc: {
629
+ readonly start: { readonly line: number; readonly column: number };
630
+ readonly end: { readonly line: number; readonly column: number };
631
+ };
632
+ [field: string]: unknown;
633
+ readonly cmd?: ShCommandNode;
634
+ readonly comments: readonly ShCommentNode[];
635
+ readonly redirs: readonly ShRedirectNode[];
636
+ }
637
+
638
+ /**
639
+ * mvdan/sh's `syntax.Subshell`, normalized.
640
+ *
641
+ * @public
642
+ */
643
+ export interface ShSubshellNode {
644
+ readonly type: 'Subshell';
645
+ readonly range: readonly [number, number];
646
+ readonly loc: {
647
+ readonly start: { readonly line: number; readonly column: number };
648
+ readonly end: { readonly line: number; readonly column: number };
649
+ };
650
+ [field: string]: unknown;
651
+ readonly last: readonly ShCommentNode[];
652
+ readonly stmts: readonly ShStmtNode[];
653
+ }
654
+
655
+ /**
656
+ * mvdan/sh's `syntax.TestClause`, normalized.
657
+ *
658
+ * @public
659
+ */
660
+ export interface ShTestClauseNode {
661
+ readonly type: 'TestClause';
662
+ readonly range: readonly [number, number];
663
+ readonly loc: {
664
+ readonly start: { readonly line: number; readonly column: number };
665
+ readonly end: { readonly line: number; readonly column: number };
666
+ };
667
+ [field: string]: unknown;
668
+ readonly x?: ShTestExprNode;
669
+ }
670
+
671
+ /**
672
+ * mvdan/sh's `syntax.TestDecl`, normalized.
673
+ *
674
+ * @public
675
+ */
676
+ export interface ShTestDeclNode {
677
+ readonly type: 'TestDecl';
678
+ readonly range: readonly [number, number];
679
+ readonly loc: {
680
+ readonly start: { readonly line: number; readonly column: number };
681
+ readonly end: { readonly line: number; readonly column: number };
682
+ };
683
+ [field: string]: unknown;
684
+ readonly body?: ShStmtNode;
685
+ readonly description?: ShWordNode;
686
+ }
687
+
688
+ /**
689
+ * mvdan/sh's `syntax.TimeClause`, normalized.
690
+ *
691
+ * @public
692
+ */
693
+ export interface ShTimeClauseNode {
694
+ readonly type: 'TimeClause';
695
+ readonly range: readonly [number, number];
696
+ readonly loc: {
697
+ readonly start: { readonly line: number; readonly column: number };
698
+ readonly end: { readonly line: number; readonly column: number };
699
+ };
700
+ [field: string]: unknown;
701
+ readonly stmt?: ShStmtNode;
702
+ }
703
+
704
+ /**
705
+ * mvdan/sh's `syntax.UnaryArithm`, normalized.
706
+ *
707
+ * @public
708
+ */
709
+ export interface ShUnaryArithmNode {
710
+ readonly type: 'UnaryArithm';
711
+ readonly range: readonly [number, number];
712
+ readonly loc: {
713
+ readonly start: { readonly line: number; readonly column: number };
714
+ readonly end: { readonly line: number; readonly column: number };
715
+ };
716
+ [field: string]: unknown;
717
+ readonly x?: ShArithmExprNode;
718
+ }
719
+
720
+ /**
721
+ * mvdan/sh's `syntax.UnaryTest`, normalized.
722
+ *
723
+ * @public
724
+ */
725
+ export interface ShUnaryTestNode {
726
+ readonly type: 'UnaryTest';
727
+ readonly range: readonly [number, number];
728
+ readonly loc: {
729
+ readonly start: { readonly line: number; readonly column: number };
730
+ readonly end: { readonly line: number; readonly column: number };
731
+ };
732
+ [field: string]: unknown;
733
+ readonly x?: ShTestExprNode;
734
+ }
735
+
736
+ /**
737
+ * mvdan/sh's `syntax.WhileClause`, normalized.
738
+ *
739
+ * @public
740
+ */
741
+ export interface ShWhileClauseNode {
742
+ readonly type: 'WhileClause';
743
+ readonly range: readonly [number, number];
744
+ readonly loc: {
745
+ readonly start: { readonly line: number; readonly column: number };
746
+ readonly end: { readonly line: number; readonly column: number };
747
+ };
748
+ [field: string]: unknown;
749
+ readonly cond: readonly ShStmtNode[];
750
+ readonly condlast: readonly ShCommentNode[];
751
+ readonly do: readonly ShStmtNode[];
752
+ readonly dolast: readonly ShCommentNode[];
753
+ }
754
+
755
+ /**
756
+ * mvdan/sh's `syntax.Word`, normalized.
757
+ *
758
+ * @public
759
+ */
760
+ export interface ShWordNode {
761
+ readonly type: 'Word';
762
+ readonly range: readonly [number, number];
763
+ readonly loc: {
764
+ readonly start: { readonly line: number; readonly column: number };
765
+ readonly end: { readonly line: number; readonly column: number };
766
+ };
767
+ [field: string]: unknown;
768
+ readonly parts: readonly ShWordPartNode[];
769
+ }
770
+
771
+ /**
772
+ * mvdan/sh's `syntax.WordIter`, normalized.
773
+ *
774
+ * @public
775
+ */
776
+ export interface ShWordIterNode {
777
+ readonly type: 'WordIter';
778
+ readonly range: readonly [number, number];
779
+ readonly loc: {
780
+ readonly start: { readonly line: number; readonly column: number };
781
+ readonly end: { readonly line: number; readonly column: number };
782
+ };
783
+ [field: string]: unknown;
784
+ readonly items: readonly ShWordNode[];
785
+ readonly name?: ShLitNode;
786
+ }
787
+
788
+ /**
789
+ * The union of concrete node types mvdan/sh's `syntax.ArithmExpr` interface can
790
+ * hold.
791
+ *
792
+ * @public
793
+ */
794
+ export type ShArithmExprNode =
795
+ ShBinaryArithmNode | ShFlagsArithmNode | ShParenArithmNode | ShUnaryArithmNode | ShWordNode;
796
+
797
+ /**
798
+ * The union of concrete node types mvdan/sh's `syntax.Command` interface can
799
+ * hold.
800
+ *
801
+ * @public
802
+ */
803
+ export type ShCommandNode =
804
+ | ShArithmCmdNode
805
+ | ShBinaryCmdNode
806
+ | ShBlockNode
807
+ | ShCallExprNode
808
+ | ShCaseClauseNode
809
+ | ShCoprocClauseNode
810
+ | ShDeclClauseNode
811
+ | ShForClauseNode
812
+ | ShFuncDeclNode
813
+ | ShIfClauseNode
814
+ | ShLetClauseNode
815
+ | ShSubshellNode
816
+ | ShTestClauseNode
817
+ | ShTestDeclNode
818
+ | ShTimeClauseNode
819
+ | ShWhileClauseNode;
820
+
821
+ /**
822
+ * The union of concrete node types mvdan/sh's `syntax.Loop` interface can
823
+ * hold.
824
+ *
825
+ * @public
826
+ */
827
+ export type ShLoopNode = ShCStyleLoopNode | ShWordIterNode;
828
+
829
+ /**
830
+ * The union of concrete node types mvdan/sh's `syntax.TestExpr` interface can
831
+ * hold.
832
+ *
833
+ * @public
834
+ */
835
+ export type ShTestExprNode = ShBinaryTestNode | ShParenTestNode | ShUnaryTestNode | ShWordNode;
836
+
837
+ /**
838
+ * The union of concrete node types mvdan/sh's `syntax.WordPart` interface can
839
+ * hold.
840
+ *
841
+ * @public
842
+ */
843
+ export type ShWordPartNode =
844
+ | ShArithmExpNode
845
+ | ShBraceExpNode
846
+ | ShCmdSubstNode
847
+ | ShDblQuotedNode
848
+ | ShExtGlobNode
849
+ | ShLitNode
850
+ | ShParamExpNode
851
+ | ShProcSubstNode
852
+ | ShSglQuotedNode;
853
+
854
+ /**
855
+ * The union of every normalized node type this bridge can produce.
856
+ *
857
+ * @public
858
+ */
859
+ export type ShAnyNode =
860
+ | ShArithmCmdNode
861
+ | ShArithmExpNode
862
+ | ShArrayElemNode
863
+ | ShArrayExprNode
864
+ | ShAssignNode
865
+ | ShBinaryArithmNode
866
+ | ShBinaryCmdNode
867
+ | ShBinaryTestNode
868
+ | ShBlockNode
869
+ | ShBraceExpNode
870
+ | ShCStyleLoopNode
871
+ | ShCallExprNode
872
+ | ShCaseClauseNode
873
+ | ShCaseItemNode
874
+ | ShCmdSubstNode
875
+ | ShCommentNode
876
+ | ShCoprocClauseNode
877
+ | ShDblQuotedNode
878
+ | ShDeclClauseNode
879
+ | ShExpansionNode
880
+ | ShExtGlobNode
881
+ | ShFileNode
882
+ | ShFlagsArithmNode
883
+ | ShForClauseNode
884
+ | ShFuncDeclNode
885
+ | ShIfClauseNode
886
+ | ShLetClauseNode
887
+ | ShLitNode
888
+ | ShParamExpNode
889
+ | ShParenArithmNode
890
+ | ShParenTestNode
891
+ | ShProcSubstNode
892
+ | ShRedirectNode
893
+ | ShReplaceNode
894
+ | ShSglQuotedNode
895
+ | ShSliceNode
896
+ | ShStmtNode
897
+ | ShSubshellNode
898
+ | ShTestClauseNode
899
+ | ShTestDeclNode
900
+ | ShTimeClauseNode
901
+ | ShUnaryArithmNode
902
+ | ShUnaryTestNode
903
+ | ShWhileClauseNode
904
+ | ShWordNode
905
+ | ShWordIterNode;
906
+
907
+ /**
908
+ * Every normalized node `type` string this bridge can produce.
909
+ *
910
+ * @public
911
+ */
912
+ export type ShNodeTypeName =
913
+ | 'ArithmCmd'
914
+ | 'ArithmExp'
915
+ | 'ArrayElem'
916
+ | 'ArrayExpr'
917
+ | 'Assign'
918
+ | 'BinaryArithm'
919
+ | 'BinaryCmd'
920
+ | 'BinaryTest'
921
+ | 'Block'
922
+ | 'BraceExp'
923
+ | 'CStyleLoop'
924
+ | 'CallExpr'
925
+ | 'CaseClause'
926
+ | 'CaseItem'
927
+ | 'CmdSubst'
928
+ | 'Comment'
929
+ | 'CoprocClause'
930
+ | 'DblQuoted'
931
+ | 'DeclClause'
932
+ | 'Expansion'
933
+ | 'ExtGlob'
934
+ | 'File'
935
+ | 'FlagsArithm'
936
+ | 'ForClause'
937
+ | 'FuncDecl'
938
+ | 'IfClause'
939
+ | 'LetClause'
940
+ | 'Lit'
941
+ | 'ParamExp'
942
+ | 'ParenArithm'
943
+ | 'ParenTest'
944
+ | 'ProcSubst'
945
+ | 'Redirect'
946
+ | 'Replace'
947
+ | 'SglQuoted'
948
+ | 'Slice'
949
+ | 'Stmt'
950
+ | 'Subshell'
951
+ | 'TestClause'
952
+ | 'TestDecl'
953
+ | 'TimeClause'
954
+ | 'UnaryArithm'
955
+ | 'UnaryTest'
956
+ | 'WhileClause'
957
+ | 'Word'
958
+ | 'WordIter';