@eagleoutice/flowr 2.9.12 → 2.9.14

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 (233) hide show
  1. package/README.md +35 -23
  2. package/abstract-interpretation/absint-visitor.d.ts +1 -1
  3. package/abstract-interpretation/absint-visitor.js +20 -20
  4. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -2
  5. package/benchmark/slicer.d.ts +5 -3
  6. package/benchmark/slicer.js +26 -10
  7. package/benchmark/stats/print.js +12 -0
  8. package/benchmark/stats/stats.d.ts +3 -2
  9. package/benchmark/stats/stats.js +1 -1
  10. package/benchmark/summarizer/data.d.ts +1 -0
  11. package/benchmark/summarizer/second-phase/process.js +5 -0
  12. package/cli/benchmark-app.d.ts +1 -0
  13. package/cli/benchmark-app.js +1 -0
  14. package/cli/benchmark-helper-app.d.ts +2 -1
  15. package/cli/benchmark-helper-app.js +6 -3
  16. package/cli/common/options.d.ts +8 -0
  17. package/cli/common/options.js +3 -1
  18. package/cli/common/scripts-info.d.ts +8 -0
  19. package/cli/export-quads-app.js +1 -1
  20. package/cli/flowr.js +3 -3
  21. package/cli/repl/commands/repl-dataflow.js +5 -5
  22. package/cli/repl/core.d.ts +3 -3
  23. package/cli/repl/parser/slice-query-parser.d.ts +1 -1
  24. package/cli/repl/parser/slice-query-parser.js +2 -2
  25. package/cli/repl/server/connection.d.ts +2 -2
  26. package/cli/repl/server/connection.js +2 -2
  27. package/cli/repl/server/messages/message-slice.d.ts +1 -1
  28. package/cli/repl/server/messages/message-slice.js +2 -2
  29. package/cli/repl/server/server.d.ts +2 -2
  30. package/cli/script-core/statistics-core.d.ts +2 -2
  31. package/cli/script-core/statistics-helper-core.d.ts +2 -2
  32. package/cli/script-core/statistics-helper-core.js +1 -1
  33. package/cli/slicer-app.js +2 -2
  34. package/cli/statistics-app.js +1 -1
  35. package/cli/statistics-helper-app.js +1 -1
  36. package/cli/wiki.js +2 -2
  37. package/config.d.ts +65 -24
  38. package/config.js +197 -161
  39. package/control-flow/extract-cfg.js +7 -10
  40. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  41. package/control-flow/semantic-cfg-guided-visitor.js +43 -43
  42. package/control-flow/useless-loop.d.ts +1 -1
  43. package/control-flow/useless-loop.js +3 -3
  44. package/core/print/dataflow-printer.d.ts +0 -14
  45. package/core/print/dataflow-printer.js +0 -21
  46. package/core/steps/all/core/20-dataflow.d.ts +3 -3
  47. package/core/steps/all/core/20-dataflow.js +3 -2
  48. package/core/steps/all/static-slicing/00-slice.d.ts +2 -5
  49. package/core/steps/all/static-slicing/00-slice.js +6 -8
  50. package/core/steps/pipeline/default-pipelines.d.ts +89 -89
  51. package/core/steps/pipeline-step.d.ts +2 -2
  52. package/dataflow/environments/built-in-proc-name.d.ts +83 -0
  53. package/dataflow/environments/built-in-proc-name.js +88 -0
  54. package/dataflow/environments/built-in.d.ts +1 -83
  55. package/dataflow/environments/built-in.js +37 -120
  56. package/dataflow/environments/default-builtin-config.d.ts +1 -1
  57. package/dataflow/environments/default-builtin-config.js +75 -75
  58. package/dataflow/environments/identifier.d.ts +1 -0
  59. package/dataflow/environments/identifier.js +1 -0
  60. package/dataflow/eval/resolve/alias-tracking.js +12 -15
  61. package/dataflow/eval/resolve/resolve.js +2 -2
  62. package/dataflow/fn/exceptions-of-function.d.ts +1 -1
  63. package/dataflow/fn/exceptions-of-function.js +2 -2
  64. package/dataflow/graph/call-graph.d.ts +49 -19
  65. package/dataflow/graph/call-graph.js +117 -114
  66. package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
  67. package/dataflow/graph/dataflowgraph-builder.js +2 -2
  68. package/dataflow/graph/df-helper.d.ts +132 -0
  69. package/dataflow/graph/df-helper.js +131 -0
  70. package/dataflow/graph/diff-dataflow-graph.d.ts +5 -10
  71. package/dataflow/graph/diff-dataflow-graph.js +3 -28
  72. package/dataflow/graph/edge.d.ts +1 -0
  73. package/dataflow/graph/edge.js +1 -0
  74. package/dataflow/graph/graph-helper.d.ts +55 -0
  75. package/dataflow/graph/graph-helper.js +105 -0
  76. package/dataflow/graph/graph.d.ts +6 -1
  77. package/dataflow/graph/graph.js +14 -9
  78. package/dataflow/graph/vertex.d.ts +1 -1
  79. package/dataflow/info.d.ts +14 -4
  80. package/dataflow/info.js +28 -16
  81. package/dataflow/internal/linker.d.ts +14 -10
  82. package/dataflow/internal/linker.js +29 -32
  83. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -5
  84. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +4 -4
  85. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +7 -6
  86. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
  87. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +5 -5
  88. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +2 -2
  89. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -2
  90. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +4 -4
  91. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -2
  92. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +3 -3
  93. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +2 -2
  94. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  95. package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +1 -1
  96. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -5
  97. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
  98. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
  99. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
  100. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +5 -5
  101. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
  102. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
  103. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
  104. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
  105. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
  107. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -1
  108. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +7 -7
  109. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
  110. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +23 -12
  111. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
  112. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +2 -2
  113. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +6 -9
  114. package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
  115. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +2 -2
  116. package/dataflow/internal/process/functions/call/known-call-handling.js +2 -2
  117. package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
  118. package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
  119. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
  120. package/dataflow/internal/process/process-uninteresting-leaf.d.ts +1 -1
  121. package/dataflow/internal/process/process-uninteresting-leaf.js +1 -1
  122. package/dataflow/origin/dfg-get-origin.d.ts +1 -1
  123. package/dataflow/origin/dfg-get-symbol-refs.js +6 -6
  124. package/documentation/doc-readme.js +2 -2
  125. package/documentation/doc-util/doc-dfg.d.ts +3 -0
  126. package/documentation/doc-util/doc-dfg.js +5 -7
  127. package/documentation/doc-util/doc-normalized-ast.d.ts +0 -6
  128. package/documentation/doc-util/doc-normalized-ast.js +0 -23
  129. package/documentation/doc-util/doc-structure.js +3 -3
  130. package/documentation/doc-util/doc-types.js +3 -3
  131. package/documentation/wiki-analyzer.js +7 -5
  132. package/documentation/wiki-core.js +6 -7
  133. package/documentation/wiki-dataflow-graph.js +15 -13
  134. package/documentation/wiki-interface.js +8 -6
  135. package/documentation/wiki-linter.js +6 -5
  136. package/documentation/wiki-mk/doc-context.js +3 -4
  137. package/documentation/wiki-normalized-ast.js +5 -4
  138. package/documentation/wiki-query.js +28 -3
  139. package/engines.d.ts +2 -2
  140. package/engines.js +4 -4
  141. package/linter/linter-rules.d.ts +24 -1
  142. package/linter/linter-rules.js +3 -1
  143. package/linter/rules/dataframe-access-validation.js +5 -5
  144. package/linter/rules/naming-convention.d.ts +1 -1
  145. package/linter/rules/naming-convention.js +7 -3
  146. package/linter/rules/seeded-randomness.js +2 -2
  147. package/linter/rules/stop-with-call-arg.d.ts +35 -0
  148. package/linter/rules/stop-with-call-arg.js +72 -0
  149. package/linter/rules/useless-loop.d.ts +1 -1
  150. package/package.json +3 -1
  151. package/project/cache/flowr-analyzer-cache.d.ts +1 -1
  152. package/project/cache/flowr-analyzer-cache.js +1 -1
  153. package/project/context/flowr-analyzer-context.d.ts +6 -6
  154. package/project/context/flowr-analyzer-context.js +2 -2
  155. package/project/context/flowr-analyzer-files-context.d.ts +2 -2
  156. package/project/context/flowr-analyzer-files-context.js +28 -8
  157. package/project/flowr-analyzer-builder.d.ts +13 -6
  158. package/project/flowr-analyzer-builder.js +12 -3
  159. package/project/flowr-analyzer.d.ts +4 -4
  160. package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +2 -2
  161. package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
  162. package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -2
  163. package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
  164. package/queries/catalog/config-query/config-query-format.d.ts +5 -5
  165. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
  166. package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
  167. package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -2
  168. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +2 -2
  169. package/queries/catalog/does-call-query/does-call-query-executor.js +2 -2
  170. package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
  171. package/queries/catalog/files-query/files-query-format.d.ts +3 -3
  172. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
  173. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +1 -1
  174. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
  175. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
  176. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
  177. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
  178. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
  179. package/queries/catalog/linter-query/linter-query-format.d.ts +3 -3
  180. package/queries/catalog/location-map-query/location-map-query-executor.js +2 -2
  181. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
  182. package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
  183. package/queries/catalog/origin-query/origin-query-executor.js +3 -3
  184. package/queries/catalog/origin-query/origin-query-format.d.ts +2 -2
  185. package/queries/catalog/provenance-query/provenance-query-executor.d.ts +9 -0
  186. package/queries/catalog/provenance-query/provenance-query-executor.js +37 -0
  187. package/queries/catalog/provenance-query/provenance-query-format.d.ts +35 -0
  188. package/queries/catalog/provenance-query/provenance-query-format.js +62 -0
  189. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -4
  190. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -2
  191. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -0
  192. package/queries/catalog/search-query/search-query-format.js +1 -1
  193. package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -2
  194. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -4
  195. package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
  196. package/queries/query.d.ts +27 -19
  197. package/queries/query.js +2 -0
  198. package/r-bridge/lang-4.x/ast/model/model.d.ts +13 -2
  199. package/r-bridge/lang-4.x/ast/model/model.js +20 -1
  200. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +8 -1
  201. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +13 -0
  202. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -2
  203. package/r-bridge/lang-4.x/ast/parser/json/parser.js +2 -2
  204. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +6 -2
  205. package/search/flowr-search-filters.d.ts +1 -1
  206. package/search/flowr-search-printer.js +3 -3
  207. package/search/search-executor/search-enrichers.js +2 -2
  208. package/search/search-executor/search-generators.js +1 -1
  209. package/slicing/criterion/parse.d.ts +40 -16
  210. package/slicing/criterion/parse.js +67 -63
  211. package/slicing/static/slicer-types.d.ts +2 -3
  212. package/slicing/static/static-slicer.d.ts +3 -4
  213. package/slicing/static/static-slicer.js +9 -12
  214. package/statistics/statistics.d.ts +2 -2
  215. package/util/diff.d.ts +2 -2
  216. package/util/mermaid/ast.js +4 -4
  217. package/util/mermaid/cfg.js +5 -5
  218. package/util/mermaid/dfg.d.ts +33 -18
  219. package/util/mermaid/dfg.js +46 -31
  220. package/util/mermaid/mermaid.d.ts +57 -12
  221. package/util/mermaid/mermaid.js +74 -67
  222. package/util/objects.d.ts +12 -0
  223. package/util/objects.js +28 -0
  224. package/util/range.d.ts +8 -0
  225. package/util/range.js +13 -1
  226. package/util/slice-direction.d.ts +7 -0
  227. package/util/slice-direction.js +12 -0
  228. package/util/summarizer.js +1 -1
  229. package/util/version.js +1 -1
  230. package/dataflow/graph/invert-dfg.d.ts +0 -6
  231. package/dataflow/graph/invert-dfg.js +0 -20
  232. package/dataflow/graph/resolve-graph.d.ts +0 -8
  233. package/dataflow/graph/resolve-graph.js +0 -59
@@ -23,7 +23,7 @@ import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
23
23
  import { type ControlFlowQuery } from './catalog/control-flow-query/control-flow-query-format';
24
24
  import { type DfShapeQuery } from './catalog/df-shape-query/df-shape-query-format';
25
25
  import type { AsyncOrSync } from 'ts-essentials';
26
- import type { FlowrConfigOptions } from '../config';
26
+ import type { FlowrConfig } from '../config';
27
27
  import { type InspectHigherOrderQuery } from './catalog/inspect-higher-order-query/inspect-higher-order-query-format';
28
28
  import type { ReadonlyFlowrAnalysisProvider } from '../project/flowr-analyzer';
29
29
  import type { ReplOutput } from '../cli/repl/commands/repl-main';
@@ -33,10 +33,11 @@ import type { CallGraphQuery } from './catalog/call-graph-query/call-graph-query
33
33
  import type { InspectRecursionQuery } from './catalog/inspect-recursion-query/inspect-recursion-query-format';
34
34
  import type { DoesCallQuery } from './catalog/does-call-query/does-call-query-format';
35
35
  import type { InspectExceptionQuery } from './catalog/inspect-exceptions-query/inspect-exception-query-format';
36
+ import type { ProvenanceQuery } from './catalog/provenance-query/provenance-query-format';
36
37
  /**
37
38
  * These are all queries that can be executed from within flowR
38
39
  */
39
- export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | DfShapeQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery;
40
+ export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | DfShapeQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery | ProvenanceQuery;
40
41
  export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
41
42
  type: QueryType;
42
43
  };
@@ -53,9 +54,9 @@ export interface ParsedQueryLine<QueryType extends BaseQueryFormat['type']> {
53
54
  export interface SupportedQuery<QueryType extends BaseQueryFormat['type'] = BaseQueryFormat['type']> {
54
55
  executor: QueryExecutor<QueryArgumentsWithType<QueryType>, Promise<BaseQueryResult>>;
55
56
  /** optional completion in, e.g., the repl */
56
- completer?: (splitLine: readonly string[], startingNewArg: boolean, config: FlowrConfigOptions) => CommandCompletions;
57
+ completer?: (splitLine: readonly string[], startingNewArg: boolean, config: FlowrConfig) => CommandCompletions;
57
58
  /** optional query construction from an, e.g., repl line */
58
- fromLine?: (output: ReplOutput, splitLine: readonly string[], config: FlowrConfigOptions) => ParsedQueryLine<QueryType>;
59
+ fromLine?: (output: ReplOutput, splitLine: readonly string[], config: FlowrConfig) => ParsedQueryLine<QueryType>;
59
60
  /**
60
61
  * Generates an ASCII summary of the query result to be printed in, e.g., the REPL.
61
62
  * @returns whether a summary was produced (`true` if so, `false` if not, in this case a default/generic summary will be created)
@@ -79,8 +80,8 @@ export declare const SupportedQueries: {
79
80
  readonly config: {
80
81
  readonly executor: typeof import("./catalog/config-query/config-query-executor").executeConfigQuery;
81
82
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
82
- readonly completer: (partialLine: readonly string[], _startingNewArg: boolean, config: FlowrConfigOptions) => CommandCompletions;
83
- readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"config">;
83
+ readonly completer: (partialLine: readonly string[], _startingNewArg: boolean, config: FlowrConfig) => CommandCompletions;
84
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"config">;
84
85
  readonly schema: Joi.ObjectSchema<any>;
85
86
  readonly flattenInvolvedNodes: () => never[];
86
87
  };
@@ -105,7 +106,7 @@ export declare const SupportedQueries: {
105
106
  readonly 'does-call': {
106
107
  readonly executor: typeof import("./catalog/does-call-query/does-call-query-executor").executeDoesCallQuery;
107
108
  readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
108
- readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"does-call">;
109
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"does-call">;
109
110
  readonly schema: Joi.ObjectSchema<any>;
110
111
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
111
112
  };
@@ -119,15 +120,15 @@ export declare const SupportedQueries: {
119
120
  readonly executor: typeof import("./catalog/df-shape-query/df-shape-query-executor").executeDfShapeQuery;
120
121
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
121
122
  readonly jsonFormatter: (queryResults: BaseQueryResult) => object;
122
- readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"df-shape">;
123
+ readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"df-shape">;
123
124
  readonly schema: Joi.ObjectSchema<any>;
124
125
  readonly flattenInvolvedNodes: () => never[];
125
126
  };
126
127
  readonly files: {
127
128
  readonly executor: typeof import("./catalog/files-query/files-query-executor").executeFileQuery;
128
129
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
129
- readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfigOptions) => CommandCompletions;
130
- readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"files">;
130
+ readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
131
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"files">;
131
132
  readonly schema: Joi.ObjectSchema<any>;
132
133
  readonly flattenInvolvedNodes: (_: BaseQueryResult) => NodeId[];
133
134
  };
@@ -152,7 +153,14 @@ export declare const SupportedQueries: {
152
153
  readonly 'static-slice': {
153
154
  readonly executor: typeof import("./catalog/static-slice-query/static-slice-query-executor").executeStaticSliceQuery;
154
155
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
155
- readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"static-slice">;
156
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"static-slice">;
157
+ readonly schema: Joi.ObjectSchema<any>;
158
+ readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
159
+ };
160
+ readonly provenance: {
161
+ readonly executor: typeof import("./catalog/provenance-query/provenance-query-executor").executeProvenanceQuery;
162
+ readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
163
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"provenance">;
156
164
  readonly schema: Joi.ObjectSchema<any>;
157
165
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
158
166
  };
@@ -165,7 +173,7 @@ export declare const SupportedQueries: {
165
173
  readonly 'location-map': {
166
174
  readonly executor: typeof import("./catalog/location-map-query/location-map-query-executor").executeLocationMapQuery;
167
175
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => true;
168
- readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"location-map">;
176
+ readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"location-map">;
169
177
  readonly schema: Joi.ObjectSchema<any>;
170
178
  readonly flattenInvolvedNodes: () => never[];
171
179
  };
@@ -184,28 +192,28 @@ export declare const SupportedQueries: {
184
192
  readonly 'inspect-exception': {
185
193
  readonly executor: typeof import("./catalog/inspect-exceptions-query/inspect-exception-query-executor").executeExceptionQuery;
186
194
  readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
187
- readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"inspect-exception">;
195
+ readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-exception">;
188
196
  readonly schema: Joi.ObjectSchema<any>;
189
197
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
190
198
  };
191
199
  readonly 'inspect-higher-order': {
192
200
  readonly executor: typeof import("./catalog/inspect-higher-order-query/inspect-higher-order-query-executor").executeHigherOrderQuery;
193
201
  readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
194
- readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"inspect-higher-order">;
202
+ readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-higher-order">;
195
203
  readonly schema: Joi.ObjectSchema<any>;
196
204
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
197
205
  };
198
206
  readonly 'inspect-recursion': {
199
207
  readonly executor: typeof import("./catalog/inspect-recursion-query/inspect-recursion-query-executor").executeRecursionQuery;
200
208
  readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
201
- readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"inspect-recursion">;
209
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-recursion">;
202
210
  readonly schema: Joi.ObjectSchema<any>;
203
211
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
204
212
  };
205
213
  readonly 'resolve-value': {
206
214
  readonly executor: typeof import("./catalog/resolve-value-query/resolve-value-query-executor").executeResolveValueQuery;
207
215
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
208
- readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"resolve-value">;
216
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"resolve-value">;
209
217
  readonly schema: Joi.ObjectSchema<any>;
210
218
  readonly flattenInvolvedNodes: () => never[];
211
219
  };
@@ -218,15 +226,15 @@ export declare const SupportedQueries: {
218
226
  readonly origin: {
219
227
  readonly executor: typeof import("./catalog/origin-query/origin-query-executor").executeResolveValueQuery;
220
228
  readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
221
- readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"origin">;
229
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"origin">;
222
230
  readonly schema: Joi.ObjectSchema<any>;
223
231
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
224
232
  };
225
233
  readonly linter: {
226
234
  readonly executor: typeof import("./catalog/linter-query/linter-query-executor").executeLinterQuery;
227
235
  readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
228
- readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfigOptions) => CommandCompletions;
229
- readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions) => ParsedQueryLine<"linter">;
236
+ readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
237
+ readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"linter">;
230
238
  readonly schema: Joi.ObjectSchema<any>;
231
239
  readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => ((string & {
232
240
  __brand?: "node-id";
package/queries/query.js CHANGED
@@ -40,6 +40,7 @@ const call_graph_query_format_1 = require("./catalog/call-graph-query/call-graph
40
40
  const inspect_recursion_query_format_1 = require("./catalog/inspect-recursion-query/inspect-recursion-query-format");
41
41
  const does_call_query_format_1 = require("./catalog/does-call-query/does-call-query-format");
42
42
  const inspect_exception_query_format_1 = require("./catalog/inspect-exceptions-query/inspect-exception-query-format");
43
+ const provenance_query_format_1 = require("./catalog/provenance-query/provenance-query-format");
43
44
  exports.SupportedQueries = {
44
45
  'call-context': call_context_query_format_1.CallContextQueryDefinition,
45
46
  'config': config_query_format_1.ConfigQueryDefinition,
@@ -54,6 +55,7 @@ exports.SupportedQueries = {
54
55
  'normalized-ast': normalized_ast_query_format_1.NormalizedAstQueryDefinition,
55
56
  'dataflow-cluster': cluster_query_format_1.ClusterQueryDefinition,
56
57
  'static-slice': static_slice_query_format_1.StaticSliceQueryDefinition,
58
+ 'provenance': provenance_query_format_1.ProvenanceQueryDefinition,
57
59
  'dependencies': dependencies_query_format_1.DependenciesQueryDefinition,
58
60
  'location-map': location_map_query_format_1.LocationMapQueryDefinition,
59
61
  'search': search_query_format_1.SearchQueryDefinition,
@@ -28,6 +28,7 @@ import type { ParentInformation } from './processing/decorate';
28
28
  import type { NodeId } from './processing/node-id';
29
29
  import type { OnEnter, OnExit } from './processing/visitor';
30
30
  import type { SingleOrArrayOrNothing } from '../../../../abstract-interpretation/normalized-ast-fold';
31
+ import { getDocumentationOf } from '../../../roxygen2/documentation-provider';
31
32
  /** Simply an empty type constraint used to say that there are additional decorations (see {@link RAstNodeBase}). */
32
33
  export type NoInfo = object;
33
34
  /**
@@ -258,13 +259,18 @@ export declare const RNode: {
258
259
  * Returns the direct parent of a node.
259
260
  * Usually, only root nodes do not have a parent, and you can assume that there is a
260
261
  * linear chain of parents leading to the root node.
262
+ * @see {@link iterateParents} - to get all parents of a node
261
263
  */
262
- readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: Map<NodeId, RNode<OtherInfo>>) => RNode<OtherInfo> | undefined;
264
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: Map<NodeId, RNode<OtherInfo & ParentInformation>>) => RNode<OtherInfo & ParentInformation> | undefined;
265
+ /**
266
+ * Returns an iterable of all parents of a node, starting with the direct parent and ending with the root node.
267
+ */
268
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation> | undefined, idMap: Map<NodeId, RNode<OtherInfo & ParentInformation>>) => Generator<RNode<OtherInfo & ParentInformation>>;
263
269
  /**
264
270
  * In contrast to the nesting stored in the {@link RNode} structure,
265
271
  * this function calculates the depth of a node by counting the number of parents until the root node is reached.
266
272
  */
267
- readonly depth: (this: void, node: RNode, idMap: Map<NodeId, RNode>) => number;
273
+ readonly depth: (this: void, node: RNode<ParentInformation>, idMap: Map<NodeId, RNode<ParentInformation>>) => number;
268
274
  /**
269
275
  * Collects all node ids within a tree given by a respective root node, but stops collecting at nodes where the given `stop` function returns `true`.
270
276
  * <p>
@@ -282,5 +288,10 @@ export declare const RNode: {
282
288
  readonly lexeme: <R extends RNode<ParentInformation>>(this: void, node: R | undefined) => R extends {
283
289
  lexeme: string;
284
290
  } ? string : string | undefined;
291
+ /**
292
+ * Return the (roxygen) documentation associated with the given node, if available.
293
+ * @see {@link getDocumentationOf}
294
+ */
295
+ readonly documentation: typeof getDocumentationOf;
285
296
  };
286
297
  export type OtherInfoNode = RNode | RDelimiter;
@@ -6,6 +6,7 @@ const type_1 = require("./type");
6
6
  const r_access_1 = require("./nodes/r-access");
7
7
  const visitor_1 = require("./processing/visitor");
8
8
  const assert_1 = require("../../../../util/assert");
9
+ const documentation_provider_1 = require("../../../roxygen2/documentation-provider");
9
10
  /**
10
11
  * Helper object to provide helper functions for {@link RConstant|RConstants}.
11
12
  * @see {@link RNode} - for more general helper functions for all nodes
@@ -200,6 +201,7 @@ exports.RNode = {
200
201
  * Returns the direct parent of a node.
201
202
  * Usually, only root nodes do not have a parent, and you can assume that there is a
202
203
  * linear chain of parents leading to the root node.
204
+ * @see {@link iterateParents} - to get all parents of a node
203
205
  */
204
206
  directParent(node, idMap) {
205
207
  const parentId = node.info.parent;
@@ -208,6 +210,18 @@ exports.RNode = {
208
210
  }
209
211
  return idMap.get(parentId);
210
212
  },
213
+ /**
214
+ * Returns an iterable of all parents of a node, starting with the direct parent and ending with the root node.
215
+ */
216
+ *iterateParents(node, idMap) {
217
+ let currentNode = node;
218
+ while (currentNode) {
219
+ currentNode = exports.RNode.directParent(currentNode, idMap);
220
+ if (currentNode) {
221
+ yield currentNode;
222
+ }
223
+ }
224
+ },
211
225
  /**
212
226
  * In contrast to the nesting stored in the {@link RNode} structure,
213
227
  * this function calculates the depth of a node by counting the number of parents until the root node is reached.
@@ -247,6 +261,11 @@ exports.RNode = {
247
261
  */
248
262
  lexeme(node) {
249
263
  return node?.info.fullLexeme ?? node?.lexeme;
250
- }
264
+ },
265
+ /**
266
+ * Return the (roxygen) documentation associated with the given node, if available.
267
+ * @see {@link getDocumentationOf}
268
+ */
269
+ documentation: documentation_provider_1.getDocumentationOf
251
270
  };
252
271
  //# sourceMappingURL=model.js.map
@@ -1,6 +1,8 @@
1
- import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
1
+ import type { RAstNodeBase, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  import type { RParameter } from './r-parameter';
5
+ import type { AstIdMap, ParentInformation } from '../processing/decorate';
4
6
  /**
5
7
  * ```r
6
8
  * function(<parameters>) <body>
@@ -25,4 +27,9 @@ export declare const RFunctionDefinition: {
25
27
  * Type guard for {@link RFunctionDefinition} nodes.
26
28
  */
27
29
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RFunctionDefinition<Info>;
30
+ /**
31
+ * Checks whether the given id is part of a function definition, and if so, this returns the id of the
32
+ * inner-most function definition.
33
+ */
34
+ readonly wrappingFunctionDefinition: <Info = object>(this: void, n: RNode<ParentInformation & Info> | undefined, idMap: AstIdMap<ParentInformation & Info>) => RFunctionDefinition<ParentInformation & Info> | undefined;
28
35
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RFunctionDefinition = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  /**
6
7
  * Helper for working with {@link RFunctionDefinition} AST nodes.
@@ -12,6 +13,18 @@ exports.RFunctionDefinition = {
12
13
  */
13
14
  is(node) {
14
15
  return node?.type === type_1.RType.FunctionDefinition;
16
+ },
17
+ /**
18
+ * Checks whether the given id is part of a function definition, and if so, this returns the id of the
19
+ * inner-most function definition.
20
+ */
21
+ wrappingFunctionDefinition(n, idMap) {
22
+ for (const p of model_1.RNode.iterateParents(n, idMap)) {
23
+ if (exports.RFunctionDefinition.is(p)) {
24
+ return p;
25
+ }
26
+ }
27
+ return undefined;
15
28
  }
16
29
  };
17
30
  //# sourceMappingURL=r-function-definition.js.map
@@ -1,7 +1,7 @@
1
1
  import { type IdGenerator, type NormalizedAst } from '../../model/processing/decorate';
2
2
  import type { NoInfo } from '../../model/model';
3
3
  import type { ParseStepOutput, ParseStepOutputSingleFile } from '../../../../parser';
4
- import { type FlowrConfigOptions } from '../../../../../config';
4
+ import { FlowrConfig } from '../../../../../config';
5
5
  import type { Tree } from 'web-tree-sitter';
6
6
  import { RProject } from '../../model/nodes/r-project';
7
7
  export declare const parseLog: import("tslog").Logger<import("tslog").ILogObj>;
@@ -19,4 +19,4 @@ export declare function normalizeButNotDecorated({ parsed, filePath }: ParseStep
19
19
  /**
20
20
  * Tree-Sitter pendant to {@link normalize}.
21
21
  */
22
- export declare function normalizeTreeSitter(parsed: ParseStepOutput<Tree>, getId: IdGenerator<NoInfo> | undefined, config: FlowrConfigOptions): NormalizedAst;
22
+ export declare function normalizeTreeSitter(parsed: ParseStepOutput<Tree>, getId?: IdGenerator<NoInfo>, config?: FlowrConfig): NormalizedAst;
@@ -32,8 +32,8 @@ function normalizeButNotDecorated({ parsed, filePath }) {
32
32
  /**
33
33
  * Tree-Sitter pendant to {@link normalize}.
34
34
  */
35
- function normalizeTreeSitter(parsed, getId = (0, decorate_1.deterministicCountingIdGenerator)(0), config) {
36
- const lax = (0, config_1.getEngineConfig)(config, 'tree-sitter')?.lax;
35
+ function normalizeTreeSitter(parsed, getId = (0, decorate_1.deterministicCountingIdGenerator)(0), config = config_1.FlowrConfig.default()) {
36
+ const lax = config_1.FlowrConfig.getForEngine(config, 'tree-sitter')?.lax;
37
37
  const result = (0, decorate_1.decorateAst)((0, tree_sitter_normalize_1.normalizeTreeSitterTreeToAst)(parsed.files, lax), { getId });
38
38
  result.hasError = parsed.files.some(p => p.parsed.rootNode.hasError);
39
39
  return result;
@@ -224,14 +224,18 @@ function convertTreeNode(node) {
224
224
  }
225
225
  }
226
226
  case tree_sitter_types_1.TreeSitterType.UnaryOperator: {
227
- const [op, operand] = nonErrorChildren(node);
227
+ const [comments, children] = splitComments(nonErrorChildren(node));
228
+ const [op, operand] = children;
228
229
  return {
229
230
  type: type_1.RType.UnaryOp,
230
231
  operand: convertTreeNode(operand),
231
232
  location: makeSourceRange(op),
232
233
  operator: op.text,
233
234
  lexeme: op.text,
234
- ...defaultInfo
235
+ info: {
236
+ ...defaultInfo.info,
237
+ adToks: comments.map(c => c[1]),
238
+ }
235
239
  };
236
240
  }
237
241
  case tree_sitter_types_1.TreeSitterType.NamespaceOperator: {
@@ -3,8 +3,8 @@ import { VertexType } from '../dataflow/graph/vertex';
3
3
  import type { ParentInformation } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
4
4
  import type { FlowrSearchElement } from './flowr-search';
5
5
  import { Enrichment } from './search-executor/search-enrichers';
6
- import type { BuiltInProcName } from '../dataflow/environments/built-in';
7
6
  import type { DataflowInformation } from '../dataflow/info';
7
+ import type { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
8
8
  export type FlowrFilterName = keyof typeof FlowrFilters;
9
9
  interface FlowrFilterWithArgs<Filter extends FlowrFilterName, Args extends FlowrFilterArgs<Filter>> {
10
10
  name: Filter;
@@ -4,10 +4,10 @@ exports.flowrSearchToMermaid = flowrSearchToMermaid;
4
4
  exports.flowrSearchToAscii = flowrSearchToAscii;
5
5
  exports.flowrSearchToCode = flowrSearchToCode;
6
6
  const flowr_search_traverse_1 = require("./flowr-search-traverse");
7
- const mermaid_1 = require("../util/mermaid/mermaid");
8
7
  const flowr_search_filters_1 = require("./flowr-search-filters");
9
8
  const vertex_1 = require("../dataflow/graph/vertex");
10
9
  const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
10
+ const mermaid_1 = require("../util/mermaid/mermaid");
11
11
  /**
12
12
  * Converts a {@link FlowrSearchLike} object to a mermaid flowchart.
13
13
  */
@@ -21,8 +21,8 @@ function argsToMermaidString(args) {
21
21
  if (args === undefined) {
22
22
  return '';
23
23
  }
24
- return Object.entries(args).map(([key, value]) => `${key}: ${(0, flowr_search_filters_1.isBinaryTree)(value) ? '_' + (0, mermaid_1.escapeMarkdown)((0, flowr_search_filters_1.binaryTreeToString)(value.tree)) + '_'
25
- : (0, mermaid_1.escapeMarkdown)(JSON.stringify(value))}`)
24
+ return Object.entries(args).map(([key, value]) => `${key}: ${(0, flowr_search_filters_1.isBinaryTree)(value) ? '_' + mermaid_1.Mermaid.escape((0, flowr_search_filters_1.binaryTreeToString)(value.tree)) + '_'
25
+ : mermaid_1.Mermaid.escape(JSON.stringify(value))}`)
26
26
  .join(', ');
27
27
  }
28
28
  function argsToAsciiString(args) {
@@ -6,13 +6,13 @@ exports.enrichElement = enrichElement;
6
6
  const objects_1 = require("../../util/objects");
7
7
  const vertex_1 = require("../../dataflow/graph/vertex");
8
8
  const assert_1 = require("../../util/assert");
9
- const dfg_get_origin_1 = require("../../dataflow/origin/dfg-get-origin");
10
9
  const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
11
10
  const cfg_simplification_1 = require("../../control-flow/cfg-simplification");
12
11
  const call_context_query_executor_1 = require("../../queries/catalog/call-context-query/call-context-query-executor");
13
12
  const cfg_kind_1 = require("../../project/cfg-kind");
14
13
  const identify_link_to_last_call_relation_1 = require("../../queries/catalog/call-context-query/identify-link-to-last-call-relation");
15
14
  const identifier_1 = require("../../dataflow/environments/identifier");
15
+ const df_helper_1 = require("../../dataflow/graph/df-helper");
16
16
  /**
17
17
  * An enumeration that stores the names of the available enrichments that can be applied to a set of search elements.
18
18
  * See {@link FlowrSearchBuilder.with} for more information on how to apply enrichments.
@@ -37,7 +37,7 @@ exports.Enrichments = {
37
37
  const n = await analyzer.normalize();
38
38
  const callVertex = df.graph.getVertex(e.node.info.id);
39
39
  if (callVertex?.tag === vertex_1.VertexType.FunctionCall) {
40
- const origins = (0, dfg_get_origin_1.getOriginInDfg)(df.graph, callVertex.id);
40
+ const origins = df_helper_1.Dataflow.origin(df.graph, callVertex.id);
41
41
  if (!origins || origins.length === 0) {
42
42
  content.targets = [(0, node_id_1.recoverName)(callVertex.id, n.idMap)];
43
43
  }
@@ -133,7 +133,7 @@ async function generateSyntax(input, args) {
133
133
  }
134
134
  async function generateCriterion(input, args) {
135
135
  const idMap = (await input.normalize()).idMap;
136
- return new flowr_search_1.FlowrSearchElements(args.criterion.map(c => ({ node: idMap.get((0, parse_1.slicingCriterionToId)(c, idMap)) })));
136
+ return new flowr_search_1.FlowrSearchElements(args.criterion.map(c => ({ node: idMap.get(parse_1.SingleSlicingCriterion.parse(c, idMap)) })));
137
137
  }
138
138
  /**
139
139
  * Gets the search generator function for the given name
@@ -2,30 +2,54 @@ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
2
2
  import type { AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
3
  /** Either `line:column`, `line@variable-name`, or `$id` */
4
4
  export type SingleSlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${NodeId | number}`;
5
- export type SlicingCriteria = SingleSlicingCriterion[];
6
- /**
7
- * Thrown if the given slicing criteria can not be found
8
- */
9
- export declare class CriteriaParseError extends Error {
10
- constructor(message: string);
11
- }
12
5
  /**
13
- * Takes a criterion in the form of `line:column` or `line@variable-name` and returns the corresponding node id
14
- * @see {@link tryResolveSliceCriterionToId} for a version that does not throw an error
6
+ * The helper object associated with {@link SingleSlicingCriterion} which makes it easy
7
+ * to parse, validate and resolve slicing criteria.
15
8
  */
16
- export declare function slicingCriterionToId(criterion: SingleSlicingCriterion, idMap: AstIdMap): NodeId;
9
+ export declare const SingleSlicingCriterion: {
10
+ /**
11
+ * Takes a criterion in the form of `line:column` or `line@variable-name` and returns the corresponding node id
12
+ * @see {@link SingleSlicingCriterion.tryParse} for a version that does not throw an error
13
+ */
14
+ readonly parse: (this: void, criterion: SingleSlicingCriterion, idMap: AstIdMap) => NodeId;
15
+ /**
16
+ * Tries to resolve a slicing criterion to an id, but does not throw an error if it fails.
17
+ * @see {@link SingleSlicingCriterion.parse} for the version that throws an error
18
+ */
19
+ readonly tryParse: (this: void, criterion: SingleSlicingCriterion | NodeId, idMap: AstIdMap) => NodeId | undefined;
20
+ /**
21
+ * Converts a node id to a slicing criterion in the form of `$id`
22
+ */
23
+ readonly fromId: (this: void, id: NodeId) => SingleSlicingCriterion;
24
+ };
17
25
  /**
18
- * Tries to resolve a slicing criterion to an id, but does not throw an error if it fails.
19
- * @see {@link slicingCriterionToId} for the version that throws an error
26
+ * A slicing criterion is a list of single slicing criteria, which can be in the form of `line:column`, `line@variable-name`, or `$id`.
20
27
  */
21
- export declare function tryResolveSliceCriterionToId(criterion: string | NodeId, idMap: AstIdMap): NodeId | undefined;
28
+ export type SlicingCriteria = SingleSlicingCriterion[];
22
29
  export interface DecodedCriterion {
23
30
  criterion: SingleSlicingCriterion;
24
31
  id: NodeId;
25
32
  }
26
33
  export type DecodedCriteria = ReadonlyArray<DecodedCriterion>;
27
34
  /**
28
- * Converts all slicing criteria to their corresponding node ids
29
- * @throws CriteriaParseError if any of the criteria can not be resolved
35
+ * The helper object associated with {@link SlicingCriteria} which makes it easy to parse, validate and resolve slicing criteria.
36
+ */
37
+ export declare const SlicingCriteria: {
38
+ /**
39
+ * Decodes all slicing criteria to their corresponding node ids
40
+ * @throws CriteriaParseError if any of the criteria can not be resolved
41
+ * @see {@link SlicingCriteria.convertAll}
42
+ */
43
+ readonly decodeAll: (this: void, criteria: SlicingCriteria, decorated: AstIdMap) => DecodedCriteria;
44
+ /**
45
+ * Converts all criteria to their id in the AST if possible, this keeps the original criterion if it can not be resolved.
46
+ * @see {@link SlicingCriteria.decodeAll}
47
+ */
48
+ readonly convertAll: (this: void, criteria: SlicingCriteria, decorated: AstIdMap) => NodeId[];
49
+ };
50
+ /**
51
+ * Thrown if the given slicing criteria can not be found
30
52
  */
31
- export declare function convertAllSlicingCriteriaToIds(criteria: SlicingCriteria, decorated: AstIdMap): DecodedCriteria;
53
+ export declare class CriteriaParseError extends Error {
54
+ constructor(message: string);
55
+ }