@eagleoutice/flowr 2.2.16 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +48 -20
  2. package/abstract-interpretation/data-frame/absint-info.d.ts +109 -0
  3. package/abstract-interpretation/data-frame/absint-info.js +31 -0
  4. package/abstract-interpretation/data-frame/absint-visitor.d.ts +58 -0
  5. package/abstract-interpretation/data-frame/absint-visitor.js +171 -0
  6. package/abstract-interpretation/data-frame/domain.d.ts +107 -0
  7. package/abstract-interpretation/data-frame/domain.js +315 -0
  8. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +17 -0
  9. package/abstract-interpretation/data-frame/mappers/access-mapper.js +166 -0
  10. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +117 -0
  11. package/abstract-interpretation/data-frame/mappers/arguments.js +188 -0
  12. package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +20 -0
  13. package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +34 -0
  14. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +261 -0
  15. package/abstract-interpretation/data-frame/mappers/function-mapper.js +1219 -0
  16. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +12 -0
  17. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +206 -0
  18. package/abstract-interpretation/data-frame/resolve-args.d.ts +42 -0
  19. package/abstract-interpretation/data-frame/resolve-args.js +118 -0
  20. package/abstract-interpretation/data-frame/semantics.d.ts +213 -0
  21. package/abstract-interpretation/data-frame/semantics.js +363 -0
  22. package/abstract-interpretation/data-frame/shape-inference.d.ts +38 -0
  23. package/abstract-interpretation/data-frame/shape-inference.js +111 -0
  24. package/benchmark/slicer.d.ts +15 -1
  25. package/benchmark/slicer.js +137 -0
  26. package/benchmark/stats/print.js +123 -45
  27. package/benchmark/stats/size-of.d.ts +7 -0
  28. package/benchmark/stats/size-of.js +1 -0
  29. package/benchmark/stats/stats.d.ts +30 -1
  30. package/benchmark/stats/stats.js +4 -2
  31. package/benchmark/summarizer/data.d.ts +33 -2
  32. package/benchmark/summarizer/first-phase/input.js +5 -1
  33. package/benchmark/summarizer/first-phase/process.js +47 -1
  34. package/benchmark/summarizer/second-phase/graph.js +1 -1
  35. package/benchmark/summarizer/second-phase/process.js +102 -4
  36. package/cli/benchmark-app.d.ts +2 -0
  37. package/cli/benchmark-app.js +2 -0
  38. package/cli/benchmark-helper-app.d.ts +2 -0
  39. package/cli/benchmark-helper-app.js +10 -3
  40. package/cli/common/options.js +4 -0
  41. package/cli/repl/commands/repl-query.js +1 -1
  42. package/cli/repl/server/connection.js +14 -5
  43. package/config.d.ts +31 -0
  44. package/config.js +21 -1
  45. package/control-flow/basic-cfg-guided-visitor.d.ts +1 -2
  46. package/control-flow/basic-cfg-guided-visitor.js +0 -6
  47. package/control-flow/cfg-simplification.d.ts +6 -0
  48. package/control-flow/cfg-simplification.js +18 -9
  49. package/control-flow/control-flow-graph.d.ts +3 -8
  50. package/control-flow/control-flow-graph.js +5 -6
  51. package/control-flow/dfg-cfg-guided-visitor.js +1 -1
  52. package/control-flow/extract-cfg.d.ts +2 -2
  53. package/control-flow/extract-cfg.js +52 -63
  54. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  55. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  56. package/core/steps/all/static-slicing/00-slice.d.ts +7 -1
  57. package/core/steps/all/static-slicing/00-slice.js +9 -3
  58. package/core/steps/pipeline/default-pipelines.d.ts +74 -74
  59. package/dataflow/environments/built-in.d.ts +7 -5
  60. package/dataflow/environments/built-in.js +16 -13
  61. package/dataflow/eval/resolve/alias-tracking.js +2 -2
  62. package/dataflow/eval/resolve/resolve.d.ts +53 -9
  63. package/dataflow/eval/resolve/resolve.js +132 -38
  64. package/dataflow/graph/dataflowgraph-builder.js +2 -2
  65. package/dataflow/graph/graph.js +1 -1
  66. package/dataflow/graph/invert-dfg.d.ts +2 -0
  67. package/dataflow/graph/invert-dfg.js +17 -0
  68. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -0
  69. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +4 -0
  70. package/documentation/doc-util/doc-query.js +11 -1
  71. package/documentation/doc-util/doc-search.js +2 -2
  72. package/documentation/print-cfg-wiki.js +3 -4
  73. package/documentation/print-core-wiki.js +2 -2
  74. package/documentation/print-dataflow-graph-wiki.js +7 -0
  75. package/documentation/print-faq-wiki.js +4 -0
  76. package/documentation/print-interface-wiki.js +11 -0
  77. package/documentation/print-linter-wiki.js +36 -4
  78. package/documentation/print-linting-and-testing-wiki.js +13 -1
  79. package/documentation/print-onboarding-wiki.js +4 -0
  80. package/documentation/print-query-wiki.js +29 -3
  81. package/linter/linter-executor.js +1 -2
  82. package/linter/linter-format.d.ts +26 -4
  83. package/linter/linter-format.js +25 -6
  84. package/linter/linter-rules.d.ts +63 -12
  85. package/linter/linter-rules.js +5 -1
  86. package/linter/rules/absolute-path.d.ts +4 -7
  87. package/linter/rules/absolute-path.js +9 -6
  88. package/linter/rules/dataframe-access-validation.d.ts +55 -0
  89. package/linter/rules/dataframe-access-validation.js +118 -0
  90. package/linter/rules/dead-code.d.ts +43 -0
  91. package/linter/rules/dead-code.js +50 -0
  92. package/linter/rules/deprecated-functions.d.ts +3 -2
  93. package/linter/rules/deprecated-functions.js +3 -1
  94. package/linter/rules/file-path-validity.d.ts +4 -4
  95. package/linter/rules/file-path-validity.js +8 -6
  96. package/linter/rules/naming-convention.d.ts +5 -4
  97. package/linter/rules/naming-convention.js +8 -2
  98. package/linter/rules/seeded-randomness.d.ts +4 -3
  99. package/linter/rules/seeded-randomness.js +3 -1
  100. package/linter/rules/unused-definition.d.ts +2 -0
  101. package/linter/rules/unused-definition.js +3 -1
  102. package/package.json +2 -2
  103. package/queries/catalog/dependencies-query/dependencies-query-executor.js +6 -1
  104. package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -0
  105. package/queries/catalog/dependencies-query/function-info/write-functions.js +1 -0
  106. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +3 -0
  107. package/queries/catalog/df-shape-query/df-shape-query-executor.js +46 -0
  108. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +72 -0
  109. package/queries/catalog/df-shape-query/df-shape-query-format.js +31 -0
  110. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  111. package/queries/catalog/location-map-query/location-map-query-executor.js +7 -5
  112. package/queries/catalog/location-map-query/location-map-query-format.d.ts +3 -0
  113. package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
  114. package/queries/catalog/search-query/search-query-executor.js +1 -1
  115. package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -1
  116. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +3 -0
  117. package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -1
  118. package/queries/query-print.d.ts +1 -1
  119. package/queries/query-print.js +0 -1
  120. package/queries/query.d.ts +77 -6
  121. package/queries/query.js +26 -11
  122. package/search/flowr-search-builder.d.ts +6 -6
  123. package/search/flowr-search-executor.d.ts +2 -2
  124. package/search/flowr-search-executor.js +1 -1
  125. package/search/flowr-search.d.ts +13 -8
  126. package/search/flowr-search.js +21 -0
  127. package/search/search-executor/search-enrichers.d.ts +87 -20
  128. package/search/search-executor/search-enrichers.js +44 -5
  129. package/search/search-executor/search-generators.d.ts +4 -4
  130. package/search/search-executor/search-generators.js +12 -7
  131. package/search/search-executor/search-mappers.js +3 -2
  132. package/search/search-executor/search-transformer.d.ts +3 -3
  133. package/search/search-executor/search-transformer.js +2 -2
  134. package/slicing/static/static-slicer.d.ts +4 -2
  135. package/slicing/static/static-slicer.js +10 -4
  136. package/util/collections/arrays.d.ts +2 -0
  137. package/util/collections/arrays.js +9 -0
  138. package/util/files.d.ts +8 -2
  139. package/util/files.js +22 -4
  140. package/util/mermaid/dfg.js +4 -2
  141. package/util/r-value.d.ts +23 -0
  142. package/util/r-value.js +113 -0
  143. package/util/range.d.ts +1 -0
  144. package/util/range.js +5 -1
  145. package/util/version.js +1 -1
  146. package/util/cfg/cfg.d.ts +0 -0
  147. package/util/cfg/cfg.js +0 -2
@@ -80,7 +80,7 @@ exports.UNUSED_DEFINITION = {
80
80
  // found an unused definition
81
81
  const variableName = element.node.lexeme;
82
82
  return [{
83
- certainty: linter_format_1.LintingCertainty.Maybe,
83
+ certainty: linter_format_1.LintingResultCertainty.Uncertain,
84
84
  variableName,
85
85
  range: element.node.info.fullRange ?? element.node.location ?? (0, range_1.rangeFrom)(-1, -1, -1, -1),
86
86
  quickFix: buildQuickFix(element.node, data.dataflow.graph, data.normalize)
@@ -97,6 +97,8 @@ exports.UNUSED_DEFINITION = {
97
97
  name: 'Unused Definitions',
98
98
  description: 'Checks for unused definitions.',
99
99
  tags: [linter_tags_1.LintingRuleTag.Readability, linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.QuickFix],
100
+ // our limited analysis causes unused definitions involving complex reflection etc. not to be included in our result, but unused definitions are correctly validated
101
+ certainty: linter_format_1.LintingRuleCertainty.BestEffort,
100
102
  defaultConfig: {
101
103
  includeFunctionDefinitions: true
102
104
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.2.16",
3
+ "version": "2.4.0",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": {
@@ -176,7 +176,7 @@
176
176
  "devDependencies": {
177
177
  "@commitlint/cli": "^19.7.1",
178
178
  "@commitlint/config-angular": "^19.7.1",
179
- "@eagleoutice/eslint-config-flowr": "^1.0.17",
179
+ "@eagleoutice/eslint-config-flowr": "^1.0.19",
180
180
  "@eslint/eslintrc": "^3.2.0",
181
181
  "@eslint/js": "^9.20.0",
182
182
  "@j-ulrich/release-it-regex-bumper": "^5.3.0",
@@ -40,7 +40,12 @@ function executeDependenciesQuery(data, queries) {
40
40
  const readFunctions = getFunctionsToCheck(query.readFunctions, ignoreDefault, read_functions_1.ReadFunctions);
41
41
  const writeFunctions = getFunctionsToCheck(query.writeFunctions, ignoreDefault, write_functions_1.WriteFunctions);
42
42
  const numberOfFunctions = libraryFunctions.length + sourceFunctions.length + readFunctions.length + writeFunctions.length;
43
- const results = numberOfFunctions === 0 ? { kinds: {}, '.meta': { timing: 0 } } : (0, query_1.executeQueriesOfSameType)(data, ...makeCallContextQuery(libraryFunctions, 'library'), ...makeCallContextQuery(sourceFunctions, 'source'), ...makeCallContextQuery(readFunctions, 'read'), ...makeCallContextQuery(writeFunctions, 'write'));
43
+ const results = numberOfFunctions === 0 ? { kinds: {}, '.meta': { timing: 0 } } : (0, query_1.executeQueriesOfSameType)(data, [
44
+ makeCallContextQuery(libraryFunctions, 'library'),
45
+ makeCallContextQuery(sourceFunctions, 'source'),
46
+ makeCallContextQuery(readFunctions, 'read'),
47
+ makeCallContextQuery(writeFunctions, 'write')
48
+ ].flat());
44
49
  function getLexeme(argument, id) {
45
50
  if ((argument && argument !== dependencies_query_format_1.Unknown) || !id) {
46
51
  return undefined;
@@ -97,5 +97,6 @@ exports.ReadFunctions = [
97
97
  { package: 'stats', name: 'read.ftable', argIdx: 0, argName: 'file', resolveValue: true },
98
98
  { package: 'DBI', name: 'dbReadTable', argIdx: 1, argName: 'name', resolveValue: true },
99
99
  { package: 'DBI', name: 'dbReadTableArrow', argIdx: 1, argName: 'name', resolveValue: true },
100
+ { package: 'jsonlite', name: 'read_json', argIdx: 0, argName: 'path', resolveValue: true },
100
101
  ];
101
102
  //# sourceMappingURL=read-functions.js.map
@@ -83,5 +83,6 @@ exports.WriteFunctions = [
83
83
  { package: 'rasterpdf', name: 'raster_pdf', argIdx: 0, argName: 'filename', resolveValue: true },
84
84
  { package: 'rasterpdf', name: 'agg_pdf', argIdx: 0, argName: 'filename', resolveValue: true },
85
85
  { package: 'highcharter', name: 'hc_exporting', argName: 'filename', resolveValue: true },
86
+ { package: 'jsonlite', name: 'write_json', argIdx: 1, argName: 'path', resolveValue: true },
86
87
  ];
87
88
  //# sourceMappingURL=write-functions.js.map
@@ -0,0 +1,3 @@
1
+ import type { DfShapeQuery, DfShapeQueryResult } from './df-shape-query-format';
2
+ import type { BasicQueryData } from '../../base-query-format';
3
+ export declare function executeDfShapeQuery({ dataflow: { graph }, ast, config }: BasicQueryData, queries: readonly DfShapeQuery[]): DfShapeQueryResult;
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeDfShapeQuery = executeDfShapeQuery;
4
+ const log_1 = require("../../../util/log");
5
+ const extract_cfg_1 = require("../../../control-flow/extract-cfg");
6
+ const shape_inference_1 = require("../../../abstract-interpretation/data-frame/shape-inference");
7
+ const parse_1 = require("../../../slicing/criterion/parse");
8
+ function executeDfShapeQuery({ dataflow: { graph }, ast, config }, queries) {
9
+ if (queries.length !== 1 && queries.some(query => query.criterion === undefined)) {
10
+ log_1.log.warn('The dataframe shape query expects only up to one query without slicing criterion, but got', queries.length);
11
+ queries = [{ type: 'df-shape' }];
12
+ }
13
+ const start = Date.now();
14
+ const cfg = (0, extract_cfg_1.extractCfg)(ast, config, graph);
15
+ const domains = (0, shape_inference_1.inferDataFrameShapes)(cfg, graph, ast, config);
16
+ if (queries.length === 1 && queries[0].criterion === undefined) {
17
+ return {
18
+ '.meta': {
19
+ timing: Date.now() - start
20
+ },
21
+ domains: domains
22
+ };
23
+ }
24
+ const result = new Map();
25
+ for (const query of queries) {
26
+ if (query.criterion === undefined) {
27
+ log_1.log.warn('Missing criterion in dataframe shape query');
28
+ continue;
29
+ }
30
+ else if (result.has(query.criterion)) {
31
+ log_1.log.warn('Duplicate criterion in dataframe shape query:', query.criterion);
32
+ continue;
33
+ }
34
+ const nodeId = (0, parse_1.slicingCriterionToId)(query.criterion, ast.idMap);
35
+ const node = ast.idMap.get(nodeId);
36
+ const value = (0, shape_inference_1.resolveIdToDataFrameShape)(node?.info.id, graph);
37
+ result.set(query.criterion, value);
38
+ }
39
+ return {
40
+ '.meta': {
41
+ timing: Date.now() - start
42
+ },
43
+ domains: result
44
+ };
45
+ }
46
+ //# sourceMappingURL=df-shape-query-executor.js.map
@@ -0,0 +1,72 @@
1
+ import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
+ import Joi from 'joi';
3
+ import type { DataFrameDomain, DataFrameStateDomain } from '../../../abstract-interpretation/data-frame/domain';
4
+ import { executeDfShapeQuery } from './df-shape-query-executor';
5
+ import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
6
+ /** Infer the shape of data frames using abstract interpretation. */
7
+ export interface DfShapeQuery extends BaseQueryFormat {
8
+ readonly type: 'df-shape';
9
+ readonly criterion?: SingleSlicingCriterion;
10
+ }
11
+ export interface DfShapeQueryResult extends BaseQueryResult {
12
+ domains: DataFrameStateDomain | Map<SingleSlicingCriterion, DataFrameDomain | undefined>;
13
+ }
14
+ export declare const DfShapeQueryDefinition: {
15
+ readonly executor: typeof executeDfShapeQuery;
16
+ readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
17
+ readonly name: "parse";
18
+ readonly humanReadableName: "parse with R shell";
19
+ readonly description: "Parse the given R code into an AST";
20
+ readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
21
+ readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
22
+ readonly printer: {
23
+ readonly 0: typeof import("../../../core/print/print").internalPrinter;
24
+ readonly 2: {
25
+ (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
26
+ (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
27
+ };
28
+ readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
29
+ };
30
+ readonly dependencies: readonly [];
31
+ readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
32
+ } | {
33
+ readonly name: "normalize";
34
+ readonly humanReadableName: "normalize";
35
+ readonly description: "Normalize the AST to flowR's AST";
36
+ readonly processor: (results: {
37
+ parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
38
+ }, 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>>;
39
+ readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
40
+ readonly printer: {
41
+ readonly 0: typeof import("../../../core/print/print").internalPrinter;
42
+ readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
43
+ readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
44
+ readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
45
+ readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
46
+ };
47
+ readonly dependencies: readonly ["parse"];
48
+ readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
49
+ } | {
50
+ readonly humanReadableName: "dataflow";
51
+ readonly processor: (results: {
52
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
53
+ }, input: {
54
+ request?: import("../../../r-bridge/retriever").RParseRequests;
55
+ parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
56
+ }, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
57
+ readonly requiredInput: {};
58
+ readonly name: "dataflow";
59
+ readonly description: "Construct the dataflow graph";
60
+ readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
61
+ readonly printer: {
62
+ readonly 0: typeof import("../../../core/print/print").internalPrinter;
63
+ readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
64
+ readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
65
+ readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
66
+ readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
67
+ };
68
+ readonly dependencies: readonly ["normalize"];
69
+ }>>, queryResults: BaseQueryResult, result: string[]) => true;
70
+ readonly schema: Joi.ObjectSchema<any>;
71
+ readonly flattenInvolvedNodes: () => never[];
72
+ };
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DfShapeQueryDefinition = void 0;
7
+ const ansi_1 = require("../../../util/text/ansi");
8
+ const time_1 = require("../../../util/text/time");
9
+ const joi_1 = __importDefault(require("joi"));
10
+ const df_shape_query_executor_1 = require("./df-shape-query-executor");
11
+ const json_1 = require("../../../util/json");
12
+ exports.DfShapeQueryDefinition = {
13
+ executor: df_shape_query_executor_1.executeDfShapeQuery,
14
+ asciiSummarizer: (formatter, _processed, queryResults, result) => {
15
+ const out = queryResults;
16
+ result.push(`Query: ${(0, ansi_1.bold)('df-shape', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
17
+ result.push(...out.domains.entries().take(20).map(([key, domain]) => {
18
+ return ` ╰ ${key}: ${JSON.stringify(domain, json_1.jsonReplacer)}`;
19
+ }));
20
+ if (out.domains.size > 20) {
21
+ result.push(' ╰ ... (see JSON)');
22
+ }
23
+ return true;
24
+ },
25
+ schema: joi_1.default.object({
26
+ type: joi_1.default.string().valid('df-shape').required().description('The type of the query.'),
27
+ criterion: joi_1.default.string().optional().description('The slicing criterion of the node to get the dataframe shape for.')
28
+ }).description('The df-shape query retrieves information on the shape of dataframes'),
29
+ flattenInvolvedNodes: () => []
30
+ };
31
+ //# sourceMappingURL=df-shape-query-format.js.map
@@ -33,7 +33,7 @@ exports.LinterQueryDefinition = {
33
33
  function addLintingRuleResult(ruleName, results, result) {
34
34
  const rule = linter_rules_1.LintingRules[ruleName];
35
35
  result.push(` ╰ **${rule.info.name}** (${ruleName}):`);
36
- for (const certainty of [linter_format_1.LintingCertainty.Definitely, linter_format_1.LintingCertainty.Maybe]) {
36
+ for (const certainty of [linter_format_1.LintingResultCertainty.Certain, linter_format_1.LintingResultCertainty.Uncertain]) {
37
37
  const certaintyResults = results.results.filter(r => r.certainty === certainty);
38
38
  if (certaintyResults.length) {
39
39
  result.push(` ╰ ${certainty}:`);
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.executeLocationMapQuery = executeLocationMapQuery;
4
- const log_1 = require("../../../util/log");
4
+ const parse_1 = require("../../../slicing/criterion/parse");
5
+ const assert_1 = require("../../../util/assert");
5
6
  const fileIdRegex = /^(?<file>.*(\.[rR]))-/;
6
7
  function fuzzyFindFile(node, idMap) {
7
8
  if (node?.info.file) {
@@ -22,10 +23,11 @@ function fuzzyFindFile(node, idMap) {
22
23
  return '<inline>';
23
24
  }
24
25
  function executeLocationMapQuery({ ast, dataflow: { graph } }, queries) {
25
- if (queries.length !== 1) {
26
- log_1.log.warn('Id-Map query expects only up to one query, but got', queries.length);
27
- }
28
26
  const start = Date.now();
27
+ const criteriaOfInterest = new Set(queries
28
+ .flatMap(q => q.ids ?? [])
29
+ .map(c => (0, parse_1.tryResolveSliceCriterionToId)(c, ast.idMap))
30
+ .filter(assert_1.isNotUndefined));
29
31
  const locationMap = {
30
32
  files: {},
31
33
  ids: {}
@@ -38,7 +40,7 @@ function executeLocationMapQuery({ ast, dataflow: { graph } }, queries) {
38
40
  count++;
39
41
  }
40
42
  for (const [id, node] of ast.idMap.entries()) {
41
- if (node.location) {
43
+ if (node.location && (criteriaOfInterest.size === 0 || criteriaOfInterest.has(id))) {
42
44
  const file = fuzzyFindFile(node, ast.idMap);
43
45
  locationMap.ids[id] = [
44
46
  inverseMap.get(file) ?? -1,
@@ -4,8 +4,11 @@ import { type OutputFormatter } from '../../../util/text/ansi';
4
4
  import Joi from 'joi';
5
5
  import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
6
6
  import type { SourceRange } from '../../../util/range';
7
+ import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
7
8
  export interface LocationMapQuery extends BaseQueryFormat {
8
9
  readonly type: 'location-map';
10
+ /** Optional list of ids to filter the results by. If not provided, all ids will be included. */
11
+ readonly ids?: readonly SingleSlicingCriterion[];
9
12
  }
10
13
  export type FileId = number & {
11
14
  readonly __fileId?: unique symbol;
@@ -23,6 +23,7 @@ exports.LocationMapQueryDefinition = {
23
23
  },
24
24
  schema: joi_1.default.object({
25
25
  type: joi_1.default.string().valid('location-map').required().description('The type of the query.'),
26
+ ids: joi_1.default.array().items(joi_1.default.string()).optional().description('Optional list of ids to filter the results by.')
26
27
  }).description('The location map query retrieves the location of every id in the ast.'),
27
28
  flattenInvolvedNodes: () => []
28
29
  };
@@ -9,7 +9,7 @@ function executeSearch({ ast, dataflow, config }, queries) {
9
9
  const { search } = query;
10
10
  results.push({
11
11
  ids: (0, flowr_search_executor_1.runSearch)(search, { normalize: ast, dataflow, config })
12
- .map(({ node }) => node.info.id),
12
+ .getElements().map(({ node }) => node.info.id),
13
13
  search
14
14
  });
15
15
  }
@@ -7,6 +7,7 @@ const reconstruct_1 = require("../../../reconstruct/reconstruct");
7
7
  const auto_select_defaults_1 = require("../../../reconstruct/auto-select/auto-select-defaults");
8
8
  const magic_comments_1 = require("../../../reconstruct/auto-select/magic-comments");
9
9
  const log_1 = require("../../../util/log");
10
+ const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
10
11
  function fingerPrintOfQuery(query) {
11
12
  return JSON.stringify(query);
12
13
  }
@@ -20,7 +21,7 @@ function executeStaticSliceQuery({ dataflow: { graph }, ast, config }, queries)
20
21
  }
21
22
  const { criteria, noReconstruction, noMagicComments } = query;
22
23
  const sliceStart = Date.now();
23
- const slice = (0, static_slicer_1.staticSlicing)(graph, ast, criteria, config.solver.slicer?.threshold);
24
+ const slice = (0, static_slicer_1.staticSlice)(graph, ast, criteria, query.direction ?? _00_slice_1.SliceDirection.Backward, config.solver.slicer?.threshold);
24
25
  const sliceEnd = Date.now();
25
26
  if (noReconstruction) {
26
27
  results[key] = { slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } } };
@@ -4,6 +4,7 @@ import type { DEFAULT_DATAFLOW_PIPELINE, DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPEL
4
4
  import type { SlicingCriteria } from '../../../slicing/criterion/parse';
5
5
  import Joi from 'joi';
6
6
  import { executeStaticSliceQuery } from './static-slice-query-executor';
7
+ import { SliceDirection } from '../../../core/steps/all/static-slicing/00-slice';
7
8
  import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
8
9
  /** Calculates and returns all clusters encountered in the dataflow graph. */
9
10
  export interface StaticSliceQuery extends BaseQueryFormat {
@@ -14,6 +15,8 @@ export interface StaticSliceQuery extends BaseQueryFormat {
14
15
  readonly noReconstruction?: boolean;
15
16
  /** Should the magic comments (force-including lines within the slice) be ignored? */
16
17
  readonly noMagicComments?: boolean;
18
+ /** The direction to slice in. Defaults to backward slicing if unset. */
19
+ readonly direction?: SliceDirection;
17
20
  }
18
21
  export interface StaticSliceQueryResult extends BaseQueryResult {
19
22
  /**
@@ -9,6 +9,7 @@ const time_1 = require("../../../util/text/time");
9
9
  const joi_1 = __importDefault(require("joi"));
10
10
  const static_slice_query_executor_1 = require("./static-slice-query-executor");
11
11
  const query_print_1 = require("../../query-print");
12
+ const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
12
13
  exports.StaticSliceQueryDefinition = {
13
14
  executor: static_slice_query_executor_1.executeStaticSliceQuery,
14
15
  asciiSummarizer: (formatter, _processed, queryResults, result) => {
@@ -37,7 +38,8 @@ exports.StaticSliceQueryDefinition = {
37
38
  type: joi_1.default.string().valid('static-slice').required().description('The type of the query.'),
38
39
  criteria: joi_1.default.array().items(joi_1.default.string()).min(0).required().description('The slicing criteria to use.'),
39
40
  noReconstruction: joi_1.default.boolean().optional().description('Do not reconstruct the slice into readable code.'),
40
- noMagicComments: joi_1.default.boolean().optional().description('Should the magic comments (force-including lines within the slice) be ignored?')
41
+ noMagicComments: joi_1.default.boolean().optional().description('Should the magic comments (force-including lines within the slice) be ignored?'),
42
+ direction: joi_1.default.string().valid(...Object.values(_00_slice_1.SliceDirection)).optional().description('The direction to slice in. Defaults to backward slicing if unset.')
41
43
  }).description('Slice query used to slice the dataflow graph'),
42
44
  flattenInvolvedNodes: (queryResults) => {
43
45
  const flattened = [];
@@ -5,4 +5,4 @@ import type { DEFAULT_DATAFLOW_PIPELINE } from '../core/steps/pipeline/default-p
5
5
  import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
6
6
  export declare function asciiCallContext(formatter: OutputFormatter, results: QueryResults<'call-context'>['call-context'], processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>): string;
7
7
  export declare function summarizeIdsIfTooLong(formatter: OutputFormatter, ids: readonly NodeId[]): string;
8
- export declare function asciiSummaryOfQueryResult(formatter: OutputFormatter, totalInMs: number, results: QueryResults<SupportedQueryTypes>, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>): string;
8
+ export declare function asciiSummaryOfQueryResult<S extends SupportedQueryTypes>(formatter: OutputFormatter, totalInMs: number, results: Awaited<QueryResults<S>>, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>): string;
@@ -81,7 +81,6 @@ function asciiSummaryOfQueryResult(formatter, totalInMs, results, processed) {
81
81
  }
82
82
  result.push(`Query: ${(0, ansi_1.bold)(query, formatter)}`);
83
83
  let timing = -1;
84
- // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
85
84
  for (const [key, value] of Object.entries(queryResults)) {
86
85
  if (key === '.meta') {
87
86
  timing = value.timing;
@@ -24,11 +24,21 @@ import type { OriginQuery } from './catalog/origin-query/origin-query-format';
24
24
  import type { LinterQuery } from './catalog/linter-query/linter-query-format';
25
25
  import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
26
26
  import type { ControlFlowQuery } from './catalog/control-flow-query/control-flow-query-format';
27
- export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | ControlFlowQuery | DataflowLensQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | LineageQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery;
27
+ import type { DfShapeQuery } from './catalog/df-shape-query/df-shape-query-format';
28
+ import type { AsyncOrSync, AsyncOrSyncType } from 'ts-essentials';
29
+ /**
30
+ * These are all queries that can be executed from within flowR
31
+ * {@link SynchronousQuery} are queries that can be executed synchronously, i.e., they do not return a Promise.
32
+ */
33
+ export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | ControlFlowQuery | DataflowLensQuery | DfShapeQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | LineageQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery;
34
+ export type SynchronousQuery = Exclude<Query, {
35
+ executor: (query: Query) => Promise<unknown>;
36
+ }>;
37
+ export type SupportedSynchronousQueryTypes = SynchronousQuery['type'];
28
38
  export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
29
39
  type: QueryType;
30
40
  };
31
- export type QueryExecutor<Query extends BaseQueryFormat, Result extends BaseQueryResult> = (data: BasicQueryData, query: readonly Query[]) => Result;
41
+ export type QueryExecutor<Query extends BaseQueryFormat, Result extends BaseQueryResult> = (data: BasicQueryData, query: readonly Query[]) => AsyncOrSync<Result>;
32
42
  type SupportedQueries = {
33
43
  [QueryType in Query['type']]: SupportedQuery<QueryType>;
34
44
  };
@@ -232,6 +242,65 @@ export declare const SupportedQueries: {
232
242
  readonly schema: Joi.ObjectSchema<any>;
233
243
  readonly flattenInvolvedNodes: () => never[];
234
244
  };
245
+ readonly 'df-shape': {
246
+ readonly executor: typeof import("./catalog/df-shape-query/df-shape-query-executor").executeDfShapeQuery;
247
+ readonly asciiSummarizer: (formatter: OutputFormatter, _processed: PipelineOutput<import("../core/steps/pipeline/pipeline").Pipeline<{
248
+ readonly name: "parse";
249
+ readonly humanReadableName: "parse with R shell";
250
+ readonly description: "Parse the given R code into an AST";
251
+ readonly processor: (_results: unknown, input: Partial<import("../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../r-bridge/parser").ParseStepOutput<string>>;
252
+ readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
253
+ readonly printer: {
254
+ readonly 0: typeof import("../core/print/print").internalPrinter;
255
+ readonly 2: {
256
+ (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
257
+ (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
258
+ };
259
+ readonly 5: ({ parsed }: import("../r-bridge/parser").ParseStepOutput<string>, config: import("../util/quads").QuadSerializationConfiguration) => string;
260
+ };
261
+ readonly dependencies: readonly [];
262
+ readonly requiredInput: import("../r-bridge/parser").ParseRequiredInput<string>;
263
+ } | {
264
+ readonly name: "normalize";
265
+ readonly humanReadableName: "normalize";
266
+ readonly description: "Normalize the AST to flowR's AST";
267
+ readonly processor: (results: {
268
+ parse?: import("../r-bridge/parser").ParseStepOutput<string>;
269
+ }, 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>>;
270
+ readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
271
+ readonly printer: {
272
+ readonly 0: typeof import("../core/print/print").internalPrinter;
273
+ readonly 2: typeof import("../core/print/normalize-printer").normalizedAstToJson;
274
+ readonly 5: typeof import("../core/print/normalize-printer").normalizedAstToQuads;
275
+ readonly 3: typeof import("../core/print/normalize-printer").printNormalizedAstToMermaid;
276
+ readonly 4: typeof import("../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
277
+ };
278
+ readonly dependencies: readonly ["parse"];
279
+ readonly requiredInput: import("../core/steps/all/core/10-normalize").NormalizeRequiredInput;
280
+ } | {
281
+ readonly humanReadableName: "dataflow";
282
+ readonly processor: (results: {
283
+ normalize?: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
284
+ }, input: {
285
+ request?: import("../r-bridge/retriever").RParseRequests;
286
+ parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
287
+ }, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
288
+ readonly requiredInput: {};
289
+ readonly name: "dataflow";
290
+ readonly description: "Construct the dataflow graph";
291
+ readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
292
+ readonly printer: {
293
+ readonly 0: typeof import("../core/print/print").internalPrinter;
294
+ readonly 2: typeof import("../core/print/dataflow-printer").dataflowGraphToJson;
295
+ readonly 5: typeof import("../core/print/dataflow-printer").dataflowGraphToQuads;
296
+ readonly 3: typeof import("../core/print/dataflow-printer").dataflowGraphToMermaid;
297
+ readonly 4: typeof import("../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
298
+ };
299
+ readonly dependencies: readonly ["normalize"];
300
+ }>>, queryResults: BaseQueryResult, result: string[]) => true;
301
+ readonly schema: Joi.ObjectSchema<any>;
302
+ readonly flattenInvolvedNodes: () => never[];
303
+ };
235
304
  readonly 'id-map': {
236
305
  readonly executor: typeof import("./catalog/id-map-query/id-map-query-executor").executeIdMapQuery;
237
306
  readonly asciiSummarizer: (formatter: OutputFormatter, _processed: PipelineOutput<import("../core/steps/pipeline/pipeline").Pipeline<{
@@ -948,17 +1017,19 @@ export declare const SupportedQueries: {
948
1017
  };
949
1018
  };
950
1019
  export type SupportedQueryTypes = keyof typeof SupportedQueries;
951
- export type QueryResult<Type extends Query['type']> = ReturnType<typeof SupportedQueries[Type]['executor']>;
952
- export declare function executeQueriesOfSameType<SpecificQuery extends Query>(data: BasicQueryData, ...queries: readonly SpecificQuery[]): QueryResult<SpecificQuery['type']>;
1020
+ export type QueryResult<Type extends Query['type']> = AsyncOrSync<ReturnType<typeof SupportedQueries[Type]['executor']>>;
1021
+ export declare function executeQueriesOfSameType<SpecificQuery extends SynchronousQuery>(data: BasicQueryData, queries: readonly SpecificQuery[]): AsyncOrSyncType<QueryResult<SpecificQuery['type']>>;
1022
+ export declare function executeQueriesOfSameType<SpecificQuery extends Query>(data: BasicQueryData, queries: readonly SpecificQuery[]): QueryResult<SpecificQuery['type']>;
953
1023
  export type QueryResults<Base extends SupportedQueryTypes> = {
954
- readonly [QueryType in Base]: QueryResult<QueryType>;
1024
+ readonly [QueryType in Base]: Awaited<QueryResult<QueryType>>;
955
1025
  } & BaseQueryResult;
956
1026
  type OmitFromValues<T, K extends string | number | symbol> = {
957
1027
  [P in keyof T]?: Omit<T[P], K>;
958
1028
  };
959
1029
  export type QueryResultsWithoutMeta<Queries extends Query> = OmitFromValues<Omit<QueryResults<Queries['type']>, '.meta'>, '.meta'>;
960
1030
  export type Queries<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>> = readonly (QueryArgumentsWithType<Base> | VirtualQueryArgumentsWithType<Base, VirtualArguments>)[];
961
- export declare function executeQueries<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(data: BasicQueryData, queries: Queries<Base, VirtualArguments>): QueryResults<Base>;
1031
+ export declare function executeQueries<Base extends SupportedSynchronousQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(data: BasicQueryData, queries: Queries<Base, VirtualArguments>): QueryResults<Base>;
1032
+ export declare function executeQueries<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(data: BasicQueryData, queries: Queries<Base, VirtualArguments>): AsyncOrSync<QueryResults<Base>>;
962
1033
  export declare function SupportedQueriesSchema(): Joi.AlternativesSchema<any>;
963
1034
  export declare const CompoundQuerySchema: Joi.ObjectSchema<any>;
964
1035
  export declare function VirtualQuerySchema(): Joi.AlternativesSchema<any>;
package/queries/query.js CHANGED
@@ -31,12 +31,14 @@ const project_query_format_1 = require("./catalog/project-query/project-query-fo
31
31
  const origin_query_format_1 = require("./catalog/origin-query/origin-query-format");
32
32
  const linter_query_format_1 = require("./catalog/linter-query/linter-query-format");
33
33
  const control_flow_query_format_1 = require("./catalog/control-flow-query/control-flow-query-format");
34
+ const df_shape_query_format_1 = require("./catalog/df-shape-query/df-shape-query-format");
34
35
  exports.SupportedQueries = {
35
36
  'call-context': call_context_query_format_1.CallContextQueryDefinition,
36
37
  'config': config_query_format_1.ConfigQueryDefinition,
37
38
  'control-flow': control_flow_query_format_1.ControlFlowQueryDefinition,
38
39
  'dataflow': dataflow_query_format_1.DataflowQueryDefinition,
39
40
  'dataflow-lens': dataflow_lens_query_format_1.DataflowLensQueryDefinition,
41
+ 'df-shape': df_shape_query_format_1.DfShapeQueryDefinition,
40
42
  'id-map': id_map_query_format_1.IdMapQueryDefinition,
41
43
  'normalized-ast': normalized_ast_query_format_1.NormalizedAstQueryDefinition,
42
44
  'dataflow-cluster': cluster_query_format_1.ClusterQueryDefinition,
@@ -51,7 +53,7 @@ exports.SupportedQueries = {
51
53
  'origin': origin_query_format_1.OriginQueryDefinition,
52
54
  'linter': linter_query_format_1.LinterQueryDefinition
53
55
  };
54
- function executeQueriesOfSameType(data, ...queries) {
56
+ function executeQueriesOfSameType(data, queries) {
55
57
  (0, assert_1.guard)(queries.length > 0, 'At least one query must be provided');
56
58
  /* every query must have the same type */
57
59
  (0, assert_1.guard)(queries.every(q => q.type === queries[0].type), 'All queries must have the same type');
@@ -65,9 +67,7 @@ function isVirtualQuery(query) {
65
67
  function groupQueriesByType(queries) {
66
68
  const grouped = {};
67
69
  function addQuery(query) {
68
- if (grouped[query.type] === undefined) {
69
- grouped[query.type] = [];
70
- }
70
+ grouped[query.type] ??= [];
71
71
  grouped[query.type].push(query);
72
72
  }
73
73
  for (const query of queries) {
@@ -84,17 +84,32 @@ function groupQueriesByType(queries) {
84
84
  }
85
85
  return grouped;
86
86
  }
87
+ function isPromiseLike(value) {
88
+ return value !== null && typeof value === 'object' && typeof value.then === 'function';
89
+ }
90
+ /**
91
+ * This is the main query execution function that takes a set of queries and executes them on the given data.
92
+ */
87
93
  function executeQueries(data, queries) {
88
94
  const now = Date.now();
89
95
  const grouped = groupQueriesByType(queries);
90
- const results = {};
91
- for (const type of Object.keys(grouped)) {
92
- results[type] = executeQueriesOfSameType(data, ...grouped[type]);
96
+ const entries = Object.entries(grouped);
97
+ const results = entries.map(([type, group]) => [type, executeQueriesOfSameType(data, group)]);
98
+ if (results.length === 0 || results.every(([_, r]) => !isPromiseLike(r))) {
99
+ // all results are synchronous, we can return them directly
100
+ const r = Object.fromEntries(results);
101
+ r['.meta'] = {
102
+ timing: Date.now() - now
103
+ };
104
+ return r;
93
105
  }
94
- results['.meta'] = {
95
- timing: Date.now() - now
96
- };
97
- return results;
106
+ return Promise.all(results.map(([type, result]) => Promise.resolve(result).then(resolvedResult => [type, resolvedResult]))).then(resultsArray => {
107
+ const results = Object.fromEntries(resultsArray);
108
+ results['.meta'] = {
109
+ timing: Date.now() - now
110
+ };
111
+ return results;
112
+ });
98
113
  }
99
114
  function SupportedQueriesSchema() {
100
115
  return joi_1.default.alternatives(Object.values(exports.SupportedQueries).map(q => q.schema)).description('Supported queries');
@@ -1,11 +1,11 @@
1
1
  import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
2
- import type { FlowrSearchElement, FlowrSearchElementFromQuery, FlowrSearchElements, FlowrSearchGetFilter } from './flowr-search';
2
+ import type { FlowrSearchElement, FlowrSearchElements, FlowrSearchGetFilter } from './flowr-search';
3
3
  import type { FlowrFilter, FlowrFilterExpression } from './flowr-search-filters';
4
4
  import type { FlowrSearchGeneratorNode, GeneratorNames } from './search-executor/search-generators';
5
5
  import type { FlowrSearchTransformerNode, GetOutputOfTransformer, TransformerNames } from './search-executor/search-transformer';
6
6
  import type { SlicingCriteria } from '../slicing/criterion/parse';
7
7
  import type { ParentInformation } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
8
- import type { Enrichment, EnrichmentArguments } from './search-executor/search-enrichers';
8
+ import type { Enrichment, EnrichmentElementArguments } from './search-executor/search-enrichers';
9
9
  import type { MapperArguments } from './search-executor/search-mappers';
10
10
  import { Mapper } from './search-executor/search-mappers';
11
11
  import type { Query } from '../queries/query';
@@ -28,7 +28,7 @@ export declare const FlowrSearchGenerator: {
28
28
  * Internally, the {@link SupportedQuery#flattenInvolvedNodes} function is used to flatten the resulting nodes of the query.
29
29
  * Please note that, due to the fact that not every query involves dataflow nodes, the search may not contain any elements at all for certain queries.
30
30
  */
31
- readonly fromQuery: (...from: readonly Query[]) => FlowrSearchBuilder<"from-query", [], ParentInformation, FlowrSearchElements<ParentInformation, FlowrSearchElementFromQuery<ParentInformation>[]>>;
31
+ readonly fromQuery: (...from: readonly Query[]) => FlowrSearchBuilder<"from-query", [], ParentInformation, FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>>;
32
32
  /**
33
33
  * Returns all elements (nodes/dataflow vertices) from the given data.
34
34
  */
@@ -86,7 +86,7 @@ export declare const Q: {
86
86
  * Internally, the {@link SupportedQuery#flattenInvolvedNodes} function is used to flatten the resulting nodes of the query.
87
87
  * Please note that, due to the fact that not every query involves dataflow nodes, the search may not contain any elements at all for certain queries.
88
88
  */
89
- readonly fromQuery: (...from: readonly Query[]) => FlowrSearchBuilder<"from-query", [], ParentInformation, FlowrSearchElements<ParentInformation, FlowrSearchElementFromQuery<ParentInformation>[]>>;
89
+ readonly fromQuery: (...from: readonly Query[]) => FlowrSearchBuilder<"from-query", [], ParentInformation, FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>>;
90
90
  /**
91
91
  * Returns all elements (nodes/dataflow vertices) from the given data.
92
92
  */
@@ -188,7 +188,7 @@ export declare class FlowrSearchBuilder<Generator extends GeneratorNames, Transf
188
188
  * Adds the given enrichment to each element of the search.
189
189
  * Added enrichments can later be retrieved using the {@link enrichmentContent} function.
190
190
  */
191
- with<ConcreteEnrichment extends Enrichment>(enrichment: ConcreteEnrichment, args?: EnrichmentArguments<ConcreteEnrichment>): FlowrSearchBuilderOut<Generator, Transformers, Info, 'with'>;
191
+ with<ConcreteEnrichment extends Enrichment>(enrichment: ConcreteEnrichment, args?: EnrichmentElementArguments<ConcreteEnrichment>): FlowrSearchBuilderOut<Generator, Transformers, Info, 'with'>;
192
192
  /**
193
193
  * Maps the elements of the search to new values using the given mapper function.
194
194
  */
@@ -196,7 +196,7 @@ export declare class FlowrSearchBuilder<Generator extends GeneratorNames, Transf
196
196
  /**
197
197
  * A convenience function that combines {@link with} and the {@link Mapper.Enrichment} mapper to immediately add an enrichment and then map to its value(s).
198
198
  */
199
- get<ConcreteEnrichment extends Enrichment>(enrichment: ConcreteEnrichment, args?: EnrichmentArguments<ConcreteEnrichment>): FlowrSearchBuilderOut<Generator, Transformers, Info, 'with' | 'map'>;
199
+ get<ConcreteEnrichment extends Enrichment>(enrichment: ConcreteEnrichment, args?: EnrichmentElementArguments<ConcreteEnrichment>): FlowrSearchBuilderOut<Generator, Transformers, Info, 'with' | 'map'>;
200
200
  /**
201
201
  * merge combines the search results with those of another search.
202
202
  */