@eagleoutice/flowr 2.14.1 → 2.14.3

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 (419) hide show
  1. package/README.md +142 -87
  2. package/abstract-interpretation/absint-visitor.d.ts +132 -25
  3. package/abstract-interpretation/absint-visitor.js +459 -99
  4. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +1 -1
  5. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  6. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
  7. package/abstract-interpretation/data-frame/mappers/arguments.js +1 -1
  8. package/abstract-interpretation/data-frame/mappers/function-mapper.js +107 -254
  9. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +5 -5
  10. package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -1
  11. package/abstract-interpretation/data-frame/resolve-args.js +6 -4
  12. package/abstract-interpretation/data-frame/shape-inference.d.ts +4 -9
  13. package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -0
  14. package/abstract-interpretation/domains/bounded-set-domain.js +1 -0
  15. package/abstract-interpretation/domains/partial-product-domain.js +1 -1
  16. package/abstract-interpretation/domains/set-range-domain.d.ts +3 -2
  17. package/abstract-interpretation/domains/set-range-domain.js +3 -2
  18. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +3 -2
  19. package/abstract-interpretation/domains/set-upper-bound-domain.js +3 -2
  20. package/benchmark/calibration.d.ts +11 -6
  21. package/benchmark/calibration.js +19 -8
  22. package/benchmark/slicer.d.ts +7 -1
  23. package/benchmark/slicer.js +38 -34
  24. package/benchmark/stats/count-comments.d.ts +16 -0
  25. package/benchmark/stats/count-comments.js +30 -0
  26. package/benchmark/stats/print.js +2 -0
  27. package/benchmark/stats/size-of.d.ts +7 -3
  28. package/benchmark/stats/size-of.js +7 -3
  29. package/benchmark/stats/stats.d.ts +7 -0
  30. package/benchmark/summarizer/first-phase/process.js +2 -19
  31. package/benchmark/summarizer/second-phase/graph.js +13 -3
  32. package/benchmark/summarizer/second-phase/process.js +2 -0
  33. package/cli/repl/commands/repl-dataflow.js +70 -27
  34. package/cli/repl/core.d.ts +1 -1
  35. package/cli/repl/core.js +1 -1
  36. package/cli/repl/parser/slice-query-parser.js +2 -1
  37. package/cli/repl/server/connection.d.ts +4 -0
  38. package/cli/repl/server/connection.js +19 -16
  39. package/cli/repl/server/messages/message-analysis.d.ts +1 -1
  40. package/config.d.ts +21 -8
  41. package/config.js +12 -5
  42. package/control-flow/basic-cfg-guided-visitor.d.ts +7 -2
  43. package/control-flow/basic-cfg-guided-visitor.js +37 -24
  44. package/control-flow/cfg-dead-code.js +44 -33
  45. package/control-flow/cfg-properties.js +2 -2
  46. package/control-flow/cfg-simplification.js +6 -5
  47. package/control-flow/cfg-to-basic-blocks.js +11 -13
  48. package/control-flow/control-flow-graph.d.ts +179 -189
  49. package/control-flow/control-flow-graph.js +400 -263
  50. package/control-flow/dfg-cfg-guided-visitor.d.ts +21 -3
  51. package/control-flow/dfg-cfg-guided-visitor.js +17 -13
  52. package/control-flow/diff-cfg.js +6 -14
  53. package/control-flow/happens-before.js +5 -4
  54. package/control-flow/semantic-cfg-guided-visitor.d.ts +44 -101
  55. package/control-flow/semantic-cfg-guided-visitor.js +6 -3
  56. package/control-flow/simple-visitor.js +14 -15
  57. package/control-flow/syntax-cfg-guided-visitor.d.ts +2 -1
  58. package/control-flow/useless-loop.js +18 -14
  59. package/core/steps/all/core/20-dataflow.d.ts +1 -3
  60. package/core/steps/pipeline/default-pipelines.d.ts +141 -157
  61. package/dataflow/cluster.js +7 -0
  62. package/dataflow/environments/apply-kill.d.ts +6 -0
  63. package/dataflow/environments/apply-kill.js +63 -31
  64. package/dataflow/environments/built-in-props.d.ts +5 -1
  65. package/dataflow/environments/built-in-props.js +4 -0
  66. package/dataflow/environments/built-in.d.ts +6 -3
  67. package/dataflow/environments/built-in.js +8 -5
  68. package/dataflow/environments/clone.d.ts +3 -3
  69. package/dataflow/environments/clone.js +5 -5
  70. package/dataflow/environments/default-builtin-config.d.ts +114 -3
  71. package/dataflow/environments/default-builtin-config.js +137 -35
  72. package/dataflow/environments/environment.d.ts +5 -5
  73. package/dataflow/environments/environment.js +5 -5
  74. package/dataflow/environments/identifier.d.ts +11 -1
  75. package/dataflow/environments/identifier.js +4 -1
  76. package/dataflow/environments/resolve-by-name.d.ts +7 -0
  77. package/dataflow/environments/resolve-by-name.js +12 -0
  78. package/dataflow/environments/resolve-helper.d.ts +3 -1
  79. package/dataflow/environments/resolve-helper.js +2 -0
  80. package/dataflow/eval/resolve/alias-tracking.d.ts +3 -3
  81. package/dataflow/eval/resolve/alias-tracking.js +3 -3
  82. package/dataflow/eval/resolve/match-arguments.js +7 -5
  83. package/dataflow/eval/resolve/node-value.d.ts +3 -1
  84. package/dataflow/eval/resolve/node-value.js +12 -0
  85. package/dataflow/eval/resolve/resolve-argument.js +5 -4
  86. package/dataflow/eval/resolve/resolve-operators.js +9 -6
  87. package/dataflow/eval/resolve/resolve-strings.js +2 -2
  88. package/dataflow/eval/resolve/resolve-working-directory.js +4 -3
  89. package/dataflow/eval/resolve/resolve.js +3 -2
  90. package/dataflow/eval/values/general.js +8 -5
  91. package/dataflow/extractor.d.ts +1 -4
  92. package/dataflow/extractor.js +11 -10
  93. package/dataflow/fn/exceptions-of-function.d.ts +3 -1
  94. package/dataflow/fn/strict-function.js +7 -5
  95. package/dataflow/graph/call-graph.js +2 -2
  96. package/dataflow/graph/df-helper.d.ts +8 -1
  97. package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
  98. package/dataflow/graph/diff-dataflow-graph.js +19 -2
  99. package/dataflow/graph/edge.d.ts +38 -2
  100. package/dataflow/graph/edge.js +32 -2
  101. package/dataflow/graph/graph.d.ts +4 -3
  102. package/dataflow/graph/graph.js +6 -2
  103. package/dataflow/graph/match-args.d.ts +69 -0
  104. package/dataflow/graph/match-args.js +167 -0
  105. package/dataflow/info.d.ts +15 -6
  106. package/dataflow/info.js +0 -17
  107. package/dataflow/internal/control-flow.d.ts +114 -0
  108. package/dataflow/internal/control-flow.js +224 -0
  109. package/dataflow/internal/linker.d.ts +6 -31
  110. package/dataflow/internal/linker.js +24 -81
  111. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
  112. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +3 -3
  113. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +2 -2
  114. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +9 -6
  115. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
  116. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +6 -4
  117. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -10
  118. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +18 -37
  119. package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
  120. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -3
  121. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +1 -1
  122. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +11 -7
  123. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
  124. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
  125. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +18 -14
  126. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +18 -2
  127. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +12 -1
  128. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
  129. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +38 -30
  130. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -2
  131. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
  132. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +36 -8
  133. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
  134. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +20 -17
  135. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +1 -1
  136. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +6 -4
  137. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +4 -3
  138. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +9 -4
  139. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +2 -2
  140. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +5 -5
  141. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.d.ts +1 -1
  142. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +5 -4
  143. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +7 -5
  144. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +1 -1
  145. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +15 -13
  146. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +1 -1
  147. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +11 -2
  148. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
  149. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +4 -3
  150. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +1 -1
  151. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +26 -4
  152. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
  153. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +17 -4
  154. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
  155. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +71 -33
  156. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +6 -15
  157. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +13 -14
  158. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  159. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +14 -11
  160. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +15 -1
  161. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
  162. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +12 -8
  163. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +6 -5
  164. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.d.ts +1 -1
  165. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +5 -4
  166. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
  167. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +50 -10
  168. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
  169. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +20 -4
  170. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +6 -2
  171. package/dataflow/internal/process/functions/call/common.js +5 -6
  172. package/dataflow/internal/process/functions/call/deferred.js +2 -2
  173. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +12 -2
  174. package/dataflow/internal/process/functions/call/known-call-handling.js +41 -15
  175. package/dataflow/internal/process/functions/call/named-call-handling.js +2 -0
  176. package/dataflow/internal/process/functions/call/nse.d.ts +1 -1
  177. package/dataflow/internal/process/functions/call/nse.js +6 -1
  178. package/dataflow/internal/process/functions/call/quoted.js +2 -2
  179. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +19 -6
  180. package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
  181. package/dataflow/internal/process/functions/process-argument.js +12 -4
  182. package/dataflow/internal/process/functions/process-parameter.js +13 -0
  183. package/dataflow/internal/process/process-named-call.d.ts +2 -2
  184. package/dataflow/internal/process/process-named-call.js +9 -7
  185. package/documentation/data/server/doc-data-server-messages.js +4 -4
  186. package/documentation/doc-readme.js +33 -0
  187. package/documentation/doc-util/doc-cfg.d.ts +8 -7
  188. package/documentation/doc-util/doc-cfg.js +10 -10
  189. package/documentation/doc-util/doc-playground.d.ts +12 -0
  190. package/documentation/doc-util/doc-playground.js +21 -0
  191. package/documentation/doc-util/doc-query.d.ts +4 -1
  192. package/documentation/doc-util/doc-query.js +4 -2
  193. package/documentation/wiki-absint.d.ts +3 -4
  194. package/documentation/wiki-absint.js +17 -5
  195. package/documentation/wiki-analyzer.js +2 -2
  196. package/documentation/wiki-cfg.js +101 -106
  197. package/documentation/wiki-dataflow-graph.js +84 -53
  198. package/documentation/wiki-interface.js +1 -0
  199. package/documentation/wiki-linter.js +15 -1
  200. package/documentation/wiki-linting-and-testing.js +1 -16
  201. package/documentation/wiki-mk/doc-maker.js +6 -4
  202. package/documentation/wiki-query.js +14 -4
  203. package/documentation/wiki-signature-database.js +28 -2
  204. package/linter/linter-fix.d.ts +16 -0
  205. package/linter/linter-fix.js +104 -0
  206. package/linter/linter-format.d.ts +18 -1
  207. package/linter/linter-format.js +31 -1
  208. package/linter/linter-output.js +46 -10
  209. package/linter/linter-rules.d.ts +40 -9
  210. package/linter/linter-rules.js +2 -0
  211. package/linter/rules/absolute-path.js +4 -2
  212. package/linter/rules/dataframe-access-validation.js +6 -7
  213. package/linter/rules/deprecated-functions.d.ts +107 -10
  214. package/linter/rules/deprecated-functions.js +311 -23
  215. package/linter/rules/file-path-validity.js +5 -4
  216. package/linter/rules/function-finder-util.d.ts +6 -0
  217. package/linter/rules/function-finder-util.js +21 -13
  218. package/linter/rules/naming-convention.js +1 -1
  219. package/linter/rules/network-functions.d.ts +2 -2
  220. package/linter/rules/stop-with-call-arg.js +2 -2
  221. package/linter/rules/unclosed-connection.js +2 -2
  222. package/linter/rules/undefined-symbol-util.js +6 -4
  223. package/linter/rules/undefined-symbol.js +2 -2
  224. package/linter/rules/unused-definition.js +8 -4
  225. package/linter/rules/unused-import.d.ts +60 -0
  226. package/linter/rules/unused-import.js +179 -0
  227. package/package.json +2 -2
  228. package/project/attached-packages.js +2 -1
  229. package/project/cache/flowr-analyzer-cache.d.ts +2 -5
  230. package/project/cache/flowr-analyzer-cache.js +4 -7
  231. package/project/cache/flowr-analyzer-controlflow-cache.d.ts +9 -8
  232. package/project/cache/flowr-analyzer-controlflow-cache.js +17 -34
  233. package/project/cache/flowr-cache.d.ts +9 -0
  234. package/project/cache/flowr-cache.js +19 -0
  235. package/project/context/flowr-analyzer-context.d.ts +7 -3
  236. package/project/context/flowr-analyzer-context.js +15 -9
  237. package/project/context/flowr-analyzer-dependencies-context.d.ts +24 -3
  238. package/project/context/flowr-analyzer-dependencies-context.js +9 -14
  239. package/project/context/flowr-analyzer-files-context.js +15 -17
  240. package/project/context/flowr-analyzer-meta-context.js +2 -12
  241. package/project/dependency-version-space.d.ts +1 -7
  242. package/project/dependency-version-space.js +9 -8
  243. package/project/flowr-analyzer-builder.d.ts +4 -4
  244. package/project/flowr-analyzer.d.ts +4 -6
  245. package/project/flowr-analyzer.js +4 -5
  246. package/project/plugins/file-plugins/files/flowr-namespace-file.js +22 -34
  247. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +13 -13
  248. package/project/plugins/file-plugins/files/flowr-rda-file.js +131 -286
  249. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +1 -0
  250. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +1 -0
  251. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +2 -5
  252. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +2 -8
  253. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +32 -0
  254. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +43 -1
  255. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +4 -12
  256. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +3 -16
  257. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +5 -8
  258. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +4 -10
  259. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +3 -10
  260. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +1 -13
  261. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +3 -6
  262. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -8
  263. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +2 -5
  264. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +2 -8
  265. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +2 -5
  266. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +2 -8
  267. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +3 -4
  268. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +3 -6
  269. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +4 -12
  270. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +3 -16
  271. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +4 -12
  272. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +3 -16
  273. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +4 -12
  274. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -16
  275. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +2 -5
  276. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +2 -8
  277. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.d.ts +2 -6
  278. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.js +1 -10
  279. package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.d.ts +2 -5
  280. package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.js +2 -8
  281. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-library-plugin.js +2 -1
  282. package/project/sigdb/build.d.ts +2 -2
  283. package/project/sigdb/decode.d.ts +0 -5
  284. package/project/sigdb/decode.js +0 -8
  285. package/project/sigdb/index-format.d.ts +4 -4
  286. package/project/sigdb/manifest.d.ts +2 -2
  287. package/project/sigdb/reader.d.ts +54 -13
  288. package/project/sigdb/reader.js +4 -3
  289. package/project/sigdb/schema.d.ts +3 -1
  290. package/project/sigdb/signature-db.d.ts +69 -0
  291. package/project/sigdb/signature-db.js +54 -0
  292. package/project/sigdb/signature-match.d.ts +10 -5
  293. package/project/sigdb/signature-match.js +13 -8
  294. package/queries/catalog/absint-query/absint-query-executor.js +1 -2
  295. package/queries/catalog/call-context-query/call-context-query-executor.js +2 -4
  296. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
  297. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +33 -6
  298. package/queries/catalog/control-flow-query/control-flow-query-executor.js +1 -2
  299. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  300. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +8 -7
  301. package/queries/catalog/dependencies-query/dependencies-query-format.js +22 -35
  302. package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +13 -1
  303. package/queries/catalog/dependencies-query/function-info/library-functions.js +26 -22
  304. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +9 -0
  305. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +19 -0
  306. package/queries/catalog/dependencies-query/implicit-echo.d.ts +13 -0
  307. package/queries/catalog/dependencies-query/implicit-echo.js +133 -0
  308. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
  309. package/queries/catalog/happens-before-query/happens-before-query-executor.js +1 -2
  310. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
  311. package/queries/catalog/signature-query/signature-query-executor.js +4 -3
  312. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
  313. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  314. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  315. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  316. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
  317. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +4 -1
  318. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +5 -2
  319. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  320. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
  321. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  322. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
  323. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  324. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
  325. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  326. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
  327. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  328. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
  329. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +6 -4
  330. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +6 -4
  331. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  332. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
  333. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  334. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
  335. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  336. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
  337. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  338. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
  339. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  340. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
  341. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +6 -0
  342. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +13 -0
  343. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +8 -0
  344. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +8 -0
  345. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  346. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
  347. package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +1 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +1 -0
  349. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  350. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  352. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +1 -0
  353. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  354. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
  355. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  356. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
  357. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  358. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
  359. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
  360. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -1
  361. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +0 -5
  362. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
  363. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +3 -2
  364. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then-else.js +2 -1
  365. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +2 -1
  366. package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
  367. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
  368. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.d.ts +2 -2
  369. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +6 -3
  370. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +2 -1
  371. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +2 -1
  372. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +5 -3
  373. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +2 -1
  374. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -1
  375. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
  376. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +5 -3
  377. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -1
  378. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.d.ts +1 -1
  379. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -1
  380. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +3 -1
  381. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +1 -1
  382. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +2 -1
  383. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +5 -3
  384. package/reconstruct/inline/source-inline-map.js +3 -3
  385. package/reconstruct/reconstruct.js +6 -4
  386. package/search/flowr-search-builder.d.ts +8 -8
  387. package/search/flowr-search-builder.js +4 -4
  388. package/search/flowr-search-filters.d.ts +2 -2
  389. package/search/flowr-search-filters.js +3 -2
  390. package/search/search-executor/search-enrichers.d.ts +6 -0
  391. package/search/search-executor/search-enrichers.js +44 -5
  392. package/slicing/criterion/filters/all-variables.js +2 -1
  393. package/slicing/criterion/parse.js +8 -6
  394. package/slicing/static/slice-call.js +2 -2
  395. package/util/arg-matching.d.ts +3 -0
  396. package/util/arg-matching.js +12 -1
  397. package/util/collections/arrays.d.ts +0 -4
  398. package/util/collections/arrays.js +4 -26
  399. package/util/diff-graph.d.ts +1 -1
  400. package/util/diff-graph.js +17 -3
  401. package/util/diff.d.ts +6 -0
  402. package/util/mermaid/ast.d.ts +1 -1
  403. package/util/mermaid/ast.js +5 -4
  404. package/util/mermaid/cfg.js +130 -24
  405. package/util/mermaid/dfg.js +31 -10
  406. package/util/mermaid/mermaid.js +2 -0
  407. package/util/objects.d.ts +24 -4
  408. package/util/objects.js +12 -0
  409. package/util/prefix.d.ts +1 -1
  410. package/util/text/playground-link.d.ts +131 -0
  411. package/util/text/playground-link.js +214 -0
  412. package/util/text/strings.js +7 -3
  413. package/util/version.js +1 -1
  414. package/control-flow/cfg-builder.d.ts +0 -30
  415. package/control-flow/cfg-builder.js +0 -79
  416. package/control-flow/extract-cfg.d.ts +0 -36
  417. package/control-flow/extract-cfg.js +0 -693
  418. package/project/cfg-kind.d.ts +0 -21
  419. package/project/cfg-kind.js +0 -26
@@ -4,35 +4,22 @@ exports.FlowrAnalyzerMetaTestFilesPlugin = void 0;
4
4
  const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
5
  const semver_1 = require("semver");
6
6
  const flowr_file_1 = require("../../context/flowr-file");
7
- const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
7
  const TestPathPattern = /tests?/i;
9
8
  /**
10
9
  * This plugin provides supports for the identification of test files.
11
10
  * If you use multiple plugins, this should be included *before* other plugins.
12
11
  */
13
- class FlowrAnalyzerMetaTestFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
12
+ class FlowrAnalyzerMetaTestFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerRoleFilePlugin {
14
13
  name = 'flowr-analyzer-test-files-plugin';
15
14
  description = 'Loads test files.';
16
15
  version = new semver_1.SemVer('0.1.0');
17
- pathPattern;
16
+ roles = [flowr_file_1.FileRole.Test];
18
17
  /**
19
18
  * Creates a new instance of the TEST file plugin.
20
19
  * @param pathPattern - The pathPattern to identify TEST files, see {@link TestPathPattern} for the default pathPattern.
21
20
  */
22
21
  constructor(pathPattern = TestPathPattern) {
23
- super();
24
- this.pathPattern = pathPattern;
25
- }
26
- applies(file) {
27
- return this.pathPattern.test((0, built_in_source_1.platformDirname)(file.toString()));
28
- }
29
- /**
30
- * Processes the given file, assigning it the {@link FileRole.Test} role.
31
- * Given that the file may still need to be processed by other plugins, this method returns the `true` flag for that purpose.
32
- */
33
- process(_ctx, file) {
34
- file.assignRole(flowr_file_1.FileRole.Test);
35
- return [file, true];
22
+ super(pathPattern, flowr_analyzer_file_plugin_1.PathPart.Dirname);
36
23
  }
37
24
  }
38
25
  exports.FlowrAnalyzerMetaTestFilesPlugin = FlowrAnalyzerMetaTestFilesPlugin;
@@ -1,26 +1,18 @@
1
- import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
1
+ import { FlowrAnalyzerRoleFilePlugin } from './flowr-analyzer-file-plugin';
2
2
  import { SemVer } from 'semver';
3
- import type { PathLike } from 'fs';
4
- import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
5
- import type { FlowrFileProvider } from '../../context/flowr-file';
3
+ import { FileRole } from '../../context/flowr-file';
6
4
  /**
7
5
  * This plugin provides supports for the loading of Vignette files.
8
6
  * If you use multiple plugins, this should be included *before* other plugins.
9
7
  */
10
- export declare class FlowrAnalyzerMetaVignetteFilesPlugin extends FlowrAnalyzerFilePlugin {
8
+ export declare class FlowrAnalyzerMetaVignetteFilesPlugin extends FlowrAnalyzerRoleFilePlugin {
11
9
  readonly name = "flowr-analyzer-vignette-files-plugin";
12
10
  readonly description = "Loads vignette files.";
13
11
  readonly version: SemVer;
14
- private readonly pathPattern;
12
+ protected readonly roles: FileRole[];
15
13
  /**
16
14
  * Creates a new instance of the VIGNETTE file plugin.
17
15
  * @param pathPattern - The pathPattern to identify VIGNETTE files, see {@link VignettePathPattern} for the default pathPattern.
18
16
  */
19
17
  constructor(pathPattern?: RegExp);
20
- applies(file: PathLike): boolean;
21
- /**
22
- * Processes the given file, assigning it the {@link FileRole.Vignette} role.
23
- * Given that the file may still need to be processed by other plugins, this method returns the `true` flag for that purpose.
24
- */
25
- process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): [FlowrFileProvider, true];
26
18
  }
@@ -4,35 +4,22 @@ exports.FlowrAnalyzerMetaVignetteFilesPlugin = void 0;
4
4
  const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
5
  const semver_1 = require("semver");
6
6
  const flowr_file_1 = require("../../context/flowr-file");
7
- const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
7
  const VignettePathPattern = /vignettes?/i;
9
8
  /**
10
9
  * This plugin provides supports for the loading of Vignette files.
11
10
  * If you use multiple plugins, this should be included *before* other plugins.
12
11
  */
13
- class FlowrAnalyzerMetaVignetteFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
12
+ class FlowrAnalyzerMetaVignetteFilesPlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerRoleFilePlugin {
14
13
  name = 'flowr-analyzer-vignette-files-plugin';
15
14
  description = 'Loads vignette files.';
16
15
  version = new semver_1.SemVer('0.1.0');
17
- pathPattern;
16
+ roles = [flowr_file_1.FileRole.Vignette];
18
17
  /**
19
18
  * Creates a new instance of the VIGNETTE file plugin.
20
19
  * @param pathPattern - The pathPattern to identify VIGNETTE files, see {@link VignettePathPattern} for the default pathPattern.
21
20
  */
22
21
  constructor(pathPattern = VignettePathPattern) {
23
- super();
24
- this.pathPattern = pathPattern;
25
- }
26
- applies(file) {
27
- return this.pathPattern.test((0, built_in_source_1.platformDirname)(file.toString()));
28
- }
29
- /**
30
- * Processes the given file, assigning it the {@link FileRole.Vignette} role.
31
- * Given that the file may still need to be processed by other plugins, this method returns the `true` flag for that purpose.
32
- */
33
- process(_ctx, file) {
34
- file.assignRole(flowr_file_1.FileRole.Vignette);
35
- return [file, true];
22
+ super(pathPattern, flowr_analyzer_file_plugin_1.PathPart.Dirname);
36
23
  }
37
24
  }
38
25
  exports.FlowrAnalyzerMetaVignetteFilesPlugin = FlowrAnalyzerMetaVignetteFilesPlugin;
@@ -1,26 +1,18 @@
1
- import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
1
+ import { FlowrAnalyzerRoleFilePlugin } from './flowr-analyzer-file-plugin';
2
2
  import { SemVer } from 'semver';
3
- import type { PathLike } from 'fs';
4
- import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
5
- import type { FlowrFileProvider } from '../../context/flowr-file';
3
+ import { FileRole } from '../../context/flowr-file';
6
4
  /**
7
5
  * Tags a project's virtual-environment lockfiles with the {@link FileRole.VirtualEnv} role, so the version
8
6
  * plugins that read them can look them up by role instead of scanning every project file.
9
7
  */
10
- export declare class FlowrAnalyzerVirtualEnvFilePlugin extends FlowrAnalyzerFilePlugin {
8
+ export declare class FlowrAnalyzerVirtualEnvFilePlugin extends FlowrAnalyzerRoleFilePlugin {
11
9
  readonly name = "flowr-analyzer-virtualenv-files-plugin";
12
10
  readonly description = "Marks virtual-environment lockfiles (renv.lock, rv.lock, uvr.lock).";
13
11
  readonly version: SemVer;
14
- private readonly pathPattern;
12
+ protected readonly roles: FileRole[];
15
13
  /**
16
14
  * Creates a new instance of the virtual-environment file plugin.
17
15
  * @param pathPattern - The pattern to identify lockfiles, see {@link VirtualEnvFilePattern} for the default.
18
16
  */
19
17
  constructor(pathPattern?: RegExp);
20
- applies(file: PathLike): boolean;
21
- /**
22
- * Processes the given file, assigning it the {@link FileRole.VirtualEnv} role. The file may still be
23
- * relevant to other plugins, so this returns the `true` flag to keep the loader chain going.
24
- */
25
- process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): [FlowrFileProvider, true];
26
18
  }
@@ -4,36 +4,23 @@ exports.FlowrAnalyzerVirtualEnvFilePlugin = void 0;
4
4
  const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
5
  const semver_1 = require("semver");
6
6
  const flowr_file_1 = require("../../context/flowr-file");
7
- const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
7
  /** Lockfiles pinning a project's package environment (`renv.lock`, `rv.lock`, `uvr.lock`, `packrat.lock`). */
9
8
  const VirtualEnvFilePattern = /^(renv|rv|uvr|packrat)\.lock$/i;
10
9
  /**
11
10
  * Tags a project's virtual-environment lockfiles with the {@link FileRole.VirtualEnv} role, so the version
12
11
  * plugins that read them can look them up by role instead of scanning every project file.
13
12
  */
14
- class FlowrAnalyzerVirtualEnvFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
13
+ class FlowrAnalyzerVirtualEnvFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerRoleFilePlugin {
15
14
  name = 'flowr-analyzer-virtualenv-files-plugin';
16
15
  description = 'Marks virtual-environment lockfiles (renv.lock, rv.lock, uvr.lock).';
17
16
  version = new semver_1.SemVer('0.1.0');
18
- pathPattern;
17
+ roles = [flowr_file_1.FileRole.VirtualEnv];
19
18
  /**
20
19
  * Creates a new instance of the virtual-environment file plugin.
21
20
  * @param pathPattern - The pattern to identify lockfiles, see {@link VirtualEnvFilePattern} for the default.
22
21
  */
23
22
  constructor(pathPattern = VirtualEnvFilePattern) {
24
- super();
25
- this.pathPattern = pathPattern;
26
- }
27
- applies(file) {
28
- return this.pathPattern.test((0, built_in_source_1.platformBasename)(file.toString()));
29
- }
30
- /**
31
- * Processes the given file, assigning it the {@link FileRole.VirtualEnv} role. The file may still be
32
- * relevant to other plugins, so this returns the `true` flag to keep the loader chain going.
33
- */
34
- process(_ctx, file) {
35
- file.assignRole(flowr_file_1.FileRole.VirtualEnv);
36
- return [file, true];
23
+ super(pathPattern);
37
24
  }
38
25
  }
39
26
  exports.FlowrAnalyzerVirtualEnvFilePlugin = FlowrAnalyzerVirtualEnvFilePlugin;
@@ -1,22 +1,19 @@
1
- import type { PathLike } from 'fs';
2
1
  import { SemVer } from 'semver';
3
2
  import type { FlowrAnalyzerContext } from '../../../context/flowr-analyzer-context';
4
3
  import type { FlowrFileProvider } from '../../../context/flowr-file';
5
- import { FlowrAnalyzerFilePlugin } from '../flowr-analyzer-file-plugin';
4
+ import { FlowrAnalyzerPatternFilePlugin } from '../flowr-analyzer-file-plugin';
6
5
  import { FlowrJupyterFile } from '../files/flowr-jupyter-file';
7
6
  /**
8
7
  * The plugin provides support for Jupyter (`.ipynb`) files
9
8
  */
10
- export declare class FlowrAnalyzerJupyterFilePlugin extends FlowrAnalyzerFilePlugin {
9
+ export declare class FlowrAnalyzerJupyterFilePlugin extends FlowrAnalyzerPatternFilePlugin {
11
10
  readonly name = "ipynb-file-plugin";
12
11
  readonly description = "Parses Jupyter files";
13
12
  readonly version: SemVer;
14
- private readonly pattern;
15
13
  /**
16
14
  * Creates a new instance of the Jupyter file plugin.
17
15
  * @param filePattern - The pattern to identify Jupyter files, see {@link IpynbPattern} for the default pattern.
18
16
  */
19
17
  constructor(filePattern?: RegExp);
20
- applies(file: PathLike): boolean;
21
18
  protected process(_ctx: FlowrAnalyzerContext, arg: FlowrFileProvider<string>): FlowrJupyterFile;
22
19
  }
@@ -3,27 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowrAnalyzerJupyterFilePlugin = void 0;
4
4
  const semver_1 = require("semver");
5
5
  const flowr_analyzer_file_plugin_1 = require("../flowr-analyzer-file-plugin");
6
- const built_in_source_1 = require("../../../../dataflow/internal/process/functions/call/built-in/built-in-source");
7
6
  const flowr_jupyter_file_1 = require("../files/flowr-jupyter-file");
8
7
  const IpynbPattern = /\.ipynb$/i;
9
8
  /**
10
9
  * The plugin provides support for Jupyter (`.ipynb`) files
11
10
  */
12
- class FlowrAnalyzerJupyterFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
11
+ class FlowrAnalyzerJupyterFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerPatternFilePlugin {
13
12
  name = 'ipynb-file-plugin';
14
13
  description = 'Parses Jupyter files';
15
14
  version = new semver_1.SemVer('0.1.0');
16
- pattern;
17
15
  /**
18
16
  * Creates a new instance of the Jupyter file plugin.
19
17
  * @param filePattern - The pattern to identify Jupyter files, see {@link IpynbPattern} for the default pattern.
20
18
  */
21
19
  constructor(filePattern = IpynbPattern) {
22
- super();
23
- this.pattern = filePattern;
24
- }
25
- applies(file) {
26
- return this.pattern.test((0, built_in_source_1.platformBasename)(file.toString()));
20
+ super(filePattern);
27
21
  }
28
22
  process(_ctx, arg) {
29
23
  return flowr_jupyter_file_1.FlowrJupyterFile.from(arg);
@@ -1,16 +1,12 @@
1
- import type { PathLike } from 'fs';
2
1
  import { SemVer } from 'semver';
3
2
  import type { FlowrAnalyzerContext } from '../../../context/flowr-analyzer-context';
4
3
  import type { FlowrFileProvider } from '../../../context/flowr-file';
5
- import { FlowrAnalyzerFilePlugin } from '../flowr-analyzer-file-plugin';
4
+ import { FlowrAnalyzerPatternFilePlugin } from '../flowr-analyzer-file-plugin';
6
5
  import { FlowrRMarkdownFile } from '../files/flowr-rmarkdown-file';
7
6
  /**
8
7
  * Common base of the plugins reading an R Markdown flavor, which differ only in the files they claim.
9
8
  */
10
- export declare abstract class FlowrAnalyzerRMarkdownFilePlugin extends FlowrAnalyzerFilePlugin {
9
+ export declare abstract class FlowrAnalyzerRMarkdownFilePlugin extends FlowrAnalyzerPatternFilePlugin {
11
10
  readonly version: SemVer;
12
- private readonly pattern;
13
- protected constructor(filePattern: RegExp);
14
- applies(file: PathLike): boolean;
15
11
  protected process(ctx: FlowrAnalyzerContext, arg: FlowrFileProvider<string>): FlowrRMarkdownFile;
16
12
  }
@@ -4,20 +4,11 @@ exports.FlowrAnalyzerRMarkdownFilePlugin = void 0;
4
4
  const semver_1 = require("semver");
5
5
  const flowr_analyzer_file_plugin_1 = require("../flowr-analyzer-file-plugin");
6
6
  const flowr_rmarkdown_file_1 = require("../files/flowr-rmarkdown-file");
7
- const built_in_source_1 = require("../../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
7
  /**
9
8
  * Common base of the plugins reading an R Markdown flavor, which differ only in the files they claim.
10
9
  */
11
- class FlowrAnalyzerRMarkdownFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
10
+ class FlowrAnalyzerRMarkdownFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerPatternFilePlugin {
12
11
  version = new semver_1.SemVer('0.1.0');
13
- pattern;
14
- constructor(filePattern) {
15
- super();
16
- this.pattern = filePattern;
17
- }
18
- applies(file) {
19
- return this.pattern.test((0, built_in_source_1.platformBasename)(file.toString()));
20
- }
21
12
  process(ctx, arg) {
22
13
  return flowr_rmarkdown_file_1.FlowrRMarkdownFile.from(arg, ctx);
23
14
  }
@@ -1,22 +1,19 @@
1
- import type { PathLike } from 'fs';
2
1
  import { SemVer } from 'semver';
3
2
  import type { FlowrAnalyzerContext } from '../../../context/flowr-analyzer-context';
4
3
  import type { FlowrFileProvider } from '../../../context/flowr-file';
5
- import { FlowrAnalyzerFilePlugin } from '../flowr-analyzer-file-plugin';
4
+ import { FlowrAnalyzerPatternFilePlugin } from '../flowr-analyzer-file-plugin';
6
5
  import { FlowrSweaveFile } from '../files/flowr-sweave-file';
7
6
  /**
8
7
  * The plugin provides support for Sweave (`.Rnw`) files
9
8
  */
10
- export declare class FlowrAnalyzerSweaveFilePlugin extends FlowrAnalyzerFilePlugin {
9
+ export declare class FlowrAnalyzerSweaveFilePlugin extends FlowrAnalyzerPatternFilePlugin {
11
10
  readonly name = "sweave-file-plugin";
12
11
  readonly description = "Parses R Sweave files";
13
12
  readonly version: SemVer;
14
- private readonly pattern;
15
13
  /**
16
14
  * Creates a new instance of the Sweave file plugin.
17
15
  * @param filePattern - The pattern to identify Sweave files, see {@link SweavePattern} for the default pattern.
18
16
  */
19
17
  constructor(filePattern?: RegExp);
20
- applies(file: PathLike): boolean;
21
18
  protected process(_ctx: FlowrAnalyzerContext, arg: FlowrFileProvider<string>): FlowrSweaveFile;
22
19
  }
@@ -3,27 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowrAnalyzerSweaveFilePlugin = void 0;
4
4
  const semver_1 = require("semver");
5
5
  const flowr_analyzer_file_plugin_1 = require("../flowr-analyzer-file-plugin");
6
- const built_in_source_1 = require("../../../../dataflow/internal/process/functions/call/built-in/built-in-source");
7
6
  const flowr_sweave_file_1 = require("../files/flowr-sweave-file");
8
7
  const SweavePattern = /\.Rnw$/i;
9
8
  /**
10
9
  * The plugin provides support for Sweave (`.Rnw`) files
11
10
  */
12
- class FlowrAnalyzerSweaveFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
11
+ class FlowrAnalyzerSweaveFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerPatternFilePlugin {
13
12
  name = 'sweave-file-plugin';
14
13
  description = 'Parses R Sweave files';
15
14
  version = new semver_1.SemVer('0.1.0');
16
- pattern;
17
15
  /**
18
16
  * Creates a new instance of the Sweave file plugin.
19
17
  * @param filePattern - The pattern to identify Sweave files, see {@link SweavePattern} for the default pattern.
20
18
  */
21
19
  constructor(filePattern = SweavePattern) {
22
- super();
23
- this.pattern = filePattern;
24
- }
25
- applies(file) {
26
- return this.pattern.test((0, built_in_source_1.platformBasename)(file.toString()));
20
+ super(filePattern);
27
21
  }
28
22
  process(_ctx, arg) {
29
23
  return flowr_sweave_file_1.FlowrSweaveFile.from(arg);
@@ -11,6 +11,7 @@ const flowr_file_1 = require("../../context/flowr-file");
11
11
  const flowr_description_file_1 = require("../file-plugins/files/flowr-description-file");
12
12
  const flowr_namespace_file_1 = require("../file-plugins/files/flowr-namespace-file");
13
13
  const log_1 = require("../../../util/log");
14
+ const arrays_1 = require("../../../util/collections/arrays");
14
15
  const fs_1 = __importDefault(require("fs"));
15
16
  const path_1 = __importDefault(require("path"));
16
17
  exports.libraryLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-package-versions-library-plugin' });
@@ -38,7 +39,7 @@ function libraryRoots(opts, projectRoot) {
38
39
  const local = opts.useProjectLibrary === false || projectRoot === undefined ? [] :
39
40
  ['renv/library', 'renv/staging', 'packrat/lib'].map(d => path_1.default.join(projectRoot, d))
40
41
  .flatMap(d => [d, ...libraryDirs(d, opts.maxDepth ?? 3)]);
41
- return [...new Set([...fromEnv, ...local])].filter(d => d.length > 0);
42
+ return (0, arrays_1.uniqueArray)([...fromEnv, ...local]).filter(d => d.length > 0);
42
43
  }
43
44
  /**
44
45
  * The package installed under `name` in one of `roots`, read from its own `DESCRIPTION` and `NAMESPACE`.
@@ -1,4 +1,4 @@
1
- import { SigDbMagic, SigDbSchema, type PkgBlob, type SigDb, type SigDbFeatures, type SigDbPkgMeta, type SigDbShard, type SigDbTier, type SigVersionInfo } from './schema';
1
+ import { SigDbMagic, SigDbSchema, type PkgBlob, type SigDb, type SigDbFeatures, type SigDbPkgMetaIndex, type SigDbShard, type SigDbTier, type SigVersionInfo } from './schema';
2
2
  import { type SigDbIndex, type SigShardIndexWire } from './index-format';
3
3
  import { type SigDbManifest, type SigDbShardRef, type SigDbDictRef } from './manifest';
4
4
  /** per-package metadata handed to {@link SigDbBuilder.addPackage} (everything but `latest` defaults) */
@@ -73,7 +73,7 @@ export interface ShardedSigDb {
73
73
  strings: string[];
74
74
  dictHash: string;
75
75
  /** package name to metadata, shared by every shard */
76
- meta: Record<string, SigDbPkgMeta>;
76
+ meta: SigDbPkgMetaIndex;
77
77
  shards: SigShard[];
78
78
  }
79
79
  /** options for {@link SigDbBuilder.build} */
@@ -38,11 +38,6 @@ export interface DecodedFunction {
38
38
  /** the Rd help topic (man-page name) documenting this function, when it differs from {@link name} */
39
39
  readonly topic?: string;
40
40
  }
41
- /**
42
- * The formal parameter names of a known signature, ready for `RFunctionCall.matchArgumentsToParameters`: the
43
- * `...` parameter is excluded so partial (`pmatch`) matches against the remaining names stay unambiguous.
44
- */
45
- export declare function signatureParameterNames(signature: readonly SigParameter[]): string[];
46
41
  /**
47
42
  * The transitive callees of `name`. Each local callee that is itself a function of `functions` (one package
48
43
  * version's set) is expanded, names outside the set stay as leaves. Deduplicated and ascending.
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.blobTuple = void 0;
4
4
  exports.cranBlobUrl = cranBlobUrl;
5
5
  exports.tupleToBlob = tupleToBlob;
6
- exports.signatureParameterNames = signatureParameterNames;
7
6
  exports.transitiveCallees = transitiveCallees;
8
7
  exports.decodeFunction = decodeFunction;
9
8
  exports.decodeDependencies = decodeDependencies;
@@ -38,13 +37,6 @@ exports.blobTuple = blobTuple;
38
37
  function tupleToBlob(t) {
39
38
  return { sigs: t[0], cgs: t[1], fns: t[2], versions: t[3], noncran: t[4]?.length ? t[4] : undefined, deps: t[5] ?? [], depsByVersion: t[6] ?? {}, dates: t[7] ?? {} };
40
39
  }
41
- /**
42
- * The formal parameter names of a known signature, ready for `RFunctionCall.matchArgumentsToParameters`: the
43
- * `...` parameter is excluded so partial (`pmatch`) matches against the remaining names stay unambiguous.
44
- */
45
- function signatureParameterNames(signature) {
46
- return signature.map(p => p.name).filter(n => n !== '...');
47
- }
48
40
  /**
49
41
  * The transitive callees of `name`. Each local callee that is itself a function of `functions` (one package
50
42
  * version's set) is expanded, names outside the set stay as leaves. Deduplicated and ascending.
@@ -1,4 +1,4 @@
1
- import type { SigDbPkgMeta } from './schema';
1
+ import type { SigDbPkgMetaIndex } from './schema';
2
2
  /** a byte range `[startByte, bytes]` in the plain `.ndjson` */
3
3
  export type ByteRange = [startByte: number, bytes: number];
4
4
  /**
@@ -16,7 +16,7 @@ export interface SigDbIndex {
16
16
  /** package name to blob index */
17
17
  pkgs: Record<string, number>;
18
18
  /** package name to metadata */
19
- meta: Record<string, SigDbPkgMeta>;
19
+ meta: SigDbPkgMetaIndex;
20
20
  }
21
21
  /** the on-disk (compact) form of a {@link SigDbIndex}: short keys, `meta` optional (hoisted into a manifest) */
22
22
  export interface SigDbIndexWire {
@@ -24,7 +24,7 @@ export interface SigDbIndexWire {
24
24
  d: ByteRange;
25
25
  b: ByteRange[];
26
26
  p: Record<string, number>;
27
- m?: Record<string, SigDbPkgMeta>;
27
+ m?: SigDbPkgMetaIndex;
28
28
  }
29
29
  /** the on-disk (compact) index of a blob-only shard (no dictionary of its own; it shares a dictionary file) */
30
30
  export interface SigShardIndexWire {
@@ -35,6 +35,6 @@ export interface SigShardIndexWire {
35
35
  /** encode an index to its compact on-disk form; omit `meta` when it is hoisted elsewhere (a manifest) */
36
36
  export declare function encodeIndex(i: SigDbIndex, withMeta?: boolean): SigDbIndexWire;
37
37
  /** decode a compact index; `meta` falls back to a hoisted map, and `dict` to empty (a blob-only shard) */
38
- export declare function decodeIndex(w: SigDbIndexWire | SigShardIndexWire, meta?: Record<string, SigDbPkgMeta>): SigDbIndex;
38
+ export declare function decodeIndex(w: SigDbIndexWire | SigShardIndexWire, meta?: SigDbPkgMetaIndex): SigDbIndex;
39
39
  /** read a plain bundle's sidecar `.idx` file and decode it */
40
40
  export declare function readSigDbIndex(plainFile: string): SigDbIndex;
@@ -1,4 +1,4 @@
1
- import { type SigDbPkgMeta, type SigDbShard, type SigDbTier } from './schema';
1
+ import { type SigDbPkgMetaIndex, type SigDbShard, type SigDbTier } from './schema';
2
2
  import type { ByteRange, SigDbIndexWire, SigShardIndexWire } from './index-format';
3
3
  export declare const SigDbManifestMagic = "flowr-sigdb-manifest";
4
4
  export declare const SigDbManifestSchema = 2;
@@ -39,7 +39,7 @@ export interface SigDbManifest {
39
39
  generated: number;
40
40
  cranBase?: string;
41
41
  /** package metadata, hoisted here once and shared by every shard (they hold overlapping package sets) */
42
- meta?: Record<string, SigDbPkgMeta>;
42
+ meta?: SigDbPkgMetaIndex;
43
43
  /** shared string dictionaries; a shard references one by id (they are stored once, not per shard) */
44
44
  dicts?: SigDbDictRef[];
45
45
  shards: SigDbShardRef[];
@@ -10,6 +10,11 @@ export declare function readSignatureDb(file: string): Promise<SigDb>;
10
10
  * The read interface every package-signature source implements, so a single {@link SigDatabase} and a
11
11
  * sharded {@link SigDatabaseSet} are interchangeable. Queries are synchronous; any decompression/caching
12
12
  * happens once during `open`.
13
+ *
14
+ * Where a query takes an optional `version` and none is given, it answers for the newest version the database
15
+ * holds for that package. That is not the version flowR assumed for the project, and nothing here reads the
16
+ * configuration, the `DESCRIPTION`, or a lockfile. A caller wanting the assumed version resolves it and passes
17
+ * it, as {@link FlowrAnalyzerDependenciesContext} does before falling back to the versionless call.
13
18
  */
14
19
  export interface PackageSignatureSource {
15
20
  /** whether the source can resolve the package at all */
@@ -18,28 +23,53 @@ export interface PackageSignatureSource {
18
23
  hasVersion(pkg: string, version: string): boolean;
19
24
  /** whether a version is a current CRAN release (i.e. not in the package's `noncran`/removed set) */
20
25
  isCranVersion(pkg: string, version: string): boolean;
21
- /** the export view of a package version (defaults to its latest) */
22
- lookup(pkg: string, version?: string): LibraryExports | undefined;
23
26
  /**
24
- * The package that OWNS the class `className`: an S3 class (a same-named constructor plus a registered method,
25
- * see {@link LibraryExports.s3Classes}) or an S4 class (exported via `exportClasses`, see
26
- * {@link LibraryExports.s4Classes}); S3 ownership wins a tie. `undefined` if none does. Without `version`, backed
27
- * by a reverse index over every package's latest version, built once and cached.
27
+ * The export view of a package version.
28
+ * @param pkg - The package to look up.
29
+ * @param version - The version to answer for, the database's newest if omitted.
28
30
  */
31
+ lookup(pkg: string, version?: string): LibraryExports | undefined;
29
32
  /**
30
33
  * The packages exporting `name`, ordered by downloads (descending, ties by name). Answered without building
31
- * a reverse index: a name the database never stores is rejected outright, and only the blobs that may hold
32
- * it are decoded.
34
+ * a reverse index, as a name the database never stores is rejected outright and only the blobs that may
35
+ * hold it are decoded.
36
+ * @param name - The exported name to search for.
33
37
  */
34
38
  packagesExporting(name: string): readonly string[];
39
+ /**
40
+ * The package that OWNS the class `className`, either as an S3 class (a same-named constructor plus a
41
+ * registered method, see {@link LibraryExports.s3Classes}) or as an S4 class (exported via `exportClasses`,
42
+ * see {@link LibraryExports.s4Classes}). S3 ownership wins a tie, and `undefined` means no package owns it.
43
+ * @param className - The class to find the owner of.
44
+ * @param version - The version *every candidate package* is inspected at, each one's newest if omitted.
45
+ * Only the versionless form reuses the cached reverse index, the other scans package by package.
46
+ */
35
47
  classOwner(className: string, version?: string): string | undefined;
36
- /** rich per-function view (signatures + call graphs) of a package version */
48
+ /**
49
+ * Rich per-function view (signatures and call graphs) of a package version.
50
+ * @param pkg - The package to decode.
51
+ * @param version - The version to answer for, the database's newest if omitted.
52
+ */
37
53
  functions(pkg: string, version?: string): DecodedFunction[] | undefined;
38
- /** the rich view of a single function by name, decoding only it (unlike {@link functions}, which decodes the whole package) */
54
+ /**
55
+ * The rich view of a single function by name, decoding only it, unlike {@link functions}.
56
+ * @param pkg - The package the function belongs to.
57
+ * @param name - The function to decode.
58
+ * @param version - The version to answer for, the database's newest if omitted.
59
+ */
39
60
  functionByName(pkg: string, name: string, version?: string): DecodedFunction | undefined;
40
- /** the transitive callees of a function within one package version, expanding the stored local call graphs */
61
+ /**
62
+ * The transitive callees of a function within one package version, expanding the stored local call graphs.
63
+ * @param pkg - The package the function belongs to.
64
+ * @param name - The function whose callees are expanded.
65
+ * @param version - The version to answer for, the database's newest if omitted.
66
+ */
41
67
  transitiveCallees(pkg: string, name: string, version?: string): string[] | undefined;
42
- /** declared dependencies (Depends/Imports/…) of a package version, with version qualifiers */
68
+ /**
69
+ * Declared dependencies (Depends, Imports, ...) of a package version, with version qualifiers.
70
+ * @param pkg - The package to read the dependencies of.
71
+ * @param version - The version to answer for, the database's newest if omitted.
72
+ */
43
73
  dependencies(pkg: string, version?: string): ResolvedDependency[] | undefined;
44
74
  /** every package name this source can resolve */
45
75
  packageNames(): string[];
@@ -49,7 +79,12 @@ export interface PackageSignatureSource {
49
79
  downloads(pkg: string): number;
50
80
  /** for a base package, the R versions it was part of core (ascending); `undefined` otherwise */
51
81
  coreVersions(pkg: string): RVersion[] | undefined;
52
- /** the release date of a package version (defaulting to the newest release), or `undefined` if unknown */
82
+ /**
83
+ * The release date of a package version, `undefined` if unknown.
84
+ * @param pkg - The package to date.
85
+ * @param version - The version to answer for. Omitted, this defaults to the newest release *by recorded
86
+ * date*, unlike the queries above, which take the package's recorded latest.
87
+ */
53
88
  releaseDate(pkg: string, version?: string): Date | undefined;
54
89
  /** every known release of a package (version + date), ascending by R-version order */
55
90
  releaseDates(pkg: string): VersionRelease[];
@@ -135,6 +170,12 @@ export interface OpenSyncOptions {
135
170
  export interface OpenSyncFromOptions extends SigDbOpenOptions, OpenSyncOptions {
136
171
  hash?: string;
137
172
  }
173
+ /**
174
+ * Fast, partial reader for a single bundle. `open()`/`openSync()` load the string dictionary + `.idx`
175
+ * once (a single ranged read of the dictionary section, no full parse), then every query seeks straight
176
+ * to one package blob on demand. `open()` additionally decompresses a `.br`/`.gz` source into a
177
+ * hash-keyed cache and reuses it on later startups. Implements {@link PackageSignatureSource}.
178
+ */
138
179
  export declare class SigDatabase implements PackageSignatureSource {
139
180
  private closed;
140
181
  /** parsed blobs by blob index so repeated lookups skip the re-read + JSON.parse; FIFO-bounded to cap memory */
@@ -29,6 +29,7 @@ const decompress_1 = require("./decompress");
29
29
  const codec_1 = require("./codec");
30
30
  const hash_1 = require("./hash");
31
31
  const manifest_1 = require("./manifest");
32
+ const arrays_1 = require("../../util/collections/arrays");
32
33
  /** apply one `d` line (`["d", start, payload]`, new newline-blob or legacy `string[]` form) to the dictionary in place */
33
34
  function applyDictLine(json, strings) {
34
35
  const [, start, payload] = JSON.parse(json);
@@ -214,7 +215,7 @@ class MergedSignatureSource {
214
215
  return this.pick(pkg, version)?.dependencies(pkg, version);
215
216
  }
216
217
  packageNames() {
217
- return [...new Set(this.sources.flatMap(s => s.packageNames()))];
218
+ return (0, arrays_1.uniqueArray)(this.sources.flatMap(s => s.packageNames()));
218
219
  }
219
220
  isBaseR(pkg) {
220
221
  return this.sources.some(s => s.has(pkg) && s.isBaseR(pkg));
@@ -258,14 +259,14 @@ function sourceForPackage(sources, pkg) {
258
259
  const having = sources.filter(s => s.has(pkg));
259
260
  return having.length === 0 ? undefined : having.length === 1 ? having[0] : new MergedSignatureSource(having);
260
261
  }
262
+ /** the {@link SigDatabase.fd} of a database that has no file behind it (see {@link SigDatabase.fromMemory}) */
263
+ const NoFile = -1;
261
264
  /**
262
265
  * Fast, partial reader for a single bundle. `open()`/`openSync()` load the string dictionary + `.idx`
263
266
  * once (a single ranged read of the dictionary section, no full parse), then every query seeks straight
264
267
  * to one package blob on demand. `open()` additionally decompresses a `.br`/`.gz` source into a
265
268
  * hash-keyed cache and reuses it on later startups. Implements {@link PackageSignatureSource}.
266
269
  */
267
- /** the {@link SigDatabase.fd} of a database that has no file behind it (see {@link SigDatabase.fromMemory}) */
268
- const NoFile = -1;
269
270
  class SigDatabase {
270
271
  closed = false;
271
272
  /** parsed blobs by blob index so repeated lookups skip the re-read + JSON.parse; FIFO-bounded to cap memory */
@@ -127,6 +127,8 @@ export type PkgBlobTuple = [Sig[], number[][], SigFn[], Record<string, number[]>
127
127
  * the package shipped with core R, so the set of versions is exactly the R versions it was part of core.
128
128
  */
129
129
  export type SigDbPkgMeta = [latest: string, archived: number, downloads: number, core?: number];
130
+ /** Every package the database knows, mapped from its name to its {@link SigDbPkgMeta}. */
131
+ export type SigDbPkgMetaIndex = Record<string, SigDbPkgMeta>;
130
132
  /**
131
133
  * Temporal tier of a bundle's packages:
132
134
  * - `current` -- only each package's latest version.
@@ -169,7 +171,7 @@ export interface SigDb {
169
171
  /** package name to its index into {@link SigDb.blobs} */
170
172
  pkgs: Record<string, number>;
171
173
  /** package name to its {@link SigDbPkgMeta} */
172
- meta: Record<string, SigDbPkgMeta>;
174
+ meta: SigDbPkgMetaIndex;
173
175
  }
174
176
  export interface SigParamInfo {
175
177
  readonly name: string;