@eagleoutice/flowr 2.6.3 → 2.7.2

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 (276) hide show
  1. package/README.md +22 -22
  2. package/abstract-interpretation/absint-visitor.d.ts +160 -0
  3. package/abstract-interpretation/absint-visitor.js +279 -0
  4. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +4 -7
  5. package/abstract-interpretation/data-frame/dataframe-domain.js +26 -16
  6. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +6 -4
  7. package/abstract-interpretation/data-frame/mappers/access-mapper.js +11 -14
  8. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +10 -9
  9. package/abstract-interpretation/data-frame/mappers/arguments.js +8 -5
  10. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +18 -18
  11. package/abstract-interpretation/data-frame/mappers/function-mapper.js +53 -58
  12. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +7 -5
  13. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +26 -29
  14. package/abstract-interpretation/data-frame/semantics.js +48 -44
  15. package/abstract-interpretation/data-frame/shape-inference.d.ts +52 -28
  16. package/abstract-interpretation/data-frame/shape-inference.js +67 -90
  17. package/abstract-interpretation/domains/abstract-domain.d.ts +1 -0
  18. package/abstract-interpretation/domains/abstract-domain.js +3 -2
  19. package/abstract-interpretation/domains/bounded-set-domain.d.ts +2 -2
  20. package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
  21. package/abstract-interpretation/domains/interval-domain.d.ts +4 -4
  22. package/abstract-interpretation/domains/interval-domain.js +3 -6
  23. package/abstract-interpretation/domains/lattice.d.ts +2 -0
  24. package/abstract-interpretation/domains/lattice.js +3 -1
  25. package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -1
  26. package/abstract-interpretation/domains/positive-interval-domain.js +1 -1
  27. package/abstract-interpretation/domains/satisfiable-domain.d.ts +2 -2
  28. package/abstract-interpretation/domains/satisfiable-domain.js +2 -2
  29. package/abstract-interpretation/domains/set-range-domain.d.ts +104 -0
  30. package/abstract-interpretation/domains/set-range-domain.js +406 -0
  31. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +2 -2
  32. package/abstract-interpretation/domains/set-upper-bound-domain.js +2 -2
  33. package/abstract-interpretation/domains/singleton-domain.d.ts +2 -2
  34. package/abstract-interpretation/domains/singleton-domain.js +2 -2
  35. package/benchmark/slicer.d.ts +2 -1
  36. package/benchmark/slicer.js +50 -29
  37. package/benchmark/stats/print.js +8 -5
  38. package/benchmark/stats/stats.d.ts +3 -2
  39. package/benchmark/summarizer/data.d.ts +11 -8
  40. package/benchmark/summarizer/first-phase/process.js +11 -8
  41. package/benchmark/summarizer/second-phase/process.js +24 -18
  42. package/cli/common/options.d.ts +431 -8
  43. package/cli/common/options.js +1 -1
  44. package/cli/common/scripts-info.d.ts +431 -7
  45. package/cli/flowr-main-options.d.ts +102 -2
  46. package/cli/flowr.d.ts +102 -2
  47. package/cli/repl/commands/repl-commands.d.ts +25 -0
  48. package/cli/repl/commands/repl-query.js +17 -5
  49. package/cli/wiki.d.ts +13 -0
  50. package/cli/wiki.js +7 -2
  51. package/config.d.ts +4 -4
  52. package/config.js +1 -1
  53. package/control-flow/basic-cfg-guided-visitor.js +7 -8
  54. package/control-flow/cfg-dead-code.js +3 -2
  55. package/control-flow/control-flow-graph.d.ts +1 -1
  56. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  57. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  58. package/control-flow/useless-loop.js +4 -2
  59. package/core/steps/all/static-slicing/00-slice.d.ts +3 -0
  60. package/core/steps/all/static-slicing/00-slice.js +2 -1
  61. package/core/steps/pipeline/default-pipelines.d.ts +42 -42
  62. package/dataflow/cluster.js +2 -2
  63. package/dataflow/environments/append.d.ts +5 -0
  64. package/dataflow/environments/append.js +6 -20
  65. package/dataflow/environments/built-in.d.ts +2 -1
  66. package/dataflow/environments/clone.d.ts +1 -1
  67. package/dataflow/environments/clone.js +3 -27
  68. package/dataflow/environments/define.d.ts +7 -3
  69. package/dataflow/environments/define.js +9 -56
  70. package/dataflow/environments/diff.js +1 -1
  71. package/dataflow/environments/environment.d.ts +48 -28
  72. package/dataflow/environments/environment.js +187 -62
  73. package/dataflow/environments/overwrite.js +2 -45
  74. package/dataflow/environments/reference-to-maybe.d.ts +13 -0
  75. package/dataflow/environments/reference-to-maybe.js +54 -0
  76. package/dataflow/environments/resolve-by-name.d.ts +6 -1
  77. package/dataflow/environments/resolve-by-name.js +56 -4
  78. package/dataflow/environments/scoping.d.ts +2 -2
  79. package/dataflow/environments/scoping.js +7 -7
  80. package/dataflow/eval/resolve/alias-tracking.d.ts +10 -4
  81. package/dataflow/eval/resolve/alias-tracking.js +16 -14
  82. package/dataflow/eval/resolve/resolve-argument.d.ts +2 -1
  83. package/dataflow/eval/resolve/resolve-argument.js +8 -8
  84. package/dataflow/eval/resolve/resolve.d.ts +13 -11
  85. package/dataflow/eval/resolve/resolve.js +16 -15
  86. package/dataflow/extractor.js +1 -7
  87. package/dataflow/fn/higher-order-function.d.ts +2 -1
  88. package/dataflow/fn/higher-order-function.js +4 -4
  89. package/dataflow/graph/dataflowgraph-builder.d.ts +9 -5
  90. package/dataflow/graph/dataflowgraph-builder.js +21 -11
  91. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  92. package/dataflow/graph/graph.d.ts +10 -2
  93. package/dataflow/graph/graph.js +41 -12
  94. package/dataflow/graph/invert-dfg.d.ts +3 -2
  95. package/dataflow/graph/invert-dfg.js +3 -3
  96. package/dataflow/graph/resolve-graph.d.ts +2 -1
  97. package/dataflow/graph/resolve-graph.js +2 -2
  98. package/dataflow/graph/vertex.d.ts +3 -3
  99. package/dataflow/graph/vertex.js +3 -3
  100. package/dataflow/info.d.ts +1 -1
  101. package/dataflow/internal/linker.d.ts +2 -0
  102. package/dataflow/internal/linker.js +13 -19
  103. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +7 -1
  104. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +12 -3
  105. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +2 -2
  107. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -1
  108. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +3 -3
  109. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +9 -9
  110. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -7
  111. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
  112. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
  113. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +9 -13
  114. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +1 -1
  115. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +3 -1
  116. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +8 -6
  117. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +1 -1
  118. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
  120. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  121. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +6 -4
  122. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  123. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -5
  124. package/dataflow/internal/process/functions/call/common.js +2 -3
  125. package/dataflow/internal/process/functions/call/known-call-handling.js +1 -1
  126. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
  127. package/dataflow/internal/process/functions/process-argument.js +1 -1
  128. package/dataflow/internal/process/process-symbol.js +1 -1
  129. package/dataflow/internal/process/process-value.d.ts +1 -1
  130. package/dataflow/internal/process/process-value.js +7 -7
  131. package/dataflow/processor.d.ts +1 -5
  132. package/documentation/doc-capabilities.d.ts +1 -1
  133. package/documentation/doc-readme.d.ts +1 -1
  134. package/documentation/doc-util/doc-cfg.js +1 -1
  135. package/documentation/doc-util/doc-cli-option.d.ts +6 -6
  136. package/documentation/doc-util/doc-cli-option.js +3 -3
  137. package/documentation/doc-util/doc-dfg.d.ts +1 -1
  138. package/documentation/doc-util/doc-dfg.js +3 -2
  139. package/documentation/doc-util/doc-files.d.ts +3 -0
  140. package/documentation/doc-util/doc-files.js +4 -1
  141. package/documentation/doc-util/doc-normalized-ast.js +5 -4
  142. package/documentation/doc-util/doc-types.d.ts +1 -1
  143. package/documentation/doc-util/doc-types.js +2 -2
  144. package/documentation/issue-linting-rule.d.ts +1 -1
  145. package/documentation/wiki-analyzer.d.ts +1 -1
  146. package/documentation/wiki-analyzer.js +14 -1
  147. package/documentation/wiki-cfg.d.ts +1 -1
  148. package/documentation/wiki-core.d.ts +1 -1
  149. package/documentation/wiki-dataflow-graph.d.ts +1 -1
  150. package/documentation/wiki-dataflow-graph.js +10 -11
  151. package/documentation/wiki-engine.d.ts +1 -1
  152. package/documentation/wiki-engine.js +9 -10
  153. package/documentation/wiki-faq.d.ts +1 -1
  154. package/documentation/wiki-faq.js +0 -1
  155. package/documentation/wiki-interface.d.ts +1 -1
  156. package/documentation/wiki-interface.js +12 -13
  157. package/documentation/wiki-linter.d.ts +1 -1
  158. package/documentation/wiki-linter.js +1 -1
  159. package/documentation/wiki-linting-and-testing.d.ts +1 -1
  160. package/documentation/wiki-mk/doc-context.d.ts +54 -1
  161. package/documentation/wiki-mk/doc-context.js +17 -0
  162. package/documentation/wiki-mk/doc-maker.d.ts +5 -5
  163. package/documentation/wiki-mk/doc-maker.js +5 -2
  164. package/documentation/wiki-normalized-ast.d.ts +1 -1
  165. package/documentation/wiki-onboarding.d.ts +1 -1
  166. package/documentation/wiki-overview.d.ts +9 -0
  167. package/documentation/wiki-overview.js +248 -0
  168. package/documentation/wiki-query.d.ts +1 -1
  169. package/documentation/wiki-query.js +17 -1
  170. package/documentation/wiki-search.d.ts +1 -1
  171. package/documentation/wiki-setup.d.ts +9 -0
  172. package/documentation/wiki-setup.js +122 -0
  173. package/linter/linter-rules.d.ts +2 -2
  174. package/linter/rules/absolute-path.js +4 -4
  175. package/linter/rules/dataframe-access-validation.d.ts +2 -2
  176. package/linter/rules/dataframe-access-validation.js +9 -11
  177. package/linter/rules/function-finder-util.d.ts +2 -2
  178. package/linter/rules/function-finder-util.js +1 -1
  179. package/linter/rules/network-functions.js +1 -1
  180. package/linter/rules/seeded-randomness.d.ts +1 -1
  181. package/linter/rules/seeded-randomness.js +5 -5
  182. package/linter/rules/unused-definition.js +1 -1
  183. package/package.json +1 -2
  184. package/project/context/flowr-analyzer-context.d.ts +11 -0
  185. package/project/context/flowr-analyzer-context.js +3 -0
  186. package/project/context/flowr-analyzer-environment-context.d.ts +47 -0
  187. package/project/context/flowr-analyzer-environment-context.js +50 -0
  188. package/project/context/flowr-analyzer-files-context.d.ts +9 -1
  189. package/project/context/flowr-analyzer-files-context.js +4 -0
  190. package/project/context/flowr-file.d.ts +2 -0
  191. package/project/context/flowr-file.js +2 -0
  192. package/project/plugins/file-plugins/{flowr-description-file.d.ts → files/flowr-description-file.d.ts} +1 -1
  193. package/project/plugins/file-plugins/files/flowr-description-file.js +75 -0
  194. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +27 -0
  195. package/project/plugins/file-plugins/files/flowr-news-file.js +152 -0
  196. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
  197. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
  198. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +23 -0
  199. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +35 -0
  200. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +1 -1
  201. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +1 -1
  202. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
  203. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +1 -1
  204. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +1 -1
  205. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +1 -1
  206. package/project/plugins/flowr-analyzer-plugin-defaults.js +2 -0
  207. package/project/plugins/plugin-registry.d.ts +2 -1
  208. package/project/plugins/plugin-registry.js +2 -0
  209. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
  210. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -4
  211. package/queries/catalog/control-flow-query/control-flow-query-format.js +3 -2
  212. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
  213. package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -4
  214. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
  215. package/queries/catalog/df-shape-query/df-shape-query-executor.js +5 -3
  216. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +4 -4
  217. package/queries/catalog/df-shape-query/df-shape-query-format.js +2 -2
  218. package/queries/catalog/files-query/files-query-executor.d.ts +6 -0
  219. package/queries/catalog/files-query/files-query-executor.js +49 -0
  220. package/queries/catalog/files-query/files-query-format.d.ts +36 -0
  221. package/queries/catalog/files-query/files-query-format.js +114 -0
  222. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
  223. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  224. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +1 -1
  225. package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
  226. package/queries/query.d.ts +10 -1
  227. package/queries/query.js +3 -1
  228. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -1
  229. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +8 -8
  230. package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +8 -8
  231. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +0 -1
  232. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +0 -1
  233. package/slicing/static/slice-call.d.ts +3 -2
  234. package/slicing/static/slice-call.js +4 -4
  235. package/slicing/static/static-slicer.d.ts +3 -1
  236. package/slicing/static/static-slicer.js +6 -7
  237. package/statistics/features/supported/control-flow/control-flow.js +1 -1
  238. package/statistics/features/supported/data-access/data-access.js +1 -1
  239. package/statistics/features/supported/used-functions/used-functions.js +1 -1
  240. package/statistics/features/supported/variables/variables.js +2 -1
  241. package/util/containers.js +2 -2
  242. package/util/files.d.ts +0 -7
  243. package/util/files.js +0 -41
  244. package/util/mermaid/ast.d.ts +3 -2
  245. package/util/mermaid/ast.js +13 -7
  246. package/util/mermaid/cfg.d.ts +3 -2
  247. package/util/mermaid/cfg.js +26 -6
  248. package/util/mermaid/dfg.d.ts +2 -7
  249. package/util/mermaid/dfg.js +10 -6
  250. package/util/mermaid/info.d.ts +17 -0
  251. package/util/mermaid/info.js +5 -0
  252. package/util/prefix.d.ts +9 -5
  253. package/util/prefix.js +14 -6
  254. package/util/r-regex.d.ts +21 -0
  255. package/util/r-regex.js +25 -0
  256. package/util/simple-df/dfg-view.d.ts +2 -1
  257. package/util/simple-df/dfg-view.js +2 -2
  258. package/util/text/args.js +12 -3
  259. package/util/version.js +1 -1
  260. package/abstract-interpretation/data-frame/absint-info.d.ts +0 -109
  261. package/abstract-interpretation/data-frame/absint-info.js +0 -31
  262. package/abstract-interpretation/data-frame/absint-visitor.d.ts +0 -57
  263. package/abstract-interpretation/data-frame/absint-visitor.js +0 -176
  264. package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +0 -19
  265. package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +0 -33
  266. package/dataflow/environments/remove.d.ts +0 -12
  267. package/dataflow/environments/remove.js +0 -52
  268. package/documentation/doc-util/doc-print.d.ts +0 -5
  269. package/documentation/doc-util/doc-print.js +0 -36
  270. package/project/plugins/file-plugins/flowr-description-file.js +0 -37
  271. package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
  272. package/project/plugins/file-plugins/notebooks/notebook.js +0 -2
  273. /package/project/plugins/file-plugins/{notebooks → files}/flowr-jupyter-file.d.ts +0 -0
  274. /package/project/plugins/file-plugins/{notebooks → files}/flowr-jupyter-file.js +0 -0
  275. /package/project/plugins/file-plugins/{notebooks → files}/flowr-rmarkdown-file.d.ts +0 -0
  276. /package/project/plugins/file-plugins/{notebooks → files}/flowr-rmarkdown-file.js +0 -0
package/cli/flowr.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import commandLineUsage from 'command-line-usage';
2
1
  export declare const toolName = "flowr";
3
2
  export interface FlowrCliOptions {
4
3
  'config-file': string;
@@ -32,6 +31,107 @@ export declare const optionHelp: ({
32
31
  optionList?: undefined;
33
32
  } | {
34
33
  header: string;
35
- optionList: commandLineUsage.OptionDefinition[];
34
+ optionList: [{
35
+ readonly name: "config-file";
36
+ readonly type: StringConstructor;
37
+ readonly description: "The name of the configuration file to use";
38
+ readonly multiple: false;
39
+ }, {
40
+ readonly name: "config-json";
41
+ readonly type: StringConstructor;
42
+ readonly description: "The flowR configuration to use, as a JSON string";
43
+ readonly multiple: false;
44
+ }, {
45
+ readonly name: "execute";
46
+ readonly alias: "e";
47
+ readonly type: StringConstructor;
48
+ readonly description: "Execute the given command and exit. Use a semicolon \";\" to separate multiple commands.";
49
+ readonly typeLabel: "{underline command}";
50
+ readonly multiple: false;
51
+ }, {
52
+ readonly name: "help";
53
+ readonly alias: "h";
54
+ readonly type: BooleanConstructor;
55
+ readonly description: "Print this usage guide (or the guide of the corresponding script)";
56
+ }, {
57
+ readonly name: "no-ansi";
58
+ readonly type: BooleanConstructor;
59
+ readonly description: "Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.";
60
+ }, {
61
+ readonly name: "port";
62
+ readonly type: NumberConstructor;
63
+ readonly description: "The port to listen on, if --server is given.";
64
+ readonly defaultValue: 1042;
65
+ readonly typeLabel: "{underline port}";
66
+ }, {
67
+ readonly name: "r-path";
68
+ readonly type: StringConstructor;
69
+ readonly description: "The path to the R executable to use. Defaults to your PATH. This option is being phased out in favor of the engine configuration option \"engine.r-shell.r-path\", which should be used instead.";
70
+ readonly multiple: false;
71
+ }, {
72
+ readonly name: "r-session-access";
73
+ readonly type: BooleanConstructor;
74
+ readonly description: "Allow to access the underlying R session when using flowR (security warning: this allows the execution of arbitrary R code!)";
75
+ }, {
76
+ readonly name: "script";
77
+ readonly alias: "s";
78
+ readonly type: StringConstructor;
79
+ readonly description: `The sub-script to run (${string})`;
80
+ readonly multiple: false;
81
+ readonly defaultOption: true;
82
+ readonly typeLabel: "{underline files}";
83
+ readonly defaultValue: undefined;
84
+ }, {
85
+ readonly name: "server";
86
+ readonly type: BooleanConstructor;
87
+ readonly description: "Do not drop into a repl, but instead start a server on the given port (default: 1042) and listen for messages.";
88
+ }, {
89
+ readonly name: "verbose";
90
+ readonly alias: "v";
91
+ readonly type: BooleanConstructor;
92
+ readonly description: "Run with verbose logging (will be passed to the corresponding script)";
93
+ }, {
94
+ readonly name: "version";
95
+ readonly alias: "V";
96
+ readonly type: BooleanConstructor;
97
+ readonly description: "Provide information about the version of flowR as well as its underlying R system and exit.";
98
+ }, {
99
+ readonly name: "ws";
100
+ readonly type: BooleanConstructor;
101
+ readonly description: "If the server flag is set, use websocket for messaging";
102
+ }, {
103
+ readonly name: "engine.r-shell.disabled";
104
+ readonly type: BooleanConstructor;
105
+ readonly description: "Disable the R shell engine";
106
+ }, {
107
+ readonly name: "engine.r-shell.r-path";
108
+ readonly type: StringConstructor;
109
+ readonly description: "The path to the R executable to use. Defaults to your PATH.";
110
+ readonly multiple: false;
111
+ }, {
112
+ readonly name: "engine.tree-sitter.disabled";
113
+ readonly type: BooleanConstructor;
114
+ readonly description: "Disable the tree-sitter engine";
115
+ }, {
116
+ readonly name: "engine.tree-sitter.wasm-path";
117
+ readonly type: StringConstructor;
118
+ readonly description: "The path to the tree-sitter-r WASM binary to use. Defaults to the one shipped with flowR.";
119
+ readonly multiple: false;
120
+ }, {
121
+ readonly name: "engine.tree-sitter.tree-sitter-wasm-path";
122
+ readonly type: StringConstructor;
123
+ readonly description: "The path to the tree-sitter WASM binary to use. Defaults to the path specified by the tree-sitter package.";
124
+ readonly multiple: false;
125
+ }, {
126
+ readonly name: "engine.tree-sitter.lax";
127
+ readonly type: BooleanConstructor;
128
+ readonly description: "Use the lax parser for parsing R code (allowing for syntax errors).";
129
+ readonly multiple: false;
130
+ }, {
131
+ readonly name: "default-engine";
132
+ readonly type: StringConstructor;
133
+ readonly description: "The default engine to use for interacting with R code. If this is undefined, an arbitrary engine from the specified list will be used.";
134
+ readonly multiple: false;
135
+ }];
36
136
  content?: undefined;
37
137
  })[];
@@ -1,5 +1,29 @@
1
1
  import type { ReplCodeCommand, ReplCommand } from './repl-main';
2
+ import { scripts } from '../../common/scripts-info';
2
3
  export declare const helpCommand: ReplCommand;
4
+ /**
5
+ * All commands that should be available in the REPL.
6
+ */
7
+ declare const _commands: {
8
+ readonly help: ReplCommand;
9
+ readonly quit: ReplCommand;
10
+ readonly version: ReplCommand;
11
+ readonly execute: ReplCommand;
12
+ readonly parse: ReplCodeCommand;
13
+ readonly normalize: ReplCodeCommand;
14
+ readonly 'normalize*': ReplCodeCommand;
15
+ readonly dataflow: ReplCodeCommand;
16
+ readonly 'dataflow*': ReplCodeCommand;
17
+ readonly dataflowsimple: ReplCodeCommand;
18
+ readonly 'dataflowsimple*': ReplCodeCommand;
19
+ readonly controlflow: ReplCodeCommand;
20
+ readonly 'controlflow*': ReplCodeCommand;
21
+ readonly controlflowbb: ReplCodeCommand;
22
+ readonly 'controlflowbb*': ReplCodeCommand;
23
+ readonly query: ReplCodeCommand;
24
+ readonly 'query*': ReplCodeCommand;
25
+ };
26
+ export type ReplCommandNames = keyof typeof _commands | keyof typeof scripts;
3
27
  /**
4
28
  * Retrieve all REPL commands (including those generated from master scripts)
5
29
  */
@@ -26,3 +50,4 @@ export declare function longestCommandName(): number;
26
50
  * @see {@link longestCommandName}
27
51
  */
28
52
  export declare function padCmd<T>(string: T): string;
53
+ export {};
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.queryStarCommand = exports.queryCommand = void 0;
4
- const retriever_1 = require("../../../r-bridge/retriever");
5
- const args_1 = require("../../../util/text/args");
6
4
  const ansi_1 = require("../../../util/text/ansi");
7
5
  const schema_1 = require("../../../util/schema");
8
6
  const query_1 = require("../../../queries/query");
9
- const json_1 = require("../../../util/json");
7
+ const retriever_1 = require("../../../r-bridge/retriever");
10
8
  const query_print_1 = require("../../../queries/query-print");
9
+ const json_1 = require("../../../util/json");
10
+ const args_1 = require("../../../util/text/args");
11
11
  function printHelp(output) {
12
12
  output.stderr(`Format: ${(0, ansi_1.italic)(':query "<query>" <code>', output.formatter)}`);
13
13
  output.stdout('The query is an array of query objects to represent multiple queries. Each query object may have the following properties:');
@@ -45,8 +45,20 @@ async function processQueryArgs(output, analyzer, remainingArgs) {
45
45
  }
46
46
  const validationResult = (0, query_1.QueriesSchema)().validate(parsedQuery);
47
47
  if (validationResult.error) {
48
- output.stderr(`Invalid query: ${validationResult.error.message}`);
49
- printHelp(output);
48
+ output.stderr(`Invalid query: "${output.formatter.format(JSON.stringify(parsedQuery), { style: 3 /* FontStyles.Italic */, color: 3 /* Colors.Yellow */, effect: ansi_1.ColorEffect.Foreground })}"`);
49
+ for (const line of validationResult.error.details) {
50
+ const value = line.context?.value ? JSON.stringify(line.context.value) : undefined;
51
+ output.stderr(` - ${line.message} ${value ? '(' + (0, ansi_1.italic)(value, output.formatter) + ')' : ''}`);
52
+ const ctx = line.context;
53
+ for (const detail of ctx?.details?.slice(0, ctx.details.length - 1) ?? []) {
54
+ if ('context' in detail && 'message' in detail.context) {
55
+ const lines = detail.context.message.split('. ');
56
+ for (const l of lines) {
57
+ output.stderr(` - ${l.trim()}`);
58
+ }
59
+ }
60
+ }
61
+ }
50
62
  return;
51
63
  }
52
64
  }
package/cli/wiki.d.ts CHANGED
@@ -1,3 +1,16 @@
1
+ import { WikiFaq } from '../documentation/wiki-faq';
2
+ import { DocCapabilities, WikiCore, WikiDataflowGraph, WikiEngine, WikiInterface, WikiLintingAndTesting, WikiNormalizedAst, WikiQuery, WikiSearch } from '../documentation';
3
+ import { WikiCfg } from '../documentation/wiki-cfg';
4
+ import { WikiOnboarding } from '../documentation/wiki-onboarding';
5
+ import { WikiAnalyzer } from '../documentation/wiki-analyzer';
6
+ import { IssueLintingRule } from '../documentation/issue-linting-rule';
7
+ import { DocReadme } from '../documentation/doc-readme';
8
+ import { WikiLinter } from '../documentation/wiki-linter';
9
+ import { WikiSetup } from '../documentation/wiki-setup';
10
+ import { WikiOverview } from '../documentation/wiki-overview';
11
+ export declare const AllWikiDocuments: [WikiFaq, WikiSearch, WikiCfg, WikiQuery, WikiOnboarding, WikiAnalyzer, WikiEngine, WikiNormalizedAst, WikiCore, WikiSetup, WikiOverview, WikiInterface, WikiDataflowGraph, WikiLintingAndTesting, WikiLinter, IssueLintingRule, DocReadme, DocCapabilities];
12
+ export type ValidWikiDocumentTargets = ReturnType<typeof AllWikiDocuments[number]['getTarget']>;
13
+ export type ValidWikiDocumentTargetsNoSuffix = ValidWikiDocumentTargets extends `${infer Name}.${string}` ? Name : never;
1
14
  /**
2
15
  * Updates and optionally re-creates all flowR wikis.
3
16
  */
package/cli/wiki.js CHANGED
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AllWikiDocuments = void 0;
6
7
  exports.makeAllWikis = makeAllWikis;
7
8
  const doc_context_1 = require("../documentation/wiki-mk/doc-context");
8
9
  const shell_1 = require("../r-bridge/shell");
@@ -22,7 +23,9 @@ const issue_linting_rule_1 = require("../documentation/issue-linting-rule");
22
23
  const doc_readme_1 = require("../documentation/doc-readme");
23
24
  const wiki_linter_1 = require("../documentation/wiki-linter");
24
25
  const os_1 = __importDefault(require("os"));
25
- const Documents = [
26
+ const wiki_setup_1 = require("../documentation/wiki-setup");
27
+ const wiki_overview_1 = require("../documentation/wiki-overview");
28
+ exports.AllWikiDocuments = [
26
29
  new wiki_faq_1.WikiFaq(),
27
30
  new documentation_1.WikiSearch(),
28
31
  new wiki_cfg_1.WikiCfg(),
@@ -32,6 +35,8 @@ const Documents = [
32
35
  new documentation_1.WikiEngine(),
33
36
  new documentation_1.WikiNormalizedAst(),
34
37
  new documentation_1.WikiCore(),
38
+ new wiki_setup_1.WikiSetup(),
39
+ new wiki_overview_1.WikiOverview(),
35
40
  new documentation_1.WikiInterface(),
36
41
  new documentation_1.WikiDataflowGraph(),
37
42
  new documentation_1.WikiLintingAndTesting(),
@@ -82,7 +87,7 @@ async function makeAllWikis(force, filter) {
82
87
  console.log(`Setup for wiki generation took ${(new Date().getTime() - setupStart.getTime())}ms`);
83
88
  const changedWikis = new Set();
84
89
  try {
85
- const sortedDocs = sortByLeastRecentChanged(Documents);
90
+ const sortedDocs = sortByLeastRecentChanged(exports.AllWikiDocuments);
86
91
  console.log(`Generating ${sortedDocs.length} wikis/docs, sorted by most recently updated...`);
87
92
  for (const doc of sortedDocs) {
88
93
  const type = doc.getTarget().toLowerCase().includes('wiki') ? 'Wiki' : 'Doc';
package/config.d.ts CHANGED
@@ -152,6 +152,10 @@ export interface FlowrConfigOptions extends MergeableRecord {
152
152
  * Configuration options for abstract interpretation
153
153
  */
154
154
  readonly abstractInterpretation: {
155
+ /**
156
+ * The threshold for the number of visitations of a node at which widening should be performed to ensure the termination of the fixpoint iteration
157
+ */
158
+ readonly wideningThreshold: number;
155
159
  /**
156
160
  * The configuration of the shape inference for data frames
157
161
  */
@@ -160,10 +164,6 @@ export interface FlowrConfigOptions extends MergeableRecord {
160
164
  * The maximum number of columns names to infer for data frames before over-approximating the column names to top
161
165
  */
162
166
  readonly maxColNames: number;
163
- /**
164
- * The threshold for the number of visitations of a node at which widening should be performed to ensure the termination of the fixpoint iteration
165
- */
166
- readonly wideningThreshold: number;
167
167
  /**
168
168
  * Configuration options for reading data frame shapes from loaded external data files, such as CSV files
169
169
  */
package/config.js CHANGED
@@ -86,9 +86,9 @@ exports.defaultConfigOptions = {
86
86
  }
87
87
  },
88
88
  abstractInterpretation: {
89
+ wideningThreshold: 4,
89
90
  dataFrame: {
90
91
  maxColNames: 50,
91
- wideningThreshold: 4,
92
92
  readLoadedData: {
93
93
  readExternalFiles: true,
94
94
  maxReadLines: 1e6
@@ -30,19 +30,18 @@ class BasicCfgGuidedVisitor {
30
30
  return true;
31
31
  }
32
32
  startVisitor(start) {
33
- const g = this.config.controlFlow.graph;
34
- const n = this.config.defaultVisitingOrder === 'forward' ?
35
- (n) => g.ingoingEdges(n) :
36
- (n) => g.outgoingEdges(n);
33
+ const graph = this.config.controlFlow.graph;
34
+ const getNext = this.config.defaultVisitingOrder === 'forward' ?
35
+ (node) => graph.ingoingEdges(node)?.keys().toArray().toReversed() :
36
+ (node) => graph.outgoingEdges(node)?.keys().toArray();
37
37
  const stack = [...start];
38
38
  while (stack.length > 0) {
39
- const current = stack.shift();
39
+ const current = stack.pop();
40
40
  if (!this.visitNode(current)) {
41
41
  continue;
42
42
  }
43
- const outgoing = n(current) ?? [];
44
- for (const [to] of outgoing) {
45
- stack.unshift(to);
43
+ for (const next of getNext(current) ?? []) {
44
+ stack.push(next);
46
45
  }
47
46
  }
48
47
  }
@@ -58,7 +58,8 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
58
58
  graph: this.config.dfg,
59
59
  full: true,
60
60
  idMap: this.config.normalizedAst.idMap,
61
- resolve: this.config.ctx.config.solver.variables
61
+ resolve: this.config.ctx.config.solver.variables,
62
+ ctx: this.config.ctx,
62
63
  }));
63
64
  if (values === undefined || values.elements.length !== 1 || values.elements[0].type != 'logical' || !(0, r_value_1.isValue)(values.elements[0].value)) {
64
65
  this.unableToCalculateValue(id);
@@ -83,7 +84,7 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
83
84
  graph: this.config.dfg,
84
85
  full: true,
85
86
  idMap: this.config.normalizedAst.idMap,
86
- resolve: this.config.ctx.config.solver.variables
87
+ ctx: this.config.ctx,
87
88
  }));
88
89
  if (values === undefined || values.elements.length !== 1 || values.elements[0].type != 'logical' || !(0, r_value_1.isValue)(values.elements[0].value)) {
89
90
  return undefined;
@@ -103,7 +103,7 @@ export interface ReadOnlyControlFlowGraph {
103
103
  readonly rootIds: () => ReadonlySet<NodeId>;
104
104
  /**
105
105
  * Provide a view of all vertices in the graph.
106
- * @param includeBasicBlockElements - if true, the elements of basic block elements are included in the result, otherwise this will only the basic blocks themselves
106
+ * @param includeBasicBlockElements - if true, the elements of basic block elements are included in the result, otherwise only the basic blocks themselves are included
107
107
  * @see {@link ReadOnlyControlFlowGraph#rootVertexIds|rootVertexIds()} - for a way to get the root vertices of the graph.
108
108
  * @see {@link ReadOnlyControlFlowGraph#getVertex|getVertex()} - for a way to get a specific vertex by its id.
109
109
  * @see {@link ReadOnlyControlFlowGraph#edges|edges()} - for a way to get all edges in the graph.
@@ -205,7 +205,7 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
205
205
  * @protected
206
206
  */
207
207
  protected onUnnamedCall(_data: {
208
- vertex: DataflowGraphVertexFunctionCall;
208
+ call: DataflowGraphVertexFunctionCall;
209
209
  }): void;
210
210
  /**
211
211
  * This event triggers for every function call that is not handled by a specific overload,
@@ -115,7 +115,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
115
115
  visitFunctionCall(vertex) {
116
116
  super.visitFunctionCall(vertex);
117
117
  if (vertex.origin === 'unnamed') {
118
- this.onUnnamedCall({ vertex });
118
+ this.onUnnamedCall({ call: vertex });
119
119
  }
120
120
  else {
121
121
  this.onDispatchFunctionCallOrigins(vertex, vertex.origin);
@@ -39,7 +39,8 @@ function onlyLoopsOnce(loop, dataflow, controlflow, ast, ctx) {
39
39
  const values = (0, general_1.valueSetGuard)((0, alias_tracking_1.resolveIdToValue)(vectorOfLoop.nodeId, {
40
40
  graph: dataflow,
41
41
  idMap: dataflow.idMap,
42
- resolve: ctx.config.solver.variables
42
+ resolve: ctx.config.solver.variables,
43
+ ctx: ctx
43
44
  }));
44
45
  if (values === undefined || values.elements.length !== 1 || values.elements[0].type !== 'vector' || !(0, r_value_1.isValue)(values.elements[0].elements)) {
45
46
  return undefined;
@@ -75,7 +76,8 @@ class CfgSingleIterationLoopDetector extends semantic_cfg_guided_visitor_1.Seman
75
76
  graph: this.config.dfg,
76
77
  full: true,
77
78
  idMap: this.config.normalizedAst.idMap,
78
- resolve: this.config.ctx.config.solver.variables
79
+ resolve: this.config.ctx.config.solver.variables,
80
+ ctx: this.config.ctx
79
81
  }));
80
82
  if (values === undefined || values.elements.length !== 1 || values.elements[0].type != 'logical' || !(0, r_value_1.isValue)(values.elements[0].value)) {
81
83
  return undefined;
@@ -3,6 +3,7 @@ import { PipelineStepStage } from '../../pipeline-step';
3
3
  import type { DataflowInformation } from '../../../../dataflow/info';
4
4
  import type { SlicingCriteria } from '../../../../slicing/criterion/parse';
5
5
  import type { NormalizedAst } from '../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
6
+ import type { ReadOnlyFlowrAnalyzerContext } from '../../../../project/context/flowr-analyzer-context';
6
7
  export interface SliceRequiredInput {
7
8
  /** The slicing criterion is only of interest if you actually want to slice the R code */
8
9
  readonly criterion: SlicingCriteria;
@@ -10,6 +11,8 @@ export interface SliceRequiredInput {
10
11
  readonly threshold?: number;
11
12
  /** The direction to slice in. Defaults to backward slicing if unset. */
12
13
  readonly direction?: SliceDirection;
14
+ /** The context of the analysis */
15
+ readonly context?: ReadOnlyFlowrAnalyzerContext;
13
16
  }
14
17
  export declare enum SliceDirection {
15
18
  Backward = "backward",
@@ -10,7 +10,8 @@ var SliceDirection;
10
10
  })(SliceDirection || (exports.SliceDirection = SliceDirection = {}));
11
11
  function processor(results, input) {
12
12
  const direction = input.direction ?? SliceDirection.Backward;
13
- return (0, static_slicer_1.staticSlice)(results.dataflow, results.normalize, input.criterion, direction, input.threshold);
13
+ const threshold = input.threshold ?? input.context?.config.solver.slicer?.threshold;
14
+ return (0, static_slicer_1.staticSlice)(input.context, results.dataflow, results.normalize, input.criterion, direction, threshold);
14
15
  }
15
16
  exports.STATIC_SLICE = {
16
17
  name: 'slice',
@@ -22,6 +22,20 @@ export declare const DEFAULT_SLICING_PIPELINE: import("./pipeline").Pipeline<{
22
22
  };
23
23
  readonly dependencies: readonly [];
24
24
  readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
25
+ } | {
26
+ readonly name: "slice";
27
+ readonly humanReadableName: "static slice";
28
+ readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
29
+ readonly processor: (results: {
30
+ dataflow?: import("../../../dataflow/info").DataflowInformation;
31
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
32
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
33
+ readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
34
+ readonly printer: {
35
+ readonly 0: typeof import("../../print/print").internalPrinter;
36
+ };
37
+ readonly dependencies: readonly ["dataflow"];
38
+ readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
25
39
  } | {
26
40
  readonly name: "normalize";
27
41
  readonly humanReadableName: "normalize";
@@ -39,20 +53,6 @@ export declare const DEFAULT_SLICING_PIPELINE: import("./pipeline").Pipeline<{
39
53
  };
40
54
  readonly dependencies: readonly ["parse"];
41
55
  readonly requiredInput: import("../all/core/10-normalize").NormalizeRequiredInput;
42
- } | {
43
- readonly name: "slice";
44
- readonly humanReadableName: "static slice";
45
- readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
46
- readonly processor: (results: {
47
- dataflow?: import("../../../dataflow/info").DataflowInformation;
48
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
49
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
50
- readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
51
- readonly printer: {
52
- readonly 0: typeof import("../../print/print").internalPrinter;
53
- };
54
- readonly dependencies: readonly ["dataflow"];
55
- readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
56
56
  } | {
57
57
  readonly humanReadableName: "dataflow";
58
58
  readonly processor: (results: {
@@ -106,6 +106,20 @@ export declare const DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipeline"
106
106
  };
107
107
  readonly dependencies: readonly [];
108
108
  readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
109
+ } | {
110
+ readonly name: "slice";
111
+ readonly humanReadableName: "static slice";
112
+ readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
113
+ readonly processor: (results: {
114
+ dataflow?: import("../../../dataflow/info").DataflowInformation;
115
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
116
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
117
+ readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
118
+ readonly printer: {
119
+ readonly 0: typeof import("../../print/print").internalPrinter;
120
+ };
121
+ readonly dependencies: readonly ["dataflow"];
122
+ readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
109
123
  } | {
110
124
  readonly name: "normalize";
111
125
  readonly humanReadableName: "normalize";
@@ -123,20 +137,6 @@ export declare const DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipeline"
123
137
  };
124
138
  readonly dependencies: readonly ["parse"];
125
139
  readonly requiredInput: import("../all/core/10-normalize").NormalizeRequiredInput;
126
- } | {
127
- readonly name: "slice";
128
- readonly humanReadableName: "static slice";
129
- readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
130
- readonly processor: (results: {
131
- dataflow?: import("../../../dataflow/info").DataflowInformation;
132
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
133
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
134
- readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
135
- readonly printer: {
136
- readonly 0: typeof import("../../print/print").internalPrinter;
137
- };
138
- readonly dependencies: readonly ["dataflow"];
139
- readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
140
140
  } | {
141
141
  readonly humanReadableName: "dataflow";
142
142
  readonly processor: (results: {
@@ -190,6 +190,20 @@ export declare const DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./pipel
190
190
  };
191
191
  readonly dependencies: readonly [];
192
192
  readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
193
+ } | {
194
+ readonly name: "slice";
195
+ readonly humanReadableName: "static slice";
196
+ readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
197
+ readonly processor: (results: {
198
+ dataflow?: import("../../../dataflow/info").DataflowInformation;
199
+ normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
200
+ }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
201
+ readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
202
+ readonly printer: {
203
+ readonly 0: typeof import("../../print/print").internalPrinter;
204
+ };
205
+ readonly dependencies: readonly ["dataflow"];
206
+ readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
193
207
  } | {
194
208
  readonly name: "normalize";
195
209
  readonly humanReadableName: "normalize";
@@ -207,20 +221,6 @@ export declare const DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./pipel
207
221
  };
208
222
  readonly dependencies: readonly ["parse"];
209
223
  readonly requiredInput: import("../all/core/10-normalize").NormalizeRequiredInput;
210
- } | {
211
- readonly name: "slice";
212
- readonly humanReadableName: "static slice";
213
- readonly description: "Calculate the actual static slice from the dataflow graph and the given slicing criteria";
214
- readonly processor: (results: {
215
- dataflow?: import("../../../dataflow/info").DataflowInformation;
216
- normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
217
- }, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
218
- readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
219
- readonly printer: {
220
- readonly 0: typeof import("../../print/print").internalPrinter;
221
- };
222
- readonly dependencies: readonly ["dataflow"];
223
- readonly requiredInput: import("../all/static-slicing/00-slice").SliceRequiredInput;
224
224
  } | {
225
225
  readonly humanReadableName: "dataflow";
226
226
  readonly processor: (results: {
@@ -10,13 +10,13 @@ const assert_1 = require("../util/assert");
10
10
  function findAllClusters(graph) {
11
11
  const clusters = [];
12
12
  // we reverse the vertices since dependencies usually point "backwards" from later nodes
13
- const notReached = new Set([...graph.vertices(true)].map(([id]) => id).reverse());
13
+ const notReached = new Set(graph.vertices(true).map(([id]) => id).toArray().reverse());
14
14
  while (notReached.size > 0) {
15
15
  const [startNode] = notReached;
16
16
  notReached.delete(startNode);
17
17
  clusters.push({
18
18
  startNode: startNode,
19
- members: [...makeCluster(graph, startNode, notReached)],
19
+ members: Array.from(makeCluster(graph, startNode, notReached)),
20
20
  hasUnknownSideEffects: graph.unknownSideEffects.has(startNode)
21
21
  });
22
22
  }
@@ -1,4 +1,9 @@
1
1
  import { type REnvironmentInformation } from './environment';
2
+ import type { IdentifierDefinition } from './identifier';
3
+ /**
4
+ * Merges two arrays of identifier definitions, ensuring uniqueness based on `nodeId` and `definedAt`.
5
+ */
6
+ export declare function uniqueMergeValuesInDefinitions(old: IdentifierDefinition[], value: readonly IdentifierDefinition[]): IdentifierDefinition[];
2
7
  /**
3
8
  * Adds all writes of `next` to `base` (i.e., the operations of `next` *might* happen).
4
9
  */
@@ -1,9 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uniqueMergeValuesInDefinitions = uniqueMergeValuesInDefinitions;
3
4
  exports.appendEnvironment = appendEnvironment;
4
5
  const assert_1 = require("../../util/assert");
5
- const environment_1 = require("./environment");
6
- function uniqueMergeValues(old, value) {
6
+ /**
7
+ * Merges two arrays of identifier definitions, ensuring uniqueness based on `nodeId` and `definedAt`.
8
+ */
9
+ function uniqueMergeValuesInDefinitions(old, value) {
7
10
  const result = old;
8
11
  for (const v of value) {
9
12
  const find = result.findIndex(o => o.nodeId === v.nodeId && o.definedAt === v.definedAt);
@@ -13,23 +16,6 @@ function uniqueMergeValues(old, value) {
13
16
  }
14
17
  return result;
15
18
  }
16
- function appendIEnvironmentWith(base, next) {
17
- (0, assert_1.guard)(base !== undefined && next !== undefined, 'can not append environments with undefined');
18
- const map = new Map(base.memory);
19
- for (const [key, value] of next.memory) {
20
- const old = map.get(key);
21
- if (old) {
22
- map.set(key, uniqueMergeValues(old, value));
23
- }
24
- else {
25
- map.set(key, value);
26
- }
27
- }
28
- const parent = base.parent.builtInEnv ? base.parent : appendIEnvironmentWith(base.parent, next.parent);
29
- const out = new environment_1.Environment(parent);
30
- out.memory = map;
31
- return out;
32
- }
33
19
  function appendEnvironment(base, next) {
34
20
  if (base === undefined) {
35
21
  return next;
@@ -39,7 +25,7 @@ function appendEnvironment(base, next) {
39
25
  }
40
26
  (0, assert_1.guard)(base.level === next.level, 'environments must have the same level to be handled, it is up to the caller to ensure that');
41
27
  return {
42
- current: appendIEnvironmentWith(base.current, next.current),
28
+ current: base.current.append(next.current),
43
29
  level: base.level,
44
30
  };
45
31
  }
@@ -33,6 +33,7 @@ import { resolveAsMinus, resolveAsPlus, resolveAsSeq, resolveAsVector } from '..
33
33
  import type { DataflowGraph } from '../graph/graph';
34
34
  import type { VariableResolve } from '../../config';
35
35
  import type { BuiltInConstantDefinition, BuiltInDefinition, BuiltInFunctionDefinition, BuiltInReplacementDefinition } from './built-in-config';
36
+ import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
36
37
  export type BuiltIn = `built-in:${string}`;
37
38
  /**
38
39
  * Generate a built-in id for the given name
@@ -69,7 +70,7 @@ export interface DefaultBuiltInProcessorConfiguration extends ForceArguments {
69
70
  */
70
71
  readonly useAsProcessor?: UseAsProcessors;
71
72
  }
72
- export type BuiltInEvalHandler = (resolve: VariableResolve, a: RNodeWithParent, env?: REnvironmentInformation, graph?: DataflowGraph, map?: AstIdMap) => Value;
73
+ export type BuiltInEvalHandler = (resolve: VariableResolve, a: RNodeWithParent, ctx: ReadOnlyFlowrAnalyzerContext, env?: REnvironmentInformation, graph?: DataflowGraph, map?: AstIdMap) => Value;
73
74
  declare function defaultBuiltInProcessor<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, { returnsNthArgument, useAsProcessor, forceArgs, readAllArguments, cfg, hasUnknownSideEffects, treatAsFnCall }: DefaultBuiltInProcessorConfiguration): DataflowInformation;
74
75
  export declare const BuiltInProcessorMapper: {
75
76
  readonly 'builtin:default': typeof defaultBuiltInProcessor;
@@ -4,4 +4,4 @@ import { type REnvironmentInformation } from './environment';
4
4
  * @param environment - The environment information to clone.
5
5
  * @param recurseParents - Whether to clone the parent environments as well.
6
6
  */
7
- export declare function cloneEnvironmentInformation(environment: REnvironmentInformation, recurseParents?: boolean): REnvironmentInformation;
7
+ export declare function cloneEnvironmentInformation({ current, level }: REnvironmentInformation, recurseParents?: boolean): REnvironmentInformation;