@eagleoutice/flowr 2.5.0 → 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 (223) hide show
  1. package/README.md +57 -42
  2. package/cli/flowr.js +3 -29
  3. package/cli/repl/commands/repl-cfg.d.ts +5 -5
  4. package/cli/repl/commands/repl-cfg.js +21 -22
  5. package/cli/repl/commands/repl-commands.d.ts +3 -3
  6. package/cli/repl/commands/repl-commands.js +2 -0
  7. package/cli/repl/commands/repl-dataflow.d.ts +5 -5
  8. package/cli/repl/commands/repl-dataflow.js +27 -30
  9. package/cli/repl/commands/repl-execute.js +1 -0
  10. package/cli/repl/commands/repl-lineage.js +1 -0
  11. package/cli/repl/commands/repl-main.d.ts +34 -3
  12. package/cli/repl/commands/repl-normalize.d.ts +3 -3
  13. package/cli/repl/commands/repl-normalize.js +15 -19
  14. package/cli/repl/commands/repl-parse.d.ts +2 -2
  15. package/cli/repl/commands/repl-parse.js +13 -8
  16. package/cli/repl/commands/repl-query.d.ts +3 -3
  17. package/cli/repl/commands/repl-query.js +29 -19
  18. package/cli/repl/commands/repl-quit.js +1 -0
  19. package/cli/repl/commands/repl-version.js +1 -0
  20. package/cli/repl/core.d.ts +4 -1
  21. package/cli/repl/core.js +21 -1
  22. package/cli/repl/server/connection.d.ts +7 -3
  23. package/cli/repl/server/connection.js +40 -48
  24. package/cli/repl/server/messages/message-slice.d.ts +1 -1
  25. package/cli/slicer-app.js +1 -1
  26. package/config.d.ts +1 -1
  27. package/config.js +4 -1
  28. package/control-flow/extract-cfg.d.ts +1 -1
  29. package/control-flow/extract-cfg.js +1 -1
  30. package/core/pipeline-executor.d.ts +5 -0
  31. package/core/pipeline-executor.js +5 -0
  32. package/core/steps/pipeline/create-pipeline.js +1 -1
  33. package/core/steps/pipeline/default-pipelines.d.ts +42 -42
  34. package/core/steps/pipeline/default-pipelines.js +4 -1
  35. package/dataflow/graph/dataflowgraph-builder.d.ts +11 -12
  36. package/dataflow/graph/dataflowgraph-builder.js +6 -6
  37. package/documentation/doc-util/doc-query.d.ts +3 -6
  38. package/documentation/doc-util/doc-query.js +5 -17
  39. package/documentation/doc-util/doc-search.js +7 -10
  40. package/documentation/doc-util/doc-structure.d.ts +4 -0
  41. package/documentation/doc-util/doc-structure.js +28 -0
  42. package/documentation/doc-util/doc-types.d.ts +5 -1
  43. package/documentation/doc-util/doc-types.js +29 -3
  44. package/documentation/print-analyzer-wiki.d.ts +1 -0
  45. package/documentation/print-analyzer-wiki.js +137 -0
  46. package/documentation/print-core-wiki.d.ts +2 -1
  47. package/documentation/print-core-wiki.js +58 -4
  48. package/documentation/print-dataflow-graph-wiki.js +15 -22
  49. package/documentation/print-interface-wiki.js +18 -1
  50. package/documentation/print-linter-wiki.js +5 -1
  51. package/documentation/print-normalized-ast-wiki.js +6 -8
  52. package/engines.d.ts +9 -0
  53. package/engines.js +38 -0
  54. package/linter/linter-executor.d.ts +2 -8
  55. package/linter/linter-executor.js +9 -4
  56. package/linter/linter-format.d.ts +8 -9
  57. package/linter/linter-rules.d.ts +57 -15
  58. package/linter/linter-rules.js +2 -0
  59. package/linter/rules/absolute-path.d.ts +1 -0
  60. package/linter/rules/dataframe-access-validation.d.ts +4 -3
  61. package/linter/rules/dataframe-access-validation.js +7 -4
  62. package/linter/rules/dead-code.d.ts +2 -1
  63. package/linter/rules/deprecated-functions.d.ts +15 -28
  64. package/linter/rules/deprecated-functions.js +5 -43
  65. package/linter/rules/file-path-validity.d.ts +2 -1
  66. package/linter/rules/file-path-validity.js +1 -1
  67. package/linter/rules/function-finder-util.d.ts +51 -0
  68. package/linter/rules/function-finder-util.js +77 -0
  69. package/linter/rules/naming-convention.d.ts +2 -1
  70. package/linter/rules/network-functions.d.ts +40 -0
  71. package/linter/rules/network-functions.js +24 -0
  72. package/linter/rules/seeded-randomness.d.ts +2 -1
  73. package/linter/rules/unused-definition.d.ts +2 -1
  74. package/linter/rules/useless-loop.d.ts +3 -2
  75. package/linter/rules/useless-loop.js +4 -6
  76. package/package.json +2 -1
  77. package/project/cache/flowr-analyzer-cache.d.ts +93 -0
  78. package/project/cache/flowr-analyzer-cache.js +156 -0
  79. package/project/cache/flowr-cache.d.ts +28 -0
  80. package/project/cache/flowr-cache.js +49 -0
  81. package/project/context/abstract-flowr-analyzer-context.d.ts +35 -0
  82. package/project/context/abstract-flowr-analyzer-context.js +46 -0
  83. package/project/context/flowr-analyzer-context.d.ts +48 -0
  84. package/project/context/flowr-analyzer-context.js +47 -0
  85. package/project/context/flowr-analyzer-dependencies-context.d.ts +38 -0
  86. package/project/context/flowr-analyzer-dependencies-context.js +39 -0
  87. package/project/context/flowr-analyzer-files-context.d.ts +86 -0
  88. package/project/context/flowr-analyzer-files-context.js +130 -0
  89. package/project/context/flowr-analyzer-loading-order-context.d.ts +76 -0
  90. package/project/context/flowr-analyzer-loading-order-context.js +90 -0
  91. package/project/context/flowr-file.d.ts +89 -0
  92. package/project/context/flowr-file.js +78 -0
  93. package/project/flowr-analyzer-builder.d.ts +106 -0
  94. package/project/flowr-analyzer-builder.js +197 -0
  95. package/project/flowr-analyzer.d.ts +125 -0
  96. package/project/flowr-analyzer.js +81 -0
  97. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +17 -0
  98. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +28 -0
  99. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +21 -0
  100. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +34 -0
  101. package/project/plugins/file-plugins/flowr-description-file.d.ts +24 -0
  102. package/project/plugins/file-plugins/flowr-description-file.js +38 -0
  103. package/project/plugins/flowr-analyzer-plugin.d.ts +90 -0
  104. package/project/plugins/flowr-analyzer-plugin.js +82 -0
  105. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +14 -0
  106. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +56 -0
  107. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.d.ts +13 -0
  108. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +33 -0
  109. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +14 -0
  110. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +41 -0
  111. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
  112. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +29 -0
  113. package/project/plugins/package-version-plugins/package.d.ts +15 -0
  114. package/project/plugins/package-version-plugins/package.js +56 -0
  115. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +15 -0
  116. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +44 -0
  117. package/queries/base-query-format.d.ts +2 -8
  118. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  119. package/queries/catalog/call-context-query/call-context-query-executor.js +20 -13
  120. package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -3
  121. package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
  122. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
  123. package/queries/catalog/cluster-query/cluster-query-executor.js +2 -2
  124. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -54
  125. package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
  126. package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
  127. package/queries/catalog/config-query/config-query-executor.js +5 -5
  128. package/queries/catalog/config-query/config-query-format.d.ts +1 -1
  129. package/queries/catalog/config-query/config-query-format.js +1 -1
  130. package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
  131. package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -3
  132. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -54
  133. package/queries/catalog/control-flow-query/control-flow-query-format.js +2 -2
  134. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +1 -1
  135. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -2
  136. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -54
  137. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -1
  138. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
  139. package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
  140. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -54
  141. package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -1
  142. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
  143. package/queries/catalog/dependencies-query/dependencies-query-executor.js +19 -12
  144. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +7 -56
  145. package/queries/catalog/dependencies-query/dependencies-query-format.js +7 -4
  146. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
  147. package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -4
  148. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -54
  149. package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
  150. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
  151. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
  152. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -54
  153. package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
  154. package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
  155. package/queries/catalog/id-map-query/id-map-query-executor.js +2 -2
  156. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -54
  157. package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
  158. package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
  159. package/queries/catalog/lineage-query/lineage-query-executor.js +2 -2
  160. package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -54
  161. package/queries/catalog/lineage-query/lineage-query-format.js +1 -1
  162. package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
  163. package/queries/catalog/linter-query/linter-query-executor.js +2 -3
  164. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -54
  165. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  166. package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
  167. package/queries/catalog/location-map-query/location-map-query-executor.js +3 -2
  168. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  169. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  170. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
  171. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -2
  172. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -54
  173. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -1
  174. package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
  175. package/queries/catalog/origin-query/origin-query-executor.js +3 -3
  176. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -54
  177. package/queries/catalog/origin-query/origin-query-format.js +1 -1
  178. package/queries/catalog/project-query/project-query-executor.d.ts +1 -1
  179. package/queries/catalog/project-query/project-query-executor.js +2 -2
  180. package/queries/catalog/project-query/project-query-format.d.ts +1 -54
  181. package/queries/catalog/project-query/project-query-format.js +1 -1
  182. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
  183. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -2
  184. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -54
  185. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
  186. package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
  187. package/queries/catalog/search-query/search-query-executor.js +3 -3
  188. package/queries/catalog/search-query/search-query-format.d.ts +1 -54
  189. package/queries/catalog/search-query/search-query-format.js +1 -1
  190. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
  191. package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -3
  192. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -54
  193. package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -1
  194. package/queries/query-print.d.ts +4 -4
  195. package/queries/query-print.js +12 -12
  196. package/queries/query.d.ts +29 -885
  197. package/queries/query.js +1 -1
  198. package/r-bridge/retriever.d.ts +6 -5
  199. package/r-bridge/retriever.js +9 -5
  200. package/search/flowr-search-executor.d.ts +3 -5
  201. package/search/flowr-search-executor.js +6 -4
  202. package/search/flowr-search-filters.d.ts +12 -6
  203. package/search/flowr-search-filters.js +1 -1
  204. package/search/flowr-search.d.ts +5 -16
  205. package/search/flowr-search.js +14 -5
  206. package/search/search-executor/search-enrichers.d.ts +37 -36
  207. package/search/search-executor/search-enrichers.js +4 -4
  208. package/search/search-executor/search-generators.d.ts +12 -12
  209. package/search/search-executor/search-generators.js +27 -19
  210. package/search/search-executor/search-mappers.d.ts +5 -5
  211. package/search/search-executor/search-transformer.d.ts +17 -17
  212. package/search/search-executor/search-transformer.js +14 -7
  213. package/util/collections/arrays.d.ts +1 -0
  214. package/util/collections/arrays.js +15 -0
  215. package/util/collections/objectmap.d.ts +17 -0
  216. package/util/collections/objectmap.js +28 -0
  217. package/util/containers.d.ts +0 -1
  218. package/util/containers.js +0 -1
  219. package/util/files.d.ts +17 -0
  220. package/util/files.js +65 -0
  221. package/util/formats/adapter.d.ts +4 -2
  222. package/util/formats/adapter.js +11 -4
  223. package/util/version.js +1 -1
@@ -15,60 +15,7 @@ export interface ResolveValueQueryResult extends BaseQueryResult {
15
15
  }
16
16
  export declare const ResolveValueQueryDefinition: {
17
17
  readonly executor: typeof executeResolveValueQuery;
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: () => never[];
74
21
  };
@@ -11,7 +11,7 @@ const resolve_value_query_executor_1 = require("./resolve-value-query-executor")
11
11
  const r_value_1 = require("../../../dataflow/eval/values/r-value");
12
12
  exports.ResolveValueQueryDefinition = {
13
13
  executor: resolve_value_query_executor_1.executeResolveValueQuery,
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)('resolve-value', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
17
17
  for (const [fingerprint, obj] of Object.entries(out.results)) {
@@ -1,3 +1,3 @@
1
1
  import type { BasicQueryData } from '../../base-query-format';
2
2
  import type { SearchQuery, SearchQueryResult } from './search-query-format';
3
- export declare function executeSearch({ ast, dataflow, config }: BasicQueryData, queries: readonly SearchQuery[]): SearchQueryResult;
3
+ export declare function executeSearch({ analyzer }: BasicQueryData, queries: readonly SearchQuery[]): Promise<SearchQueryResult>;
@@ -2,14 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.executeSearch = executeSearch;
4
4
  const flowr_search_executor_1 = require("../../../search/flowr-search-executor");
5
- function executeSearch({ ast, dataflow, config }, queries) {
5
+ async function executeSearch({ analyzer }, queries) {
6
6
  const start = Date.now();
7
7
  const results = [];
8
8
  for (const query of queries) {
9
9
  const { search } = query;
10
+ const searchResult = await (0, flowr_search_executor_1.runSearch)(search, analyzer);
10
11
  results.push({
11
- ids: (0, flowr_search_executor_1.runSearch)(search, { normalize: ast, dataflow, config })
12
- .getElements().map(({ node }) => node.info.id),
12
+ ids: searchResult.getElements().map(({ node }) => node.info.id),
13
13
  search
14
14
  });
15
15
  }
@@ -15,60 +15,7 @@ export interface SearchQueryResult extends BaseQueryResult {
15
15
  }
16
16
  export declare const SearchQueryDefinition: {
17
17
  readonly executor: typeof executeSearch;
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
  };
@@ -13,7 +13,7 @@ const flowr_search_printer_1 = require("../../../search/flowr-search-printer");
13
13
  const mermaid_1 = require("../../../util/mermaid/mermaid");
14
14
  exports.SearchQueryDefinition = {
15
15
  executor: search_query_executor_1.executeSearch,
16
- asciiSummarizer: (formatter, _processed, queryResults, result) => {
16
+ asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
17
17
  const out = queryResults;
18
18
  result.push(`Query: ${(0, ansi_1.bold)('search', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
19
19
  for (const [, { ids, search }] of out.results.entries()) {
@@ -1,4 +1,4 @@
1
1
  import type { StaticSliceQuery, StaticSliceQueryResult } from './static-slice-query-format';
2
2
  import type { BasicQueryData } from '../../base-query-format';
3
3
  export declare function fingerPrintOfQuery(query: StaticSliceQuery): string;
4
- export declare function executeStaticSliceQuery({ dataflow, ast, config }: BasicQueryData, queries: readonly StaticSliceQuery[]): StaticSliceQueryResult;
4
+ export declare function executeStaticSliceQuery({ analyzer }: BasicQueryData, queries: readonly StaticSliceQuery[]): Promise<StaticSliceQueryResult>;
@@ -11,7 +11,7 @@ const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
11
11
  function fingerPrintOfQuery(query) {
12
12
  return JSON.stringify(query);
13
13
  }
14
- function executeStaticSliceQuery({ dataflow, ast, config }, queries) {
14
+ async function executeStaticSliceQuery({ analyzer }, queries) {
15
15
  const start = Date.now();
16
16
  const results = {};
17
17
  for (const query of queries) {
@@ -21,14 +21,14 @@ function executeStaticSliceQuery({ dataflow, ast, config }, queries) {
21
21
  }
22
22
  const { criteria, noReconstruction, noMagicComments } = query;
23
23
  const sliceStart = Date.now();
24
- const slice = (0, static_slicer_1.staticSlice)(dataflow, ast, criteria, query.direction ?? _00_slice_1.SliceDirection.Backward, config.solver.slicer?.threshold);
24
+ const slice = (0, static_slicer_1.staticSlice)(await analyzer.dataflow(), await analyzer.normalize(), criteria, query.direction ?? _00_slice_1.SliceDirection.Backward, analyzer.flowrConfig.solver.slicer?.threshold);
25
25
  const sliceEnd = Date.now();
26
26
  if (noReconstruction) {
27
27
  results[key] = { slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } } };
28
28
  }
29
29
  else {
30
30
  const reconstructStart = Date.now();
31
- const reconstruct = (0, reconstruct_1.reconstructToCode)(ast, slice.result, noMagicComments ? auto_select_defaults_1.doNotAutoSelect : (0, magic_comments_1.makeMagicCommentHandler)(auto_select_defaults_1.doNotAutoSelect));
31
+ const reconstruct = (0, reconstruct_1.reconstructToCode)(await analyzer.normalize(), slice.result, noMagicComments ? auto_select_defaults_1.doNotAutoSelect : (0, magic_comments_1.makeMagicCommentHandler)(auto_select_defaults_1.doNotAutoSelect));
32
32
  const reconstructEnd = Date.now();
33
33
  results[key] = {
34
34
  slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } },
@@ -30,60 +30,7 @@ export interface StaticSliceQueryResult extends BaseQueryResult {
30
30
  }
31
31
  export declare const StaticSliceQueryDefinition: {
32
32
  readonly executor: typeof executeStaticSliceQuery;
33
- readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
34
- readonly name: "parse";
35
- readonly humanReadableName: "parse with R shell";
36
- readonly description: "Parse the given R code into an AST";
37
- readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
38
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
39
- readonly printer: {
40
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
41
- readonly 2: {
42
- (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
43
- (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
44
- };
45
- readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
46
- };
47
- readonly dependencies: readonly [];
48
- readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
49
- } | {
50
- readonly name: "normalize";
51
- readonly humanReadableName: "normalize";
52
- readonly description: "Normalize the AST to flowR's AST";
53
- readonly processor: (results: {
54
- parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
55
- }, 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>>;
56
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
57
- readonly printer: {
58
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
59
- readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
60
- readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
61
- readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
62
- readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
63
- };
64
- readonly dependencies: readonly ["parse"];
65
- readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
66
- } | {
67
- readonly humanReadableName: "dataflow";
68
- readonly processor: (results: {
69
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
70
- }, input: {
71
- request?: import("../../../r-bridge/retriever").RParseRequests;
72
- parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
73
- }, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
74
- readonly requiredInput: {};
75
- readonly name: "dataflow";
76
- readonly description: "Construct the dataflow graph";
77
- readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
78
- readonly printer: {
79
- readonly 0: typeof import("../../../core/print/print").internalPrinter;
80
- readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
81
- readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
82
- readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
83
- readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
84
- };
85
- readonly dependencies: readonly ["normalize"];
86
- }>>, queryResults: BaseQueryResult, result: string[]) => true;
33
+ readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
87
34
  readonly schema: Joi.ObjectSchema<any>;
88
35
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
89
36
  };
@@ -12,7 +12,7 @@ const query_print_1 = require("../../query-print");
12
12
  const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
13
13
  exports.StaticSliceQueryDefinition = {
14
14
  executor: static_slice_query_executor_1.executeStaticSliceQuery,
15
- asciiSummarizer: (formatter, _processed, queryResults, result) => {
15
+ asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
16
16
  const out = queryResults;
17
17
  result.push(`Query: ${(0, ansi_1.bold)('static-slice', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
18
18
  for (const [fingerprint, obj] of Object.entries(out.results)) {
@@ -1,8 +1,8 @@
1
1
  import type { OutputFormatter } from '../util/text/ansi';
2
2
  import type { Queries, QueryResults, SupportedQueryTypes } from './query';
3
- import type { PipelineOutput } from '../core/steps/pipeline/pipeline';
4
- import type { DEFAULT_DATAFLOW_PIPELINE } from '../core/steps/pipeline/default-pipelines';
5
3
  import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
6
- export declare function asciiCallContext(formatter: OutputFormatter, results: QueryResults<'call-context'>['call-context'], processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>): string;
4
+ import type { AstIdMap, ParentInformation } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
5
+ import type { FlowrAnalysisProvider } from '../project/flowr-analyzer';
6
+ export declare function asciiCallContext(formatter: OutputFormatter, results: QueryResults<'call-context'>['call-context'], idMap: AstIdMap<ParentInformation>): string;
7
7
  export declare function summarizeIdsIfTooLong(formatter: OutputFormatter, ids: readonly NodeId[]): string;
8
- export declare function asciiSummaryOfQueryResult<S extends SupportedQueryTypes>(formatter: OutputFormatter, totalInMs: number, results: Awaited<QueryResults<S>>, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>, queries: Queries<S>): string;
8
+ export declare function asciiSummaryOfQueryResult<S extends SupportedQueryTypes>(formatter: OutputFormatter, totalInMs: number, results: QueryResults<S>, analyzer: FlowrAnalysisProvider, queries: Queries<S>): Promise<string>;
@@ -8,48 +8,48 @@ const query_1 = require("./query");
8
8
  const html_hover_over_1 = require("../util/html-hover-over");
9
9
  const time_1 = require("../util/text/time");
10
10
  const built_in_1 = require("../dataflow/environments/built-in");
11
- function nodeString(nodeId, formatter, processed) {
11
+ function nodeString(nodeId, formatter, idMap) {
12
12
  const isObj = typeof nodeId === 'object' && nodeId !== null && 'id' in nodeId;
13
13
  const id = isObj ? nodeId.id : nodeId;
14
14
  const info = isObj ? nodeId.info : undefined;
15
15
  if ((0, built_in_1.isBuiltIn)(id)) {
16
16
  return (0, ansi_1.italic)(id, formatter) + (info ? ` (${JSON.stringify(info)})` : '');
17
17
  }
18
- const node = processed.normalize.idMap.get(id);
18
+ const node = idMap.get(id);
19
19
  if (node === undefined) {
20
20
  return `UNKNOWN: ${id} (info: ${JSON.stringify(info)})`;
21
21
  }
22
22
  return `${(0, ansi_1.italic)('`' + (node.lexeme ?? node.info.fullLexeme ?? 'UNKNOWN') + '`', formatter)} (L.${node.location?.[0]}${info ? ', ' + JSON.stringify(info) : ''})`;
23
23
  }
24
- function asciiCallContextSubHit(formatter, results, processed) {
24
+ function asciiCallContextSubHit(formatter, results, idMap) {
25
25
  const result = [];
26
26
  for (const { id, calls = [], linkedIds = [], aliasRoots = [] } of results) {
27
- const node = processed.normalize.idMap.get(id);
27
+ const node = idMap.get(id);
28
28
  if (node === undefined) {
29
29
  result.push(` ${(0, ansi_1.bold)('UNKNOWN: ' + JSON.stringify({ calls, linkedIds }))}`);
30
30
  continue;
31
31
  }
32
- let line = nodeString(id, formatter, processed);
32
+ let line = nodeString(id, formatter, idMap);
33
33
  if (calls.length > 0) {
34
- line += ` with ${calls.length} call${calls.length > 1 ? 's' : ''} (${calls.map(c => nodeString(c, formatter, processed)).join(', ')})`;
34
+ line += ` with ${calls.length} call${calls.length > 1 ? 's' : ''} (${calls.map(c => nodeString(c, formatter, idMap)).join(', ')})`;
35
35
  }
36
36
  if (linkedIds.length > 0) {
37
- line += ` with ${linkedIds.length} link${linkedIds.length > 1 ? 's' : ''} (${linkedIds.map(c => nodeString(c, formatter, processed)).join(', ')})`;
37
+ line += ` with ${linkedIds.length} link${linkedIds.length > 1 ? 's' : ''} (${linkedIds.map(c => nodeString(c, formatter, idMap)).join(', ')})`;
38
38
  }
39
39
  if (aliasRoots.length > 0) {
40
- line += ` with ${aliasRoots.length} alias root${aliasRoots.length > 1 ? 's' : ''} (${aliasRoots.map(c => nodeString(c, formatter, processed)).join(', ')})`;
40
+ line += ` with ${aliasRoots.length} alias root${aliasRoots.length > 1 ? 's' : ''} (${aliasRoots.map(c => nodeString(c, formatter, idMap)).join(', ')})`;
41
41
  }
42
42
  result.push(line);
43
43
  }
44
44
  return result.join(', ');
45
45
  }
46
- function asciiCallContext(formatter, results, processed) {
46
+ function asciiCallContext(formatter, results, idMap) {
47
47
  /* traverse over 'kinds' and within them 'subkinds' */
48
48
  const result = [];
49
49
  for (const [kind, { subkinds }] of Object.entries(results['kinds'])) {
50
50
  result.push(` ╰ ${(0, ansi_1.bold)(kind, formatter)}`);
51
51
  for (const [subkind, values] of Object.entries(subkinds)) {
52
- result.push(` ╰ ${(0, ansi_1.bold)(subkind, formatter)}: ${asciiCallContextSubHit(formatter, values, processed)}`);
52
+ result.push(` ╰ ${(0, ansi_1.bold)(subkind, formatter)}: ${asciiCallContextSubHit(formatter, values, idMap)}`);
53
53
  }
54
54
  }
55
55
  return result.join('\n');
@@ -69,7 +69,7 @@ function summarizeIdsIfTooLong(formatter, ids) {
69
69
  }
70
70
  return formatter === ansi_1.markdownFormatter ? (0, html_hover_over_1.textWithTooltip)(acc, JSON.stringify(ids)) : acc;
71
71
  }
72
- function asciiSummaryOfQueryResult(formatter, totalInMs, results, processed, queries) {
72
+ async function asciiSummaryOfQueryResult(formatter, totalInMs, results, analyzer, queries) {
73
73
  const result = [];
74
74
  for (const [query, queryResults] of Object.entries(results)) {
75
75
  if (query === '.meta') {
@@ -77,7 +77,7 @@ function asciiSummaryOfQueryResult(formatter, totalInMs, results, processed, que
77
77
  }
78
78
  const queryType = query_1.SupportedQueries[query];
79
79
  const relevantQueries = queries.filter(q => q.type === query);
80
- if (queryType.asciiSummarizer(formatter, processed, queryResults, result, relevantQueries)) {
80
+ if (await queryType.asciiSummarizer(formatter, analyzer, queryResults, result, relevantQueries)) {
81
81
  continue;
82
82
  }
83
83
  result.push(`Query: ${(0, ansi_1.bold)(query, formatter)}`);