@eagleoutice/flowr 2.9.14 → 2.10.2

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 (214) hide show
  1. package/README.md +52 -29
  2. package/abstract-interpretation/absint-visitor.d.ts +13 -8
  3. package/abstract-interpretation/absint-visitor.js +35 -26
  4. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +1 -2
  5. package/abstract-interpretation/data-frame/dataframe-domain.js +14 -15
  6. package/abstract-interpretation/data-frame/mappers/access-mapper.js +2 -15
  7. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +11 -17
  8. package/abstract-interpretation/data-frame/mappers/arguments.js +18 -18
  9. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +41 -15
  10. package/abstract-interpretation/data-frame/mappers/function-mapper.js +74 -48
  11. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -1
  12. package/abstract-interpretation/data-frame/semantics.d.ts +1 -1
  13. package/abstract-interpretation/data-frame/semantics.js +31 -35
  14. package/abstract-interpretation/data-frame/shape-inference.js +1 -1
  15. package/abstract-interpretation/domains/interval-domain.d.ts +1 -0
  16. package/abstract-interpretation/domains/interval-domain.js +3 -0
  17. package/abstract-interpretation/domains/product-domain.d.ts +9 -0
  18. package/abstract-interpretation/domains/product-domain.js +26 -6
  19. package/abstract-interpretation/domains/state-abstract-domain.d.ts +36 -22
  20. package/abstract-interpretation/domains/state-abstract-domain.js +169 -62
  21. package/abstract-interpretation/unsupported-functions.d.ts +10 -0
  22. package/abstract-interpretation/unsupported-functions.js +45 -0
  23. package/benchmark/slicer.js +10 -13
  24. package/benchmark/stats/stats.d.ts +2 -2
  25. package/cli/flowr.js +1 -1
  26. package/cli/repl/parser/slice-query-parser.d.ts +2 -2
  27. package/config.d.ts +4 -0
  28. package/config.js +5 -3
  29. package/control-flow/control-flow-graph.js +13 -9
  30. package/control-flow/semantic-cfg-guided-visitor.d.ts +6 -0
  31. package/control-flow/semantic-cfg-guided-visitor.js +6 -0
  32. package/dataflow/environments/built-in-proc-name.d.ts +6 -0
  33. package/dataflow/environments/built-in-proc-name.js +6 -0
  34. package/dataflow/environments/built-in.d.ts +7 -5
  35. package/dataflow/environments/built-in.js +2 -0
  36. package/dataflow/environments/default-builtin-config.d.ts +442 -6
  37. package/dataflow/environments/default-builtin-config.js +158 -3
  38. package/dataflow/environments/identifier.d.ts +4 -0
  39. package/dataflow/environments/identifier.js +17 -0
  40. package/dataflow/environments/overwrite.js +2 -5
  41. package/dataflow/graph/call-graph.d.ts +4 -7
  42. package/dataflow/graph/call-graph.js +0 -22
  43. package/dataflow/graph/df-helper.d.ts +23 -12
  44. package/dataflow/graph/df-helper.js +44 -7
  45. package/dataflow/graph/graph-helper.d.ts +9 -4
  46. package/dataflow/graph/graph-helper.js +26 -3
  47. package/dataflow/graph/graph.d.ts +23 -2
  48. package/dataflow/graph/graph.js +38 -4
  49. package/dataflow/graph/vertex.d.ts +2 -0
  50. package/dataflow/instrument/instrument-dataflow-count.d.ts +10 -0
  51. package/dataflow/instrument/instrument-dataflow-count.js +10 -0
  52. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +4 -4
  53. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +3 -3
  54. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +2 -2
  55. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -0
  56. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -3
  57. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +1 -1
  58. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +2 -2
  59. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +2 -2
  60. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +2 -2
  61. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
  62. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
  63. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +8 -19
  64. package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -2
  65. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +2 -2
  66. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +2 -2
  67. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +2 -2
  68. package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +2 -2
  69. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +23 -3
  70. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +80 -12
  71. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +41 -0
  72. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +179 -0
  73. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +7 -4
  74. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +62 -1
  75. package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +7 -2
  76. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +15 -1
  77. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +2 -2
  78. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +2 -2
  79. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
  80. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
  81. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +2 -2
  82. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -2
  83. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +2 -2
  84. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
  85. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +2 -2
  86. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.d.ts +2 -2
  87. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
  88. package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +2 -2
  89. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
  90. package/dataflow/internal/process/functions/call/common.d.ts +2 -2
  91. package/dataflow/internal/process/functions/call/common.js +6 -4
  92. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -2
  93. package/dataflow/internal/process/functions/call/named-call-handling.d.ts +2 -2
  94. package/dataflow/internal/process/functions/process-parameter.js +1 -1
  95. package/documentation/doc-readme.js +2 -1
  96. package/documentation/wiki-absint.js +6 -5
  97. package/documentation/wiki-analyzer.js +0 -2
  98. package/documentation/wiki-linter.js +6 -0
  99. package/documentation/wiki-normalized-ast.js +7 -7
  100. package/linter/linter-rules.d.ts +49 -1
  101. package/linter/linter-rules.js +5 -1
  102. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  103. package/linter/rules/dataframe-access-validation.js +3 -4
  104. package/linter/rules/problematic-eval.d.ts +44 -0
  105. package/linter/rules/problematic-eval.js +83 -0
  106. package/linter/rules/roxygen-arguments.d.ts +35 -0
  107. package/linter/rules/roxygen-arguments.js +100 -0
  108. package/package.json +8 -9
  109. package/project/context/flowr-analyzer-context.d.ts +1 -8
  110. package/project/context/flowr-analyzer-context.js +1 -7
  111. package/project/context/flowr-analyzer-environment-context.d.ts +5 -0
  112. package/project/context/flowr-analyzer-environment-context.js +6 -0
  113. package/project/context/flowr-analyzer-files-context.d.ts +6 -0
  114. package/project/context/flowr-analyzer-files-context.js +4 -2
  115. package/project/flowr-analyzer-builder.js +1 -4
  116. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  117. package/queries/catalog/call-context-query/call-context-query-executor.js +10 -5
  118. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
  119. package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -0
  120. package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -1
  121. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -3
  122. package/queries/catalog/df-shape-query/df-shape-query-format.js +7 -2
  123. package/queries/catalog/does-call-query/does-call-query-executor.js +1 -1
  124. package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
  125. package/queries/catalog/files-query/files-query-executor.js +0 -1
  126. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
  127. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +3 -3
  128. package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +6 -0
  129. package/queries/catalog/input-sources-query/input-sources-query-executor.js +66 -0
  130. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +36 -0
  131. package/queries/catalog/input-sources-query/input-sources-query-format.js +63 -0
  132. package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +92 -0
  133. package/queries/catalog/input-sources-query/simple-input-classifier.js +310 -0
  134. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +2 -2
  135. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
  136. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
  137. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -1
  138. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
  139. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
  140. package/queries/catalog/location-map-query/location-map-query-executor.js +1 -1
  141. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
  142. package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
  143. package/queries/catalog/origin-query/origin-query-executor.js +1 -1
  144. package/queries/catalog/origin-query/origin-query-format.d.ts +3 -3
  145. package/queries/catalog/provenance-query/provenance-query-executor.d.ts +1 -4
  146. package/queries/catalog/provenance-query/provenance-query-executor.js +3 -6
  147. package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -2
  148. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +1 -1
  149. package/queries/query.d.ts +9 -1
  150. package/queries/query.js +2 -0
  151. package/r-bridge/data/data.d.ts +2 -2
  152. package/r-bridge/data/data.js +2 -2
  153. package/r-bridge/lang-4.x/ast/model/model.d.ts +3 -0
  154. package/r-bridge/lang-4.x/ast/model/model.js +3 -0
  155. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +16 -1
  156. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +2 -0
  157. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +29 -6
  158. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +16 -2
  159. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
  160. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +2 -0
  161. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +15 -0
  162. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +2 -0
  163. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +15 -0
  164. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +2 -0
  165. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +16 -1
  166. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +2 -0
  167. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +16 -1
  168. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +2 -0
  169. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +19 -4
  170. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -0
  171. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +21 -0
  172. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +16 -0
  173. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +16 -1
  174. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +2 -0
  175. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +16 -1
  176. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +2 -0
  177. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +16 -1
  178. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +2 -0
  179. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +16 -1
  180. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +2 -0
  181. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +16 -1
  182. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +2 -0
  183. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +16 -1
  184. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +2 -0
  185. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +25 -1
  186. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +15 -0
  187. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +16 -1
  188. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +2 -0
  189. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +16 -1
  190. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -0
  191. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +16 -1
  192. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +2 -0
  193. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
  194. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +2 -0
  195. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +16 -1
  196. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +2 -0
  197. package/r-bridge/lang-4.x/ast/model/versions.d.ts +2 -0
  198. package/r-bridge/lang-4.x/ast/model/versions.js +3 -1
  199. package/r-bridge/roxygen2/documentation-provider.js +15 -6
  200. package/r-bridge/roxygen2/roxygen-ast.d.ts +3 -1
  201. package/search/flowr-search-builder.js +3 -2
  202. package/search/search-executor/search-generators.js +1 -1
  203. package/slicing/criterion/parse.d.ts +11 -10
  204. package/slicing/criterion/parse.js +9 -8
  205. package/slicing/static/static-slicer.js +24 -1
  206. package/util/collections/arrays.d.ts +4 -0
  207. package/util/collections/arrays.js +7 -0
  208. package/util/mermaid/ast.js +2 -1
  209. package/util/mermaid/dfg.js +2 -1
  210. package/util/record.d.ts +23 -0
  211. package/util/record.js +33 -0
  212. package/util/version.js +1 -1
  213. package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +0 -41
  214. package/abstract-interpretation/domains/mapped-abstract-domain.js +0 -213
@@ -7,10 +7,7 @@ const parse_1 = require("../../../slicing/criterion/parse");
7
7
  const df_helper_1 = require("../../../dataflow/graph/df-helper");
8
8
  const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
9
9
  /**
10
- * Execute static slice queries, catching duplicates with the same fingerprint
11
- * @param analyzer - The basic query data containing the analyzer
12
- * @param queries - The static slice queries to execute
13
- * @returns The results of the static slice queries
10
+ * Execute a provenance query collection, {@link Dataflow.provenance}
14
11
  */
15
12
  async function executeProvenanceQuery({ analyzer }, queries) {
16
13
  const start = Date.now();
@@ -20,9 +17,9 @@ async function executeProvenanceQuery({ analyzer }, queries) {
20
17
  for (const query of queries) {
21
18
  const key = query.criterion;
22
19
  if (results[key]) {
23
- log_1.log.warn(`Duplicate Key for provenance query: ${key}, skipping...`);
20
+ log_1.log.warn(`Duplicate key for provenance query: ${key}, skipping...`);
24
21
  }
25
- const criterionId = parse_1.SingleSlicingCriterion.tryParse(key, nast.idMap) ?? key;
22
+ const criterionId = parse_1.SlicingCriterion.tryParse(key, nast.idMap) ?? key;
26
23
  const provenanceNode = nast.idMap.get(criterionId);
27
24
  const fdef = r_function_definition_1.RFunctionDefinition.wrappingFunctionDefinition(provenanceNode, nast.idMap);
28
25
  results[key] = Array.from(df_helper_1.Dataflow.provenance(criterionId, df.graph, fdef ? model_1.RNode.collectAllIds(fdef) : undefined));
@@ -1,5 +1,5 @@
1
1
  import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
- import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
2
+ import type { SlicingCriterion } from '../../../slicing/criterion/parse';
3
3
  import type { ParsedQueryLine } from '../../query';
4
4
  import Joi from 'joi';
5
5
  import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
@@ -10,7 +10,7 @@ import { executeProvenanceQuery } from './provenance-query-executor';
10
10
  export interface ProvenanceQuery extends BaseQueryFormat {
11
11
  readonly type: 'provenance';
12
12
  /** The slicing criterion to use as a start*/
13
- readonly criterion: SingleSlicingCriterion;
13
+ readonly criterion: SlicingCriterion;
14
14
  /** Whether to stop on fdef boundaries */
15
15
  readonly restrictFdef?: boolean;
16
16
  }
@@ -25,7 +25,7 @@ async function executeResolveValueQuery({ analyzer }, queries) {
25
25
  log_1.log.warn(`Duplicate Key for resolve-value-query: ${key}, skipping...`);
26
26
  }
27
27
  const values = query.criteria
28
- .map(criteria => parse_1.SingleSlicingCriterion.parse(criteria, idMap))
28
+ .map(criteria => parse_1.SlicingCriterion.parse(criteria, idMap))
29
29
  .flatMap(ident => (0, alias_tracking_1.resolveIdToValue)(ident, { graph, full: true, idMap, resolve: analyzer.flowrConfig.solver.variables, ctx: analyzer.inspectContext() }));
30
30
  results[key] = {
31
31
  values: values
@@ -33,11 +33,12 @@ import type { CallGraphQuery } from './catalog/call-graph-query/call-graph-query
33
33
  import type { InspectRecursionQuery } from './catalog/inspect-recursion-query/inspect-recursion-query-format';
34
34
  import type { DoesCallQuery } from './catalog/does-call-query/does-call-query-format';
35
35
  import type { InspectExceptionQuery } from './catalog/inspect-exceptions-query/inspect-exception-query-format';
36
+ import type { InputSourcesQuery } from './catalog/input-sources-query/input-sources-query-format';
36
37
  import type { ProvenanceQuery } from './catalog/provenance-query/provenance-query-format';
37
38
  /**
38
39
  * These are all queries that can be executed from within flowR
39
40
  */
40
- export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | DfShapeQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery | ProvenanceQuery;
41
+ export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | DfShapeQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery | ProvenanceQuery | InputSourcesQuery;
41
42
  export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
42
43
  type: QueryType;
43
44
  };
@@ -164,6 +165,13 @@ export declare const SupportedQueries: {
164
165
  readonly schema: Joi.ObjectSchema<any>;
165
166
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
166
167
  };
168
+ readonly 'input-sources': {
169
+ readonly executor: typeof import("./catalog/input-sources-query/input-sources-query-executor").executeInputSourcesQuery;
170
+ readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
171
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"input-sources">;
172
+ readonly schema: Joi.ObjectSchema<any>;
173
+ readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
174
+ };
167
175
  readonly dependencies: {
168
176
  readonly executor: typeof import("./catalog/dependencies-query/dependencies-query-executor").executeDependenciesQuery;
169
177
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
package/queries/query.js CHANGED
@@ -40,6 +40,7 @@ const call_graph_query_format_1 = require("./catalog/call-graph-query/call-graph
40
40
  const inspect_recursion_query_format_1 = require("./catalog/inspect-recursion-query/inspect-recursion-query-format");
41
41
  const does_call_query_format_1 = require("./catalog/does-call-query/does-call-query-format");
42
42
  const inspect_exception_query_format_1 = require("./catalog/inspect-exceptions-query/inspect-exception-query-format");
43
+ const input_sources_query_format_1 = require("./catalog/input-sources-query/input-sources-query-format");
43
44
  const provenance_query_format_1 = require("./catalog/provenance-query/provenance-query-format");
44
45
  exports.SupportedQueries = {
45
46
  'call-context': call_context_query_format_1.CallContextQueryDefinition,
@@ -56,6 +57,7 @@ exports.SupportedQueries = {
56
57
  'dataflow-cluster': cluster_query_format_1.ClusterQueryDefinition,
57
58
  'static-slice': static_slice_query_format_1.StaticSliceQueryDefinition,
58
59
  'provenance': provenance_query_format_1.ProvenanceQueryDefinition,
60
+ 'input-sources': input_sources_query_format_1.InputSourcesDefinition,
59
61
  'dependencies': dependencies_query_format_1.DependenciesQueryDefinition,
60
62
  'location-map': location_map_query_format_1.LocationMapQueryDefinition,
61
63
  'search': search_query_format_1.SearchQueryDefinition,
@@ -422,9 +422,9 @@ export declare const flowrCapabilities: {
422
422
  readonly description: "_Handle `&&`, `||`, ..._";
423
423
  }, {
424
424
  readonly name: "Pipe and Pipe-Bind";
425
- readonly id: "built-in-pipe-and-pipe-bind";
425
+ readonly id: "pipe-and-pipe-bind";
426
426
  readonly supported: "partially";
427
- readonly description: "_Handle the [new (4.1) pipe and pipe-bind syntax](https://www.r-bloggers.com/2021/05/the-new-r-pipe/): `|>`, and `=>`._ We have not enough tests and do not support pipe-bind.";
427
+ readonly description: "_Handle the [new (4.1) pipe and pipe-bind syntax](https://www.r-bloggers.com/2021/05/the-new-r-pipe/): `|>`, and `=>`._; Similarly support the other pipe binds";
428
428
  }, {
429
429
  readonly name: "Sequencing";
430
430
  readonly id: "built-in-sequencing";
@@ -537,9 +537,9 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { simplified: true })}
537
537
  },
538
538
  {
539
539
  name: 'Pipe and Pipe-Bind',
540
- id: 'built-in-pipe-and-pipe-bind',
540
+ id: 'pipe-and-pipe-bind',
541
541
  supported: 'partially',
542
- description: '_Handle the [new (4.1) pipe and pipe-bind syntax](https://www.r-bloggers.com/2021/05/the-new-r-pipe/): `|>`, and `=>`._ We have not enough tests and do not support pipe-bind.'
542
+ description: '_Handle the [new (4.1) pipe and pipe-bind syntax](https://www.r-bloggers.com/2021/05/the-new-r-pipe/): `|>`, and `=>`._; Similarly support the other pipe binds'
543
543
  },
544
544
  {
545
545
  name: 'Sequencing',
@@ -219,6 +219,9 @@ export declare const ROther: {
219
219
  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>;
220
220
  /**
221
221
  * Helper object to provide helper functions for {@link RNode|RNodes}.
222
+ * For the individual type checks, please consult the individual vertices, e.g. {@link RPipe.is}.
223
+ * Some vertices also have a {@link RPipe.availableFromRVersion} property that indicates from which R version they are available,
224
+ * so you can check for that as well if needed.
222
225
  * @see {@link DefaultNormalizedAstFold} - for a more powerful way to traverse the normalized AST
223
226
  */
224
227
  export declare const RNode: {
@@ -120,6 +120,9 @@ exports.ROther = {
120
120
  };
121
121
  /**
122
122
  * Helper object to provide helper functions for {@link RNode|RNodes}.
123
+ * For the individual type checks, please consult the individual vertices, e.g. {@link RPipe.is}.
124
+ * Some vertices also have a {@link RPipe.availableFromRVersion} property that indicates from which R version they are available,
125
+ * so you can check for that as well if needed.
123
126
  * @see {@link DefaultNormalizedAstFold} - for a more powerful way to traverse the normalized AST
124
127
  */
125
128
  exports.RNode = {
@@ -1,4 +1,5 @@
1
- import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
1
+ import type { RAstNodeBase, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  import type { RArgument, RUnnamedArgument } from './r-argument';
4
5
  import type { EmptyArgument } from './r-function-call';
@@ -42,5 +43,19 @@ export declare const RAccess: {
42
43
  * Type guard for {@link RIndexAccess} nodes.
43
44
  */
44
45
  readonly isIndex: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RIndexAccess<Info>;
46
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
47
+ readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
48
+ readonly getType: (this: void, node: RNode) => RType;
49
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
50
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
51
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof EmptyArgument)[];
52
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
53
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
54
+ readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
55
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
56
+ readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
57
+ lexeme: string;
58
+ } ? string : string | undefined;
59
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
45
60
  };
46
61
  export {};
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RAccess = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  /**
6
7
  * Helper for working with {@link RAccess} AST nodes.
7
8
  */
8
9
  exports.RAccess = {
10
+ ...model_1.RNode,
9
11
  name: 'RAccess',
10
12
  /**
11
13
  * Type guard for {@link RAccess} nodes.
@@ -1,9 +1,10 @@
1
- import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
1
+ import type { RAstNodeBase, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  import type { RSymbol } from './r-symbol';
4
5
  import type { ParentInformation } from '../processing/decorate';
5
6
  import type { NodeId } from '../processing/node-id';
6
- import type { RFunctionArgument } from './r-function-call';
7
+ import type { PotentiallyEmptyRArgument } from './r-function-call';
7
8
  import { EmptyArgument } from './r-function-call';
8
9
  import type { BrandedIdentifier } from '../../../../../dataflow/environments/identifier';
9
10
  /**
@@ -32,25 +33,47 @@ export declare const RArgument: {
32
33
  * @see {@link RArgument.isUnnamed} - to check whether an argument is unnamed
33
34
  */
34
35
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RArgument<Info>;
36
+ /**
37
+ * Type guard for arguments that are empty, i.e. {@link EmptyArgument}.
38
+ */
39
+ readonly isEmpty: <Info = object>(this: void, node: RNode<Info> | typeof EmptyArgument | undefined) => node is typeof EmptyArgument;
40
+ /**
41
+ * Type guard for arguments that are _not_ empty, i.e. _not_ {@link EmptyArgument}.
42
+ */
43
+ readonly isNotEmpty: <Info = object>(this: void, node: RNode<Info> | typeof EmptyArgument | undefined) => node is RArgument<Info>;
35
44
  /**
36
45
  * Type guard for named arguments, i.e. arguments with a name.
37
46
  */
38
- readonly isNamed: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RArgument<Info> & {
47
+ readonly isNamed: <Info = object>(this: void, node: RNode<Info> | typeof EmptyArgument | undefined) => node is RArgument<Info> & {
39
48
  name: RSymbol<Info, BrandedIdentifier>;
40
49
  };
41
50
  /**
42
51
  * Type guard for unnamed arguments, i.e. arguments without a name.
43
52
  */
44
- readonly isUnnamed: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RUnnamedArgument<Info>;
53
+ readonly isUnnamed: <Info = object>(this: void, node: RNode<Info> | typeof EmptyArgument | undefined) => node is RUnnamedArgument<Info>;
45
54
  /**
46
55
  * Type guard for arguments with a value, i.e. arguments that are not just placeholders without a value.
47
56
  */
48
57
  readonly isWithValue: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RArgument<Info> & {
49
58
  value: RNode<Info>;
50
59
  };
51
- readonly getWithId: <OtherInfo>(args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined) => Exclude<RFunctionArgument<OtherInfo & ParentInformation>, typeof EmptyArgument> | undefined;
60
+ readonly getWithId: <OtherInfo>(args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined) => Exclude<PotentiallyEmptyRArgument<OtherInfo & ParentInformation>, typeof EmptyArgument> | undefined;
52
61
  /**
53
62
  * Retrieve the value of the argument with the given id from the list of arguments.
54
63
  */
55
- readonly getValue: <OtherInfo>(args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined) => RNode<OtherInfo> | undefined;
64
+ readonly getValue: <OtherInfo>(args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined) => RNode<OtherInfo> | undefined;
65
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
66
+ readonly getId: (this: void, node: RNode<ParentInformation>) => NodeId;
67
+ readonly getType: (this: void, node: RNode) => RType;
68
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
69
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & ParentInformation>>) => Set<NodeId>;
70
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof EmptyArgument)[];
71
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: Map<NodeId, RNode<OtherInfo & ParentInformation>>) => RNode<OtherInfo & ParentInformation> | undefined;
72
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation> | undefined, idMap: Map<NodeId, RNode<OtherInfo & ParentInformation>>) => Generator<RNode<OtherInfo & ParentInformation>>;
73
+ readonly depth: (this: void, node: RNode<ParentInformation>, idMap: Map<NodeId, RNode<ParentInformation>>) => number;
74
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & ParentInformation>>, stop: (node: RNode<OtherInfo & ParentInformation>) => boolean) => Set<NodeId>;
75
+ readonly lexeme: <R extends RNode<ParentInformation>>(this: void, node: R | undefined) => R extends {
76
+ lexeme: string;
77
+ } ? string : string | undefined;
78
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
56
79
  };
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RArgument = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  const r_function_call_1 = require("./r-function-call");
6
7
  /**
7
8
  * Helper for working with {@link RArgument} AST nodes.
8
9
  */
9
10
  exports.RArgument = {
11
+ ...model_1.RNode,
10
12
  name: 'RArgument',
11
13
  /**
12
14
  * Type guard for {@link RArgument} nodes.
@@ -15,17 +17,29 @@ exports.RArgument = {
15
17
  is(node) {
16
18
  return node?.type === type_1.RType.Argument;
17
19
  },
20
+ /**
21
+ * Type guard for arguments that are empty, i.e. {@link EmptyArgument}.
22
+ */
23
+ isEmpty(node) {
24
+ return node === r_function_call_1.EmptyArgument;
25
+ },
26
+ /**
27
+ * Type guard for arguments that are _not_ empty, i.e. _not_ {@link EmptyArgument}.
28
+ */
29
+ isNotEmpty(node) {
30
+ return node !== r_function_call_1.EmptyArgument && exports.RArgument.is(node);
31
+ },
18
32
  /**
19
33
  * Type guard for named arguments, i.e. arguments with a name.
20
34
  */
21
35
  isNamed(node) {
22
- return exports.RArgument.is(node) && node.name !== undefined;
36
+ return node !== r_function_call_1.EmptyArgument && exports.RArgument.is(node) && node.name !== undefined;
23
37
  },
24
38
  /**
25
39
  * Type guard for unnamed arguments, i.e. arguments without a name.
26
40
  */
27
41
  isUnnamed(node) {
28
- return exports.RArgument.is(node) && node.name === undefined && node.value !== undefined;
42
+ return node !== r_function_call_1.EmptyArgument && exports.RArgument.is(node) && node.name === undefined && node.value !== undefined;
29
43
  },
30
44
  /**
31
45
  * Type guard for arguments with a value, i.e. arguments that are not just placeholders without a value.
@@ -1,4 +1,5 @@
1
- import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
1
+ import type { RAstNodeBase, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  import type { OperatorInformationValue } from '../operators';
4
5
  /**
@@ -23,4 +24,18 @@ export declare const RBinaryOp: {
23
24
  * Get the operator information for a binary operator node.
24
25
  */
25
26
  readonly getOperatorInfo: <Info = object>(node: RBinaryOp<Info>) => OperatorInformationValue | undefined;
27
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
28
+ readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
29
+ readonly getType: (this: void, node: RNode) => RType;
30
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
31
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
32
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
33
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
34
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
35
+ readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
36
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
37
+ readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
38
+ lexeme: string;
39
+ } ? string : string | undefined;
40
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
26
41
  };
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RBinaryOp = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  const operators_1 = require("../operators");
6
7
  /**
7
8
  * Helper for working with {@link RBinaryOp} AST nodes.
8
9
  */
9
10
  exports.RBinaryOp = {
11
+ ...model_1.RNode,
10
12
  name: 'RBinaryOp',
11
13
  /**
12
14
  * Type guard for {@link RBinaryOp} nodes.
@@ -1,4 +1,5 @@
1
1
  import type { Leaf, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  /**
4
5
  * A `break` statement.
@@ -15,4 +16,18 @@ export declare const RBreak: {
15
16
  * Type guard for {@link RBreak} nodes.
16
17
  */
17
18
  readonly is: <Info = object>(this: void, node: unknown) => node is RBreak<Info>;
19
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
20
+ readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
21
+ readonly getType: (this: void, node: RNode) => RType;
22
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
23
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
24
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
25
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
26
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
27
+ readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
28
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
29
+ readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
30
+ lexeme: string;
31
+ } ? string : string | undefined;
32
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
18
33
  };
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RBreak = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  /**
6
7
  * Helper for working with {@link RBreak} AST nodes.
7
8
  */
8
9
  exports.RBreak = {
10
+ ...model_1.RNode,
9
11
  name: 'RBreak',
10
12
  /**
11
13
  * Type guard for {@link RBreak} nodes.
@@ -1,4 +1,5 @@
1
1
  import type { Leaf, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  /**
4
5
  * ```r
@@ -17,4 +18,18 @@ export declare const RComment: {
17
18
  * Type guard for {@link RComment} nodes.
18
19
  */
19
20
  readonly is: <Info = object>(this: void, node: unknown) => node is RComment<Info>;
21
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
22
+ readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
23
+ readonly getType: (this: void, node: RNode) => RType;
24
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
25
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
26
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
27
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
28
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
29
+ readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
30
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
31
+ readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
32
+ lexeme: string;
33
+ } ? string : string | undefined;
34
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
20
35
  };
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RComment = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  /**
6
7
  * Helper for working with {@link RComment} AST nodes.
7
8
  */
8
9
  exports.RComment = {
10
+ ...model_1.RNode,
9
11
  name: 'RComment',
10
12
  /**
11
13
  * Type guard for {@link RComment} nodes.
@@ -1,4 +1,5 @@
1
- import type { RAstNodeBase, Location, NoInfo, RNode, WithChildren } from '../model';
1
+ import type { RAstNodeBase, Location, NoInfo, WithChildren } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  import type { RSymbol } from './r-symbol';
4
5
  /**
@@ -31,4 +32,18 @@ export declare const RExpressionList: {
31
32
  * Returns the grouping symbol at the end of the expression list, if it exists. For example, for an expression list created by `{ ... }`, this would return the symbol for `}`.
32
33
  */
33
34
  readonly groupEnd: <Info = object>(this: void, node: RExpressionList<Info>) => RSymbol<Info> | undefined;
35
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
36
+ readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
37
+ readonly getType: (this: void, node: RNode) => RType;
38
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
39
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
40
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
41
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
42
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
43
+ readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
44
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
45
+ readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
46
+ lexeme: string;
47
+ } ? string : string | undefined;
48
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
34
49
  };
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RExpressionList = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  /**
6
7
  * Helper for working with {@link RExpressionList} AST nodes.
7
8
  */
8
9
  exports.RExpressionList = {
10
+ ...model_1.RNode,
9
11
  name: 'RExpressionList',
10
12
  /**
11
13
  * Type guard for {@link RExpressionList} nodes.
@@ -1,4 +1,5 @@
1
- import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
1
+ import type { RAstNodeBase, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  import type { RSymbol } from './r-symbol';
4
5
  import type { RExpressionList } from './r-expression-list';
@@ -25,4 +26,18 @@ export declare const RForLoop: {
25
26
  * Type guard for RForLoop nodes.
26
27
  */
27
28
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RForLoop<Info>;
29
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
30
+ readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
31
+ readonly getType: (this: void, node: RNode) => RType;
32
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
33
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
34
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
35
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
36
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
37
+ readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
38
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
39
+ readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
40
+ lexeme: string;
41
+ } ? string : string | undefined;
42
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
28
43
  };
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RForLoop = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  /**
6
7
  * Helper for working with {@link RForLoop} AST nodes.
7
8
  */
8
9
  exports.RForLoop = {
10
+ ...model_1.RNode,
9
11
  name: 'RForLoop',
10
12
  /**
11
13
  * Type guard for RForLoop nodes.
@@ -1,9 +1,10 @@
1
- import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
1
+ import type { RAstNodeBase, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  import type { RSymbol } from './r-symbol';
4
5
  import type { RArgument } from './r-argument';
5
6
  export declare const EmptyArgument = "<>";
6
- export type RFunctionArgument<Info = NoInfo> = RArgument<Info> | typeof EmptyArgument;
7
+ export type PotentiallyEmptyRArgument<Info = NoInfo> = RArgument<Info> | typeof EmptyArgument;
7
8
  /**
8
9
  * Calls of functions like `a()` and `foo(42, "hello")`.
9
10
  * @see RUnnamedFunctionCall
@@ -13,7 +14,7 @@ export interface RNamedFunctionCall<Info = NoInfo> extends RAstNodeBase<Info>, L
13
14
  readonly named: true;
14
15
  functionName: RSymbol<Info>;
15
16
  /** arguments can be empty, for example when calling as `a(1, ,3)` */
16
- readonly arguments: readonly RFunctionArgument<Info>[];
17
+ readonly arguments: readonly PotentiallyEmptyRArgument<Info>[];
17
18
  }
18
19
  /**
19
20
  * Direct calls of functions like `(function(x) { x })(3)`.
@@ -26,7 +27,7 @@ export interface RUnnamedFunctionCall<Info = NoInfo> extends RAstNodeBase<Info>,
26
27
  /** marks function calls like `3 %xx% 4` which have been written in special infix notation; deprecated in v2 */
27
28
  infixSpecial?: boolean;
28
29
  /** arguments can be undefined, for example when calling as `a(1, ,3)` */
29
- readonly arguments: readonly RFunctionArgument<Info>[];
30
+ readonly arguments: readonly PotentiallyEmptyRArgument<Info>[];
30
31
  }
31
32
  export type RFunctionCall<Info = NoInfo> = RNamedFunctionCall<Info> | RUnnamedFunctionCall<Info>;
32
33
  /**
@@ -46,4 +47,18 @@ export declare const RFunctionCall: {
46
47
  * Type guard for {@link RUnnamedFunctionCall} nodes.
47
48
  */
48
49
  readonly isUnnamed: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RUnnamedFunctionCall<Info>;
50
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
51
+ readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
52
+ readonly getType: (this: void, node: RNode) => RType;
53
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
54
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
55
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof EmptyArgument)[];
56
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
57
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
58
+ readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
59
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
60
+ readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
61
+ lexeme: string;
62
+ } ? string : string | undefined;
63
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
49
64
  };
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RFunctionCall = exports.EmptyArgument = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  exports.EmptyArgument = '<>';
6
7
  /**
7
8
  * Helper for working with {@link RFunctionCall} AST nodes.
8
9
  */
9
10
  exports.RFunctionCall = {
11
+ ...model_1.RNode,
10
12
  name: 'RFunctionCall',
11
13
  /**
12
14
  * Type guard for {@link RFunctionCall} nodes.