@eagleoutice/flowr 2.1.11 → 2.2.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 (137) hide show
  1. package/benchmark/slicer.d.ts +5 -12
  2. package/benchmark/slicer.js +46 -28
  3. package/cli/benchmark-app.d.ts +2 -0
  4. package/cli/benchmark-app.js +2 -1
  5. package/cli/benchmark-helper-app.d.ts +2 -0
  6. package/cli/benchmark-helper-app.js +2 -2
  7. package/cli/common/options.js +3 -1
  8. package/cli/flowr-main-options.js +36 -2
  9. package/cli/flowr.d.ts +6 -0
  10. package/cli/flowr.js +51 -24
  11. package/cli/repl/commands/repl-cfg.js +2 -4
  12. package/cli/repl/commands/repl-dataflow.js +2 -4
  13. package/cli/repl/commands/repl-execute.d.ts +2 -2
  14. package/cli/repl/commands/repl-execute.js +15 -5
  15. package/cli/repl/commands/repl-lineage.js +2 -4
  16. package/cli/repl/commands/repl-main.d.ts +2 -2
  17. package/cli/repl/commands/repl-normalize.js +2 -4
  18. package/cli/repl/commands/repl-parse.js +2 -4
  19. package/cli/repl/commands/repl-query.js +7 -9
  20. package/cli/repl/commands/repl-version.d.ts +5 -4
  21. package/cli/repl/commands/repl-version.js +10 -9
  22. package/cli/repl/core.d.ts +5 -5
  23. package/cli/repl/core.js +8 -12
  24. package/cli/repl/print-version.d.ts +2 -2
  25. package/cli/repl/print-version.js +3 -3
  26. package/cli/repl/server/connection.d.ts +3 -3
  27. package/cli/repl/server/connection.js +6 -8
  28. package/cli/repl/server/messages/message-hello.js +2 -1
  29. package/cli/repl/server/server.d.ts +4 -3
  30. package/cli/repl/server/server.js +7 -5
  31. package/cli/slicer-app.js +1 -1
  32. package/config.d.ts +36 -4
  33. package/config.js +30 -1
  34. package/core/pipeline-executor.d.ts +1 -1
  35. package/core/pipeline-executor.js +1 -1
  36. package/core/steps/all/core/00-parse.d.ts +4 -18
  37. package/core/steps/all/core/00-parse.js +2 -11
  38. package/core/steps/all/core/01-parse-tree-sitter.d.ts +23 -0
  39. package/core/steps/all/core/01-parse-tree-sitter.js +19 -0
  40. package/core/steps/all/core/10-normalize.d.ts +3 -2
  41. package/core/steps/all/core/10-normalize.js +1 -0
  42. package/core/steps/all/core/11-normalize-tree-sitter.d.ts +25 -0
  43. package/core/steps/all/core/11-normalize-tree-sitter.js +27 -0
  44. package/core/steps/all/core/20-dataflow.d.ts +2 -0
  45. package/core/steps/all/core/20-dataflow.js +1 -1
  46. package/core/steps/pipeline/default-pipelines.d.ts +374 -23
  47. package/core/steps/pipeline/default-pipelines.js +48 -4
  48. package/dataflow/extractor.d.ts +2 -1
  49. package/dataflow/extractor.js +2 -1
  50. package/dataflow/graph/vertex.d.ts +4 -0
  51. package/dataflow/graph/vertex.js +3 -1
  52. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +6 -5
  53. package/dataflow/processor.d.ts +2 -0
  54. package/documentation/doc-util/doc-auto-gen.js +2 -1
  55. package/documentation/doc-util/doc-cfg.js +1 -1
  56. package/documentation/doc-util/doc-dfg.js +3 -3
  57. package/documentation/doc-util/doc-files.d.ts +1 -0
  58. package/documentation/doc-util/doc-files.js +4 -0
  59. package/documentation/doc-util/doc-normalized-ast.js +2 -3
  60. package/documentation/doc-util/doc-query.js +2 -2
  61. package/documentation/doc-util/doc-search.d.ts +25 -0
  62. package/documentation/doc-util/doc-search.js +121 -0
  63. package/documentation/doc-util/doc-types.d.ts +10 -2
  64. package/documentation/doc-util/doc-types.js +81 -3
  65. package/documentation/print-dataflow-graph-wiki.js +16 -16
  66. package/documentation/print-engines-wiki.d.ts +1 -0
  67. package/documentation/print-engines-wiki.js +82 -0
  68. package/documentation/print-interface-wiki.js +30 -20
  69. package/documentation/print-normalized-ast-wiki.js +5 -5
  70. package/documentation/print-query-wiki.js +22 -0
  71. package/documentation/print-search-wiki.d.ts +1 -0
  72. package/documentation/print-search-wiki.js +74 -0
  73. package/package.json +10 -5
  74. package/queries/base-query-format.d.ts +2 -2
  75. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  76. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  77. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
  78. package/queries/catalog/cluster-query/cluster-query-executor.js +1 -1
  79. package/queries/catalog/cluster-query/cluster-query-format.d.ts +5 -4
  80. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
  81. package/queries/catalog/dataflow-query/dataflow-query-executor.js +1 -1
  82. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +5 -4
  83. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  84. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +5 -4
  85. package/queries/catalog/id-map-query/id-map-query-format.d.ts +5 -4
  86. package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
  87. package/queries/catalog/lineage-query/lineage-query-executor.js +1 -1
  88. package/queries/catalog/lineage-query/lineage-query-format.d.ts +5 -4
  89. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +5 -4
  90. package/queries/catalog/search-query/search-query-executor.d.ts +3 -0
  91. package/queries/catalog/search-query/search-query-executor.js +27 -0
  92. package/queries/catalog/search-query/search-query-format.d.ts +73 -0
  93. package/queries/catalog/search-query/search-query-format.js +29 -0
  94. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
  95. package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
  96. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +5 -4
  97. package/queries/query.d.ts +95 -29
  98. package/queries/query.js +3 -1
  99. package/r-bridge/lang-4.x/ast/model/type.d.ts +4 -0
  100. package/r-bridge/lang-4.x/ast/model/type.js +3 -1
  101. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +4 -2
  102. package/r-bridge/lang-4.x/ast/parser/json/parser.js +5 -0
  103. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +18 -0
  104. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +57 -0
  105. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +3 -0
  106. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +541 -0
  107. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-types.d.ts +35 -0
  108. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-types.js +40 -0
  109. package/r-bridge/parser.d.ts +32 -0
  110. package/r-bridge/parser.js +14 -0
  111. package/r-bridge/shell-executor.d.ts +37 -1
  112. package/r-bridge/shell-executor.js +39 -0
  113. package/r-bridge/shell.d.ts +12 -6
  114. package/r-bridge/shell.js +15 -6
  115. package/search/flowr-search-builder.d.ts +193 -0
  116. package/search/flowr-search-builder.js +192 -0
  117. package/search/flowr-search-executor.d.ts +9 -0
  118. package/search/flowr-search-executor.js +16 -0
  119. package/search/flowr-search-filters.d.ts +74 -0
  120. package/search/flowr-search-filters.js +136 -0
  121. package/search/flowr-search-printer.d.ts +10 -0
  122. package/search/flowr-search-printer.js +85 -0
  123. package/search/flowr-search-traverse.d.ts +7 -0
  124. package/search/flowr-search-traverse.js +12 -0
  125. package/search/flowr-search.d.ts +58 -0
  126. package/search/flowr-search.js +29 -0
  127. package/search/search-executor/search-generators.d.ts +37 -0
  128. package/search/search-executor/search-generators.js +64 -0
  129. package/search/search-executor/search-transformer.d.ts +57 -0
  130. package/search/search-executor/search-transformer.js +99 -0
  131. package/search/search-optimizer/search-optimizer.d.ts +9 -0
  132. package/search/search-optimizer/search-optimizer.js +89 -0
  133. package/statistics/statistics.js +1 -1
  134. package/util/arrays.d.ts +13 -0
  135. package/util/assert.d.ts +1 -1
  136. package/util/mermaid/mermaid.js +17 -0
  137. package/util/version.js +1 -1
@@ -18,7 +18,7 @@ export declare const ClusterQueryDefinition: {
18
18
  readonly name: "parse";
19
19
  readonly humanReadableName: "parse with R shell";
20
20
  readonly description: "Parse the given R code into an AST";
21
- readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
21
+ readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
22
22
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
23
23
  readonly printer: {
24
24
  readonly 0: typeof import("../../../core/print/print").internalPrinter;
@@ -26,16 +26,16 @@ export declare const ClusterQueryDefinition: {
26
26
  (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
27
27
  (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
28
28
  };
29
- readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
29
+ readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
30
30
  };
31
31
  readonly dependencies: readonly [];
32
- readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
32
+ readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
33
33
  } | {
34
34
  readonly name: "normalize";
35
35
  readonly humanReadableName: "normalize";
36
36
  readonly description: "Normalize the AST to flowR's AST";
37
37
  readonly processor: (results: {
38
- parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
38
+ parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
39
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
40
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
41
41
  readonly printer: {
@@ -53,6 +53,7 @@ export declare const ClusterQueryDefinition: {
53
53
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
54
54
  }, input: {
55
55
  request?: import("../../../r-bridge/retriever").RParseRequests;
56
+ parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
56
57
  }) => import("../../../dataflow/info").DataflowInformation;
57
58
  readonly requiredInput: {};
58
59
  readonly name: "dataflow";
@@ -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({ graph }: BasicQueryData, queries: readonly DataflowQuery[]): DataflowQueryResult;
3
+ export declare function executeDataflowQuery({ dataflow: { graph } }: BasicQueryData, queries: readonly DataflowQuery[]): 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({ graph }, queries) {
5
+ function executeDataflowQuery({ dataflow: { graph } }, 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
  }
@@ -18,7 +18,7 @@ export declare const DataflowQueryDefinition: {
18
18
  readonly name: "parse";
19
19
  readonly humanReadableName: "parse with R shell";
20
20
  readonly description: "Parse the given R code into an AST";
21
- readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
21
+ readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
22
22
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
23
23
  readonly printer: {
24
24
  readonly 0: typeof import("../../../core/print/print").internalPrinter;
@@ -26,16 +26,16 @@ export declare const DataflowQueryDefinition: {
26
26
  (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
27
27
  (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
28
28
  };
29
- readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
29
+ readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
30
30
  };
31
31
  readonly dependencies: readonly [];
32
- readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
32
+ readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
33
33
  } | {
34
34
  readonly name: "normalize";
35
35
  readonly humanReadableName: "normalize";
36
36
  readonly description: "Normalize the AST to flowR's AST";
37
37
  readonly processor: (results: {
38
- parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
38
+ parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
39
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
40
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
41
41
  readonly printer: {
@@ -53,6 +53,7 @@ export declare const DataflowQueryDefinition: {
53
53
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
54
54
  }, input: {
55
55
  request?: import("../../../r-bridge/retriever").RParseRequests;
56
+ parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
56
57
  }) => import("../../../dataflow/info").DataflowInformation;
57
58
  readonly requiredInput: {};
58
59
  readonly name: "dataflow";
@@ -83,7 +83,7 @@ function makeCallContextQuery(functions, kind) {
83
83
  }
84
84
  function getResults(data, results, kind, functions, makeInfo, additionalAllowedTypes) {
85
85
  return Object.entries(results?.kinds[kind]?.subkinds ?? {}).flatMap(([name, results]) => results.flatMap(({ id, linkedIds }) => {
86
- const vertex = data.graph.getVertex(id);
86
+ const vertex = data.dataflow.graph.getVertex(id);
87
87
  const info = functions.find(f => f.name === name);
88
88
  let index = info.argIdx;
89
89
  if (info.argName) {
@@ -99,7 +99,7 @@ function getResults(data, results, kind, functions, makeInfo, additionalAllowedT
99
99
  return args.flatMap(a => (0, objects_1.compactRecord)(makeInfo(id, vertex, a, linkedIds)));
100
100
  })).filter(assert_1.isNotUndefined) ?? [];
101
101
  }
102
- function getArgumentValue({ graph }, vertex, argumentIndex, additionalAllowedTypes) {
102
+ function getArgumentValue({ dataflow: { graph } }, vertex, argumentIndex, additionalAllowedTypes) {
103
103
  if (vertex) {
104
104
  if (argumentIndex === 'unnamed') {
105
105
  // return all unnamed arguments
@@ -49,7 +49,7 @@ export declare const DependenciesQueryDefinition: {
49
49
  readonly name: "parse";
50
50
  readonly humanReadableName: "parse with R shell";
51
51
  readonly description: "Parse the given R code into an AST";
52
- readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
52
+ readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
53
53
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
54
54
  readonly printer: {
55
55
  readonly 0: typeof import("../../../core/print/print").internalPrinter;
@@ -57,16 +57,16 @@ export declare const DependenciesQueryDefinition: {
57
57
  (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
58
58
  (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
59
59
  };
60
- readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
60
+ readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
61
61
  };
62
62
  readonly dependencies: readonly [];
63
- readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
63
+ readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
64
64
  } | {
65
65
  readonly name: "normalize";
66
66
  readonly humanReadableName: "normalize";
67
67
  readonly description: "Normalize the AST to flowR's AST";
68
68
  readonly processor: (results: {
69
- parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
69
+ parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
70
70
  }, 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>>;
71
71
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
72
72
  readonly printer: {
@@ -84,6 +84,7 @@ export declare const DependenciesQueryDefinition: {
84
84
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
85
85
  }, input: {
86
86
  request?: import("../../../r-bridge/retriever").RParseRequests;
87
+ parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
87
88
  }) => import("../../../dataflow/info").DataflowInformation;
88
89
  readonly requiredInput: {};
89
90
  readonly name: "dataflow";
@@ -14,7 +14,7 @@ export declare const IdMapQueryDefinition: {
14
14
  readonly name: "parse";
15
15
  readonly humanReadableName: "parse with R shell";
16
16
  readonly description: "Parse the given R code into an AST";
17
- readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
17
+ readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
18
18
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
19
19
  readonly printer: {
20
20
  readonly 0: typeof import("../../../core/print/print").internalPrinter;
@@ -22,16 +22,16 @@ export declare const IdMapQueryDefinition: {
22
22
  (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
23
23
  (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
24
24
  };
25
- readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
25
+ readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
26
26
  };
27
27
  readonly dependencies: readonly [];
28
- readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
28
+ readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
29
29
  } | {
30
30
  readonly name: "normalize";
31
31
  readonly humanReadableName: "normalize";
32
32
  readonly description: "Normalize the AST to flowR's AST";
33
33
  readonly processor: (results: {
34
- parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
34
+ parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
35
35
  }, 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>>;
36
36
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
37
37
  readonly printer: {
@@ -49,6 +49,7 @@ export declare const IdMapQueryDefinition: {
49
49
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
50
50
  }, input: {
51
51
  request?: import("../../../r-bridge/retriever").RParseRequests;
52
+ parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
52
53
  }) => import("../../../dataflow/info").DataflowInformation;
53
54
  readonly requiredInput: {};
54
55
  readonly name: "dataflow";
@@ -1,3 +1,3 @@
1
1
  import type { LineageQuery, LineageQueryResult } from './lineage-query-format';
2
2
  import type { BasicQueryData } from '../../base-query-format';
3
- export declare function executeLineageQuery({ graph, ast }: BasicQueryData, queries: readonly LineageQuery[]): LineageQueryResult;
3
+ export declare function executeLineageQuery({ dataflow: { graph }, ast }: BasicQueryData, queries: readonly LineageQuery[]): LineageQueryResult;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.executeLineageQuery = executeLineageQuery;
4
4
  const log_1 = require("../../../util/log");
5
5
  const repl_lineage_1 = require("../../../cli/repl/commands/repl-lineage");
6
- function executeLineageQuery({ graph, ast }, queries) {
6
+ function executeLineageQuery({ dataflow: { graph }, ast }, queries) {
7
7
  const start = Date.now();
8
8
  const result = {};
9
9
  for (const { criterion } of queries) {
@@ -20,7 +20,7 @@ export declare const LineageQueryDefinition: {
20
20
  readonly name: "parse";
21
21
  readonly humanReadableName: "parse with R shell";
22
22
  readonly description: "Parse the given R code into an AST";
23
- readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
23
+ readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
24
24
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
25
25
  readonly printer: {
26
26
  readonly 0: typeof import("../../../core/print/print").internalPrinter;
@@ -28,16 +28,16 @@ export declare const LineageQueryDefinition: {
28
28
  (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
29
29
  (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
30
30
  };
31
- readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
31
+ readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
32
32
  };
33
33
  readonly dependencies: readonly [];
34
- readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
34
+ readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
35
35
  } | {
36
36
  readonly name: "normalize";
37
37
  readonly humanReadableName: "normalize";
38
38
  readonly description: "Normalize the AST to flowR's AST";
39
39
  readonly processor: (results: {
40
- parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
40
+ parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
41
41
  }, 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>>;
42
42
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
43
43
  readonly printer: {
@@ -55,6 +55,7 @@ export declare const LineageQueryDefinition: {
55
55
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
56
56
  }, input: {
57
57
  request?: import("../../../r-bridge/retriever").RParseRequests;
58
+ parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
58
59
  }) => import("../../../dataflow/info").DataflowInformation;
59
60
  readonly requiredInput: {};
60
61
  readonly name: "dataflow";
@@ -17,7 +17,7 @@ export declare const NormalizedAstQueryDefinition: {
17
17
  readonly name: "parse";
18
18
  readonly humanReadableName: "parse with R shell";
19
19
  readonly description: "Parse the given R code into an AST";
20
- readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
20
+ readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
21
21
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
22
22
  readonly printer: {
23
23
  readonly 0: typeof import("../../../core/print/print").internalPrinter;
@@ -25,16 +25,16 @@ export declare const NormalizedAstQueryDefinition: {
25
25
  (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
26
26
  (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
27
27
  };
28
- readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
28
+ readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
29
29
  };
30
30
  readonly dependencies: readonly [];
31
- readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
31
+ readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
32
32
  } | {
33
33
  readonly name: "normalize";
34
34
  readonly humanReadableName: "normalize";
35
35
  readonly description: "Normalize the AST to flowR's AST";
36
36
  readonly processor: (results: {
37
- parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
37
+ parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
38
38
  }, input: Partial<import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => 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
39
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
40
40
  readonly printer: {
@@ -52,6 +52,7 @@ export declare const NormalizedAstQueryDefinition: {
52
52
  normalize?: NormalizedAst;
53
53
  }, input: {
54
54
  request?: import("../../../r-bridge/retriever").RParseRequests;
55
+ parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
55
56
  }) => import("../../../dataflow/info").DataflowInformation;
56
57
  readonly requiredInput: {};
57
58
  readonly name: "dataflow";
@@ -0,0 +1,3 @@
1
+ import type { BasicQueryData } from '../../base-query-format';
2
+ import type { SearchQuery, SearchQueryResult } from './search-query-format';
3
+ export declare function executeSearch({ ast, dataflow }: BasicQueryData, queries: readonly SearchQuery[]): SearchQueryResult;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeSearch = executeSearch;
4
+ const log_1 = require("../../../util/log");
5
+ const flowr_search_executor_1 = require("../../../search/flowr-search-executor");
6
+ function executeSearch({ ast, dataflow }, queries) {
7
+ const start = Date.now();
8
+ if (queries.length !== 1) {
9
+ log_1.log.warn('Id-Map query expects only up to one query, but got', queries.length);
10
+ }
11
+ const results = [];
12
+ for (const query of queries) {
13
+ const { search } = query;
14
+ results.push({
15
+ ids: (0, flowr_search_executor_1.runSearch)(search, { normalize: ast, dataflow })
16
+ .map(({ node }) => node.info.id),
17
+ search
18
+ });
19
+ }
20
+ return {
21
+ '.meta': {
22
+ timing: Date.now() - start
23
+ },
24
+ results
25
+ };
26
+ }
27
+ //# sourceMappingURL=search-query-executor.js.map
@@ -0,0 +1,73 @@
1
+ import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
+ import Joi from 'joi';
3
+ import type { FlowrSearch } from '../../../search/flowr-search-builder';
4
+ import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
5
+ import { executeSearch } from './search-query-executor';
6
+ export interface SearchQuery extends BaseQueryFormat {
7
+ readonly type: 'search';
8
+ readonly search: FlowrSearch;
9
+ }
10
+ export interface SearchQueryResult extends BaseQueryResult {
11
+ readonly results: {
12
+ ids: NodeId[];
13
+ search: FlowrSearch;
14
+ }[];
15
+ }
16
+ export declare const SearchQueryDefinition: {
17
+ readonly executor: typeof executeSearch;
18
+ readonly asciiSummarizer: (formatter: import("../../../util/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
+ }) => 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;
72
+ readonly schema: Joi.ObjectSchema<any>;
73
+ };
@@ -0,0 +1,29 @@
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.SearchQueryDefinition = void 0;
7
+ const ansi_1 = require("../../../util/ansi");
8
+ const time_1 = require("../../../util/time");
9
+ const joi_1 = __importDefault(require("joi"));
10
+ const query_print_1 = require("../../query-print");
11
+ const search_query_executor_1 = require("./search-query-executor");
12
+ const flowr_search_printer_1 = require("../../../search/flowr-search-printer");
13
+ const mermaid_1 = require("../../../util/mermaid/mermaid");
14
+ exports.SearchQueryDefinition = {
15
+ executor: search_query_executor_1.executeSearch,
16
+ asciiSummarizer: (formatter, _processed, queryResults, result) => {
17
+ const out = queryResults;
18
+ result.push(`Query: ${(0, ansi_1.bold)('search', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
19
+ for (const [, { ids, search }] of out.results.entries()) {
20
+ result.push(` ╰ [query](${(0, mermaid_1.mermaidCodeToUrl)((0, flowr_search_printer_1.flowrSearchToMermaid)(search))}): {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, ids)}}`);
21
+ }
22
+ return true;
23
+ },
24
+ schema: joi_1.default.object({
25
+ type: joi_1.default.string().valid('search').required().description('The type of the query.'),
26
+ search: joi_1.default.object().required().description('The search query to execute.')
27
+ }).description('The id map query retrieves the id map from the normalized AST.')
28
+ };
29
+ //# sourceMappingURL=search-query-format.js.map
@@ -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({ graph, ast }: BasicQueryData, queries: readonly StaticSliceQuery[]): StaticSliceQueryResult;
4
+ export declare function executeStaticSliceQuery({ dataflow: { graph }, ast }: BasicQueryData, queries: readonly StaticSliceQuery[]): StaticSliceQueryResult;
@@ -10,7 +10,7 @@ const log_1 = require("../../../util/log");
10
10
  function fingerPrintOfQuery(query) {
11
11
  return JSON.stringify(query);
12
12
  }
13
- function executeStaticSliceQuery({ graph, ast }, queries) {
13
+ function executeStaticSliceQuery({ dataflow: { graph }, ast }, queries) {
14
14
  const start = Date.now();
15
15
  const results = {};
16
16
  for (const query of queries) {
@@ -30,7 +30,7 @@ export declare const StaticSliceQueryDefinition: {
30
30
  readonly name: "parse";
31
31
  readonly humanReadableName: "parse with R shell";
32
32
  readonly description: "Parse the given R code into an AST";
33
- readonly processor: (_results: unknown, input: Partial<import("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
33
+ readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
34
34
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
35
35
  readonly printer: {
36
36
  readonly 0: typeof import("../../../core/print/print").internalPrinter;
@@ -38,16 +38,16 @@ export declare const StaticSliceQueryDefinition: {
38
38
  (value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
39
39
  (value: any, replacer?: (number | string)[] | null, space?: string | number): string;
40
40
  };
41
- readonly 5: ({ parsed }: import("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
41
+ readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
42
42
  };
43
43
  readonly dependencies: readonly [];
44
- readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
44
+ readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
45
45
  } | {
46
46
  readonly name: "normalize";
47
47
  readonly humanReadableName: "normalize";
48
48
  readonly description: "Normalize the AST to flowR's AST";
49
49
  readonly processor: (results: {
50
- parse?: import("../../../core/steps/all/core/00-parse").ParseStepOutput;
50
+ parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
51
51
  }, 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>>;
52
52
  readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
53
53
  readonly printer: {
@@ -65,6 +65,7 @@ export declare const StaticSliceQueryDefinition: {
65
65
  normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
66
66
  }, input: {
67
67
  request?: import("../../../r-bridge/retriever").RParseRequests;
68
+ parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
68
69
  }) => import("../../../dataflow/info").DataflowInformation;
69
70
  readonly requiredInput: {};
70
71
  readonly name: "dataflow";