@eagleoutice/flowr 2.4.8 → 2.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (234) hide show
  1. package/README.md +66 -45
  2. package/benchmark/slicer.js +1 -1
  3. package/benchmark/summarizer/second-phase/graph.js +2 -2
  4. package/cli/flowr.js +3 -29
  5. package/cli/repl/commands/repl-cfg.d.ts +5 -5
  6. package/cli/repl/commands/repl-cfg.js +21 -22
  7. package/cli/repl/commands/repl-commands.d.ts +3 -3
  8. package/cli/repl/commands/repl-commands.js +2 -0
  9. package/cli/repl/commands/repl-dataflow.d.ts +5 -5
  10. package/cli/repl/commands/repl-dataflow.js +27 -30
  11. package/cli/repl/commands/repl-execute.js +1 -0
  12. package/cli/repl/commands/repl-lineage.js +1 -0
  13. package/cli/repl/commands/repl-main.d.ts +34 -3
  14. package/cli/repl/commands/repl-normalize.d.ts +3 -3
  15. package/cli/repl/commands/repl-normalize.js +15 -19
  16. package/cli/repl/commands/repl-parse.d.ts +2 -2
  17. package/cli/repl/commands/repl-parse.js +13 -8
  18. package/cli/repl/commands/repl-query.d.ts +3 -3
  19. package/cli/repl/commands/repl-query.js +29 -19
  20. package/cli/repl/commands/repl-quit.js +1 -0
  21. package/cli/repl/commands/repl-version.js +1 -0
  22. package/cli/repl/core.d.ts +4 -1
  23. package/cli/repl/core.js +21 -1
  24. package/cli/repl/server/connection.d.ts +7 -3
  25. package/cli/repl/server/connection.js +40 -48
  26. package/cli/repl/server/messages/message-slice.d.ts +1 -1
  27. package/cli/slicer-app.js +8 -3
  28. package/config.d.ts +1 -1
  29. package/config.js +4 -1
  30. package/control-flow/extract-cfg.d.ts +1 -1
  31. package/control-flow/extract-cfg.js +1 -1
  32. package/core/pipeline-executor.d.ts +5 -0
  33. package/core/pipeline-executor.js +5 -0
  34. package/core/steps/pipeline/create-pipeline.js +1 -1
  35. package/core/steps/pipeline/default-pipelines.d.ts +42 -42
  36. package/core/steps/pipeline/default-pipelines.js +4 -1
  37. package/dataflow/graph/dataflowgraph-builder.d.ts +11 -12
  38. package/dataflow/graph/dataflowgraph-builder.js +6 -6
  39. package/documentation/doc-util/doc-query.d.ts +3 -6
  40. package/documentation/doc-util/doc-query.js +5 -17
  41. package/documentation/doc-util/doc-search.js +7 -10
  42. package/documentation/doc-util/doc-structure.d.ts +4 -0
  43. package/documentation/doc-util/doc-structure.js +28 -0
  44. package/documentation/doc-util/doc-types.d.ts +5 -1
  45. package/documentation/doc-util/doc-types.js +29 -3
  46. package/documentation/print-analyzer-wiki.d.ts +1 -0
  47. package/documentation/print-analyzer-wiki.js +137 -0
  48. package/documentation/print-core-wiki.d.ts +2 -1
  49. package/documentation/print-core-wiki.js +58 -4
  50. package/documentation/print-dataflow-graph-wiki.js +15 -22
  51. package/documentation/print-interface-wiki.js +18 -1
  52. package/documentation/print-linter-wiki.js +5 -1
  53. package/documentation/print-linting-and-testing-wiki.js +4 -0
  54. package/documentation/print-normalized-ast-wiki.js +6 -8
  55. package/documentation/print-readme.js +6 -0
  56. package/engines.d.ts +9 -0
  57. package/engines.js +38 -0
  58. package/linter/linter-executor.d.ts +2 -8
  59. package/linter/linter-executor.js +9 -4
  60. package/linter/linter-format.d.ts +8 -9
  61. package/linter/linter-rules.d.ts +57 -15
  62. package/linter/linter-rules.js +2 -0
  63. package/linter/rules/absolute-path.d.ts +1 -0
  64. package/linter/rules/dataframe-access-validation.d.ts +4 -3
  65. package/linter/rules/dataframe-access-validation.js +7 -4
  66. package/linter/rules/dead-code.d.ts +2 -1
  67. package/linter/rules/deprecated-functions.d.ts +15 -28
  68. package/linter/rules/deprecated-functions.js +5 -43
  69. package/linter/rules/file-path-validity.d.ts +2 -1
  70. package/linter/rules/file-path-validity.js +1 -1
  71. package/linter/rules/function-finder-util.d.ts +51 -0
  72. package/linter/rules/function-finder-util.js +77 -0
  73. package/linter/rules/naming-convention.d.ts +2 -1
  74. package/linter/rules/network-functions.d.ts +40 -0
  75. package/linter/rules/network-functions.js +24 -0
  76. package/linter/rules/seeded-randomness.d.ts +2 -1
  77. package/linter/rules/unused-definition.d.ts +2 -1
  78. package/linter/rules/useless-loop.d.ts +3 -2
  79. package/linter/rules/useless-loop.js +4 -6
  80. package/package.json +5 -1
  81. package/project/cache/flowr-analyzer-cache.d.ts +93 -0
  82. package/project/cache/flowr-analyzer-cache.js +156 -0
  83. package/project/cache/flowr-cache.d.ts +28 -0
  84. package/project/cache/flowr-cache.js +49 -0
  85. package/project/context/abstract-flowr-analyzer-context.d.ts +35 -0
  86. package/project/context/abstract-flowr-analyzer-context.js +46 -0
  87. package/project/context/flowr-analyzer-context.d.ts +48 -0
  88. package/project/context/flowr-analyzer-context.js +47 -0
  89. package/project/context/flowr-analyzer-dependencies-context.d.ts +38 -0
  90. package/project/context/flowr-analyzer-dependencies-context.js +39 -0
  91. package/project/context/flowr-analyzer-files-context.d.ts +86 -0
  92. package/project/context/flowr-analyzer-files-context.js +130 -0
  93. package/project/context/flowr-analyzer-loading-order-context.d.ts +76 -0
  94. package/project/context/flowr-analyzer-loading-order-context.js +90 -0
  95. package/project/context/flowr-file.d.ts +89 -0
  96. package/project/context/flowr-file.js +78 -0
  97. package/project/flowr-analyzer-builder.d.ts +106 -0
  98. package/project/flowr-analyzer-builder.js +197 -0
  99. package/project/flowr-analyzer.d.ts +125 -0
  100. package/project/flowr-analyzer.js +81 -0
  101. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +17 -0
  102. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +28 -0
  103. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +21 -0
  104. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +34 -0
  105. package/project/plugins/file-plugins/flowr-description-file.d.ts +24 -0
  106. package/project/plugins/file-plugins/flowr-description-file.js +38 -0
  107. package/project/plugins/flowr-analyzer-plugin.d.ts +90 -0
  108. package/project/plugins/flowr-analyzer-plugin.js +82 -0
  109. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +14 -0
  110. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +56 -0
  111. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.d.ts +13 -0
  112. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +33 -0
  113. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +14 -0
  114. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +41 -0
  115. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
  116. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +29 -0
  117. package/project/plugins/package-version-plugins/package.d.ts +15 -0
  118. package/project/plugins/package-version-plugins/package.js +56 -0
  119. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +15 -0
  120. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +44 -0
  121. package/queries/base-query-format.d.ts +2 -8
  122. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  123. package/queries/catalog/call-context-query/call-context-query-executor.js +20 -13
  124. package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -3
  125. package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
  126. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
  127. package/queries/catalog/cluster-query/cluster-query-executor.js +2 -2
  128. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -54
  129. package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
  130. package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
  131. package/queries/catalog/config-query/config-query-executor.js +5 -5
  132. package/queries/catalog/config-query/config-query-format.d.ts +1 -1
  133. package/queries/catalog/config-query/config-query-format.js +1 -1
  134. package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
  135. package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -3
  136. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -54
  137. package/queries/catalog/control-flow-query/control-flow-query-format.js +2 -2
  138. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +1 -1
  139. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -2
  140. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -54
  141. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -1
  142. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
  143. package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
  144. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -54
  145. package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -1
  146. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
  147. package/queries/catalog/dependencies-query/dependencies-query-executor.js +19 -12
  148. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +7 -56
  149. package/queries/catalog/dependencies-query/dependencies-query-format.js +7 -4
  150. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
  151. package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -4
  152. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -54
  153. package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
  154. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
  155. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
  156. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -54
  157. package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
  158. package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
  159. package/queries/catalog/id-map-query/id-map-query-executor.js +2 -2
  160. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -54
  161. package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
  162. package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
  163. package/queries/catalog/lineage-query/lineage-query-executor.js +2 -2
  164. package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -54
  165. package/queries/catalog/lineage-query/lineage-query-format.js +1 -1
  166. package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
  167. package/queries/catalog/linter-query/linter-query-executor.js +2 -3
  168. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -54
  169. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  170. package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
  171. package/queries/catalog/location-map-query/location-map-query-executor.js +3 -2
  172. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  173. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  174. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
  175. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -2
  176. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -54
  177. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -1
  178. package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
  179. package/queries/catalog/origin-query/origin-query-executor.js +3 -3
  180. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -54
  181. package/queries/catalog/origin-query/origin-query-format.js +1 -1
  182. package/queries/catalog/project-query/project-query-executor.d.ts +1 -1
  183. package/queries/catalog/project-query/project-query-executor.js +2 -2
  184. package/queries/catalog/project-query/project-query-format.d.ts +1 -54
  185. package/queries/catalog/project-query/project-query-format.js +1 -1
  186. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
  187. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -2
  188. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -54
  189. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
  190. package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
  191. package/queries/catalog/search-query/search-query-executor.js +3 -3
  192. package/queries/catalog/search-query/search-query-format.d.ts +1 -54
  193. package/queries/catalog/search-query/search-query-format.js +1 -1
  194. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
  195. package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -3
  196. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -54
  197. package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -1
  198. package/queries/query-print.d.ts +4 -4
  199. package/queries/query-print.js +12 -12
  200. package/queries/query.d.ts +29 -885
  201. package/queries/query.js +1 -1
  202. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +1 -1
  203. package/r-bridge/retriever.d.ts +15 -2
  204. package/r-bridge/retriever.js +15 -5
  205. package/search/flowr-search-executor.d.ts +3 -5
  206. package/search/flowr-search-executor.js +6 -4
  207. package/search/flowr-search-filters.d.ts +12 -6
  208. package/search/flowr-search-filters.js +1 -1
  209. package/search/flowr-search.d.ts +5 -16
  210. package/search/flowr-search.js +14 -5
  211. package/search/search-executor/search-enrichers.d.ts +37 -36
  212. package/search/search-executor/search-enrichers.js +4 -4
  213. package/search/search-executor/search-generators.d.ts +12 -12
  214. package/search/search-executor/search-generators.js +27 -19
  215. package/search/search-executor/search-mappers.d.ts +5 -5
  216. package/search/search-executor/search-transformer.d.ts +17 -17
  217. package/search/search-executor/search-transformer.js +14 -7
  218. package/util/collections/arrays.d.ts +1 -0
  219. package/util/collections/arrays.js +15 -0
  220. package/util/collections/objectmap.d.ts +17 -0
  221. package/util/collections/objectmap.js +28 -0
  222. package/util/containers.d.ts +0 -1
  223. package/util/containers.js +0 -1
  224. package/util/files.d.ts +17 -0
  225. package/util/files.js +65 -0
  226. package/util/formats/adapter-format.d.ts +6 -0
  227. package/util/formats/adapter-format.js +3 -0
  228. package/util/formats/adapter.d.ts +18 -0
  229. package/util/formats/adapter.js +49 -0
  230. package/util/formats/adapters/r-adapter.d.ts +4 -0
  231. package/util/formats/adapters/r-adapter.js +7 -0
  232. package/util/formats/adapters/rmd-adapter.d.ts +26 -0
  233. package/util/formats/adapters/rmd-adapter.js +91 -0
  234. package/util/version.js +1 -1
@@ -15,60 +15,7 @@ export interface DataflowClusterQueryResult extends BaseQueryResult {
15
15
  }
16
16
  export declare const ClusterQueryDefinition: {
17
17
  readonly executor: typeof executeDataflowClusterQuery;
18
- readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
19
- readonly name: "parse";
20
- readonly humanReadableName: "parse with R shell";
21
- readonly description: "Parse the given R code into an AST";
22
- readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
23
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
24
- readonly printer: {
25
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
26
- readonly 2: {
27
- (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
28
- (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
29
- };
30
- readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
31
- };
32
- readonly dependencies: readonly [];
33
- readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
34
- } | {
35
- readonly name: "normalize";
36
- readonly humanReadableName: "normalize";
37
- readonly description: "Normalize the AST to flowR's AST";
38
- readonly processor: (results: {
39
- parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
40
- }, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
41
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
42
- readonly printer: {
43
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
44
- readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
45
- readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
46
- readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
47
- readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
48
- };
49
- readonly dependencies: readonly ["parse"];
50
- readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
51
- } | {
52
- readonly humanReadableName: "dataflow";
53
- readonly processor: (results: {
54
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
55
- }, input: {
56
- request?: import("../../../r-bridge/retriever").RParseRequests;
57
- parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
58
- }, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
59
- readonly requiredInput: {};
60
- readonly name: "dataflow";
61
- readonly description: "Construct the dataflow graph";
62
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
63
- readonly printer: {
64
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
65
- readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
66
- readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
67
- readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
68
- readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
69
- };
70
- readonly dependencies: readonly ["normalize"];
71
- }>>, queryResults: BaseQueryResult, result: string[]) => true;
18
+ readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
72
19
  readonly schema: Joi.ObjectSchema<any>;
73
20
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
74
21
  };
@@ -11,7 +11,7 @@ const dfg_1 = require("../../../util/mermaid/dfg");
11
11
  const query_print_1 = require("../../query-print");
12
12
  exports.ClusterQueryDefinition = {
13
13
  executor: cluster_query_executor_1.executeDataflowClusterQuery,
14
- asciiSummarizer: (formatter, processed, queryResults, result) => {
14
+ asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
15
15
  const out = queryResults;
16
16
  result.push(`Query: ${(0, ansi_1.bold)('dataflow-cluster', formatter)} (${out['.meta'].timing.toFixed(0)}ms)`);
17
17
  result.push(` ╰ Found ${out.clusters.length} cluster${out.clusters.length === 1 ? '' : 's'}`);
@@ -19,7 +19,7 @@ exports.ClusterQueryDefinition = {
19
19
  const unknownSideEffects = cluster.hasUnknownSideEffects ? '(has unknown side effect)' : '';
20
20
  let suffix = '';
21
21
  if (formatter === ansi_1.markdownFormatter) {
22
- suffix = `([marked](${(0, dfg_1.graphToMermaidUrl)(processed.dataflow.graph, false, new Set(cluster.members))}))`;
22
+ suffix = `([marked](${(0, dfg_1.graphToMermaidUrl)((await analyzer.dataflow()).graph, false, new Set(cluster.members))}))`;
23
23
  }
24
24
  result.push(` ╰ ${unknownSideEffects} {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, cluster.members)}} ${suffix}`);
25
25
  }
@@ -1,3 +1,3 @@
1
1
  import type { ConfigQuery, ConfigQueryResult } from './config-query-format';
2
2
  import type { BasicQueryData } from '../../base-query-format';
3
- export declare function executeConfigQuery({ config }: BasicQueryData, queries: readonly ConfigQuery[]): ConfigQueryResult;
3
+ export declare function executeConfigQuery({ analyzer }: BasicQueryData, queries: readonly ConfigQuery[]): Promise<ConfigQueryResult>;
@@ -4,20 +4,20 @@ exports.executeConfigQuery = executeConfigQuery;
4
4
  const log_1 = require("../../../util/log");
5
5
  const assert_1 = require("../../../util/assert");
6
6
  const objects_1 = require("../../../util/objects");
7
- function executeConfigQuery({ config }, queries) {
7
+ function executeConfigQuery({ analyzer }, queries) {
8
8
  if (queries.length !== 1) {
9
9
  log_1.log.warn('Config query usually expects only up to one query, but got', queries.length);
10
10
  }
11
11
  const updates = queries.map(q => q.update).filter(assert_1.isNotUndefined);
12
12
  for (const update of updates) {
13
- (0, objects_1.deepMergeObjectInPlace)(config, update);
13
+ (0, objects_1.deepMergeObjectInPlace)(analyzer.flowrConfig, update);
14
14
  }
15
- return {
15
+ return Promise.resolve({
16
16
  '.meta': {
17
17
  /* there is no sense in measuring a get */
18
18
  timing: 0
19
19
  },
20
- config: config
21
- };
20
+ config: analyzer.flowrConfig
21
+ });
22
22
  }
23
23
  //# sourceMappingURL=config-query-executor.js.map
@@ -15,7 +15,7 @@ declare function configReplCompleter(partialLine: readonly string[], config: Flo
15
15
  declare function configQueryLineParser(line: readonly string[], _config: FlowrConfigOptions): [ConfigQuery];
16
16
  export declare const ConfigQueryDefinition: {
17
17
  readonly executor: typeof executeConfigQuery;
18
- readonly asciiSummarizer: (formatter: OutputFormatter, _processed: unknown, queryResults: BaseQueryResult, result: string[]) => boolean;
18
+ readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => boolean;
19
19
  readonly completer: typeof configReplCompleter;
20
20
  readonly fromLine: typeof configQueryLineParser;
21
21
  readonly schema: Joi.ObjectSchema<any>;
@@ -79,7 +79,7 @@ function configQueryLineParser(line, _config) {
79
79
  }
80
80
  exports.ConfigQueryDefinition = {
81
81
  executor: config_query_executor_1.executeConfigQuery,
82
- asciiSummarizer: (formatter, _processed, queryResults, result) => {
82
+ asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
83
83
  const out = queryResults;
84
84
  result.push(`Query: ${(0, ansi_1.bold)('config', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
85
85
  result.push(` ╰ Config:\n${JSON.stringify(out.config, json_1.jsonReplacer, 4)}`);
@@ -1,3 +1,3 @@
1
1
  import type { ControlFlowQuery, ControlFlowQueryResult } from './control-flow-query-format';
2
2
  import type { BasicQueryData } from '../../base-query-format';
3
- export declare function executeControlFlowQuery({ dataflow: { graph }, ast, config }: BasicQueryData, queries: readonly ControlFlowQuery[]): ControlFlowQueryResult;
3
+ export declare function executeControlFlowQuery({ analyzer }: BasicQueryData, queries: readonly ControlFlowQuery[]): Promise<ControlFlowQueryResult>;
@@ -2,14 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.executeControlFlowQuery = executeControlFlowQuery;
4
4
  const log_1 = require("../../../util/log");
5
- const extract_cfg_1 = require("../../../control-flow/extract-cfg");
6
- function executeControlFlowQuery({ dataflow: { graph }, ast, config }, queries) {
5
+ async function executeControlFlowQuery({ analyzer }, queries) {
7
6
  if (queries.length !== 1) {
8
7
  log_1.log.warn('The control flow query expects only up to one query, but got', queries.length);
9
8
  }
10
9
  const query = queries[0];
11
10
  const start = Date.now();
12
- const controlFlow = (0, extract_cfg_1.extractCfg)(ast, config, graph, query.config?.simplificationPasses);
11
+ const controlFlow = await analyzer.controlflow(query.config?.simplificationPasses, true);
13
12
  return {
14
13
  '.meta': {
15
14
  timing: Date.now() - start
@@ -22,60 +22,7 @@ export interface ControlFlowQueryResult extends BaseQueryResult {
22
22
  }
23
23
  export declare const ControlFlowQueryDefinition: {
24
24
  readonly executor: typeof executeControlFlowQuery;
25
- readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
26
- readonly name: "parse";
27
- readonly humanReadableName: "parse with R shell";
28
- readonly description: "Parse the given R code into an AST";
29
- readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
30
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
31
- readonly printer: {
32
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
33
- readonly 2: {
34
- (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
35
- (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
36
- };
37
- readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
38
- };
39
- readonly dependencies: readonly [];
40
- readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
41
- } | {
42
- readonly name: "normalize";
43
- readonly humanReadableName: "normalize";
44
- readonly description: "Normalize the AST to flowR's AST";
45
- readonly processor: (results: {
46
- parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
47
- }, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
48
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
49
- readonly printer: {
50
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
51
- readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
52
- readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
53
- readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
54
- readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
55
- };
56
- readonly dependencies: readonly ["parse"];
57
- readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
58
- } | {
59
- readonly humanReadableName: "dataflow";
60
- readonly processor: (results: {
61
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
62
- }, input: {
63
- request?: import("../../../r-bridge/retriever").RParseRequests;
64
- parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
65
- }, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
66
- readonly requiredInput: {};
67
- readonly name: "dataflow";
68
- readonly description: "Construct the dataflow graph";
69
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
70
- readonly printer: {
71
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
72
- readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
73
- readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
74
- readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
75
- readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
76
- };
77
- readonly dependencies: readonly ["normalize"];
78
- }>>, queryResults: BaseQueryResult, result: string[]) => true;
25
+ readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
79
26
  readonly schema: Joi.ObjectSchema<any>;
80
27
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
81
28
  };
@@ -12,10 +12,10 @@ const cfg_1 = require("../../../util/mermaid/cfg");
12
12
  const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
13
13
  exports.ControlFlowQueryDefinition = {
14
14
  executor: control_flow_query_executor_1.executeControlFlowQuery,
15
- asciiSummarizer: (formatter, processed, queryResults, result) => {
15
+ asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
16
16
  const out = queryResults;
17
17
  result.push(`Query: ${(0, ansi_1.bold)('control-flow', formatter)} (${out['.meta'].timing.toFixed(0)}ms)`);
18
- result.push(` ╰ CFG: ${(0, cfg_1.cfgToMermaidUrl)(out.controlFlow, processed.normalize)}`);
18
+ result.push(` ╰ CFG: ${(0, cfg_1.cfgToMermaidUrl)(out.controlFlow, await analyzer.normalize())}`);
19
19
  return true;
20
20
  },
21
21
  schema: joi_1.default.object({
@@ -1,3 +1,3 @@
1
1
  import type { DataflowLensQuery, DataflowLensQueryResult } from './dataflow-lens-query-format';
2
2
  import type { BasicQueryData } from '../../base-query-format';
3
- export declare function executeDataflowLensQuery({ dataflow: { graph } }: BasicQueryData, queries: readonly DataflowLensQuery[]): DataflowLensQueryResult;
3
+ export declare function executeDataflowLensQuery({ analyzer }: BasicQueryData, queries: readonly DataflowLensQuery[]): Promise<DataflowLensQueryResult>;
@@ -4,12 +4,12 @@ exports.executeDataflowLensQuery = executeDataflowLensQuery;
4
4
  const log_1 = require("../../../util/log");
5
5
  const dfg_view_1 = require("../../../util/simple-df/dfg-view");
6
6
  const vertex_1 = require("../../../dataflow/graph/vertex");
7
- function executeDataflowLensQuery({ dataflow: { graph } }, queries) {
7
+ async function executeDataflowLensQuery({ analyzer }, queries) {
8
8
  if (queries.length !== 1) {
9
9
  log_1.log.warn('Dataflow query expects only up to one query, but got', queries.length);
10
10
  }
11
11
  const now = Date.now();
12
- const simplifiedGraph = (0, dfg_view_1.reduceDfg)(graph, {
12
+ const simplifiedGraph = (0, dfg_view_1.reduceDfg)((await analyzer.dataflow()).graph, {
13
13
  vertices: {
14
14
  keepEnv: false,
15
15
  keepCd: true,
@@ -14,60 +14,7 @@ export interface DataflowLensQueryResult extends BaseQueryResult {
14
14
  }
15
15
  export declare const DataflowLensQueryDefinition: {
16
16
  readonly executor: typeof executeDataflowLensQuery;
17
- readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
18
- readonly name: "parse";
19
- readonly humanReadableName: "parse with R shell";
20
- readonly description: "Parse the given R code into an AST";
21
- readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
22
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
23
- readonly printer: {
24
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
25
- readonly 2: {
26
- (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
27
- (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
28
- };
29
- readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
30
- };
31
- readonly dependencies: readonly [];
32
- readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
33
- } | {
34
- readonly name: "normalize";
35
- readonly humanReadableName: "normalize";
36
- readonly description: "Normalize the AST to flowR's AST";
37
- readonly processor: (results: {
38
- parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
39
- }, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
40
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
41
- readonly printer: {
42
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
43
- readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
44
- readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
45
- readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
46
- readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
47
- };
48
- readonly dependencies: readonly ["parse"];
49
- readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
50
- } | {
51
- readonly humanReadableName: "dataflow";
52
- readonly processor: (results: {
53
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
54
- }, input: {
55
- request?: import("../../../r-bridge/retriever").RParseRequests;
56
- parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
57
- }, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
58
- readonly requiredInput: {};
59
- readonly name: "dataflow";
60
- readonly description: "Construct the dataflow graph";
61
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
62
- readonly printer: {
63
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
64
- readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
65
- readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
66
- readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
67
- readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
68
- };
69
- readonly dependencies: readonly ["normalize"];
70
- }>>, queryResults: BaseQueryResult, result: string[]) => true;
17
+ readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
71
18
  readonly schema: Joi.ObjectSchema<any>;
72
19
  readonly flattenInvolvedNodes: () => never[];
73
20
  };
@@ -11,7 +11,7 @@ const dfg_1 = require("../../../util/mermaid/dfg");
11
11
  const joi_1 = __importDefault(require("joi"));
12
12
  exports.DataflowLensQueryDefinition = {
13
13
  executor: dataflow_lens_query_executor_1.executeDataflowLensQuery,
14
- asciiSummarizer: (formatter, _processed, queryResults, result) => {
14
+ asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
15
15
  const out = queryResults;
16
16
  result.push(`Query: ${(0, ansi_1.bold)('dataflow-lens', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
17
17
  result.push(` ╰ [Simplified Graph](${(0, dfg_1.graphToMermaidUrl)(out.simplifiedGraph, false, undefined, true)})`);
@@ -1,3 +1,3 @@
1
1
  import type { DataflowQuery, DataflowQueryResult } from './dataflow-query-format';
2
2
  import type { BasicQueryData } from '../../base-query-format';
3
- export declare function executeDataflowQuery({ dataflow: { graph } }: BasicQueryData, queries: readonly DataflowQuery[]): DataflowQueryResult;
3
+ export declare function executeDataflowQuery({ analyzer }: BasicQueryData, queries: readonly DataflowQuery[]): Promise<DataflowQueryResult>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.executeDataflowQuery = executeDataflowQuery;
4
4
  const log_1 = require("../../../util/log");
5
- function executeDataflowQuery({ dataflow: { graph } }, queries) {
5
+ async function executeDataflowQuery({ analyzer }, queries) {
6
6
  if (queries.length !== 1) {
7
7
  log_1.log.warn('Dataflow query expects only up to one query, but got', queries.length);
8
8
  }
@@ -11,7 +11,7 @@ function executeDataflowQuery({ dataflow: { graph } }, queries) {
11
11
  /* there is no sense in measuring a get */
12
12
  timing: 0
13
13
  },
14
- graph
14
+ graph: (await analyzer.dataflow()).graph
15
15
  };
16
16
  }
17
17
  //# sourceMappingURL=dataflow-query-executor.js.map
@@ -15,60 +15,7 @@ export interface DataflowQueryResult extends BaseQueryResult {
15
15
  }
16
16
  export declare const DataflowQueryDefinition: {
17
17
  readonly executor: typeof executeDataflowQuery;
18
- readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
19
- readonly name: "parse";
20
- readonly humanReadableName: "parse with R shell";
21
- readonly description: "Parse the given R code into an AST";
22
- readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
23
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
24
- readonly printer: {
25
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
26
- readonly 2: {
27
- (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
28
- (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
29
- };
30
- readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
31
- };
32
- readonly dependencies: readonly [];
33
- readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
34
- } | {
35
- readonly name: "normalize";
36
- readonly humanReadableName: "normalize";
37
- readonly description: "Normalize the AST to flowR's AST";
38
- readonly processor: (results: {
39
- parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
40
- }, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
41
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
42
- readonly printer: {
43
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
44
- readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
45
- readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
46
- readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
47
- readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
48
- };
49
- readonly dependencies: readonly ["parse"];
50
- readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
51
- } | {
52
- readonly humanReadableName: "dataflow";
53
- readonly processor: (results: {
54
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
55
- }, input: {
56
- request?: import("../../../r-bridge/retriever").RParseRequests;
57
- parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
58
- }, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
59
- readonly requiredInput: {};
60
- readonly name: "dataflow";
61
- readonly description: "Construct the dataflow graph";
62
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
63
- readonly printer: {
64
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
65
- readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
66
- readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
67
- readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
68
- readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
69
- };
70
- readonly dependencies: readonly ["normalize"];
71
- }>>, queryResults: BaseQueryResult, result: string[]) => true;
18
+ readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
72
19
  readonly schema: Joi.ObjectSchema<any>;
73
20
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
74
21
  };
@@ -11,7 +11,7 @@ const dfg_1 = require("../../../util/mermaid/dfg");
11
11
  const joi_1 = __importDefault(require("joi"));
12
12
  exports.DataflowQueryDefinition = {
13
13
  executor: dataflow_query_executor_1.executeDataflowQuery,
14
- asciiSummarizer: (formatter, _processed, queryResults, result) => {
14
+ asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
15
15
  const out = queryResults;
16
16
  result.push(`Query: ${(0, ansi_1.bold)('dataflow', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
17
17
  result.push(` ╰ [Dataflow Graph](${(0, dfg_1.graphToMermaidUrl)(out.graph)})`);
@@ -1,3 +1,3 @@
1
1
  import type { DependenciesQuery, DependenciesQueryResult } from './dependencies-query-format';
2
2
  import type { BasicQueryData } from '../../base-query-format';
3
- export declare function executeDependenciesQuery(data: BasicQueryData, queries: readonly DependenciesQuery[]): DependenciesQueryResult;
3
+ export declare function executeDependenciesQuery({ analyzer, }: BasicQueryData, queries: readonly DependenciesQuery[]): Promise<DependenciesQueryResult>;
@@ -11,10 +11,14 @@ const function_info_1 = require("./function-info/function-info");
11
11
  const identify_link_to_last_call_relation_1 = require("../call-context-query/identify-link-to-last-call-relation");
12
12
  const resolve_argument_1 = require("../../../dataflow/eval/resolve/resolve-argument");
13
13
  const assert_1 = require("../../../util/assert");
14
- function executeDependenciesQuery(data, queries) {
14
+ async function executeDependenciesQuery({ analyzer, }, queries) {
15
15
  if (queries.length !== 1) {
16
16
  log_1.log.warn('Dependencies query expects only up to one query, but got ', queries.length, 'only using the first query');
17
17
  }
18
+ const data = { analyzer };
19
+ const normalize = await analyzer.normalize();
20
+ const dataflow = await analyzer.dataflow();
21
+ const config = analyzer.flowrConfig;
18
22
  const now = Date.now();
19
23
  const [query] = queries;
20
24
  const ignoreDefault = query.ignoreDefaultFunctions ?? false;
@@ -28,10 +32,10 @@ function executeDependenciesQuery(data, queries) {
28
32
  }
29
33
  }
30
34
  const queryResults = functions.values().toArray().flat().length === 0 ? { kinds: {}, '.meta': { timing: 0 } } :
31
- (0, query_1.executeQueriesOfSameType)(data, functions.entries().map(([c, f]) => makeCallContextQuery(f, c)).toArray().flat());
35
+ await (0, query_1.executeQueriesOfSameType)(data, functions.entries().map(([c, f]) => makeCallContextQuery(f, c)).toArray().flat());
32
36
  const results = Object.fromEntries(functions.entries().map(([c, f]) => {
33
- const results = getResults(queries, data, queryResults, c, f);
34
- // only default categories allow additional analyses, so we null coalese here!
37
+ const results = getResults(queries, { dataflow, config, normalize }, queryResults, c, f, data);
38
+ // only default categories allow additional analyses, so we null-coalesce here!
35
39
  dependencies_query_format_1.DefaultDependencyCategories[c]?.additionalAnalysis?.(data, ignoreDefault, f, queryResults, results);
36
40
  return [c, results];
37
41
  }));
@@ -39,7 +43,7 @@ function executeDependenciesQuery(data, queries) {
39
43
  '.meta': {
40
44
  timing: Date.now() - now
41
45
  },
42
- ...results
46
+ ...results,
43
47
  };
44
48
  }
45
49
  function makeCallContextQuery(functions, kind) {
@@ -62,15 +66,15 @@ function dropInfoOnLinkedIds(linkedIds) {
62
66
  }
63
67
  const readOnlyModes = new Set(['r', 'rt', 'rb']);
64
68
  const writeOnlyModes = new Set(['w', 'wt', 'wb', 'a', 'at', 'ab']);
65
- function getResults(queries, data, results, kind, functions) {
69
+ function getResults(queries, { dataflow, config, normalize }, results, kind, functions, data) {
66
70
  const defaultValue = (0, dependencies_query_format_1.getAllCategories)(queries)[kind].defaultValue;
67
71
  const functionMap = new Map(functions.map(f => [f.name, f]));
68
72
  const kindEntries = Object.entries(results?.kinds[kind]?.subkinds ?? {});
69
73
  return kindEntries.flatMap(([name, results]) => results.flatMap(({ id, linkedIds }) => {
70
- const vertex = data.dataflow.graph.getVertex(id);
74
+ const vertex = dataflow.graph.getVertex(id);
71
75
  const info = functionMap.get(name);
72
- const args = (0, resolve_argument_1.getArgumentStringValue)(data.config.solver.variables, data.dataflow.graph, vertex, info.argIdx, info.argName, info.resolveValue);
73
- const linkedArgs = collectValuesFromLinks(args, data, linkedIds);
76
+ const args = (0, resolve_argument_1.getArgumentStringValue)(config.solver.variables, dataflow.graph, vertex, info.argIdx, info.argName, info.resolveValue);
77
+ const linkedArgs = collectValuesFromLinks(args, { dataflow, config }, linkedIds);
74
78
  const linked = dropInfoOnLinkedIds(linkedIds);
75
79
  const foundValues = linkedArgs ?? args;
76
80
  if (!foundValues) {
@@ -90,7 +94,7 @@ function getResults(queries, data, results, kind, functions) {
90
94
  (0, assert_1.guard)('mode' in (info.additionalArgs ?? {}), 'Need additional argument mode when checking for mode');
91
95
  const margs = info.additionalArgs?.mode;
92
96
  (0, assert_1.guard)(margs, 'Need additional argument mode when checking for mode');
93
- const modeArgs = (0, resolve_argument_1.getArgumentStringValue)(data.config.solver.variables, data.dataflow.graph, vertex, margs.argIdx, margs.argName, margs.resolveValue);
97
+ const modeArgs = (0, resolve_argument_1.getArgumentStringValue)(config.solver.variables, dataflow.graph, vertex, margs.argIdx, margs.argName, margs.resolveValue);
94
98
  const modeValues = modeArgs?.values().flatMap(v => [...v]) ?? [];
95
99
  if (info.ignoreIf === 'mode-only-read' && modeValues.every(m => m && readOnlyModes.has(m))) {
96
100
  // all modes are read-only, so we can ignore this
@@ -104,12 +108,15 @@ function getResults(queries, data, results, kind, functions) {
104
108
  const results = [];
105
109
  for (const [arg, values] of foundValues.entries()) {
106
110
  for (const value of values) {
111
+ const dep = value ? data?.analyzer.context().deps.getDependency(value) ?? undefined : undefined;
107
112
  const result = (0, objects_1.compactRecord)({
108
113
  nodeId: id,
109
114
  functionName: vertex.name,
110
115
  lexemeOfArgument: getLexeme(value, arg),
111
116
  linkedIds: linked?.length ? linked : undefined,
112
- value: value ?? defaultValue
117
+ value: value ?? defaultValue,
118
+ versionConstraints: dep?.versionConstraints,
119
+ derivedVersion: dep?.derivedVersion
113
120
  });
114
121
  if (result) {
115
122
  results.push(result);
@@ -122,7 +129,7 @@ function getResults(queries, data, results, kind, functions) {
122
129
  if ((argument && argument !== dependencies_query_format_1.Unknown) || !id) {
123
130
  return undefined;
124
131
  }
125
- let get = data.ast.idMap.get(id);
132
+ let get = normalize.idMap.get(id);
126
133
  if (get?.type === type_1.RType.Argument) {
127
134
  get = get.value;
128
135
  }