@eagleoutice/flowr 2.2.11 → 2.2.13

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 (301) hide show
  1. package/README.md +82 -20
  2. package/benchmark/slicer.d.ts +49 -22
  3. package/benchmark/slicer.js +89 -29
  4. package/benchmark/stats/print.js +16 -10
  5. package/benchmark/stats/size-of.js +18 -1
  6. package/benchmark/stats/stats.d.ts +3 -0
  7. package/benchmark/summarizer/first-phase/input.js +1 -1
  8. package/benchmark/summarizer/first-phase/process.js +3 -3
  9. package/benchmark/summarizer/second-phase/process.js +9 -3
  10. package/benchmark/summarizer/summarizer.js +1 -1
  11. package/cli/benchmark-app.d.ts +5 -0
  12. package/cli/benchmark-app.js +49 -6
  13. package/cli/benchmark-helper-app.d.ts +4 -0
  14. package/cli/benchmark-helper-app.js +20 -4
  15. package/cli/common/options.js +15 -6
  16. package/cli/common/script.js +1 -1
  17. package/cli/flowr.js +1 -1
  18. package/cli/repl/commands/repl-cfg.d.ts +2 -0
  19. package/cli/repl/commands/repl-cfg.js +38 -24
  20. package/cli/repl/commands/repl-commands.js +6 -2
  21. package/cli/repl/commands/repl-dataflow.d.ts +2 -0
  22. package/cli/repl/commands/repl-dataflow.js +37 -3
  23. package/cli/repl/commands/repl-execute.js +1 -1
  24. package/cli/repl/commands/repl-main.d.ts +1 -1
  25. package/cli/repl/commands/repl-main.js +1 -1
  26. package/cli/repl/commands/repl-normalize.js +1 -1
  27. package/cli/repl/commands/repl-query.js +2 -2
  28. package/cli/repl/core.js +1 -1
  29. package/cli/repl/prompt.js +1 -1
  30. package/cli/repl/server/connection.js +4 -4
  31. package/cli/repl/server/messages/message-analysis.d.ts +1 -1
  32. package/cli/script-core/statistics-core.js +1 -1
  33. package/cli/script-core/statistics-helper-core.js +4 -4
  34. package/config.d.ts +60 -21
  35. package/config.js +24 -4
  36. package/control-flow/basic-cfg-guided-visitor.d.ts +39 -0
  37. package/control-flow/basic-cfg-guided-visitor.js +114 -0
  38. package/control-flow/cfg-properties.d.ts +26 -0
  39. package/control-flow/cfg-properties.js +100 -0
  40. package/control-flow/cfg-simplification.d.ts +18 -0
  41. package/control-flow/cfg-simplification.js +55 -0
  42. package/control-flow/cfg-to-basic-blocks.d.ts +5 -0
  43. package/control-flow/cfg-to-basic-blocks.js +81 -0
  44. package/control-flow/control-flow-graph.d.ts +247 -0
  45. package/control-flow/control-flow-graph.js +290 -0
  46. package/control-flow/dfg-cfg-guided-visitor.d.ts +32 -0
  47. package/control-flow/dfg-cfg-guided-visitor.js +71 -0
  48. package/control-flow/diff-cfg.d.ts +11 -0
  49. package/control-flow/diff-cfg.js +161 -0
  50. package/control-flow/extract-cfg.d.ts +30 -0
  51. package/control-flow/extract-cfg.js +475 -0
  52. package/control-flow/happens-before.d.ts +7 -0
  53. package/{util/cfg → control-flow}/happens-before.js +3 -3
  54. package/control-flow/semantic-cfg-guided-visitor.d.ts +452 -0
  55. package/control-flow/semantic-cfg-guided-visitor.js +492 -0
  56. package/control-flow/simple-visitor.d.ts +25 -0
  57. package/control-flow/simple-visitor.js +80 -0
  58. package/control-flow/syntax-cfg-guided-visitor.d.ts +128 -0
  59. package/control-flow/syntax-cfg-guided-visitor.js +166 -0
  60. package/core/print/print.d.ts +1 -1
  61. package/core/print/slice-diff-ansi.js +1 -1
  62. package/core/steps/pipeline/create-pipeline.js +1 -1
  63. package/dataflow/environments/built-in-config.d.ts +5 -2
  64. package/dataflow/environments/built-in-config.js +17 -8
  65. package/dataflow/environments/built-in.d.ts +16 -5
  66. package/dataflow/environments/built-in.js +55 -6
  67. package/dataflow/environments/clone.d.ts +5 -0
  68. package/dataflow/environments/clone.js +5 -0
  69. package/dataflow/environments/default-builtin-config.d.ts +2 -0
  70. package/dataflow/environments/default-builtin-config.js +164 -13
  71. package/dataflow/environments/define.d.ts +5 -1
  72. package/dataflow/environments/define.js +36 -10
  73. package/dataflow/environments/overwrite.js +4 -0
  74. package/dataflow/environments/remove.d.ts +6 -0
  75. package/dataflow/environments/remove.js +24 -0
  76. package/dataflow/environments/resolve-by-name.js +16 -5
  77. package/dataflow/extractor.js +2 -2
  78. package/dataflow/graph/dataflowgraph-builder.d.ts +79 -7
  79. package/dataflow/graph/dataflowgraph-builder.js +106 -8
  80. package/dataflow/graph/diff-dataflow-graph.d.ts +16 -0
  81. package/dataflow/graph/{diff.js → diff-dataflow-graph.js} +30 -56
  82. package/dataflow/graph/graph.d.ts +17 -4
  83. package/dataflow/graph/graph.js +51 -12
  84. package/dataflow/graph/vertex.d.ts +59 -4
  85. package/dataflow/graph/vertex.js +32 -0
  86. package/dataflow/internal/linker.d.ts +3 -2
  87. package/dataflow/internal/linker.js +36 -25
  88. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
  89. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -1
  90. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -0
  91. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +67 -54
  92. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +6 -4
  93. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +108 -21
  94. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +54 -17
  95. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +10 -0
  96. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +140 -0
  97. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -4
  98. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -2
  99. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +15 -4
  100. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +4 -3
  101. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -3
  102. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -3
  103. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +51 -17
  104. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
  105. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +9 -7
  106. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +3 -2
  107. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +4 -0
  108. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +100 -31
  109. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +7 -0
  110. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +41 -0
  111. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +35 -8
  112. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +4 -3
  113. package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +15 -0
  114. package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +75 -0
  115. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
  116. package/dataflow/internal/process/functions/call/common.d.ts +5 -2
  117. package/dataflow/internal/process/functions/call/common.js +9 -5
  118. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -2
  119. package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
  120. package/dataflow/internal/process/functions/call/named-call-handling.d.ts +2 -0
  121. package/dataflow/internal/process/functions/call/named-call-handling.js +10 -6
  122. package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +1 -0
  123. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +6 -4
  124. package/dataflow/internal/process/process-named-call.d.ts +4 -1
  125. package/dataflow/internal/process/process-named-call.js +8 -5
  126. package/dataflow/origin/dfg-get-origin.d.ts +82 -0
  127. package/dataflow/origin/dfg-get-origin.js +116 -0
  128. package/documentation/doc-util/doc-cfg.d.ts +20 -4
  129. package/documentation/doc-util/doc-cfg.js +41 -7
  130. package/documentation/doc-util/doc-cli-option.js +4 -2
  131. package/documentation/doc-util/doc-code.js +10 -2
  132. package/documentation/doc-util/doc-dfg.js +3 -3
  133. package/documentation/doc-util/doc-escape.d.ts +7 -0
  134. package/documentation/doc-util/doc-escape.js +19 -0
  135. package/documentation/doc-util/doc-files.d.ts +1 -0
  136. package/documentation/doc-util/doc-files.js +2 -1
  137. package/documentation/doc-util/doc-normalized-ast.js +3 -3
  138. package/documentation/doc-util/doc-query.js +2 -2
  139. package/documentation/doc-util/doc-repl.js +1 -1
  140. package/documentation/doc-util/doc-search.js +1 -1
  141. package/documentation/doc-util/doc-server-message.js +2 -2
  142. package/documentation/doc-util/doc-structure.d.ts +1 -0
  143. package/documentation/doc-util/doc-structure.js +5 -0
  144. package/documentation/doc-util/doc-types.d.ts +7 -1
  145. package/documentation/doc-util/doc-types.js +13 -2
  146. package/documentation/print-capabilities-markdown.js +28 -2
  147. package/documentation/print-cfg-wiki.d.ts +1 -0
  148. package/documentation/print-cfg-wiki.js +572 -0
  149. package/documentation/print-core-wiki.js +2 -2
  150. package/documentation/print-dataflow-graph-wiki.js +180 -25
  151. package/documentation/print-engines-wiki.js +1 -1
  152. package/documentation/print-faq-wiki.d.ts +1 -0
  153. package/documentation/print-faq-wiki.js +75 -0
  154. package/documentation/print-interface-wiki.js +2 -1
  155. package/documentation/print-linting-and-testing-wiki.js +52 -36
  156. package/documentation/print-normalized-ast-wiki.js +1 -1
  157. package/documentation/print-onboarding-wiki.d.ts +1 -0
  158. package/documentation/print-onboarding-wiki.js +42 -0
  159. package/documentation/print-query-wiki.js +23 -3
  160. package/documentation/print-readme.js +10 -3
  161. package/package.json +10 -6
  162. package/queries/catalog/call-context-query/call-context-query-executor.js +5 -5
  163. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
  164. package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
  165. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +2 -2
  166. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +24 -21
  167. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
  168. package/queries/catalog/cluster-query/cluster-query-format.js +1 -1
  169. package/queries/catalog/config-query/config-query-format.d.ts +1 -1
  170. package/queries/catalog/config-query/config-query-format.js +2 -2
  171. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
  172. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
  173. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
  174. package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
  175. package/queries/catalog/dependencies-query/dependencies-query-executor.js +17 -7
  176. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +2 -26
  177. package/queries/catalog/dependencies-query/dependencies-query-format.js +4 -147
  178. package/queries/catalog/dependencies-query/function-info/function-info.d.ts +24 -0
  179. package/queries/catalog/dependencies-query/function-info/function-info.js +10 -0
  180. package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +2 -0
  181. package/queries/catalog/dependencies-query/function-info/library-functions.js +18 -0
  182. package/queries/catalog/dependencies-query/function-info/read-functions.d.ts +2 -0
  183. package/queries/catalog/dependencies-query/function-info/read-functions.js +101 -0
  184. package/queries/catalog/dependencies-query/function-info/source-functions.d.ts +2 -0
  185. package/queries/catalog/dependencies-query/function-info/source-functions.js +11 -0
  186. package/queries/catalog/dependencies-query/function-info/write-functions.d.ts +2 -0
  187. package/queries/catalog/dependencies-query/function-info/write-functions.js +87 -0
  188. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
  189. package/queries/catalog/happens-before-query/happens-before-query-executor.js +4 -4
  190. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
  191. package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
  192. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
  193. package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
  194. package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -1
  195. package/queries/catalog/lineage-query/lineage-query-format.js +2 -2
  196. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  197. package/queries/catalog/location-map-query/location-map-query-format.js +2 -2
  198. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
  199. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -2
  200. package/queries/catalog/origin-query/origin-query-executor.d.ts +5 -0
  201. package/queries/catalog/origin-query/origin-query-executor.js +33 -0
  202. package/queries/catalog/origin-query/origin-query-format.d.ts +71 -0
  203. package/queries/catalog/origin-query/origin-query-format.js +27 -0
  204. package/queries/catalog/project-query/project-query-format.d.ts +1 -1
  205. package/queries/catalog/project-query/project-query-format.js +2 -2
  206. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  207. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -2
  208. package/queries/catalog/search-query/search-query-format.d.ts +1 -1
  209. package/queries/catalog/search-query/search-query-format.js +2 -2
  210. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
  211. package/queries/catalog/static-slice-query/static-slice-query-format.js +2 -2
  212. package/queries/query-print.d.ts +1 -1
  213. package/queries/query-print.js +4 -4
  214. package/queries/query.d.ts +61 -2
  215. package/queries/query.js +3 -1
  216. package/r-bridge/data/data.d.ts +2 -2
  217. package/r-bridge/data/data.js +2 -2
  218. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -2
  219. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +5 -0
  220. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -2
  221. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +5 -0
  222. package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +1 -1
  223. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -1
  224. package/r-bridge/lang-4.x/ast/model/processing/fold.js +3 -1
  225. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
  226. package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
  227. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +1 -1
  228. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
  229. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
  230. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -1
  231. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +1 -1
  232. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +1 -1
  233. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -1
  234. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +2 -2
  235. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +4 -4
  236. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +26 -8
  237. package/r-bridge/retriever.js +1 -1
  238. package/search/search-executor/search-generators.d.ts +1 -1
  239. package/search/search-executor/search-transformer.d.ts +1 -1
  240. package/slicing/criterion/collect-all.js +1 -1
  241. package/slicing/static/slice-call.js +13 -3
  242. package/statistics/features/supported/assignments/post-process.js +1 -1
  243. package/statistics/features/supported/defined-functions/post-process.js +2 -2
  244. package/statistics/features/supported/used-functions/post-process.js +1 -1
  245. package/statistics/features/supported/used-packages/post-process.js +2 -2
  246. package/statistics/features/supported/values/post-process.js +2 -2
  247. package/statistics/output/print-stats.js +2 -2
  248. package/statistics/summarizer/post-process/clusterer.d.ts +1 -1
  249. package/statistics/summarizer/post-process/clusterer.js +1 -1
  250. package/statistics/summarizer/post-process/histogram.js +3 -3
  251. package/statistics/summarizer/post-process/post-process-output.js +3 -3
  252. package/statistics/summarizer/second-phase/process.js +2 -2
  253. package/statistics/summarizer/summarizer.js +2 -2
  254. package/util/assert.js +36 -1
  255. package/util/cfg/cfg.d.ts +0 -80
  256. package/util/cfg/cfg.js +0 -549
  257. package/util/{arrays.d.ts → collections/arrays.d.ts} +24 -1
  258. package/util/{arrays.js → collections/arrays.js} +44 -3
  259. package/util/collections/set.js +17 -0
  260. package/util/{list-access.d.ts → containers.d.ts} +24 -4
  261. package/util/{list-access.js → containers.js} +42 -12
  262. package/util/diff-graph.d.ts +47 -0
  263. package/util/diff-graph.js +61 -0
  264. package/util/diff.d.ts +6 -6
  265. package/util/diff.js +1 -1
  266. package/util/mermaid/ast.js +12 -1
  267. package/util/mermaid/cfg.d.ts +9 -2
  268. package/util/mermaid/cfg.js +65 -13
  269. package/util/mermaid/dfg.d.ts +2 -1
  270. package/util/mermaid/dfg.js +26 -10
  271. package/util/mermaid/mermaid.d.ts +2 -0
  272. package/util/mermaid/mermaid.js +6 -0
  273. package/util/parallel.d.ts +2 -1
  274. package/util/parallel.js +11 -2
  275. package/util/prefix.d.ts +13 -0
  276. package/util/prefix.js +34 -0
  277. package/util/quads.js +1 -1
  278. package/util/schema.d.ts +1 -1
  279. package/util/schema.js +1 -1
  280. package/util/summarizer.js +1 -1
  281. package/util/{text.js → text/text.js} +1 -1
  282. package/util/{time.js → text/time.js} +1 -1
  283. package/util/version.js +1 -1
  284. package/dataflow/graph/diff.d.ts +0 -36
  285. package/util/cfg/happens-before.d.ts +0 -7
  286. package/util/cfg/visitor.d.ts +0 -9
  287. package/util/cfg/visitor.js +0 -30
  288. package/util/set.js +0 -31
  289. /package/util/{bimap.d.ts → collections/bimap.d.ts} +0 -0
  290. /package/util/{bimap.js → collections/bimap.js} +0 -0
  291. /package/util/{defaultmap.d.ts → collections/defaultmap.d.ts} +0 -0
  292. /package/util/{defaultmap.js → collections/defaultmap.js} +0 -0
  293. /package/util/{set.d.ts → collections/set.d.ts} +0 -0
  294. /package/util/{ansi.d.ts → text/ansi.d.ts} +0 -0
  295. /package/util/{ansi.js → text/ansi.js} +0 -0
  296. /package/util/{args.d.ts → text/args.d.ts} +0 -0
  297. /package/util/{args.js → text/args.js} +0 -0
  298. /package/util/{strings.d.ts → text/strings.d.ts} +0 -0
  299. /package/util/{strings.js → text/strings.js} +0 -0
  300. /package/util/{text.d.ts → text/text.d.ts} +0 -0
  301. /package/util/{time.d.ts → text/time.d.ts} +0 -0
@@ -22,32 +22,34 @@ function getText() {
22
22
  For the latest code coverage information, see [codecov.io](${doc_files_1.FlowrCodecovRef}),
23
23
  for the latest benchmark results, see the [benchmark results](${doc_files_1.FlowrSiteBaseRef}/wiki/stats/benchmark) wiki page.
24
24
 
25
- - [Testing Suites](#testing-suites)
26
- - [Functionality Tests](#functionality-tests)
27
- - [Test Structure](#test-structure)
28
- - [Writing a Test](#writing-a-test)
29
- - [Running Only Some Tests](#running-only-some-tests)
30
- - [System Tests](#system-tests)
31
- - [Performance Tests](#performance-tests)
32
- - [Oh no, the tests are slow](#oh-no-the-tests-are-slow)
33
- - [Testing Within Your IDE](#testing-within-your-ide)
25
+ - [🏨 Testing Suites](#testing-suites)
26
+ - [🧪 Functionality Tests](#functionality-tests)
27
+ - [🏗️ Test Structure](#test-structure)
28
+ - [🏷️ Test Labels](#test-labels)
29
+ - [🖋️ Writing a Test](#writing-a-test)
30
+ - [🤏 Running Only Some Tests](#running-only-some-tests)
31
+ - [💽 System Tests](#system-tests)
32
+ - [💃 Performance Tests](#performance-tests)
33
+ - [📝 Testing Within Your IDE](#testing-within-your-ide)
34
34
  - [VS Code](#vs-code)
35
35
  - [Webstorm](#webstorm)
36
- - [CI Pipeline](#ci-pipeline)
37
- - [Linting](#linting)
36
+ - [🪈 CI Pipeline](#ci-pipeline)
37
+ - [🧹 Linting](#linting)
38
38
  - [Oh no, the linter fails](#oh-no-the-linter-fails)
39
39
  - [License Checker](#license-checker)
40
- - [Debugging](#debugging)
40
+ - [🐛 Debugging](#debugging)
41
41
  - [VS Code](#vs-code-1)
42
42
 
43
- ## Testing Suites
43
+ <a id='testing-suites'></a>
44
+ ## 🏨 Testing Suites
44
45
 
45
46
  Currently, flowR contains three testing suites: one for [functionality](#functionality-tests),
46
47
  one for [system tests](#system-tests), and one for [performance](#performance-tests). We explain each of them in the following.
47
48
  In addition to running those tests, you can use the more generalized \`npm run checkup\`.
48
49
  This command includes the construction of the docker image, the generation of the wiki pages, and the linter.
49
50
 
50
- ### Functionality Tests
51
+ <a id='functionality-tests'></a>
52
+ ### 🧪 Functionality Tests
51
53
 
52
54
  The functionality tests represent conventional unit (and depending on your terminology component/api) tests.
53
55
  We use [vitest](https://vitest.dev/) as our testing framework.
@@ -75,7 +77,8 @@ some tests may be skipped automatically as they do not apply to your current sys
75
77
  Each test can specify such requirements as part of the \`TestConfiguration\`, which is then used in the \`test.skipIf\` function of _vitest_.
76
78
  It is up to the [ci](#ci-pipeline) to run the tests on different systems to ensure that those tests run.
77
79
 
78
- #### Test Structure
80
+ <a id='test-structure'></a>
81
+ #### 🏗️ Test Structure
79
82
 
80
83
  All functionality tests are to be located under [test/functionality](${doc_files_1.RemoteFlowrFilePathBaseRef}/test/functionality).
81
84
 
@@ -94,15 +97,24 @@ to disable parallel execution for the respective test (otherwise, such tests are
94
97
  `
95
98
  })}
96
99
 
97
- #### Writing a Test
100
+ <a id='test-labels'></a>
101
+ #### 🏷️ Test Labels
98
102
 
99
- Currently, this is heavily dependent on what you want to test (normalization, dataflow, quad-export, …)
100
- and it is probably best to have a look at existing tests in that area to get an idea of what comfort functionality is available.
103
+ Generally, tests are [labeled](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/_helper/label.ts) according to the *flowR* capabilities they test.
101
104
 
102
- Generally, tests should be [labeled](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/_helper/label.ts) according to the *flowR* capabilities they test.
103
105
  The set of currently supported capabilities and their IDs can be found in ${(0, doc_files_1.getFilePathMd)('../r-bridge/data/data.ts')}.
106
+
104
107
  The resulting labels are used in the test report that is generated as part of the test output.
105
108
  They group tests by the capabilities they test and allow the report to display how many tests ensure that any given capability is properly supported.
109
+ The report can be found on the wiki's [capabilities page](${doc_files_1.FlowrWikiBaseRef}/Capabilities).
110
+
111
+ To add new labels, simply add them to the relevant section in ${(0, doc_files_1.getFilePathMd)('../r-bridge/data/data.ts')} as part of a pull request.
112
+
113
+ <a id='writing-a-test'></a>
114
+ #### 🖋️ Writing a Test
115
+
116
+ Currently, this is heavily dependent on what you want to test (normalization, dataflow, quad-export, …)
117
+ and it is probably best to have a look at existing tests in that area to get an idea of what comfort functionality is available.
106
118
 
107
119
  Various helper functions are available to ease in writing tests with common behaviors, like testing for dataflow, slicing or query results.
108
120
  These can be found in [the \`_helper\` subdirectory](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/_helper).
@@ -136,12 +148,14 @@ assertDataflow(label('without distractors', [...OperatorDatabase['<-'].capabilit
136
148
  );
137
149
  `)}
138
150
 
139
- #### Running Only Some Tests
151
+ <a id='running-only-some-tests'></a>
152
+ #### 🤏 Running Only Some Tests
140
153
 
141
154
  To run only some tests, vitest allows you to [filter](https://vitest.dev/guide/filtering.html) tests.
142
155
  Besides, you can use the watch mode (with \`npm run test\`) to only run tests that are affected by your changes.
143
156
 
144
- ### System Tests
157
+ <a id='system-tests'></a>
158
+ ### 💽 System Tests
145
159
 
146
160
  In contrast to the [functionality tests](#functionality-tests), the system tests use runners like the \`npm\` scripts
147
161
  to test the behavior of the whole system, for example, by running the CLI or the server.
@@ -154,9 +168,8 @@ with the [functionality tests](#functionality-tests)).
154
168
 
155
169
  Have a look at the [test/system-tests](${doc_files_1.RemoteFlowrFilePathBaseRef}test/system-tests) folder for more information.
156
170
 
157
-
158
-
159
- ### Performance Tests
171
+ <a id='performance-tests'></a>
172
+ ### 💃 Performance Tests
160
173
 
161
174
  The performance test suite of *flowR* uses several suites to check for variations in the required times for certain steps.
162
175
  Although we measure wall time in the CI (which is subject to rather large variations), it should give a rough idea *flowR*'s performance.
@@ -167,8 +180,8 @@ ${(0, doc_code_1.codeBlock)('shell', 'npm run performance-test')}
167
180
 
168
181
  See [test/performance](${doc_files_1.RemoteFlowrFilePathBaseRef}test/performance) for more information on the suites, how to run them, and their results. If you are interested in the results of the benchmarks, see [here](${doc_files_1.FlowrSiteBaseRef}/wiki/stats/benchmark).
169
182
 
170
-
171
- ### Testing Within Your IDE
183
+ <a id='testing-within-your-ide'></a>
184
+ ### 📝 Testing Within Your IDE
172
185
 
173
186
  #### VS Code
174
187
 
@@ -188,8 +201,8 @@ To get started, install the [vitest Extension](https://marketplace.visualstudio.
188
201
 
189
202
  Please follow the official guide [here](https://www.jetbrains.com/help/webstorm/vitest.html).
190
203
 
191
-
192
- ## CI Pipeline
204
+ <a id='ci-pipeline'></a>
205
+ ## 🪈 CI Pipeline
193
206
 
194
207
  We have several workflows defined in [.github/workflows](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/).
195
208
  We explain the most important workflows in the following:
@@ -203,8 +216,9 @@ We explain the most important workflows in the following:
203
216
  - deploying the documentation to [GitHub Pages](${doc_files_1.FlowrSiteBaseRef}/doc/)
204
217
  - [release.yaml](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/release.yaml) is responsible for creating a new release, only to be run by repository owners. Furthermore, it adds the new docker image to [docker hub](${doc_files_1.FlowrDockerRef}).
205
218
  - [broken-links-and-wiki.yaml](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/workflows/broken-links-and-wiki.yaml) repeatedly tests that all links are not dead!
206
-
207
- ## Linting
219
+
220
+ <a id='linting'></a>
221
+ ## 🧹 Linting
208
222
 
209
223
  There are two linting scripts.
210
224
  The main one:
@@ -222,21 +236,23 @@ eslint can automatically fix several linting problems[](https://eslint.org/docs/
222
236
  So you may be fine by just running:
223
237
 
224
238
  ${(0, doc_code_1.codeBlock)('shell', 'npm run lint-local -- --fix')}
225
-
226
- ### Oh no, the linter fails
239
+
240
+ <a id='oh-no-the-linter-fails'></a>
241
+ ### 💥 Oh no, the linter fails
227
242
 
228
243
  By now, the rules should be rather stable and so, if the linter fails,
229
244
  it is usually best if you (when necessary) read the respective description and fix the respective problem.
230
245
  Rules in this project cover general JavaScript issues [using regular ESLint](https://eslint.org/docs/latest/rules), TypeScript-specific issues [using typescript-eslint](https://typescript-eslint.io/rules/), and code formatting [with ESLint Stylistic](https://eslint.style/packages/default#rules).
231
246
 
232
247
  However, in case you think that the linter is wrong, please do not hesitate to open a [new issue](${doc_files_1.FlowrGithubBaseRef}/flowr/issues/new/choose).
233
-
234
- ### License Checker
248
+
249
+ <a id='license-checker'></a>
250
+ ### 🪪 License Checker
235
251
 
236
252
  *flowR* is licensed under the [GPLv3 License](${doc_files_1.FlowrGithubBaseRef}/flowr/blob/main/LICENSE) requiring us to only rely on [compatible licenses](https://www.gnu.org/licenses/license-list.en.html). For now, this list is hardcoded as part of the npm [\`license-compat\`](${doc_files_1.RemoteFlowrFilePathBaseRef}/package.json) script so it can very well be that a new dependency you add causes the checker to fail &mdash; *even though it is compatible*. In that case, please either open a [new issue](${doc_files_1.FlowrGithubBaseRef}/flowr/issues/new/choose) or directly add the license to the list (including a reference to why it is compatible).
237
253
 
238
-
239
- ## Debugging
254
+ <a id='debugging'></a>
255
+ ## 🐛 Debugging
240
256
  ### VS Code
241
257
  When working with VS Code, you can attach a debugger to the REPL. This works automatically by running the \`Start Debugging\` command (\`F5\` by default).
242
258
  You can also set the \`Auto Attach Filter\` setting to automatically attach the debugger, when running \`npm run flowr\`.
@@ -12,7 +12,7 @@ const doc_types_1 = require("./doc-util/doc-types");
12
12
  const path_1 = __importDefault(require("path"));
13
13
  const doc_files_1 = require("./doc-util/doc-files");
14
14
  const doc_cli_option_1 = require("./doc-util/doc-cli-option");
15
- const time_1 = require("../util/time");
15
+ const time_1 = require("../util/text/time");
16
16
  const doc_structure_1 = require("./doc-util/doc-structure");
17
17
  const pipeline_executor_1 = require("../core/pipeline-executor");
18
18
  const retriever_1 = require("../r-bridge/retriever");
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const log_1 = require("../../test/functionality/_helper/log");
4
+ const doc_files_1 = require("./doc-util/doc-files");
5
+ const doc_code_1 = require("./doc-util/doc-code");
6
+ const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
7
+ function print() {
8
+ return `${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'developer onboarding process' })}
9
+
10
+ To get started developing on *flowR*, we recommend carefully reading the following pages:
11
+ - 💻 [Setting up the *flowR* development environment](${doc_files_1.FlowrWikiBaseRef}/Setup#%EF%B8%8F-building-from-scratch).\
12
+ This page explains how to install **R** and **Node.js**.
13
+ - 💖 [Contributing guidelines](${doc_files_1.FlowrGithubBaseRef}/flowr/tree/main/.github/CONTRIBUTING.md).\
14
+ This page also includes information about how to set up **git-lfs** and several **git hooks**.
15
+
16
+ ## ⌛ TL;DR
17
+
18
+ The most important steps to get the *flowR* development environment set up (after installing **R** and **Node.js**) can be seen below. For convenience, they can be executed all at once using the following command:
19
+ ${(0, doc_code_1.codeBlock)('shell', 'npm run setup:dev')}
20
+
21
+ If you want to execute the steps manually, please follow the instructions below:
22
+
23
+ ${(0, doc_code_1.codeBlock)('shell', `
24
+ # Installing git-lfs for your current user (if you haven't already)
25
+ git lfs install
26
+ # Cloning the repository
27
+ git clone https://github.com/flowr-analysis/flowr.git
28
+ # Installing dependencies
29
+ npm ci
30
+ # Configuring git hooks
31
+ git config --local core.hooksPath .githooks/
32
+ # Test if the git hooks are working correctly
33
+ # Running this command should lint the code
34
+ git push --dry-run
35
+ `)}
36
+ `.trim();
37
+ }
38
+ if (require.main === module) {
39
+ (0, log_1.setMinLevelOfAllLogs)(6 /* LogLevel.Fatal */);
40
+ console.log(print());
41
+ }
42
+ //# sourceMappingURL=print-onboarding-wiki.js.map
@@ -10,7 +10,7 @@ const query_1 = require("../queries/query");
10
10
  const doc_files_1 = require("./doc-util/doc-files");
11
11
  const doc_query_1 = require("./doc-util/doc-query");
12
12
  const schema_1 = require("../util/schema");
13
- const ansi_1 = require("../util/ansi");
13
+ const ansi_1 = require("../util/text/ansi");
14
14
  const call_context_query_executor_1 = require("../queries/catalog/call-context-query/call-context-query-executor");
15
15
  const compound_query_1 = require("../queries/virtual-query/compound-query");
16
16
  const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
@@ -238,6 +238,26 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
238
238
  `;
239
239
  }
240
240
  });
241
+ (0, doc_query_1.registerQueryDocumentation)('origin', {
242
+ name: 'Origin Query',
243
+ type: 'active',
244
+ shortDescription: 'Retrieve the origin of a variable, function call, ...',
245
+ functionName: search_query_executor_1.executeSearch.name,
246
+ functionFile: '../queries/catalog/origin-query/origin-query-executor.ts',
247
+ buildExplanation: async (shell) => {
248
+ const exampleCode = 'x <- 1\nprint(x)';
249
+ return `
250
+ With this query you can use flowR's origin tracking to find out the read origins of a variable,
251
+ the functions called by a call, and more.
252
+
253
+ Using the example code \`${exampleCode}\` (with the \`print(x)\` in the second line), the following query returns the origins of \`x\` in the code:
254
+ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
255
+ type: 'origin',
256
+ criterion: '2@x'
257
+ }], { showCode: true })}
258
+ `;
259
+ }
260
+ });
241
261
  (0, doc_query_1.registerQueryDocumentation)('search', {
242
262
  name: 'Search Query',
243
263
  type: 'active',
@@ -424,7 +444,7 @@ print("hello world!")
424
444
  `;
425
445
  return `
426
446
  This query extracts all dependencies from an R script, using a combination of a ${(0, doc_query_1.linkToQueryOfName)('call-context')}
427
- and more advanced tracking in the [Dataflow Graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph).
447
+ and more advanced tracking in the [Dataflow Graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph).
428
448
 
429
449
  In other words, if you have a script simply reading: \`${exampleCode}\`, the following query returns the loaded library:
430
450
  ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
@@ -447,7 +467,7 @@ In the meantime we offer several properties to overwrite the default behavior (e
447
467
  ${await (0, doc_query_1.showQuery)(shell, longerCode, [{
448
468
  type: 'dependencies',
449
469
  ignoreDefaultFunctions: true,
450
- libraryFunctions: [{ name: 'print', argIdx: 0, argName: 'library', resolveValue: true }],
470
+ libraryFunctions: [{ package: 'base', name: 'print', argIdx: 0, argName: 'library', resolveValue: true }],
451
471
  sourceFunctions: [],
452
472
  readFunctions: [],
453
473
  writeFunctions: []
@@ -23,9 +23,12 @@ async function getText(shell) {
23
23
  [![Docker Image Version (latest semver)](https://img.shields.io/docker/v/eagleoutice/flowr?logo=docker&logoColor=white&label=dockerhub)](${doc_files_1.FlowrDockerRef})
24
24
  [![latest tag](https://badgen.net/github/tag/flowr-analysis/flowr?label=latest&color=purple)](${doc_files_1.FlowrGithubBaseRef}/flowr/releases/latest)
25
25
  [![Marketplace](https://badgen.net/vs-marketplace/v/code-inspect.vscode-flowr)](${doc_files_1.FlowrVsCode})
26
+ [![Marketplace](https://badgen.net/open-vsx/version/code-inspect/vscode-flowr?label=Positron/Open%20VSX)](${doc_files_1.FlowrPositron})
26
27
  [![DOI](https://zenodo.org/badge/624819038.svg)](https://zenodo.org/doi/10.5281/zenodo.13319290)
27
28
 
28
- _flowR_ is a sophisticated, static [dataflow analyzer](https://en.wikipedia.org/wiki/Data-flow_analysis) for the [R programming language](https://www.r-project.org/).
29
+ _flowR_ is a sophisticated, static [dataflow analyzer](https://en.wikipedia.org/wiki/Data-flow_analysis) for the [R programming language](https://www.r-project.org/),
30
+ available for [VSCode](${doc_files_1.FlowrVsCode}), [Positron](${doc_files_1.FlowrPositron}), [RStudio](${doc_files_1.FlowrGithubBaseRef}/rstudio-addin-flowr),
31
+ and [Docker](${doc_files_1.FlowrDockerRef}).
29
32
  It offers a wide variety of features, for example:
30
33
 
31
34
  * 🍕 **program slicing**\\
@@ -90,12 +93,16 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(shell, (0, doc_files_1.getFileContent
90
93
 
91
94
  If you want to use flowR and the features it provides, feel free to check out the:
92
95
 
93
- - [Visual Studio Code extension](${doc_files_1.FlowrVsCode}): provides access to flowR directly in VS Code (or [vscode.dev](https://vscode.dev/))
96
+ - [Visual Studio Code](${doc_files_1.FlowrVsCode})/[Positron](${doc_files_1.FlowrPositron}): provides access to flowR directly in VS Code and Positron (or [vscode.dev](https://vscode.dev/))
94
97
  - [RStudio Addin](${doc_files_1.FlowrGithubBaseRef}/rstudio-addin-flowr): integrates flowR into [RStudio](https://posit.co/downloads/)
95
98
  - [R package](${doc_files_1.FlowrGithubBaseRef}/flowr-r-adapter): use flowR in your R scripts
96
99
  - [Docker image](${doc_files_1.FlowrDockerRef}): run flowR in a container, this also includes [flowR's server](${doc_files_1.FlowrWikiBaseRef}/Interface#communicating-with-the-server)
97
100
  - [NPM package](${doc_files_1.FlowrNpmRef}): include flowR in your TypeScript and JavaScript projects
98
101
 
102
+
103
+ If you are already using flowR and want to give feedback, please consider filling out our [feedback form](https://docs.google.com/forms/d/e/1FAIpQLScKFhgnh9LGVU7QzqLvFwZe1oiv_5jNhkIO-G-zND0ppqsMxQ/viewform).
104
+
105
+
99
106
  ## ⭐ Getting Started
100
107
 
101
108
  To get started with _flowR_ and its features, please check out the [Overview](${doc_files_1.FlowrGithubBaseRef}/flowr/wiki/Overview) wiki page.
@@ -121,7 +128,7 @@ as well as the deployed [code documentation](https://flowr-analysis.github.io/fl
121
128
 
122
129
  ## 🚀 Contributing
123
130
 
124
- We welcome every contribution! Please check out the [contributing guidelines](${doc_files_1.FlowrGithubBaseRef}/flowr/tree/main/.github/CONTRIBUTING.md) for more information.
131
+ We welcome every contribution! Please check out the [developer onboarding](${doc_files_1.FlowrWikiBaseRef}/Onboarding) section in the wiki for all the information you will need.
125
132
 
126
133
  ### Contributors
127
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.2.11",
3
+ "version": "2.2.13",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "repository": {
@@ -12,6 +12,7 @@
12
12
  "url": "https://github.com/flowr-analysis/flowr/issues"
13
13
  },
14
14
  "scripts": {
15
+ "setup:dev": "git lfs fetch && npm ci && git config --local core.hooksPath .githooks/ && git push --dry-run",
15
16
  "main": "npm run build:bundle-flowr && node dist/src/cli/flowr.min.js",
16
17
  "flowr": "npm run main --",
17
18
  "main-dev": "ts-node src/cli/flowr.ts",
@@ -33,12 +34,14 @@
33
34
  "wiki:search-api": "ts-node src/documentation/print-search-wiki.ts",
34
35
  "wiki:linting-and-testing": "ts-node src/documentation/print-linting-and-testing-wiki.ts",
35
36
  "wiki:interface": "ts-node src/documentation/print-interface-wiki.ts",
37
+ "wiki:onboarding": "ts-node src/documentation/print-onboarding-wiki.ts",
38
+ "wiki:faq": "ts-node src/documentation/print-faq-wiki.ts",
39
+ "wiki:cfg": "ts-node src/documentation/print-cfg-wiki.ts",
36
40
  "gen:readme": "ts-node src/documentation/print-readme.ts",
37
41
  "build": "tsc --project .",
38
42
  "build-dev": "npm run build && npm run build:copy-wasm",
39
- "build:bundle-flowr": "npm run build && esbuild --bundle dist/src/cli/flowr.js --platform=node --tree-shaking=true --bundle --minify --external:clipboardy --target=node22 --outfile=dist/src/cli/flowr.min.js && npm run build:copy-wasm-min",
40
- "build:copy-wasm": "mkdir -p dist/src/r-bridge/lang-4.x/tree-sitter/ && cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter-r.wasm src/r-bridge/lang-4.x/tree-sitter/tree-sitter.wasm dist/src/r-bridge/lang-4.x/tree-sitter/",
41
- "build:copy-wasm-min": "mkdir -p dist/src/cli && cp src/r-bridge/lang-4.x/tree-sitter/tree-sitter-r.wasm src/r-bridge/lang-4.x/tree-sitter/tree-sitter.wasm dist/src/cli",
43
+ "build:bundle-flowr": "npm run build && esbuild --bundle dist/src/cli/flowr.js --platform=node --tree-shaking=true --bundle --minify --external:clipboardy --target=node22 --outfile=dist/src/cli/flowr.min.js && npm run build:copy-wasm",
44
+ "build:copy-wasm": "mkdir -p dist/node_modules/@eagleoutice/tree-sitter-r/ && mkdir -p dist/node_modules/web-tree-sitter && cp node_modules/@eagleoutice/tree-sitter-r/tree-sitter-r.wasm dist/node_modules/@eagleoutice/tree-sitter-r/ && cp node_modules/web-tree-sitter/tree-sitter.wasm dist/node_modules/web-tree-sitter/",
42
45
  "lint-local": "npx eslint --version && npx eslint src/ test/ --rule \"no-warning-comments: off\"",
43
46
  "lint": "npm run license-compat -- --summary && npx eslint --version && npx eslint src/ test/",
44
47
  "license-compat": "license-checker --onlyAllow 'MIT;MIT OR X11;GPLv2;LGPL;GNUGPL;ISC;Apache-2.0;FreeBSD;BSD-2-Clause;clearbsd;ModifiedBSD;BSD-3-Clause;Python-2.0;Unlicense;WTFPL;BlueOak-1.0.0;CC-BY-4.0;CC-BY-3.0;CC0-1.0;0BSD'",
@@ -174,7 +177,7 @@
174
177
  "@eagleoutice/eslint-config-flowr": "^1.0.17",
175
178
  "@eslint/eslintrc": "^3.2.0",
176
179
  "@eslint/js": "^9.20.0",
177
- "@j-ulrich/release-it-regex-bumper": "^5.2.0",
180
+ "@j-ulrich/release-it-regex-bumper": "^5.3.0",
178
181
  "@types/command-line-args": "^5.2.3",
179
182
  "@types/command-line-usage": "^5.0.4",
180
183
  "@types/n-readlines": "^1.0.6",
@@ -189,7 +192,7 @@
189
192
  "eslint": "^9.20.1",
190
193
  "license-checker": "^25.0.1",
191
194
  "npm-run-all": "^4.1.5",
192
- "release-it": "^18.1.2",
195
+ "release-it": "^19.0.2",
193
196
  "ts-node": "^10.9.2",
194
197
  "typedoc": "^0.27.7",
195
198
  "typedoc-plugin-missing-exports": "^3.1.0",
@@ -199,6 +202,7 @@
199
202
  "vitest": "^3.0.6"
200
203
  },
201
204
  "dependencies": {
205
+ "@eagleoutice/tree-sitter-r": "^1.1.2",
202
206
  "@xmldom/xmldom": "^0.9.7",
203
207
  "clipboardy": "^4.0.0",
204
208
  "command-line-args": "^6.0.1",
@@ -4,7 +4,7 @@ exports.executeCallContextQueries = executeCallContextQueries;
4
4
  const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
5
5
  const vertex_1 = require("../../../dataflow/graph/vertex");
6
6
  const edge_1 = require("../../../dataflow/graph/edge");
7
- const cfg_1 = require("../../../util/cfg/cfg");
7
+ const extract_cfg_1 = require("../../../control-flow/extract-cfg");
8
8
  const two_layer_collector_1 = require("../../two-layer-collector");
9
9
  const objects_1 = require("../../../util/objects");
10
10
  const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
@@ -85,7 +85,7 @@ function retrieveAllCallAliases(nodeId, graph) {
85
85
  const aliases = new Map();
86
86
  const visited = new Set();
87
87
  /* we store the current call name */
88
- const queue = [[(0, node_id_1.recoverContent)(nodeId, graph) ?? '', nodeId]];
88
+ let queue = [[(0, node_id_1.recoverContent)(nodeId, graph) ?? '', nodeId]];
89
89
  while (queue.length > 0) {
90
90
  const [str, id] = queue.shift();
91
91
  if (visited.has(id)) {
@@ -111,7 +111,7 @@ function retrieveAllCallAliases(nodeId, graph) {
111
111
  .filter(([, { types }]) => (0, edge_1.edgeIncludesType)(types, edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall))
112
112
  .map(([t]) => [(0, node_id_1.recoverContent)(t, graph) ?? '', t]);
113
113
  /** only follow defined-by and reads */
114
- queue.push(...x);
114
+ queue = queue.concat(x);
115
115
  continue;
116
116
  }
117
117
  let track = edge_1.EdgeType.Calls | edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall;
@@ -180,7 +180,7 @@ function executeCallContextQueries({ dataflow: { graph }, ast }, queries) {
180
180
  const { promotedQueries, requiresCfg } = promoteQueryCallNames(queries);
181
181
  let cfg = undefined;
182
182
  if (requiresCfg) {
183
- cfg = (0, cfg_1.extractCFG)(ast, graph);
183
+ cfg = (0, extract_cfg_1.extractCFG)(ast, graph, []);
184
184
  }
185
185
  const queriesWhichWantAliases = promotedQueries.filter(q => q.includeAliases);
186
186
  for (const [nodeId, info] of graph.vertices(true)) {
@@ -203,7 +203,7 @@ function executeCallContextQueries({ dataflow: { graph }, ast }, queries) {
203
203
  }
204
204
  }
205
205
  }
206
- for (const query of promotedQueries.filter(q => q.callName.test(info.name))) {
206
+ for (const query of promotedQueries.filter(q => !q.includeAliases && q.callName.test(info.name))) {
207
207
  const file = ast.idMap.get(nodeId)?.info.file;
208
208
  if (!doesFilepathMatch(file, query.fileFilter)) {
209
209
  continue;
@@ -1,7 +1,7 @@
1
1
  import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
2
  import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
3
3
  import { executeCallContextQueries } from './call-context-query-executor';
4
- import type { OutputFormatter } from '../../../util/ansi';
4
+ import type { OutputFormatter } from '../../../util/text/ansi';
5
5
  import Joi from 'joi';
6
6
  import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
7
7
  import type { DEFAULT_DATAFLOW_PIPELINE } from '../../../core/steps/pipeline/default-pipelines';
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CallContextQueryDefinition = void 0;
7
7
  const call_context_query_executor_1 = require("./call-context-query-executor");
8
- const ansi_1 = require("../../../util/ansi");
9
- const time_1 = require("../../../util/time");
8
+ const ansi_1 = require("../../../util/text/ansi");
9
+ const time_1 = require("../../../util/text/time");
10
10
  const joi_1 = __importDefault(require("joi"));
11
11
  const query_print_1 = require("../../query-print");
12
12
  const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
@@ -1,12 +1,12 @@
1
1
  import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
2
- import type { ControlFlowGraph } from '../../../util/cfg/cfg';
3
2
  import type { DataflowGraph } from '../../../dataflow/graph/graph';
4
3
  import type { DataflowGraphVertexFunctionCall } from '../../../dataflow/graph/vertex';
5
4
  import { RType } from '../../../r-bridge/lang-4.x/ast/model/type';
6
5
  import type { RNodeWithParent } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
7
6
  import type { LinkTo } from './call-context-query-format';
7
+ import type { ControlFlowGraph } from '../../../control-flow/control-flow-graph';
8
8
  export declare enum CallTargets {
9
- /** call targets a function that is not defined locally (e.g., the call targets a library function) */
9
+ /** call targets a function that is not defined locally in the script (e.g., the call targets a library function) */
10
10
  OnlyGlobal = "global",
11
11
  /** call targets a function that is defined locally or globally, but must include a global function */
12
12
  MustIncludeGlobal = "must-include-global",
@@ -5,7 +5,7 @@ exports.satisfiesCallTargets = satisfiesCallTargets;
5
5
  exports.getValueOfArgument = getValueOfArgument;
6
6
  exports.identifyLinkToLastCallRelation = identifyLinkToLastCallRelation;
7
7
  const graph_1 = require("../../../dataflow/graph/graph");
8
- const visitor_1 = require("../../../util/cfg/visitor");
8
+ const simple_visitor_1 = require("../../../control-flow/simple-visitor");
9
9
  const vertex_1 = require("../../../dataflow/graph/vertex");
10
10
  const edge_1 = require("../../../dataflow/graph/edge");
11
11
  const resolve_by_name_1 = require("../../../dataflow/environments/resolve-by-name");
@@ -17,7 +17,7 @@ const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-
17
17
  const cascade_action_1 = require("./cascade-action");
18
18
  var CallTargets;
19
19
  (function (CallTargets) {
20
- /** call targets a function that is not defined locally (e.g., the call targets a library function) */
20
+ /** call targets a function that is not defined locally in the script (e.g., the call targets a library function) */
21
21
  CallTargets["OnlyGlobal"] = "global";
22
22
  /** call targets a function that is defined locally or globally, but must include a global function */
23
23
  CallTargets["MustIncludeGlobal"] = "must-include-global";
@@ -29,16 +29,19 @@ var CallTargets;
29
29
  CallTargets["Any"] = "any";
30
30
  })(CallTargets || (exports.CallTargets = CallTargets = {}));
31
31
  function satisfiesCallTargets(id, graph, callTarget) {
32
- const callVertex = graph.get(id);
33
- if (callVertex === undefined || callVertex[0].tag !== vertex_1.VertexType.FunctionCall) {
32
+ const callVertex = graph.getVertex(id, true);
33
+ if (callVertex === undefined || callVertex.tag !== vertex_1.VertexType.FunctionCall) {
34
+ return 'no';
35
+ }
36
+ const outgoing = graph.outgoingEdges(id);
37
+ if (outgoing === undefined) {
34
38
  return 'no';
35
39
  }
36
- const [info, outgoing] = callVertex;
37
40
  const callTargets = [...outgoing]
38
- .filter(([, e]) => (0, edge_1.edgeIncludesType)(e.types, edge_1.EdgeType.Calls))
41
+ .filter(([, { types }]) => (0, edge_1.edgeIncludesType)(types, edge_1.EdgeType.Calls))
39
42
  .map(([t]) => t);
40
43
  let builtIn = false;
41
- if (info.environment === undefined) {
44
+ if (callVertex.environment === undefined) {
42
45
  /* if we have a call with an unbound environment,
43
46
  * this only happens if we are sure of built-in relations and want to save references
44
47
  */
@@ -49,8 +52,8 @@ function satisfiesCallTargets(id, graph, callTarget) {
49
52
  * for performance and scoping reasons, flowR will not identify the global linkage,
50
53
  * including any potential built-in mapping.
51
54
  */
52
- const reResolved = (0, resolve_by_name_1.resolveByName)(info.name, info.environment, identifier_1.ReferenceType.Unknown);
53
- if (reResolved?.some(t => t.definedAt === built_in_1.BuiltIn)) {
55
+ const reResolved = (0, resolve_by_name_1.resolveByName)(callVertex.name, callVertex.environment, identifier_1.ReferenceType.Unknown);
56
+ if (reResolved?.some(t => (0, built_in_1.isBuiltIn)(t.definedAt))) {
54
57
  builtIn = true;
55
58
  }
56
59
  }
@@ -58,19 +61,19 @@ function satisfiesCallTargets(id, graph, callTarget) {
58
61
  case CallTargets.Any:
59
62
  return callTargets;
60
63
  case CallTargets.OnlyGlobal:
61
- if (callTargets.length === 0) {
62
- return builtIn ? [built_in_1.BuiltIn] : [];
64
+ if (callTargets.every(built_in_1.isBuiltIn)) {
65
+ return builtIn ? ['built-in'] : [];
63
66
  }
64
67
  else {
65
68
  return 'no';
66
69
  }
67
70
  case CallTargets.MustIncludeGlobal:
68
- return builtIn || callTargets.length === 0 ? [...callTargets, built_in_1.BuiltIn] : 'no';
71
+ return builtIn || callTargets.length === 0 ? [...callTargets, 'built-in'] : 'no';
69
72
  case CallTargets.OnlyLocal:
70
73
  return !builtIn && callTargets.length > 0 ? callTargets : 'no';
71
74
  case CallTargets.MustIncludeLocal:
72
75
  if (callTargets.length > 0) {
73
- return builtIn ? [...callTargets, built_in_1.BuiltIn] : callTargets;
76
+ return builtIn ? [...callTargets, 'built-in'] : callTargets;
74
77
  }
75
78
  else {
76
79
  return 'no';
@@ -105,25 +108,25 @@ function getValueOfArgument(graph, call, argument, additionalAllowedTypes) {
105
108
  }
106
109
  }
107
110
  function identifyLinkToLastCallRelation(from, cfg, graph, { callName, ignoreIf, cascadeIf }) {
108
- const found = [];
109
111
  if (ignoreIf && ignoreIf(from, graph)) {
110
- return found;
112
+ return [];
111
113
  }
112
- (0, visitor_1.visitInReverseOrder)(cfg, from, node => {
114
+ const found = [];
115
+ (0, simple_visitor_1.visitCfgInReverseOrder)(cfg, [from], node => {
113
116
  /* we ignore the start id as it cannot be the last call */
114
117
  if (node === from) {
115
118
  return;
116
119
  }
117
- const vertex = graph.get(node);
118
- if (vertex === undefined || vertex[0].tag !== vertex_1.VertexType.FunctionCall) {
120
+ const vertex = graph.getVertex(node, true);
121
+ if (vertex === undefined || vertex.tag !== vertex_1.VertexType.FunctionCall) {
119
122
  return;
120
123
  }
121
- if (callName.test(vertex[0].name)) {
122
- const act = cascadeIf ? cascadeIf(vertex[0], from, graph) : cascade_action_1.CascadeAction.Stop;
124
+ if (callName.test(vertex.name)) {
125
+ const act = cascadeIf ? cascadeIf(vertex, from, graph) : cascade_action_1.CascadeAction.Stop;
123
126
  if (act === cascade_action_1.CascadeAction.Skip) {
124
127
  return;
125
128
  }
126
- const tar = satisfiesCallTargets(vertex[0].id, graph, CallTargets.MustIncludeGlobal);
129
+ const tar = satisfiesCallTargets(vertex.id, graph, CallTargets.MustIncludeGlobal);
127
130
  if (tar === 'no') {
128
131
  return act === cascade_action_1.CascadeAction.Stop;
129
132
  }
@@ -14,7 +14,7 @@ export interface DataflowClusterQueryResult extends BaseQueryResult {
14
14
  }
15
15
  export declare const ClusterQueryDefinition: {
16
16
  readonly executor: typeof executeDataflowClusterQuery;
17
- readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
17
+ readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
18
18
  readonly name: "parse";
19
19
  readonly humanReadableName: "parse with R shell";
20
20
  readonly description: "Parse the given R code into an AST";
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ClusterQueryDefinition = void 0;
7
- const ansi_1 = require("../../../util/ansi");
7
+ const ansi_1 = require("../../../util/text/ansi");
8
8
  const joi_1 = __importDefault(require("joi"));
9
9
  const cluster_query_executor_1 = require("./cluster-query-executor");
10
10
  const dfg_1 = require("../../../util/mermaid/dfg");
@@ -1,6 +1,6 @@
1
1
  import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
2
  import { executeConfigQuery } from './config-query-executor';
3
- import { type OutputFormatter } from '../../../util/ansi';
3
+ import { type OutputFormatter } from '../../../util/text/ansi';
4
4
  import Joi from 'joi';
5
5
  import type { FlowrConfigOptions } from '../../../config';
6
6
  export interface ConfigQuery extends BaseQueryFormat {
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ConfigQueryDefinition = void 0;
7
7
  const config_query_executor_1 = require("./config-query-executor");
8
- const ansi_1 = require("../../../util/ansi");
9
- const time_1 = require("../../../util/time");
8
+ const ansi_1 = require("../../../util/text/ansi");
9
+ const time_1 = require("../../../util/text/time");
10
10
  const joi_1 = __importDefault(require("joi"));
11
11
  const json_1 = require("../../../util/json");
12
12
  exports.ConfigQueryDefinition = {