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
@@ -0,0 +1,60 @@
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
+ /**
34
+ * A field's upstream value kind and nil-bearing boundaries. Null type names
35
+ * identify scalar/position kinds; other names identify concrete Go types.
36
+ * @public
37
+ */
38
+ export interface SyntaxFieldSchema {
39
+ /** The upstream value domain, independent of a field's current value. */
40
+ readonly kind: 'boolean' | 'string' | 'position' | 'operator' | 'struct' | 'interface';
41
+ /** Named operator, record, or interface domain; null for scalar/position data. */
42
+ readonly type: string | null;
43
+ /** Whether the entire field may hold the upstream nil value. */
44
+ readonly nullable: boolean;
45
+ /** Whether the field is an ordered Go slice, preserving nil versus empty. */
46
+ readonly slice: boolean;
47
+ /** Whether a slice element may independently hold a nil pointer/interface. */
48
+ readonly elementNullable: boolean;
49
+ }
50
+ /** Complete data fields and real syntax.Node membership. @public */
51
+ export interface SyntaxRecordSchema {
52
+ /** Whether the actual upstream type implements syntax.Node. */
53
+ readonly node: boolean;
54
+ /** Every exported upstream field, retaining its original spelling. */
55
+ readonly fields: Readonly<Record<string, SyntaxFieldSchema>>;
56
+ }
57
+ /** Reflection metadata; field order is not upstream Walk order. @public */
58
+ export declare const SYNTAX_SCHEMA: Readonly<Record<string, SyntaxRecordSchema>>;
59
+ /** Concrete alternatives accepted by upstream interfaces. @public */
60
+ export declare const SYNTAX_INTERFACES: Readonly<Record<string, readonly string[]>>;