@eagleoutice/flowr 2.9.9 → 2.9.11

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 (198) hide show
  1. package/README.md +57 -54
  2. package/abstract-interpretation/absint-visitor.d.ts +16 -14
  3. package/abstract-interpretation/absint-visitor.js +93 -47
  4. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
  5. package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
  6. package/abstract-interpretation/data-frame/shape-inference.d.ts +2 -5
  7. package/abstract-interpretation/data-frame/shape-inference.js +4 -5
  8. package/abstract-interpretation/domains/abstract-domain.d.ts +4 -4
  9. package/abstract-interpretation/domains/abstract-domain.js +8 -8
  10. package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +12 -5
  11. package/abstract-interpretation/domains/mapped-abstract-domain.js +47 -23
  12. package/abstract-interpretation/domains/set-range-domain.js +1 -1
  13. package/abstract-interpretation/domains/state-abstract-domain.d.ts +30 -1
  14. package/abstract-interpretation/domains/state-abstract-domain.js +130 -4
  15. package/abstract-interpretation/normalized-ast-fold.d.ts +2 -2
  16. package/abstract-interpretation/normalized-ast-fold.js +4 -3
  17. package/benchmark/slicer.js +5 -5
  18. package/benchmark/summarizer/first-phase/process.js +4 -4
  19. package/cli/repl/commands/repl-normalize.js +2 -2
  20. package/cli/repl/core.js +2 -2
  21. package/config.js +1 -1
  22. package/control-flow/cfg-simplification.d.ts +1 -0
  23. package/control-flow/cfg-simplification.js +1 -0
  24. package/control-flow/control-flow-graph.d.ts +1 -1
  25. package/control-flow/control-flow-graph.js +1 -2
  26. package/control-flow/extract-cfg.js +34 -15
  27. package/control-flow/semantic-cfg-guided-visitor.js +1 -0
  28. package/dataflow/cluster.js +1 -1
  29. package/dataflow/environments/built-in.d.ts +6 -15
  30. package/dataflow/environments/built-in.js +25 -33
  31. package/dataflow/environments/default-builtin-config.d.ts +4 -8
  32. package/dataflow/environments/default-builtin-config.js +8 -5
  33. package/dataflow/environments/reference-to-maybe.d.ts +8 -0
  34. package/dataflow/environments/reference-to-maybe.js +46 -3
  35. package/dataflow/eval/resolve/alias-tracking.d.ts +2 -2
  36. package/dataflow/eval/resolve/alias-tracking.js +6 -6
  37. package/dataflow/eval/resolve/resolve.js +12 -10
  38. package/dataflow/fn/exceptions-of-function.d.ts +1 -1
  39. package/dataflow/fn/exceptions-of-function.js +2 -1
  40. package/dataflow/graph/call-graph.d.ts +1 -1
  41. package/dataflow/graph/call-graph.js +4 -3
  42. package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
  43. package/dataflow/graph/dataflowgraph-builder.js +21 -21
  44. package/dataflow/graph/graph.d.ts +5 -5
  45. package/dataflow/graph/graph.js +36 -32
  46. package/dataflow/graph/unknown-side-effect.js +3 -1
  47. package/dataflow/info.d.ts +4 -0
  48. package/dataflow/info.js +2 -2
  49. package/dataflow/internal/linker.d.ts +4 -4
  50. package/dataflow/internal/linker.js +59 -33
  51. package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +2 -1
  52. package/dataflow/internal/process/functions/call/argument/make-argument.js +3 -1
  53. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -1
  54. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -1
  55. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -5
  56. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +1 -1
  57. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +6 -5
  58. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +15 -6
  59. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -1
  60. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +3 -2
  61. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -4
  62. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +3 -3
  63. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
  64. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
  65. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -1
  66. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +7 -7
  67. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +3 -3
  68. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +22 -11
  69. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +22 -19
  70. package/dataflow/internal/process/functions/call/common.d.ts +1 -1
  71. package/dataflow/internal/process/functions/call/common.js +43 -35
  72. package/dataflow/internal/process/functions/call/known-call-handling.js +0 -2
  73. package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
  74. package/dataflow/internal/process/functions/process-argument.js +3 -3
  75. package/dataflow/internal/process/functions/process-parameter.js +2 -2
  76. package/dataflow/origin/dfg-get-origin.d.ts +1 -1
  77. package/dataflow/origin/dfg-get-origin.js +2 -2
  78. package/documentation/doc-util/doc-types.js +1 -1
  79. package/documentation/wiki-absint.js +7 -8
  80. package/documentation/wiki-cfg.js +3 -3
  81. package/documentation/wiki-mk/doc-context.d.ts +8 -0
  82. package/documentation/wiki-mk/doc-context.js +4 -0
  83. package/documentation/wiki-normalized-ast.d.ts +1 -1
  84. package/documentation/wiki-normalized-ast.js +9 -6
  85. package/linter/linter-format.d.ts +10 -0
  86. package/linter/linter-format.js +15 -0
  87. package/linter/rules/absolute-path.js +3 -3
  88. package/linter/rules/dead-code.js +1 -1
  89. package/linter/rules/file-path-validity.js +1 -1
  90. package/linter/rules/seeded-randomness.js +1 -1
  91. package/linter/rules/unused-definition.js +1 -1
  92. package/package.json +7 -7
  93. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +9 -0
  94. package/project/plugins/file-plugins/files/flowr-description-file.js +12 -0
  95. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  96. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
  97. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +4 -5
  98. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -1
  99. package/queries/catalog/dependencies-query/dependencies-query-format.js +6 -5
  100. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -1
  101. package/queries/catalog/df-shape-query/df-shape-query-format.js +3 -3
  102. package/queries/catalog/does-call-query/does-call-query-executor.js +3 -3
  103. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +1 -1
  104. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -2
  105. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +1 -1
  106. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -1
  107. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +1 -1
  108. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
  109. package/queries/query-print.d.ts +1 -1
  110. package/queries/query-print.js +4 -3
  111. package/r-bridge/lang-4.x/ast/model/model.d.ts +151 -4
  112. package/r-bridge/lang-4.x/ast/model/model.js +249 -0
  113. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +11 -1
  114. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +13 -0
  115. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +19 -1
  116. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +26 -0
  117. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +36 -3
  118. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +48 -13
  119. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
  120. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +21 -0
  121. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +11 -1
  122. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +14 -0
  123. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +8 -2
  124. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +11 -5
  125. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +23 -1
  126. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +32 -0
  127. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +11 -1
  128. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +14 -0
  129. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +19 -1
  130. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +26 -1
  131. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +11 -1
  132. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +14 -0
  133. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +11 -1
  134. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +14 -0
  135. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +12 -2
  136. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +14 -0
  137. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +20 -2
  138. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +26 -0
  139. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +12 -2
  140. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +14 -0
  141. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +8 -2
  142. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +11 -5
  143. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +17 -1
  144. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +22 -0
  145. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +16 -1
  146. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +22 -0
  147. package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +45 -8
  148. package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +57 -16
  149. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +12 -2
  150. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +14 -0
  151. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +15 -3
  152. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +21 -6
  153. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +21 -6
  154. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +22 -5
  155. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
  156. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +21 -0
  157. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +11 -1
  158. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +14 -0
  159. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +23 -17
  160. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +39 -2
  161. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +52 -9
  162. package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +18 -17
  163. package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +8 -7
  164. package/r-bridge/lang-4.x/ast/model/processing/visitor.js +6 -13
  165. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +1 -1
  166. package/r-bridge/lang-4.x/ast/parser/json/parser.js +1 -1
  167. package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +4 -2
  168. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
  169. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +2 -2
  170. package/r-bridge/lang-4.x/convert-values.d.ts +14 -5
  171. package/r-bridge/lang-4.x/convert-values.js +76 -72
  172. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -15
  173. package/r-bridge/roxygen2/roxygen-parse.js +1 -1
  174. package/r-bridge/shell-executor.js +1 -1
  175. package/reconstruct/auto-select/magic-comments.js +4 -4
  176. package/reconstruct/reconstruct.js +2 -1
  177. package/search/search-executor/search-generators.js +2 -2
  178. package/slicing/criterion/filters/all-variables.js +1 -1
  179. package/slicing/criterion/parse.d.ts +1 -1
  180. package/slicing/criterion/parse.js +5 -3
  181. package/slicing/static/slice-call.d.ts +1 -1
  182. package/slicing/static/slice-call.js +2 -2
  183. package/statistics/features/supported/assignments/assignments.js +2 -2
  184. package/statistics/features/supported/control-flow/control-flow.js +2 -2
  185. package/statistics/features/supported/data-access/data-access.js +6 -5
  186. package/statistics/features/supported/defined-functions/defined-functions.js +9 -8
  187. package/statistics/features/supported/expression-list/statistics-expression-list.js +2 -2
  188. package/statistics/features/supported/loops/loops.js +6 -5
  189. package/statistics/features/supported/used-functions/used-functions.js +2 -2
  190. package/statistics/features/supported/variables/variables.js +8 -8
  191. package/util/mermaid/ast.js +3 -3
  192. package/util/mermaid/cfg.js +3 -4
  193. package/util/mermaid/dfg.d.ts +1 -1
  194. package/util/mermaid/dfg.js +13 -12
  195. package/util/simple-df/dfg-ascii.js +1 -1
  196. package/util/version.js +1 -1
  197. package/r-bridge/lang-4.x/ast/model/collect.d.ts +0 -10
  198. package/r-bridge/lang-4.x/ast/model/collect.js +0 -25
@@ -1,5 +1,6 @@
1
1
  import type { SourceRange } from '../../../../util/range';
2
- import type { RType } from './type';
2
+ import { SourceLocation } from '../../../../util/range';
3
+ import { RType } from './type';
3
4
  import type { MergeableRecord } from '../../../../util/objects';
4
5
  import type { RNumber } from './nodes/r-number';
5
6
  import type { RString } from './nodes/r-string';
@@ -14,7 +15,7 @@ import type { RRepeatLoop } from './nodes/r-repeat-loop';
14
15
  import type { RWhileLoop } from './nodes/r-while-loop';
15
16
  import type { RIfThenElse } from './nodes/r-if-then-else';
16
17
  import type { RFunctionDefinition } from './nodes/r-function-definition';
17
- import type { RFunctionCall } from './nodes/r-function-call';
18
+ import type { EmptyArgument, RFunctionCall } from './nodes/r-function-call';
18
19
  import type { RParameter } from './nodes/r-parameter';
19
20
  import type { RArgument } from './nodes/r-argument';
20
21
  import type { RExpressionList } from './nodes/r-expression-list';
@@ -23,13 +24,17 @@ import type { RUnaryOp } from './nodes/r-unary-op';
23
24
  import type { RBinaryOp } from './nodes/r-binary-op';
24
25
  import type { RPipe } from './nodes/r-pipe';
25
26
  import type { RDelimiter } from './nodes/info/r-delimiter';
27
+ import type { ParentInformation } from './processing/decorate';
28
+ import type { NodeId } from './processing/node-id';
29
+ import type { OnEnter, OnExit } from './processing/visitor';
30
+ import type { SingleOrArrayOrNothing } from '../../../../abstract-interpretation/normalized-ast-fold';
26
31
  /** Simply an empty type constraint used to say that there are additional decorations (see {@link RAstNodeBase}). */
27
32
  export type NoInfo = object;
28
33
  /**
29
34
  * Will be used to reconstruct the source of the given element in the R-ast.
30
35
  * This will not be part of most comparisons as it is mainly of interest to the reconstruction of R code.
31
36
  */
32
- interface Source {
37
+ export interface Source {
33
38
  /**
34
39
  * The range is different from the assigned {@link Location} as it refers to the complete source range covered by the given
35
40
  * element.
@@ -98,30 +103,105 @@ export type NamespaceIdentifier = string;
98
103
  * represented in the normalized AST.
99
104
  */
100
105
  export type RConstant<Info> = RNumber<Info> | RString<Info> | RLogical<Info>;
106
+ /**
107
+ * Helper object to provide helper functions for {@link RConstant|RConstants}.
108
+ * @see {@link RNode} - for more general helper functions for all nodes
109
+ */
110
+ export declare const RConstant: {
111
+ readonly name: "RConstant";
112
+ /**
113
+ * Type guard for {@link RConstant} nodes, i.e. checks whether a node is a number, string or logical constant.
114
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RNumber.is}) or check the `type` node directly.
115
+ */
116
+ readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RConstant<Info>;
117
+ /**
118
+ * A set of all types of constants in the normalized AST, i.e. number, string and logical constants.
119
+ */
120
+ readonly constantTypes: ReadonlySet<RType>;
121
+ };
101
122
  /**
102
123
  * This subtype of {@link RNode} represents all types of {@link Leaf} nodes in the
103
124
  * normalized AST.
104
125
  */
105
126
  export type RSingleNode<Info> = RComment<Info> | RSymbol<Info> | RConstant<Info> | RBreak<Info> | RNext<Info> | RLineDirective<Info>;
127
+ /**
128
+ * Represents a leaf node in the normalized AST, i.e. a node that does not have any children. This includes comment, symbol, constant, break, next and line directive nodes.
129
+ */
130
+ export declare const RSingleNode: {
131
+ readonly name: "RSingleNode";
132
+ /**
133
+ * Type guard for {@link RSingleNode} nodes, i.e. checks whether a node is a comment, symbol, constant, break, next or line directive.
134
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RComment.is}) or check the `type` node directly.
135
+ */
136
+ readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RSingleNode<Info>;
137
+ /**
138
+ * A set of all types of single nodes in the normalized AST, i.e. comment, symbol, constant, break, next and line directive nodes.
139
+ */
140
+ readonly singleNodeTypes: ReadonlySet<RType>;
141
+ };
106
142
  /**
107
143
  * This subtype of {@link RNode} represents all looping constructs in the normalized AST.
108
144
  */
109
145
  export type RLoopConstructs<Info> = RForLoop<Info> | RRepeatLoop<Info> | RWhileLoop<Info>;
146
+ export declare const RLoopConstructs: {
147
+ readonly name: "RLoopConstructs";
148
+ /**
149
+ * Type guard for {@link RLoopConstructs} nodes, i.e. checks whether a node is a for, repeat or while loop.
150
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RForLoop.is}) or check the `type` node directly.
151
+ */
152
+ readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RLoopConstructs<Info>;
153
+ /**
154
+ * A set of all types of loop constructs in the normalized AST, i.e. for, repeat and while loops.
155
+ */
156
+ readonly loopConstructTypes: ReadonlySet<RType>;
157
+ };
110
158
  /**
111
159
  * As an extension to {@link RLoopConstructs}, this subtype of {@link RNode} includes
112
160
  * the {@link RIfThenElse} construct as well.
113
161
  */
114
162
  export type RConstructs<Info> = RLoopConstructs<Info> | RIfThenElse<Info>;
163
+ export declare const RConstructs: {
164
+ readonly name: "RConstructs";
165
+ /**
166
+ * Type guard for {@link RConstructs} nodes, i.e. checks whether a node is a for, repeat or while loop or an if-then-else construct.
167
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RForLoop.is}) or check the `type` node directly.
168
+ */
169
+ readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RConstructs<Info>;
170
+ /**
171
+ * A set of all types of constructs in the normalized AST, i.e. for, repeat and while loops and if-then-else constructs.
172
+ */
173
+ readonly constructTypes: ReadonlySet<RType>;
174
+ };
115
175
  /**
116
176
  * This subtype of {@link RNode} represents all types related to functions
117
177
  * (calls and definitions) in the normalized AST.
118
178
  */
119
179
  export type RFunctions<Info> = RFunctionDefinition<Info> | RFunctionCall<Info> | RParameter<Info> | RArgument<Info>;
180
+ export declare const RFunctions: {
181
+ readonly name: "RFunctions";
182
+ /**
183
+ * Type guard for {@link RFunctions} nodes, i.e. checks whether a node is a function definition, function call, parameter or argument.
184
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RFunctionDefinition.is}) or check the `type` node directly.
185
+ */
186
+ readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RFunctions<Info>;
187
+ /**
188
+ * A set of all types of function-related nodes in the normalized AST, i.e. function definitions, function calls, parameters and arguments.
189
+ */
190
+ readonly functionTypes: ReadonlySet<RType>;
191
+ };
120
192
  /**
121
193
  * This subtype of {@link RNode} represents all types of otherwise hard to categorize
122
194
  * nodes in the normalized AST. At the moment these are the comment-like nodes.
123
195
  */
124
196
  export type ROther<Info> = RComment<Info> | RLineDirective<Info>;
197
+ export declare const ROther: {
198
+ readonly name: "ROther";
199
+ /**
200
+ * Type guard for {@link ROther} nodes, i.e. checks whether a node is a comment or line directive.
201
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RComment.is}) or check the `type` node directly.
202
+ */
203
+ readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is ROther<Info>;
204
+ };
125
205
  /**
126
206
  * The `RNode` type is the union of all possible nodes in the R-ast.
127
207
  * It should be used whenever you either not care what kind of
@@ -133,7 +213,74 @@ export type ROther<Info> = RComment<Info> | RLineDirective<Info>;
133
213
  * exclusive, some nodes can appear in multiple subtypes.
134
214
  * @see {@link recoverName} - to receive the name/lexeme from such a node
135
215
  * @see {@link recoverContent} - for a more rigorous approach to get the content of a node within a {@link DataflowGraph|dataflow graph}
216
+ * @see {@link RNode.getLocation} - to get the location of a node and other helpful functions provided by the {@link RNode} helper object
136
217
  */
137
218
  export type RNode<Info = NoInfo> = RExpressionList<Info> | RFunctions<Info> | ROther<Info> | RConstructs<Info> | RNamedAccess<Info> | RIndexAccess<Info> | RUnaryOp<Info> | RBinaryOp<Info> | RSingleNode<Info> | RPipe<Info>;
219
+ /**
220
+ * Helper object to provide helper functions for {@link RNode|RNodes}.
221
+ * @see {@link DefaultNormalizedAstFold} - for a more powerful way to traverse the normalized AST
222
+ */
223
+ export declare const RNode: {
224
+ readonly name: "RNode";
225
+ /**
226
+ * A helper function to retrieve the location of a given node, if available.
227
+ * @see SourceLocation.fromNode
228
+ */
229
+ readonly getLocation: (this: void, node: RNode) => SourceLocation | undefined;
230
+ /**
231
+ * A helper function to retrieve the id of a given node, if available.
232
+ */
233
+ readonly getId: (this: void, node: RNode<ParentInformation>) => NodeId;
234
+ /**
235
+ * A helper function to retrieve the type of a given node.
236
+ */
237
+ readonly getType: (this: void, node: RNode) => RType;
238
+ /**
239
+ * Visits all node ids within a tree given by a respective root node using a depth-first search with prefix order.
240
+ * @param nodes - The root id nodes to start collecting from
241
+ * @param onVisit - Called before visiting the subtree of each node. Can be used to stop visiting the subtree starting with this node (return `true` stop)
242
+ * @param onExit - Called after the subtree of a node has been visited, called for leafs too (even though their subtree is empty)
243
+ * @see {@link RProject.visitAst} - to visit all nodes in a project
244
+ */
245
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: OnEnter<OtherInfo>, onExit?: OnExit<OtherInfo>) => void;
246
+ /**
247
+ * Collects all node ids within a tree given by a respective root node
248
+ * @param nodes - The root id nodes to start collecting from
249
+ * @see {@link collectAllIdsWithStop} - to stop collecting at certain nodes
250
+ * @see {@link RProject.collectAllIds} - to collect all ids within a project
251
+ */
252
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: SingleOrArrayOrNothing<RNode<OtherInfo & ParentInformation>>) => Set<NodeId>;
253
+ /**
254
+ * Collects all direct children of a given node, i.e. all nodes that are directly reachable via a property of the given node.
255
+ */
256
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof EmptyArgument)[];
257
+ /**
258
+ * Returns the direct parent of a node.
259
+ * Usually, only root nodes do not have a parent, and you can assume that there is a
260
+ * linear chain of parents leading to the root node.
261
+ */
262
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: Map<NodeId, RNode<OtherInfo>>) => RNode<OtherInfo> | undefined;
263
+ /**
264
+ * In contrast to the nesting stored in the {@link RNode} structure,
265
+ * this function calculates the depth of a node by counting the number of parents until the root node is reached.
266
+ */
267
+ readonly depth: (this: void, node: RNode, idMap: Map<NodeId, RNode>) => number;
268
+ /**
269
+ * Collects all node ids within a tree given by a respective root node, but stops collecting at nodes where the given `stop` function returns `true`.
270
+ * <p>
271
+ * This can be used to exclude certain subtrees from the collection, for example to exclude function bodies when collecting ids on the root level.
272
+ * @param nodes - The root id nodes to start collecting from
273
+ * @param stop - A function that determines whether to stop collecting at a given node, does not stop by default
274
+ * @see {@link collectAllIds} - to collect all ids without stopping
275
+ * @see {@link RProject.collectAllIdsWithStop} - to collect all ids within a project with stopping
276
+ */
277
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: SingleOrArrayOrNothing<RNode<OtherInfo & ParentInformation>>, stop: (node: RNode<OtherInfo & ParentInformation>) => boolean) => Set<NodeId>;
278
+ /**
279
+ * A helper function to retrieve the lexeme of a given node, if available.
280
+ * If the `fullLexeme` is available, it will be returned, otherwise the `lexeme` will be returned.
281
+ */
282
+ readonly lexeme: <R extends RNode<ParentInformation>>(this: void, node: R | undefined) => R extends {
283
+ lexeme: string;
284
+ } ? string : string | undefined;
285
+ };
138
286
  export type OtherInfoNode = RNode | RDelimiter;
139
- export {};
@@ -1,3 +1,252 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RNode = exports.ROther = exports.RFunctions = exports.RConstructs = exports.RLoopConstructs = exports.RSingleNode = exports.RConstant = void 0;
4
+ const range_1 = require("../../../../util/range");
5
+ const type_1 = require("./type");
6
+ const r_access_1 = require("./nodes/r-access");
7
+ const visitor_1 = require("./processing/visitor");
8
+ const assert_1 = require("../../../../util/assert");
9
+ /**
10
+ * Helper object to provide helper functions for {@link RConstant|RConstants}.
11
+ * @see {@link RNode} - for more general helper functions for all nodes
12
+ */
13
+ exports.RConstant = {
14
+ name: 'RConstant',
15
+ /**
16
+ * Type guard for {@link RConstant} nodes, i.e. checks whether a node is a number, string or logical constant.
17
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RNumber.is}) or check the `type` node directly.
18
+ */
19
+ is(node) {
20
+ if (!node) {
21
+ return false;
22
+ }
23
+ const t = node.type;
24
+ return t === type_1.RType.Number || t === type_1.RType.String || t === type_1.RType.Logical;
25
+ },
26
+ /**
27
+ * A set of all types of constants in the normalized AST, i.e. number, string and logical constants.
28
+ */
29
+ constantTypes: new Set([type_1.RType.Number, type_1.RType.String, type_1.RType.Logical])
30
+ };
31
+ /**
32
+ * Represents a leaf node in the normalized AST, i.e. a node that does not have any children. This includes comment, symbol, constant, break, next and line directive nodes.
33
+ */
34
+ exports.RSingleNode = {
35
+ name: 'RSingleNode',
36
+ /**
37
+ * Type guard for {@link RSingleNode} nodes, i.e. checks whether a node is a comment, symbol, constant, break, next or line directive.
38
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RComment.is}) or check the `type` node directly.
39
+ */
40
+ is(node) {
41
+ if (!node) {
42
+ return false;
43
+ }
44
+ const t = node.type;
45
+ return t === type_1.RType.Comment || t === type_1.RType.Symbol || exports.RConstant.constantTypes.has(t) || t === type_1.RType.Break || t === type_1.RType.Next || t === type_1.RType.LineDirective;
46
+ },
47
+ /**
48
+ * A set of all types of single nodes in the normalized AST, i.e. comment, symbol, constant, break, next and line directive nodes.
49
+ */
50
+ singleNodeTypes: new Set([type_1.RType.Comment, type_1.RType.Symbol, type_1.RType.Break, type_1.RType.Next, type_1.RType.LineDirective, ...exports.RConstant.constantTypes])
51
+ };
52
+ exports.RLoopConstructs = {
53
+ name: 'RLoopConstructs',
54
+ /**
55
+ * Type guard for {@link RLoopConstructs} nodes, i.e. checks whether a node is a for, repeat or while loop.
56
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RForLoop.is}) or check the `type` node directly.
57
+ */
58
+ is(node) {
59
+ if (!node) {
60
+ return false;
61
+ }
62
+ const t = node.type;
63
+ return t === type_1.RType.ForLoop || t === type_1.RType.RepeatLoop || t === type_1.RType.WhileLoop;
64
+ },
65
+ /**
66
+ * A set of all types of loop constructs in the normalized AST, i.e. for, repeat and while loops.
67
+ */
68
+ loopConstructTypes: new Set([type_1.RType.ForLoop, type_1.RType.RepeatLoop, type_1.RType.WhileLoop])
69
+ };
70
+ exports.RConstructs = {
71
+ name: 'RConstructs',
72
+ /**
73
+ * Type guard for {@link RConstructs} nodes, i.e. checks whether a node is a for, repeat or while loop or an if-then-else construct.
74
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RForLoop.is}) or check the `type` node directly.
75
+ */
76
+ is(node) {
77
+ if (!node) {
78
+ return false;
79
+ }
80
+ const t = node.type;
81
+ return exports.RLoopConstructs.loopConstructTypes.has(t) || t === type_1.RType.IfThenElse;
82
+ },
83
+ /**
84
+ * A set of all types of constructs in the normalized AST, i.e. for, repeat and while loops and if-then-else constructs.
85
+ */
86
+ constructTypes: new Set([...exports.RLoopConstructs.loopConstructTypes, type_1.RType.IfThenElse])
87
+ };
88
+ exports.RFunctions = {
89
+ name: 'RFunctions',
90
+ /**
91
+ * Type guard for {@link RFunctions} nodes, i.e. checks whether a node is a function definition, function call, parameter or argument.
92
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RFunctionDefinition.is}) or check the `type` node directly.
93
+ */
94
+ is(node) {
95
+ if (!node) {
96
+ return false;
97
+ }
98
+ const t = node.type;
99
+ return t === type_1.RType.FunctionDefinition || t === type_1.RType.FunctionCall || t === type_1.RType.Parameter || t === type_1.RType.Argument;
100
+ },
101
+ /**
102
+ * A set of all types of function-related nodes in the normalized AST, i.e. function definitions, function calls, parameters and arguments.
103
+ */
104
+ functionTypes: new Set([type_1.RType.FunctionDefinition, type_1.RType.FunctionCall, type_1.RType.Parameter, type_1.RType.Argument])
105
+ };
106
+ exports.ROther = {
107
+ name: 'ROther',
108
+ /**
109
+ * Type guard for {@link ROther} nodes, i.e. checks whether a node is a comment or line directive.
110
+ * If you need the specific type, please either use the respective type guards (e.g., {@link RComment.is}) or check the `type` node directly.
111
+ */
112
+ is(node) {
113
+ if (!node) {
114
+ return false;
115
+ }
116
+ const t = node.type;
117
+ return t === type_1.RType.Comment || t === type_1.RType.LineDirective;
118
+ }
119
+ };
120
+ /**
121
+ * Helper object to provide helper functions for {@link RNode|RNodes}.
122
+ * @see {@link DefaultNormalizedAstFold} - for a more powerful way to traverse the normalized AST
123
+ */
124
+ exports.RNode = {
125
+ name: 'RNode',
126
+ /**
127
+ * A helper function to retrieve the location of a given node, if available.
128
+ * @see SourceLocation.fromNode
129
+ */
130
+ getLocation(node) {
131
+ return range_1.SourceLocation.fromNode(node);
132
+ },
133
+ /**
134
+ * A helper function to retrieve the id of a given node, if available.
135
+ */
136
+ getId(node) {
137
+ return node.info.id;
138
+ },
139
+ /**
140
+ * A helper function to retrieve the type of a given node.
141
+ */
142
+ getType(node) {
143
+ return node.type;
144
+ },
145
+ /**
146
+ * Visits all node ids within a tree given by a respective root node using a depth-first search with prefix order.
147
+ * @param nodes - The root id nodes to start collecting from
148
+ * @param onVisit - Called before visiting the subtree of each node. Can be used to stop visiting the subtree starting with this node (return `true` stop)
149
+ * @param onExit - Called after the subtree of a node has been visited, called for leafs too (even though their subtree is empty)
150
+ * @see {@link RProject.visitAst} - to visit all nodes in a project
151
+ */
152
+ visitAst(nodes, onVisit, onExit) {
153
+ return new visitor_1.NodeVisitor(onVisit, onExit).visit(nodes);
154
+ },
155
+ /**
156
+ * Collects all node ids within a tree given by a respective root node
157
+ * @param nodes - The root id nodes to start collecting from
158
+ * @see {@link collectAllIdsWithStop} - to stop collecting at certain nodes
159
+ * @see {@link RProject.collectAllIds} - to collect all ids within a project
160
+ */
161
+ collectAllIds(nodes) {
162
+ const ids = new Set();
163
+ exports.RNode.visitAst(nodes, node => {
164
+ ids.add(node.info.id);
165
+ });
166
+ return ids;
167
+ },
168
+ /**
169
+ * Collects all direct children of a given node, i.e. all nodes that are directly reachable via a property of the given node.
170
+ */
171
+ directChildren(node) {
172
+ const type = node.type;
173
+ switch (type) {
174
+ case type_1.RType.FunctionCall: return [node.named ? node.functionName : node.calledFunction, ...node.arguments];
175
+ case type_1.RType.FunctionDefinition: return [...node.parameters, node.body];
176
+ case type_1.RType.ExpressionList: return node.grouping ? [node.grouping[0], ...node.children, node.grouping[1]] : node.children;
177
+ case type_1.RType.ForLoop: return [node.variable, node.vector, node.body];
178
+ case type_1.RType.WhileLoop: return [node.condition, node.body];
179
+ case type_1.RType.RepeatLoop: return [node.body];
180
+ case type_1.RType.IfThenElse: return node.otherwise ? [node.condition, node.then, node.otherwise] : [node.condition, node.then];
181
+ case type_1.RType.BinaryOp:
182
+ case type_1.RType.Pipe: return [node.lhs, node.rhs];
183
+ case type_1.RType.UnaryOp: return [node.operand];
184
+ case type_1.RType.Parameter: return node.defaultValue ? [node.name, node.defaultValue] : [node.name];
185
+ case type_1.RType.Argument: return node.name && node.value ? [node.name, node.value] : node.name ? [node.name] : node.value ? [node.value] : [];
186
+ case type_1.RType.Access: return r_access_1.RAccess.isIndex(node) ? [node.accessed, ...node.access] : [node.accessed];
187
+ case type_1.RType.Symbol:
188
+ case type_1.RType.Logical:
189
+ case type_1.RType.Number:
190
+ case type_1.RType.String:
191
+ case type_1.RType.Comment:
192
+ case type_1.RType.Break:
193
+ case type_1.RType.Next:
194
+ case type_1.RType.LineDirective: return [];
195
+ default:
196
+ (0, assert_1.assertUnreachable)(type);
197
+ }
198
+ },
199
+ /**
200
+ * Returns the direct parent of a node.
201
+ * Usually, only root nodes do not have a parent, and you can assume that there is a
202
+ * linear chain of parents leading to the root node.
203
+ */
204
+ directParent(node, idMap) {
205
+ const parentId = node.info.parent;
206
+ if (parentId === undefined) {
207
+ return undefined;
208
+ }
209
+ return idMap.get(parentId);
210
+ },
211
+ /**
212
+ * In contrast to the nesting stored in the {@link RNode} structure,
213
+ * this function calculates the depth of a node by counting the number of parents until the root node is reached.
214
+ */
215
+ depth(node, idMap) {
216
+ let depth = 0;
217
+ let currentNode = node;
218
+ while (currentNode) {
219
+ currentNode = exports.RNode.directParent(currentNode, idMap);
220
+ depth++;
221
+ }
222
+ return depth;
223
+ },
224
+ /**
225
+ * Collects all node ids within a tree given by a respective root node, but stops collecting at nodes where the given `stop` function returns `true`.
226
+ * <p>
227
+ * This can be used to exclude certain subtrees from the collection, for example to exclude function bodies when collecting ids on the root level.
228
+ * @param nodes - The root id nodes to start collecting from
229
+ * @param stop - A function that determines whether to stop collecting at a given node, does not stop by default
230
+ * @see {@link collectAllIds} - to collect all ids without stopping
231
+ * @see {@link RProject.collectAllIdsWithStop} - to collect all ids within a project with stopping
232
+ */
233
+ collectAllIdsWithStop(nodes, stop) {
234
+ const ids = new Set();
235
+ exports.RNode.visitAst(nodes, node => {
236
+ if (stop(node)) {
237
+ return true;
238
+ }
239
+ ids.add(node.info.id);
240
+ return false;
241
+ });
242
+ return ids;
243
+ },
244
+ /**
245
+ * A helper function to retrieve the lexeme of a given node, if available.
246
+ * If the `fullLexeme` is available, it will be returned, otherwise the `lexeme` will be returned.
247
+ */
248
+ lexeme(node) {
249
+ return node?.info.fullLexeme ?? node?.lexeme;
250
+ }
251
+ };
3
252
  //# sourceMappingURL=model.js.map
@@ -1,4 +1,5 @@
1
- import type { RawRType, RType } from '../../type';
1
+ import type { RawRType } from '../../type';
2
+ import { RType } from '../../type';
2
3
  import type { Location } from '../../model';
3
4
  import type { MergeableRecord } from '../../../../../../util/objects';
4
5
  /**
@@ -10,3 +11,12 @@ export interface RDelimiter extends MergeableRecord, Location {
10
11
  readonly lexeme: string;
11
12
  readonly subtype: RawRType;
12
13
  }
14
+ /**
15
+ * Helper for working with {@link RDelimiter} AST nodes.
16
+ */
17
+ export declare const RDelimiter: {
18
+ /**
19
+ * Type guard for {@link RDelimiter} nodes.
20
+ */
21
+ readonly is: (this: void, node: unknown) => node is RDelimiter;
22
+ };
@@ -1,3 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RDelimiter = void 0;
4
+ const type_1 = require("../../type");
5
+ /**
6
+ * Helper for working with {@link RDelimiter} AST nodes.
7
+ */
8
+ exports.RDelimiter = {
9
+ /**
10
+ * Type guard for {@link RDelimiter} nodes.
11
+ */
12
+ is(node) {
13
+ return typeof node === 'object' && node !== null && 'type' in node && node.type === type_1.RType.Delimiter;
14
+ }
15
+ };
3
16
  //# sourceMappingURL=r-delimiter.js.map
@@ -1,5 +1,5 @@
1
1
  import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
2
- import type { RType } from '../type';
2
+ import { RType } from '../type';
3
3
  import type { RArgument, RUnnamedArgument } from './r-argument';
4
4
  import type { EmptyArgument } from './r-function-call';
5
5
  /**
@@ -25,4 +25,22 @@ export interface RIndexAccess<Info = NoInfo> extends RAccessBase<Info> {
25
25
  access: readonly (RArgument<Info> | typeof EmptyArgument)[];
26
26
  }
27
27
  export type RAccess<Info = NoInfo> = RNamedAccess<Info> | RIndexAccess<Info>;
28
+ /**
29
+ * Helper for working with {@link RAccess} AST nodes.
30
+ */
31
+ export declare const RAccess: {
32
+ readonly name: "RAccess";
33
+ /**
34
+ * Type guard for {@link RAccess} nodes.
35
+ */
36
+ readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RAccess<Info>;
37
+ /**
38
+ * Type guard for {@link RNamedAccess} nodes.
39
+ */
40
+ readonly isNamed: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RNamedAccess<Info>;
41
+ /**
42
+ * Type guard for {@link RIndexAccess} nodes.
43
+ */
44
+ readonly isIndex: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RIndexAccess<Info>;
45
+ };
28
46
  export {};
@@ -1,3 +1,29 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RAccess = void 0;
4
+ const type_1 = require("../type");
5
+ /**
6
+ * Helper for working with {@link RAccess} AST nodes.
7
+ */
8
+ exports.RAccess = {
9
+ name: 'RAccess',
10
+ /**
11
+ * Type guard for {@link RAccess} nodes.
12
+ */
13
+ is(node) {
14
+ return node?.type === type_1.RType.Access;
15
+ },
16
+ /**
17
+ * Type guard for {@link RNamedAccess} nodes.
18
+ */
19
+ isNamed(node) {
20
+ return exports.RAccess.is(node) && (node.operator === '$' || node.operator === '@');
21
+ },
22
+ /**
23
+ * Type guard for {@link RIndexAccess} nodes.
24
+ */
25
+ isIndex(node) {
26
+ return exports.RAccess.is(node) && (node.operator === '[' || node.operator === '[[');
27
+ }
28
+ };
3
29
  //# sourceMappingURL=r-access.js.map
@@ -1,9 +1,10 @@
1
1
  import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
2
- import type { RType } from '../type';
2
+ import { RType } from '../type';
3
3
  import type { RSymbol } from './r-symbol';
4
4
  import type { ParentInformation } from '../processing/decorate';
5
5
  import type { NodeId } from '../processing/node-id';
6
6
  import type { RFunctionArgument } from './r-function-call';
7
+ import { EmptyArgument } from './r-function-call';
7
8
  import type { BrandedIdentifier } from '../../../../../dataflow/environments/identifier';
8
9
  /**
9
10
  * Represents a named or unnamed argument of a function definition in R.
@@ -13,11 +14,43 @@ export interface RArgument<Info = NoInfo> extends RAstNodeBase<Info>, Location {
13
14
  name: RSymbol<Info, BrandedIdentifier> | undefined;
14
15
  value: RNode<Info> | undefined;
15
16
  }
17
+ /**
18
+ * Represents an unnamed argument of a function definition in R, i.e. an argument without a name.
19
+ * For the helper object, see {@link RArgument.isUnnamed}.
20
+ */
16
21
  export interface RUnnamedArgument<Info = NoInfo> extends RArgument<Info> {
17
22
  name: undefined;
18
23
  value: RNode<Info>;
19
24
  }
20
25
  /**
21
- * Retrieve the argument with the given id from the list of arguments.
26
+ * Helper for working with {@link RArgument} AST nodes.
22
27
  */
23
- export declare function getArgumentWithId<OtherInfo>(args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined): RFunctionArgument<OtherInfo & ParentInformation> | undefined;
28
+ export declare const RArgument: {
29
+ readonly name: "RArgument";
30
+ /**
31
+ * Type guard for {@link RArgument} nodes.
32
+ * @see {@link RArgument.isUnnamed} - to check whether an argument is unnamed
33
+ */
34
+ readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RArgument<Info>;
35
+ /**
36
+ * Type guard for named arguments, i.e. arguments with a name.
37
+ */
38
+ readonly isNamed: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RArgument<Info> & {
39
+ name: RSymbol<Info, BrandedIdentifier>;
40
+ };
41
+ /**
42
+ * Type guard for unnamed arguments, i.e. arguments without a name.
43
+ */
44
+ readonly isUnnamed: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RUnnamedArgument<Info>;
45
+ /**
46
+ * Type guard for arguments with a value, i.e. arguments that are not just placeholders without a value.
47
+ */
48
+ readonly isWithValue: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RArgument<Info> & {
49
+ value: RNode<Info>;
50
+ };
51
+ readonly getWithId: <OtherInfo>(args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined) => Exclude<RFunctionArgument<OtherInfo & ParentInformation>, typeof EmptyArgument> | undefined;
52
+ /**
53
+ * Retrieve the value of the argument with the given id from the list of arguments.
54
+ */
55
+ readonly getValue: <OtherInfo>(args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined) => RNode<OtherInfo> | undefined;
56
+ };