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