@eagleoutice/flowr 2.5.0 → 2.6.1

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 (254) hide show
  1. package/README.md +46 -35
  2. package/abstract-interpretation/data-frame/absint-visitor.d.ts +1 -1
  3. package/abstract-interpretation/data-frame/absint-visitor.js +1 -1
  4. package/cli/flowr.js +11 -33
  5. package/cli/repl/commands/repl-cfg.d.ts +5 -5
  6. package/cli/repl/commands/repl-cfg.js +21 -22
  7. package/cli/repl/commands/repl-commands.d.ts +3 -3
  8. package/cli/repl/commands/repl-commands.js +2 -0
  9. package/cli/repl/commands/repl-dataflow.d.ts +5 -5
  10. package/cli/repl/commands/repl-dataflow.js +27 -30
  11. package/cli/repl/commands/repl-execute.d.ts +1 -1
  12. package/cli/repl/commands/repl-execute.js +8 -7
  13. package/cli/repl/commands/repl-lineage.d.ts +2 -2
  14. package/cli/repl/commands/repl-lineage.js +11 -11
  15. package/cli/repl/commands/repl-main.d.ts +35 -7
  16. package/cli/repl/commands/repl-normalize.d.ts +3 -3
  17. package/cli/repl/commands/repl-normalize.js +15 -19
  18. package/cli/repl/commands/repl-parse.d.ts +2 -2
  19. package/cli/repl/commands/repl-parse.js +14 -8
  20. package/cli/repl/commands/repl-query.d.ts +3 -3
  21. package/cli/repl/commands/repl-query.js +29 -19
  22. package/cli/repl/commands/repl-quit.js +1 -0
  23. package/cli/repl/commands/repl-version.d.ts +1 -16
  24. package/cli/repl/commands/repl-version.js +2 -18
  25. package/cli/repl/core.d.ts +12 -9
  26. package/cli/repl/core.js +26 -12
  27. package/cli/repl/print-version.js +2 -2
  28. package/cli/repl/server/connection.d.ts +7 -3
  29. package/cli/repl/server/connection.js +46 -50
  30. package/cli/repl/server/messages/message-hello.d.ts +1 -1
  31. package/cli/repl/server/messages/message-slice.d.ts +1 -1
  32. package/cli/repl/server/server.js +2 -2
  33. package/cli/slicer-app.js +1 -1
  34. package/config.d.ts +1 -1
  35. package/config.js +4 -1
  36. package/control-flow/extract-cfg.d.ts +1 -1
  37. package/control-flow/extract-cfg.js +1 -1
  38. package/core/pipeline-executor.d.ts +5 -0
  39. package/core/pipeline-executor.js +5 -0
  40. package/core/steps/all/core/20-dataflow.d.ts +3 -1
  41. package/core/steps/pipeline/create-pipeline.js +1 -1
  42. package/core/steps/pipeline/default-pipelines.d.ts +24 -8
  43. package/core/steps/pipeline/default-pipelines.js +4 -1
  44. package/dataflow/environments/default-builtin-config.js +8 -0
  45. package/dataflow/eval/resolve/alias-tracking.js +2 -0
  46. package/dataflow/eval/resolve/resolve.js +3 -0
  47. package/dataflow/eval/values/r-value.d.ts +4 -1
  48. package/dataflow/eval/values/r-value.js +2 -0
  49. package/dataflow/extractor.d.ts +4 -1
  50. package/dataflow/extractor.js +7 -5
  51. package/dataflow/fn/higher-order-function.d.ts +9 -0
  52. package/dataflow/fn/higher-order-function.js +75 -0
  53. package/dataflow/graph/dataflowgraph-builder.d.ts +11 -12
  54. package/dataflow/graph/dataflowgraph-builder.js +6 -6
  55. package/documentation/doc-util/doc-query.d.ts +3 -6
  56. package/documentation/doc-util/doc-query.js +5 -17
  57. package/documentation/doc-util/doc-repl.js +5 -2
  58. package/documentation/doc-util/doc-search.js +7 -10
  59. package/documentation/doc-util/doc-structure.d.ts +4 -0
  60. package/documentation/doc-util/doc-structure.js +28 -0
  61. package/documentation/doc-util/doc-types.d.ts +5 -1
  62. package/documentation/doc-util/doc-types.js +29 -3
  63. package/documentation/print-analyzer-wiki.d.ts +1 -0
  64. package/documentation/print-analyzer-wiki.js +137 -0
  65. package/documentation/print-core-wiki.d.ts +2 -1
  66. package/documentation/print-core-wiki.js +58 -4
  67. package/documentation/print-dataflow-graph-wiki.js +16 -23
  68. package/documentation/print-interface-wiki.js +18 -1
  69. package/documentation/print-linter-wiki.js +5 -1
  70. package/documentation/print-normalized-ast-wiki.js +6 -8
  71. package/documentation/print-query-wiki.js +20 -0
  72. package/documentation/print-readme.js +1 -1
  73. package/engines.d.ts +9 -0
  74. package/engines.js +38 -0
  75. package/linter/linter-executor.d.ts +2 -8
  76. package/linter/linter-executor.js +9 -4
  77. package/linter/linter-format.d.ts +8 -9
  78. package/linter/linter-rules.d.ts +57 -15
  79. package/linter/linter-rules.js +2 -0
  80. package/linter/rules/absolute-path.d.ts +1 -0
  81. package/linter/rules/dataframe-access-validation.d.ts +4 -3
  82. package/linter/rules/dataframe-access-validation.js +7 -4
  83. package/linter/rules/dead-code.d.ts +2 -1
  84. package/linter/rules/deprecated-functions.d.ts +15 -28
  85. package/linter/rules/deprecated-functions.js +5 -43
  86. package/linter/rules/file-path-validity.d.ts +2 -1
  87. package/linter/rules/file-path-validity.js +1 -1
  88. package/linter/rules/function-finder-util.d.ts +51 -0
  89. package/linter/rules/function-finder-util.js +77 -0
  90. package/linter/rules/naming-convention.d.ts +2 -1
  91. package/linter/rules/network-functions.d.ts +40 -0
  92. package/linter/rules/network-functions.js +24 -0
  93. package/linter/rules/seeded-randomness.d.ts +2 -1
  94. package/linter/rules/unused-definition.d.ts +2 -1
  95. package/linter/rules/useless-loop.d.ts +3 -2
  96. package/linter/rules/useless-loop.js +4 -6
  97. package/package.json +2 -1
  98. package/project/cache/flowr-analyzer-cache.d.ts +94 -0
  99. package/project/cache/flowr-analyzer-cache.js +164 -0
  100. package/project/cache/flowr-cache.d.ts +28 -0
  101. package/project/cache/flowr-cache.js +49 -0
  102. package/project/cfg-kind.d.ts +17 -0
  103. package/project/cfg-kind.js +22 -0
  104. package/project/context/abstract-flowr-analyzer-context.d.ts +39 -0
  105. package/project/context/abstract-flowr-analyzer-context.js +46 -0
  106. package/project/context/flowr-analyzer-context.d.ts +54 -0
  107. package/project/context/flowr-analyzer-context.js +58 -0
  108. package/project/context/flowr-analyzer-dependencies-context.d.ts +39 -0
  109. package/project/context/flowr-analyzer-dependencies-context.js +43 -0
  110. package/project/context/flowr-analyzer-files-context.d.ts +87 -0
  111. package/project/context/flowr-analyzer-files-context.js +134 -0
  112. package/project/context/flowr-analyzer-loading-order-context.d.ts +77 -0
  113. package/project/context/flowr-analyzer-loading-order-context.js +96 -0
  114. package/project/context/flowr-file.d.ts +89 -0
  115. package/project/context/flowr-file.js +78 -0
  116. package/project/flowr-analyzer-builder.d.ts +106 -0
  117. package/project/flowr-analyzer-builder.js +197 -0
  118. package/project/flowr-analyzer.d.ts +126 -0
  119. package/project/flowr-analyzer.js +88 -0
  120. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +17 -0
  121. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +28 -0
  122. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +21 -0
  123. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +34 -0
  124. package/project/plugins/file-plugins/flowr-description-file.d.ts +24 -0
  125. package/project/plugins/file-plugins/flowr-description-file.js +38 -0
  126. package/project/plugins/flowr-analyzer-plugin.d.ts +90 -0
  127. package/project/plugins/flowr-analyzer-plugin.js +82 -0
  128. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +14 -0
  129. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +56 -0
  130. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.d.ts +13 -0
  131. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +33 -0
  132. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +14 -0
  133. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +41 -0
  134. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
  135. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +29 -0
  136. package/project/plugins/package-version-plugins/package.d.ts +15 -0
  137. package/project/plugins/package-version-plugins/package.js +56 -0
  138. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +15 -0
  139. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +44 -0
  140. package/queries/base-query-format.d.ts +2 -8
  141. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  142. package/queries/catalog/call-context-query/call-context-query-executor.js +21 -13
  143. package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -3
  144. package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
  145. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
  146. package/queries/catalog/cluster-query/cluster-query-executor.js +2 -2
  147. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -54
  148. package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
  149. package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
  150. package/queries/catalog/config-query/config-query-executor.js +5 -5
  151. package/queries/catalog/config-query/config-query-format.d.ts +1 -1
  152. package/queries/catalog/config-query/config-query-format.js +1 -1
  153. package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
  154. package/queries/catalog/control-flow-query/control-flow-query-executor.js +3 -3
  155. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -54
  156. package/queries/catalog/control-flow-query/control-flow-query-format.js +2 -2
  157. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +1 -1
  158. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -2
  159. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -54
  160. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -1
  161. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
  162. package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
  163. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -54
  164. package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -1
  165. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
  166. package/queries/catalog/dependencies-query/dependencies-query-executor.js +19 -12
  167. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +7 -56
  168. package/queries/catalog/dependencies-query/dependencies-query-format.js +7 -4
  169. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
  170. package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -4
  171. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -54
  172. package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
  173. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
  174. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
  175. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -54
  176. package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
  177. package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
  178. package/queries/catalog/id-map-query/id-map-query-executor.js +2 -2
  179. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -54
  180. package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
  181. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +3 -0
  182. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +45 -0
  183. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +22 -0
  184. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +32 -0
  185. package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
  186. package/queries/catalog/lineage-query/lineage-query-executor.js +2 -2
  187. package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -54
  188. package/queries/catalog/lineage-query/lineage-query-format.js +1 -1
  189. package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
  190. package/queries/catalog/linter-query/linter-query-executor.js +2 -3
  191. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -54
  192. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  193. package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
  194. package/queries/catalog/location-map-query/location-map-query-executor.js +3 -2
  195. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  196. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  197. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
  198. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -2
  199. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -54
  200. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -1
  201. package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
  202. package/queries/catalog/origin-query/origin-query-executor.js +3 -3
  203. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -54
  204. package/queries/catalog/origin-query/origin-query-format.js +1 -1
  205. package/queries/catalog/project-query/project-query-executor.d.ts +1 -1
  206. package/queries/catalog/project-query/project-query-executor.js +2 -2
  207. package/queries/catalog/project-query/project-query-format.d.ts +1 -54
  208. package/queries/catalog/project-query/project-query-format.js +1 -1
  209. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
  210. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -2
  211. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -54
  212. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
  213. package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
  214. package/queries/catalog/search-query/search-query-executor.js +3 -3
  215. package/queries/catalog/search-query/search-query-format.d.ts +1 -54
  216. package/queries/catalog/search-query/search-query-format.js +1 -1
  217. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
  218. package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -3
  219. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -54
  220. package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -1
  221. package/queries/query-print.d.ts +4 -4
  222. package/queries/query-print.js +12 -12
  223. package/queries/query.d.ts +37 -885
  224. package/queries/query.js +3 -1
  225. package/r-bridge/parser.d.ts +7 -0
  226. package/r-bridge/retriever.d.ts +6 -5
  227. package/r-bridge/retriever.js +9 -5
  228. package/search/flowr-search-executor.d.ts +3 -5
  229. package/search/flowr-search-executor.js +6 -4
  230. package/search/flowr-search-filters.d.ts +12 -6
  231. package/search/flowr-search-filters.js +1 -1
  232. package/search/flowr-search.d.ts +5 -16
  233. package/search/flowr-search.js +14 -5
  234. package/search/search-executor/search-enrichers.d.ts +37 -36
  235. package/search/search-executor/search-enrichers.js +5 -4
  236. package/search/search-executor/search-generators.d.ts +12 -12
  237. package/search/search-executor/search-generators.js +27 -19
  238. package/search/search-executor/search-mappers.d.ts +5 -5
  239. package/search/search-executor/search-transformer.d.ts +17 -17
  240. package/search/search-executor/search-transformer.js +14 -7
  241. package/util/collections/arrays.d.ts +1 -0
  242. package/util/collections/arrays.js +15 -0
  243. package/util/collections/objectmap.d.ts +17 -0
  244. package/util/collections/objectmap.js +28 -0
  245. package/util/containers.d.ts +0 -1
  246. package/util/containers.js +0 -1
  247. package/util/files.d.ts +17 -0
  248. package/util/files.js +65 -0
  249. package/util/formats/adapter.d.ts +4 -2
  250. package/util/formats/adapter.js +11 -4
  251. package/util/r-value.d.ts +1 -1
  252. package/util/r-value.js +2 -0
  253. package/util/version.d.ts +17 -0
  254. package/util/version.js +28 -1
package/README.md CHANGED
@@ -24,7 +24,7 @@ It offers a wide variety of features, for example:
24
24
 
25
25
  ```shell
26
26
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
27
- flowR repl using flowR v2.4.8, R v4.5.0 (r-shell engine)
27
+ flowR repl using flowR v2.6.0, R v4.5.0 (r-shell engine)
28
28
  R> :query @linter "read.csv(\"/root/x.txt\")"
29
29
  ```
30
30
 
@@ -33,30 +33,32 @@ It offers a wide variety of features, for example:
33
33
 
34
34
 
35
35
  ```text
36
- Query: linter (3 ms)
36
+ Query: linter (6 ms)
37
37
  ╰ **Deprecated Functions** (deprecated-functions):
38
- ╰ _Metadata_: <code>{"totalDeprecatedCalls":0,"totalDeprecatedFunctionDefinitions":0,"searchTimeMs":0,"processTimeMs":0}</code>
38
+ ╰ _Metadata_: <code>{"totalCalls":0,"totalFunctionDefinitions":0,"searchTimeMs":3,"processTimeMs":0}</code>
39
39
  ╰ **File Path Validity** (file-path-validity):
40
40
  ╰ certain:
41
41
  ╰ Path `/root/x.txt` at 1.1-23
42
42
  ╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":1,"processTimeMs":0}</code>
43
43
  ╰ **Seeded Randomness** (seeded-randomness):
44
- ╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":0,"processTimeMs":0}</code>
44
+ ╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":1,"processTimeMs":0}</code>
45
45
  ╰ **Absolute Paths** (absolute-file-paths):
46
46
  ╰ certain:
47
47
  ╰ Path `/root/x.txt` at 1.1-23
48
- ╰ _Metadata_: <code>{"totalConsidered":1,"totalUnknown":0,"searchTimeMs":1,"processTimeMs":0}</code>
48
+ ╰ _Metadata_: <code>{"totalConsidered":1,"totalUnknown":0,"searchTimeMs":0,"processTimeMs":0}</code>
49
49
  ╰ **Unused Definitions** (unused-definitions):
50
50
  ╰ _Metadata_: <code>{"totalConsidered":0,"searchTimeMs":0,"processTimeMs":0}</code>
51
51
  ╰ **Naming Convention** (naming-convention):
52
52
  ╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":0,"processTimeMs":0}</code>
53
+ ╰ **Network Functions** (network-functions):
54
+ ╰ _Metadata_: <code>{"totalCalls":0,"totalFunctionDefinitions":0,"searchTimeMs":0,"processTimeMs":0}</code>
53
55
  ╰ **Dataframe Access Validation** (dataframe-access-validation):
54
- ╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":0}</code>
56
+ ╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":1,"processTimeMs":0}</code>
55
57
  ╰ **Dead Code** (dead-code):
56
58
  ╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":0,"processTimeMs":0}</code>
57
59
  ╰ **Useless Loops** (useless-loop):
58
60
  ╰ _Metadata_: <code>{"numOfUselessLoops":0,"searchTimeMs":0,"processTimeMs":0}</code>
59
- All queries together required ≈3 ms (1ms accuracy, total 9 ms)
61
+ All queries together required ≈6 ms (1ms accuracy, total 9 ms)
60
62
  ```
61
63
 
62
64
 
@@ -78,15 +80,15 @@ It offers a wide variety of features, for example:
78
80
 
79
81
  _Results (prettified and summarized):_
80
82
 
81
- Query: **linter** (15 ms)\
83
+ Query: **linter** (213 ms)\
82
84
  &nbsp;&nbsp;&nbsp;╰ **Deprecated Functions** (deprecated-functions):\
83
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalDeprecatedCalls":0,"totalDeprecatedFunctionDefinitions":0,"searchTimeMs":2,"processTimeMs":0}</code>\
85
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalCalls":0,"totalFunctionDefinitions":0,"searchTimeMs":199,"processTimeMs":1}</code>\
84
86
  &nbsp;&nbsp;&nbsp;╰ **File Path Validity** (file-path-validity):\
85
87
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ certain:\
86
88
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ Path `/root/x.txt` at 1.1-23\
87
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":5,"processTimeMs":0}</code>\
89
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalReads":1,"totalUnknown":0,"totalWritesBeforeAlways":0,"totalValid":0,"searchTimeMs":4,"processTimeMs":1}</code>\
88
90
  &nbsp;&nbsp;&nbsp;╰ **Seeded Randomness** (seeded-randomness):\
89
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":1,"processTimeMs":0}</code>\
91
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"consumerCalls":0,"callsWithFunctionProducers":0,"callsWithAssignmentProducers":0,"callsWithNonConstantProducers":0,"searchTimeMs":0,"processTimeMs":1}</code>\
90
92
  &nbsp;&nbsp;&nbsp;╰ **Absolute Paths** (absolute-file-paths):\
91
93
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ certain:\
92
94
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ Path `/root/x.txt` at 1.1-23\
@@ -95,17 +97,19 @@ It offers a wide variety of features, for example:
95
97
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalConsidered":0,"searchTimeMs":0,"processTimeMs":0}</code>\
96
98
  &nbsp;&nbsp;&nbsp;╰ **Naming Convention** (naming-convention):\
97
99
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"numMatches":0,"numBreak":0,"searchTimeMs":0,"processTimeMs":0}</code>\
100
+ &nbsp;&nbsp;&nbsp;╰ **Network Functions** (network-functions):\
101
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"totalCalls":0,"totalFunctionDefinitions":0,"searchTimeMs":1,"processTimeMs":0}</code>\
98
102
  &nbsp;&nbsp;&nbsp;╰ **Dataframe Access Validation** (dataframe-access-validation):\
99
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":4}</code>\
103
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"numOperations":0,"numAccesses":0,"totalAccessed":0,"searchTimeMs":0,"processTimeMs":3}</code>\
100
104
  &nbsp;&nbsp;&nbsp;╰ **Dead Code** (dead-code):\
101
- &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":1,"processTimeMs":0}</code>\
105
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"consideredNodes":5,"searchTimeMs":0,"processTimeMs":1}</code>\
102
106
  &nbsp;&nbsp;&nbsp;╰ **Useless Loops** (useless-loop):\
103
107
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;╰ _Metadata_: <code>{"numOfUselessLoops":0,"searchTimeMs":0,"processTimeMs":0}</code>\
104
- _All queries together required ≈16 ms (1ms accuracy, total 209 ms)_
108
+ _All queries together required ≈213 ms (1ms accuracy, total 214 ms)_
105
109
 
106
110
  <details> <summary style="color:gray">Show Detailed Results as Json</summary>
107
111
 
108
- The analysis required _209.2 ms_ (including parsing and normalization and the query) within the generation environment.
112
+ The analysis required _214.2 ms_ (including parsing and normalization and the query) within the generation environment.
109
113
 
110
114
  In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
111
115
  Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
@@ -120,10 +124,10 @@ It offers a wide variety of features, for example:
120
124
  "deprecated-functions": {
121
125
  "results": [],
122
126
  ".meta": {
123
- "totalDeprecatedCalls": 0,
124
- "totalDeprecatedFunctionDefinitions": 0,
125
- "searchTimeMs": 2,
126
- "processTimeMs": 0
127
+ "totalCalls": 0,
128
+ "totalFunctionDefinitions": 0,
129
+ "searchTimeMs": 199,
130
+ "processTimeMs": 1
127
131
  }
128
132
  },
129
133
  "file-path-validity": {
@@ -144,8 +148,8 @@ It offers a wide variety of features, for example:
144
148
  "totalUnknown": 0,
145
149
  "totalWritesBeforeAlways": 0,
146
150
  "totalValid": 0,
147
- "searchTimeMs": 5,
148
- "processTimeMs": 0
151
+ "searchTimeMs": 4,
152
+ "processTimeMs": 1
149
153
  }
150
154
  },
151
155
  "seeded-randomness": {
@@ -155,8 +159,8 @@ It offers a wide variety of features, for example:
155
159
  "callsWithFunctionProducers": 0,
156
160
  "callsWithAssignmentProducers": 0,
157
161
  "callsWithNonConstantProducers": 0,
158
- "searchTimeMs": 1,
159
- "processTimeMs": 0
162
+ "searchTimeMs": 0,
163
+ "processTimeMs": 1
160
164
  }
161
165
  },
162
166
  "absolute-file-paths": {
@@ -196,6 +200,15 @@ It offers a wide variety of features, for example:
196
200
  "processTimeMs": 0
197
201
  }
198
202
  },
203
+ "network-functions": {
204
+ "results": [],
205
+ ".meta": {
206
+ "totalCalls": 0,
207
+ "totalFunctionDefinitions": 0,
208
+ "searchTimeMs": 1,
209
+ "processTimeMs": 0
210
+ }
211
+ },
199
212
  "dataframe-access-validation": {
200
213
  "results": [],
201
214
  ".meta": {
@@ -203,15 +216,15 @@ It offers a wide variety of features, for example:
203
216
  "numAccesses": 0,
204
217
  "totalAccessed": 0,
205
218
  "searchTimeMs": 0,
206
- "processTimeMs": 4
219
+ "processTimeMs": 3
207
220
  }
208
221
  },
209
222
  "dead-code": {
210
223
  "results": [],
211
224
  ".meta": {
212
225
  "consideredNodes": 5,
213
- "searchTimeMs": 1,
214
- "processTimeMs": 0
226
+ "searchTimeMs": 0,
227
+ "processTimeMs": 1
215
228
  }
216
229
  },
217
230
  "useless-loop": {
@@ -224,11 +237,11 @@ It offers a wide variety of features, for example:
224
237
  }
225
238
  },
226
239
  ".meta": {
227
- "timing": 15
240
+ "timing": 213
228
241
  }
229
242
  },
230
243
  ".meta": {
231
- "timing": 16
244
+ "timing": 213
232
245
  }
233
246
  }
234
247
  ```
@@ -241,8 +254,6 @@ It offers a wide variety of features, for example:
241
254
 
242
255
 
243
256
 
244
-
245
-
246
257
 
247
258
 
248
259
 
@@ -295,7 +306,7 @@ It offers a wide variety of features, for example:
295
306
 
296
307
  ```shell
297
308
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
298
- flowR repl using flowR v2.4.8, R v4.5.0 (r-shell engine)
309
+ flowR repl using flowR v2.6.0, R v4.5.0 (r-shell engine)
299
310
  R> :slicer test/testfiles/example.R --criterion "11@sum"
300
311
  ```
301
312
 
@@ -342,7 +353,7 @@ It offers a wide variety of features, for example:
342
353
 
343
354
 
344
355
  * 🚀 **fast data- and control-flow graphs**\
345
- Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">135.1 ms</span></i> (as of Aug 20, 2025),
356
+ Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">136.9 ms</span></i> (as of Oct 13, 2025),
346
357
  _flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
347
358
  and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the dataflow graph.
348
359
 
@@ -378,7 +389,7 @@ It offers a wide variety of features, for example:
378
389
 
379
390
  ```shell
380
391
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
381
- flowR repl using flowR v2.4.8, R v4.5.0 (r-shell engine)
392
+ flowR repl using flowR v2.6.0, R v4.5.0 (r-shell engine)
382
393
  R> :dataflow* test/testfiles/example.R
383
394
  ```
384
395
 
@@ -683,7 +694,7 @@ It offers a wide variety of features, for example:
683
694
  ```
684
695
 
685
696
 
686
- (The analysis required _14.2 ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
697
+ (The analysis required _15.0 ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
687
698
 
688
699
 
689
700
 
@@ -753,7 +764,7 @@ We welcome every contribution! Please check out the [developer onboarding](https
753
764
 
754
765
  ----
755
766
 
756
- *flowr* is actively developed by [Florian Sihler](https://eagleoutice.github.io/portfolio/) under the
767
+ *flowr* is actively developed by [Florian Sihler](https://eagleoutice.github.io/portfolio/) and (since October 1st 2025) [Oliver Gerstl](https://www.linkedin.com/in/oliver-gerstl) under the
757
768
  [GPLv3 License](LICENSE).\
758
769
  It is partially supported by the German Research Foundation (DFG) under the grant [504226141](https://gepris.dfg.de/gepris/projekt/504226141) ("CodeInspector").
759
770
 
@@ -22,7 +22,7 @@ export declare class DataFrameShapeInferenceVisitor<OtherInfo = NoInfo, ControlF
22
22
  private oldDomain;
23
23
  /**
24
24
  * The new domain of an AST node during and after processing the node.
25
- * This information is stored in the {@link AbstractInterpretationInfo} afterwards.
25
+ * This information is stored in the {@link AbstractInterpretationInfo} afterward.
26
26
  */
27
27
  private newDomain;
28
28
  constructor(config: Config);
@@ -23,7 +23,7 @@ class DataFrameShapeInferenceVisitor extends semantic_cfg_guided_visitor_1.Seman
23
23
  oldDomain = new Map();
24
24
  /**
25
25
  * The new domain of an AST node during and after processing the node.
26
- * This information is stored in the {@link AbstractInterpretationInfo} afterwards.
26
+ * This information is stored in the {@link AbstractInterpretationInfo} afterward.
27
27
  */
28
28
  newDomain = new Map();
29
29
  constructor(config) {
package/cli/flowr.js CHANGED
@@ -14,16 +14,15 @@ const command_line_args_1 = __importDefault(require("command-line-args"));
14
14
  const config_1 = require("../config");
15
15
  const assert_1 = require("../util/assert");
16
16
  const scripts_info_1 = require("./common/scripts-info");
17
- const shell_1 = require("../r-bridge/shell");
18
17
  const execute_1 = require("./repl/execute");
19
18
  const repl_main_1 = require("./repl/commands/repl-main");
20
19
  const core_1 = require("./repl/core");
21
- const repl_version_1 = require("./repl/commands/repl-version");
22
20
  const print_version_1 = require("./repl/print-version");
23
21
  const flowr_main_options_1 = require("./flowr-main-options");
24
- const tree_sitter_executor_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor");
25
22
  const fs_1 = __importDefault(require("fs"));
26
23
  const path_1 = __importDefault(require("path"));
24
+ const engines_1 = require("../engines");
25
+ const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
27
26
  exports.toolName = 'flowr';
28
27
  exports.optionHelp = [
29
28
  {
@@ -92,31 +91,6 @@ function createConfig() {
92
91
  });
93
92
  return config;
94
93
  }
95
- async function retrieveEngineInstances(config) {
96
- const engines = {};
97
- if ((0, config_1.getEngineConfig)(config, 'r-shell')) {
98
- // we keep an active shell session to allow other parse investigations :)
99
- engines['r-shell'] = new shell_1.RShell((0, config_1.getEngineConfig)(config, 'r-shell'), {
100
- revive: 2 /* RShellReviveOptions.Always */,
101
- onRevive: (code, signal) => {
102
- const signalText = signal == null ? '' : ` and signal ${signal}`;
103
- console.log(ansi_1.formatter.format(`R process exited with code ${code}${signalText}. Restarting...`, { color: 5 /* Colors.Magenta */, effect: ansi_1.ColorEffect.Foreground }));
104
- console.log((0, ansi_1.italic)(`If you want to exit, press either Ctrl+C twice, or enter ${(0, ansi_1.bold)(':quit')}`));
105
- }
106
- });
107
- }
108
- if ((0, config_1.getEngineConfig)(config, 'tree-sitter')) {
109
- await tree_sitter_executor_1.TreeSitterExecutor.initTreeSitter((0, config_1.getEngineConfig)(config, 'tree-sitter'));
110
- engines['tree-sitter'] = new tree_sitter_executor_1.TreeSitterExecutor();
111
- }
112
- let defaultEngine = config.defaultEngine;
113
- if (!defaultEngine || !engines[defaultEngine]) {
114
- // if a default engine isn't specified, we just take the first one we have
115
- defaultEngine = Object.keys(engines)[0];
116
- }
117
- log_1.log.info(`Using engines ${Object.keys(engines).join(', ')} with default ${defaultEngine}`);
118
- return { engines, default: defaultEngine };
119
- }
120
94
  function hookSignalHandlers(engines) {
121
95
  const end = () => {
122
96
  if (options.execute === undefined) {
@@ -142,29 +116,33 @@ async function mainRepl() {
142
116
  console.log((0, command_line_usage_1.default)(exports.optionHelp));
143
117
  process.exit(0);
144
118
  }
145
- const engines = await retrieveEngineInstances(config);
119
+ const engines = await (0, engines_1.retrieveEngineInstances)(config);
146
120
  const defaultEngine = engines.engines[engines.default];
147
121
  if (options.version) {
148
122
  for (const engine of Object.values(engines.engines)) {
149
- await (0, repl_version_1.printVersionInformation)(repl_main_1.standardReplOutput, engine);
123
+ await (0, version_1.printVersionInformation)(repl_main_1.standardReplOutput, engine);
150
124
  engine?.close();
151
125
  }
152
126
  process.exit(0);
153
127
  }
154
128
  hookSignalHandlers(engines);
129
+ const analyzer = new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
130
+ .setParser(defaultEngine)
131
+ .setConfig(config)
132
+ .buildSync();
155
133
  const allowRSessionAccess = options['r-session-access'] ?? false;
156
134
  if (options.execute) {
157
- await (0, core_1.replProcessAnswer)(config, repl_main_1.standardReplOutput, options.execute, defaultEngine, allowRSessionAccess);
135
+ await (0, core_1.replProcessAnswer)(analyzer, repl_main_1.standardReplOutput, options.execute, allowRSessionAccess);
158
136
  }
159
137
  else {
160
138
  await (0, print_version_1.printVersionRepl)(defaultEngine);
161
- await (0, core_1.repl)(config, { parser: defaultEngine, allowRSessionAccess });
139
+ await (0, core_1.repl)({ analyzer: analyzer, allowRSessionAccess });
162
140
  }
163
141
  process.exit(0);
164
142
  }
165
143
  async function mainServer(backend = new net_1.NetServer()) {
166
144
  const config = createConfig();
167
- const engines = await retrieveEngineInstances(config);
145
+ const engines = await (0, engines_1.retrieveEngineInstances)(config);
168
146
  hookSignalHandlers(engines);
169
147
  await new server_1.FlowRServer(engines.engines, engines.default, options['r-session-access'], config, backend).start(options.port);
170
148
  }
@@ -1,5 +1,5 @@
1
- import type { ReplCommand } from './repl-main';
2
- export declare const controlflowCommand: ReplCommand;
3
- export declare const controlflowStarCommand: ReplCommand;
4
- export declare const controlflowBbCommand: ReplCommand;
5
- export declare const controlflowBbStarCommand: ReplCommand;
1
+ import type { ReplCodeCommand } from './repl-main';
2
+ export declare const controlflowCommand: ReplCodeCommand;
3
+ export declare const controlflowStarCommand: ReplCodeCommand;
4
+ export declare const controlflowBbCommand: ReplCodeCommand;
5
+ export declare const controlflowBbStarCommand: ReplCodeCommand;
@@ -34,27 +34,18 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.controlflowBbStarCommand = exports.controlflowBbCommand = exports.controlflowStarCommand = exports.controlflowCommand = void 0;
37
- const extract_cfg_1 = require("../../../control-flow/extract-cfg");
38
- const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
39
37
  const retriever_1 = require("../../../r-bridge/retriever");
40
38
  const cfg_1 = require("../../../util/mermaid/cfg");
41
39
  const ansi_1 = require("../../../util/text/ansi");
42
40
  const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
43
- async function controlflow(parser, remainingLine, config) {
44
- return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
45
- request: (0, retriever_1.requestFromInput)(remainingLine.trim())
46
- }, config).allRemainingSteps();
47
- }
48
- function handleString(code) {
49
- return code.startsWith('"') ? JSON.parse(code) : code;
50
- }
41
+ const core_1 = require("../core");
51
42
  function formatInfo(out, type) {
52
43
  return out.formatter.format(`Copied ${type} to clipboard.`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
53
44
  }
54
- async function produceAndPrintCfg(shell, remainingLine, output, simplifications, cfgConverter, config) {
55
- const result = await controlflow(shell, handleString(remainingLine), config);
56
- const cfg = (0, extract_cfg_1.extractCfg)(result.normalize, config, result.dataflow.graph, [...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications]);
57
- const mermaid = cfgConverter(cfg, result.normalize);
45
+ async function produceAndPrintCfg(analyzer, output, simplifications, cfgConverter) {
46
+ const cfg = await analyzer.controlflow([...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications]);
47
+ const normalizedAst = await analyzer.normalize();
48
+ const mermaid = cfgConverter(cfg, normalizedAst);
58
49
  output.stdout(mermaid);
59
50
  try {
60
51
  const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
@@ -66,38 +57,46 @@ async function produceAndPrintCfg(shell, remainingLine, output, simplifications,
66
57
  }
67
58
  exports.controlflowCommand = {
68
59
  description: `Get mermaid code for the control-flow graph of R code, start with '${retriever_1.fileProtocol}' to indicate a file`,
60
+ isCodeCommand: true,
69
61
  usageExample: ':controlflow',
70
62
  aliases: ['cfg', 'cf'],
71
63
  script: false,
72
- fn: async ({ output, parser, remainingLine, config }) => {
73
- await produceAndPrintCfg(parser, remainingLine, output, [], cfg_1.cfgToMermaid, config);
64
+ argsParser: (args) => (0, core_1.handleString)(args),
65
+ fn: async ({ output, analyzer }) => {
66
+ await produceAndPrintCfg(analyzer, output, [], cfg_1.cfgToMermaid);
74
67
  }
75
68
  };
76
69
  exports.controlflowStarCommand = {
77
70
  description: 'Returns the URL to mermaid.live',
71
+ isCodeCommand: true,
78
72
  usageExample: ':controlflow*',
79
73
  aliases: ['cfg*', 'cf*'],
80
74
  script: false,
81
- fn: async ({ output, parser, remainingLine, config }) => {
82
- await produceAndPrintCfg(parser, remainingLine, output, [], cfg_1.cfgToMermaidUrl, config);
75
+ argsParser: (args) => (0, core_1.handleString)(args),
76
+ fn: async ({ output, analyzer }) => {
77
+ await produceAndPrintCfg(analyzer, output, [], cfg_1.cfgToMermaidUrl);
83
78
  }
84
79
  };
85
80
  exports.controlflowBbCommand = {
86
81
  description: `Get mermaid code for the control-flow graph with basic blocks, start with '${retriever_1.fileProtocol}' to indicate a file`,
82
+ isCodeCommand: true,
87
83
  usageExample: ':controlflowbb',
88
84
  aliases: ['cfgb', 'cfb'],
89
85
  script: false,
90
- fn: async ({ output, parser, remainingLine, config }) => {
91
- await produceAndPrintCfg(parser, remainingLine, output, ['to-basic-blocks'], cfg_1.cfgToMermaid, config);
86
+ argsParser: (args) => (0, core_1.handleString)(args),
87
+ fn: async ({ output, analyzer }) => {
88
+ await produceAndPrintCfg(analyzer, output, ['to-basic-blocks'], cfg_1.cfgToMermaid);
92
89
  }
93
90
  };
94
91
  exports.controlflowBbStarCommand = {
95
92
  description: 'Returns the URL to mermaid.live',
93
+ isCodeCommand: true,
96
94
  usageExample: ':controlflowbb*',
97
95
  aliases: ['cfgb*', 'cfb*'],
98
96
  script: false,
99
- fn: async ({ output, parser, remainingLine, config }) => {
100
- await produceAndPrintCfg(parser, remainingLine, output, ['to-basic-blocks'], cfg_1.cfgToMermaidUrl, config);
97
+ argsParser: (args) => (0, core_1.handleString)(args),
98
+ fn: async ({ output, analyzer }) => {
99
+ await produceAndPrintCfg(analyzer, output, ['to-basic-blocks'], cfg_1.cfgToMermaidUrl);
101
100
  }
102
101
  };
103
102
  //# sourceMappingURL=repl-cfg.js.map
@@ -1,6 +1,6 @@
1
- import type { ReplCommand } from './repl-main';
1
+ import type { ReplCodeCommand, ReplCommand } from './repl-main';
2
2
  export declare const helpCommand: ReplCommand;
3
- export declare function getReplCommands(): Record<string, ReplCommand>;
3
+ export declare function getReplCommands(): Record<string, ReplCommand | ReplCodeCommand>;
4
4
  /**
5
5
  * The names of all commands including their aliases (but without the leading `:`)
6
6
  */
@@ -9,7 +9,7 @@ export declare function getCommandNames(): string[];
9
9
  * Get the command for a given command name or alias.
10
10
  * @param command - The name of the command (without the leading `:`)
11
11
  */
12
- export declare function getCommand(command: string): ReplCommand | undefined;
12
+ export declare function getCommand(command: string): ReplCodeCommand | ReplCommand | undefined;
13
13
  export declare function asOptionName(argument: string): string;
14
14
  export declare function longestCommandName(): number;
15
15
  export declare function padCmd<T>(string: T): string;
@@ -47,6 +47,7 @@ function printCommandHelp(formatter) {
47
47
  }
48
48
  exports.helpCommand = {
49
49
  description: 'Show help information',
50
+ isCodeCommand: false,
50
51
  script: false,
51
52
  usageExample: ':help',
52
53
  aliases: ['h', '?'],
@@ -113,6 +114,7 @@ function getReplCommands() {
113
114
  aliases: [],
114
115
  script: true,
115
116
  usageExample: `:${script} --help`,
117
+ isCodeCommand: false,
116
118
  fn: async ({ output, remainingLine }) => {
117
119
  // check if the target *module* exists in the current directory, else try two dirs up, otherwise, fail with a message
118
120
  let path = `${__dirname}/${target}`;
@@ -1,5 +1,5 @@
1
- import type { ReplCommand } from './repl-main';
2
- export declare const dataflowCommand: ReplCommand;
3
- export declare const dataflowStarCommand: ReplCommand;
4
- export declare const dataflowSimplifiedCommand: ReplCommand;
5
- export declare const dataflowSimpleStarCommand: ReplCommand;
1
+ import type { ReplCodeCommand } from './repl-main';
2
+ export declare const dataflowCommand: ReplCodeCommand;
3
+ export declare const dataflowStarCommand: ReplCodeCommand;
4
+ export declare const dataflowSimplifiedCommand: ReplCodeCommand;
5
+ export declare const dataflowSimpleStarCommand: ReplCodeCommand;
@@ -34,88 +34,85 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.dataflowSimpleStarCommand = exports.dataflowSimplifiedCommand = exports.dataflowStarCommand = exports.dataflowCommand = void 0;
37
- const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
38
37
  const retriever_1 = require("../../../r-bridge/retriever");
39
38
  const dfg_1 = require("../../../util/mermaid/dfg");
40
39
  const ansi_1 = require("../../../util/text/ansi");
41
- /**
42
- * Obtain the dataflow graph using a known parser (such as the {@link RShell} or {@link TreeSitterExecutor}).
43
- */
44
- async function replGetDataflow(config, parser, code) {
45
- return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
46
- request: (0, retriever_1.requestFromInput)(code.trim())
47
- }, config).allRemainingSteps();
48
- }
49
- function handleString(code) {
50
- return code.startsWith('"') ? JSON.parse(code) : code;
51
- }
52
- function formatInfo(out, type, timing) {
53
- return out.formatter.format(`Copied ${type} to clipboard (dataflow: ${timing}ms).`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
40
+ const core_1 = require("../core");
41
+ function formatInfo(out, type, meta) {
42
+ return out.formatter.format(`Copied ${type} to clipboard (dataflow: ${meta['.meta'].timing + 'ms'}).`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
54
43
  }
55
44
  exports.dataflowCommand = {
56
45
  description: `Get mermaid code for the dataflow graph, start with '${retriever_1.fileProtocol}' to indicate a file`,
46
+ isCodeCommand: true,
57
47
  usageExample: ':dataflow',
58
48
  aliases: ['d', 'df'],
59
49
  script: false,
60
- fn: async ({ output, parser, remainingLine, config }) => {
61
- const result = await replGetDataflow(config, parser, handleString(remainingLine));
62
- const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.dataflow.graph, includeEnvironments: false }).string;
50
+ argsParser: (args) => (0, core_1.handleString)(args),
51
+ fn: async ({ output, analyzer }) => {
52
+ const result = await analyzer.dataflow();
53
+ const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.graph, includeEnvironments: false }).string;
63
54
  output.stdout(mermaid);
64
55
  try {
65
56
  const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
66
57
  clipboard.default.writeSync(mermaid);
67
- output.stdout(formatInfo(output, 'mermaid code', result.dataflow['.meta'].timing));
58
+ output.stdout(formatInfo(output, 'mermaid code', result));
68
59
  }
69
60
  catch { /* do nothing this is a service thing */ }
70
61
  }
71
62
  };
72
63
  exports.dataflowStarCommand = {
73
64
  description: 'Returns the URL to mermaid.live',
65
+ isCodeCommand: true,
74
66
  usageExample: ':dataflow*',
75
67
  aliases: ['d*', 'df*'],
76
68
  script: false,
77
- fn: async ({ output, parser, remainingLine, config }) => {
78
- const result = await replGetDataflow(config, parser, handleString(remainingLine));
79
- const mermaid = (0, dfg_1.graphToMermaidUrl)(result.dataflow.graph, false);
69
+ argsParser: (args) => (0, core_1.handleString)(args),
70
+ fn: async ({ output, analyzer }) => {
71
+ const result = await analyzer.dataflow();
72
+ const mermaid = (0, dfg_1.graphToMermaidUrl)(result.graph, false);
80
73
  output.stdout(mermaid);
81
74
  try {
82
75
  const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
83
76
  clipboard.default.writeSync(mermaid);
84
- output.stdout(formatInfo(output, 'mermaid url', result.dataflow['.meta'].timing));
77
+ output.stdout(formatInfo(output, 'mermaid url', result));
85
78
  }
86
79
  catch { /* do nothing this is a service thing */ }
87
80
  }
88
81
  };
89
82
  exports.dataflowSimplifiedCommand = {
90
83
  description: `Get mermaid code for the simplified dataflow graph, start with '${retriever_1.fileProtocol}' to indicate a file`,
84
+ isCodeCommand: true,
91
85
  usageExample: ':dataflowsimple',
92
86
  aliases: ['ds', 'dfs'],
93
87
  script: false,
94
- fn: async ({ output, parser, remainingLine, config }) => {
95
- const result = await replGetDataflow(config, parser, handleString(remainingLine));
96
- const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.dataflow.graph, includeEnvironments: false, simplified: true }).string;
88
+ argsParser: (args) => (0, core_1.handleString)(args),
89
+ fn: async ({ output, analyzer }) => {
90
+ const result = await analyzer.dataflow();
91
+ const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.graph, includeEnvironments: false, simplified: true }).string;
97
92
  output.stdout(mermaid);
98
93
  try {
99
94
  const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
100
95
  clipboard.default.writeSync(mermaid);
101
- output.stdout(formatInfo(output, 'mermaid code', result.dataflow['.meta'].timing));
96
+ output.stdout(formatInfo(output, 'mermaid code', result));
102
97
  }
103
98
  catch { /* do nothing this is a service thing */ }
104
99
  }
105
100
  };
106
101
  exports.dataflowSimpleStarCommand = {
107
102
  description: 'Returns the URL to mermaid.live',
103
+ isCodeCommand: true,
108
104
  usageExample: ':dataflowsimple*',
109
105
  aliases: ['ds*', 'dfs*'],
110
106
  script: false,
111
- fn: async ({ output, parser, remainingLine, config }) => {
112
- const result = await replGetDataflow(config, parser, handleString(remainingLine));
113
- const mermaid = (0, dfg_1.graphToMermaidUrl)(result.dataflow.graph, false, undefined, true);
107
+ argsParser: (args) => (0, core_1.handleString)(args),
108
+ fn: async ({ output, analyzer }) => {
109
+ const result = await analyzer.dataflow();
110
+ const mermaid = (0, dfg_1.graphToMermaidUrl)(result.graph, false, undefined, true);
114
111
  output.stdout(mermaid);
115
112
  try {
116
113
  const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
117
114
  clipboard.default.writeSync(mermaid);
118
- output.stdout(formatInfo(output, 'mermaid url', result.dataflow['.meta'].timing));
115
+ output.stdout(formatInfo(output, 'mermaid url', result));
119
116
  }
120
117
  catch { /* do nothing this is a service thing */ }
121
118
  }
@@ -1,3 +1,3 @@
1
1
  import type { ReplCommand, ReplCommandInformation } from './repl-main';
2
- export declare function tryExecuteRShellCommand({ output, parser, allowRSessionAccess, remainingLine }: ReplCommandInformation): Promise<void>;
2
+ export declare function tryExecuteRShellCommand({ output, analyzer, allowRSessionAccess, remainingLine }: ReplCommandInformation): Promise<void>;
3
3
  export declare const executeCommand: ReplCommand;