@eagleoutice/flowr 2.14.3 → 2.15.0

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 (385) hide show
  1. package/README.md +76 -63
  2. package/abstract-interpretation/absint-inference.d.ts +347 -0
  3. package/abstract-interpretation/{absint-visitor.js → absint-inference.js} +327 -97
  4. package/abstract-interpretation/abstract-semantics.d.ts +246 -0
  5. package/abstract-interpretation/abstract-semantics.js +3 -0
  6. package/abstract-interpretation/data-frame/{mappers/arguments.d.ts → arguments.d.ts} +18 -16
  7. package/abstract-interpretation/data-frame/{mappers/arguments.js → arguments.js} +20 -21
  8. package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +52 -0
  9. package/abstract-interpretation/data-frame/dataframe-semantics.js +1656 -0
  10. package/abstract-interpretation/data-frame/resolve-args.js +4 -4
  11. package/abstract-interpretation/data-frame/semantics.d.ts +15 -21
  12. package/abstract-interpretation/data-frame/semantics.js +27 -29
  13. package/abstract-interpretation/data-frame/shape-inference.d.ts +28 -24
  14. package/abstract-interpretation/data-frame/shape-inference.js +14 -79
  15. package/abstract-interpretation/domains/interval-domain.d.ts +5 -1
  16. package/abstract-interpretation/domains/interval-domain.js +25 -33
  17. package/abstract-interpretation/domains/multi-value-state-domain.d.ts +6 -3
  18. package/abstract-interpretation/domains/multi-value-state-domain.js +24 -4
  19. package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -6
  20. package/abstract-interpretation/domains/partial-product-domain.js +26 -43
  21. package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -6
  22. package/abstract-interpretation/domains/positive-interval-domain.js +3 -29
  23. package/abstract-interpretation/domains/product-domain.d.ts +1 -1
  24. package/abstract-interpretation/domains/set-range-domain.d.ts +6 -0
  25. package/abstract-interpretation/domains/set-range-domain.js +29 -62
  26. package/abstract-interpretation/domains/state-abstract-domain.d.ts +9 -2
  27. package/abstract-interpretation/domains/state-abstract-domain.js +26 -37
  28. package/abstract-interpretation/domains/{state-domain-like.d.ts → state-domain.d.ts} +10 -6
  29. package/abstract-interpretation/domains/{state-domain-like.js → state-domain.js} +1 -1
  30. package/abstract-interpretation/value-semantics.d.ts +113 -0
  31. package/abstract-interpretation/value-semantics.js +115 -0
  32. package/benchmark/slicer.js +12 -6
  33. package/benchmark/stats/feature-counts.d.ts +2 -1
  34. package/benchmark/stats/feature-counts.js +25 -1
  35. package/benchmark/stats/stats.d.ts +4 -0
  36. package/benchmark/summarizer/second-phase/graph.js +7 -0
  37. package/cli/repl/commands/repl-parse.js +11 -22
  38. package/cli/repl/parser/slice-query-parser.d.ts +2 -0
  39. package/cli/repl/parser/slice-query-parser.js +1 -0
  40. package/config.d.ts +30 -205
  41. package/config.js +37 -3
  42. package/control-flow/cfg-properties.d.ts +5 -0
  43. package/control-flow/cfg-properties.js +25 -7
  44. package/control-flow/control-flow-graph.d.ts +11 -37
  45. package/control-flow/control-flow-graph.js +33 -77
  46. package/control-flow/semantic-cfg-guided-visitor.d.ts +63 -320
  47. package/control-flow/semantic-cfg-guided-visitor.js +65 -320
  48. package/dataflow/environments/built-in-config.d.ts +2 -0
  49. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  50. package/dataflow/environments/built-in-proc-name.js +4 -0
  51. package/dataflow/environments/built-in-props.d.ts +192 -82
  52. package/dataflow/environments/built-in-props.js +336 -106
  53. package/dataflow/environments/built-in.d.ts +21 -9
  54. package/dataflow/environments/built-in.js +43 -12
  55. package/dataflow/environments/default-builtin-config.d.ts +3219 -328
  56. package/dataflow/environments/default-builtin-config.js +804 -1031
  57. package/dataflow/environments/environment.d.ts +26 -49
  58. package/dataflow/environments/environment.js +34 -47
  59. package/dataflow/environments/group-generics.d.ts +36 -0
  60. package/dataflow/environments/group-generics.js +58 -0
  61. package/dataflow/environments/identifier.d.ts +106 -6
  62. package/dataflow/environments/identifier.js +19 -1
  63. package/dataflow/environments/query-fn-props.d.ts +16 -8
  64. package/dataflow/environments/query-fn-props.js +45 -21
  65. package/dataflow/environments/resolve-by-name.js +9 -2
  66. package/dataflow/environments/scoping.d.ts +5 -0
  67. package/dataflow/environments/scoping.js +11 -0
  68. package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
  69. package/dataflow/eval/resolve/alias-tracking.js +20 -2
  70. package/dataflow/eval/resolve/resolve-numbers.d.ts +182 -7
  71. package/dataflow/eval/resolve/resolve-numbers.js +44 -9
  72. package/dataflow/eval/resolve/resolve-strings.d.ts +79 -2
  73. package/dataflow/eval/resolve/resolve-strings.js +16 -7
  74. package/dataflow/eval/resolve/resolve.d.ts +5 -22
  75. package/dataflow/eval/resolve/resolve.js +24 -34
  76. package/dataflow/eval/values/general.d.ts +7 -1
  77. package/dataflow/eval/values/general.js +17 -3
  78. package/dataflow/eval/values/string/string-constants.d.ts +16 -15
  79. package/dataflow/eval/values/string/string-constants.js +59 -27
  80. package/dataflow/extractor.d.ts +2 -1
  81. package/dataflow/extractor.js +16 -4
  82. package/dataflow/fn/argument-roles.d.ts +35 -0
  83. package/dataflow/fn/argument-roles.js +252 -0
  84. package/dataflow/fn/class-declaration.d.ts +148 -0
  85. package/dataflow/fn/class-declaration.js +317 -0
  86. package/dataflow/fn/condition-handlers.d.ts +5 -0
  87. package/dataflow/fn/condition-handlers.js +13 -0
  88. package/dataflow/fn/exceptions-of-function.d.ts +21 -7
  89. package/dataflow/fn/exceptions-of-function.js +74 -43
  90. package/dataflow/fn/frame-reflection.d.ts +46 -0
  91. package/dataflow/fn/frame-reflection.js +169 -0
  92. package/dataflow/fn/function-props.d.ts +32 -0
  93. package/dataflow/fn/function-props.js +160 -0
  94. package/dataflow/fn/higher-order-function.d.ts +23 -5
  95. package/dataflow/fn/higher-order-function.js +64 -18
  96. package/dataflow/fn/strict-function.d.ts +24 -2
  97. package/dataflow/fn/strict-function.js +49 -19
  98. package/dataflow/graph/call-graph.js +10 -2
  99. package/dataflow/graph/df-helper.d.ts +1 -12
  100. package/dataflow/graph/df-helper.js +2 -19
  101. package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
  102. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  103. package/dataflow/graph/graph.d.ts +39 -188
  104. package/dataflow/graph/graph.js +46 -163
  105. package/dataflow/graph/match-args.d.ts +34 -2
  106. package/dataflow/graph/match-args.js +45 -12
  107. package/dataflow/graph/vertex.d.ts +8 -0
  108. package/dataflow/info.d.ts +7 -5
  109. package/dataflow/info.js +1 -5
  110. package/dataflow/internal/control-flow.js +20 -17
  111. package/dataflow/internal/linker.d.ts +8 -37
  112. package/dataflow/internal/linker.js +22 -55
  113. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -2
  114. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -8
  115. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -4
  116. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +8 -14
  117. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +43 -50
  118. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +4 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +5 -2
  120. package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +23 -0
  121. package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.js +24 -0
  122. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -2
  123. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
  124. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +0 -4
  125. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +73 -27
  126. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -11
  127. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +131 -92
  128. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +17 -12
  129. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +187 -99
  130. package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +4 -0
  131. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -0
  132. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +2 -3
  133. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +4 -3
  134. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
  135. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -2
  136. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +0 -1
  137. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -1
  138. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +31 -0
  139. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +101 -0
  140. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -1
  141. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -0
  142. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +23 -21
  143. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +1 -2
  144. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -2
  145. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +22 -1
  146. package/dataflow/internal/process/functions/call/common.d.ts +4 -6
  147. package/dataflow/internal/process/functions/call/common.js +2 -2
  148. package/dataflow/internal/process/functions/call/deferred.d.ts +1 -1
  149. package/dataflow/internal/process/functions/call/deferred.js +2 -2
  150. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +5 -3
  151. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -4
  152. package/dataflow/internal/process/functions/call/named-call-handling.js +19 -13
  153. package/dataflow/internal/process/functions/call/quoted.d.ts +2 -2
  154. package/dataflow/internal/process/functions/call/quoted.js +144 -28
  155. package/dataflow/origin/dfg-get-origin.js +23 -10
  156. package/dataflow/processor.d.ts +2 -1
  157. package/dataflow/processor.js +6 -0
  158. package/documentation/data/interface/doc-writing-code.js +2 -0
  159. package/documentation/doc-util/doc-search.js +1 -1
  160. package/documentation/wiki-absint.d.ts +11 -14
  161. package/documentation/wiki-absint.js +73 -59
  162. package/documentation/wiki-core.js +64 -24
  163. package/documentation/wiki-linter.js +1 -0
  164. package/documentation/wiki-query.js +82 -264
  165. package/documentation/wiki-signature-database.js +23 -6
  166. package/gas.d.ts +91 -47
  167. package/gas.js +97 -13
  168. package/index.d.ts +31 -0
  169. package/index.js +52 -0
  170. package/linter/linter-rules.d.ts +87 -23
  171. package/linter/linter-rules.js +3 -1
  172. package/linter/rules/absolute-path.d.ts +1 -1
  173. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  174. package/linter/rules/dataframe-access-validation.js +10 -8
  175. package/linter/rules/dead-code.d.ts +1 -1
  176. package/linter/rules/deprecated-functions.js +14 -5
  177. package/linter/rules/file-path-validity.d.ts +1 -1
  178. package/linter/rules/naming-convention.d.ts +1 -1
  179. package/linter/rules/naming-convention.js +13 -2
  180. package/linter/rules/network-functions.d.ts +10 -5
  181. package/linter/rules/network-functions.js +48 -36
  182. package/linter/rules/no-leaked-credentials.d.ts +1 -1
  183. package/linter/rules/problematic-inputs.d.ts +1 -1
  184. package/linter/rules/problematic-inputs.js +1 -1
  185. package/linter/rules/seeded-randomness.d.ts +3 -2
  186. package/linter/rules/seeded-randomness.js +7 -3
  187. package/linter/rules/software-has-license.d.ts +1 -1
  188. package/linter/rules/software-has-tests.d.ts +1 -1
  189. package/linter/rules/stop-with-call-arg.d.ts +1 -1
  190. package/linter/rules/syntactically-valid.d.ts +1 -1
  191. package/linter/rules/unclosed-connection.d.ts +3 -3
  192. package/linter/rules/unclosed-connection.js +3 -4
  193. package/linter/rules/undefined-symbol.d.ts +1 -1
  194. package/linter/rules/unescaped-arguments.d.ts +161 -0
  195. package/linter/rules/unescaped-arguments.js +293 -0
  196. package/linter/rules/unused-definition.d.ts +1 -1
  197. package/linter/rules/unused-definition.js +51 -6
  198. package/linter/rules/unused-import.d.ts +1 -1
  199. package/linter/rules/useless-loop.d.ts +1 -1
  200. package/package.json +3 -198
  201. package/project/context/flowr-analyzer-environment-context.d.ts +12 -1
  202. package/project/context/flowr-analyzer-environment-context.js +33 -1
  203. package/project/context/flowr-analyzer-files-context.d.ts +24 -1
  204. package/project/context/flowr-analyzer-files-context.js +42 -21
  205. package/project/context/flowr-analyzer-functions-context.d.ts +8 -0
  206. package/project/context/flowr-analyzer-functions-context.js +2 -0
  207. package/project/context/flowr-analyzer-gas-context.d.ts +9 -1
  208. package/project/context/flowr-analyzer-gas-context.js +21 -0
  209. package/project/context/flowr-file.d.ts +16 -1
  210. package/project/context/flowr-file.js +26 -2
  211. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +19 -20
  212. package/project/plugins/file-plugins/files/flowr-description-file.js +55 -41
  213. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +9 -4
  214. package/project/plugins/file-plugins/files/flowr-jupyter-file.js +11 -3
  215. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +6 -9
  216. package/project/plugins/file-plugins/files/flowr-manifest-files.js +5 -21
  217. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +11 -12
  218. package/project/plugins/file-plugins/files/flowr-namespace-file.js +48 -61
  219. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +3 -12
  220. package/project/plugins/file-plugins/files/flowr-news-file.js +2 -19
  221. package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +145 -0
  222. package/project/plugins/file-plugins/files/flowr-rd-file.js +676 -0
  223. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +122 -422
  224. package/project/plugins/file-plugins/files/flowr-rda-file.js +517 -1005
  225. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +8 -2
  226. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +10 -1
  227. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +7 -2
  228. package/project/plugins/file-plugins/files/flowr-sweave-file.js +9 -1
  229. package/project/plugins/file-plugins/files/flowr-sysdata-file.d.ts +17 -0
  230. package/project/plugins/file-plugins/files/flowr-sysdata-file.js +40 -0
  231. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -0
  232. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +3 -1
  233. package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.d.ts +58 -0
  234. package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.js +95 -0
  235. package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.d.ts +23 -0
  236. package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.js +33 -0
  237. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +33 -72
  238. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +17 -15
  239. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +20 -37
  240. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +29 -53
  241. package/project/plugins/package-version-plugins/package.js +2 -1
  242. package/project/plugins/plugin-registry.d.ts +3 -1
  243. package/project/plugins/plugin-registry.js +11 -0
  244. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +20 -4
  245. package/project/sigdb/build.d.ts +9 -15
  246. package/project/sigdb/build.js +63 -42
  247. package/project/sigdb/decode.d.ts +10 -4
  248. package/project/sigdb/decode.js +60 -21
  249. package/project/sigdb/memory-source.d.ts +4 -0
  250. package/project/sigdb/memory-source.js +8 -0
  251. package/project/sigdb/reader.d.ts +50 -100
  252. package/project/sigdb/reader.js +84 -105
  253. package/project/sigdb/schema.d.ts +102 -26
  254. package/project/sigdb/schema.js +14 -6
  255. package/project/sigdb/signature-db.d.ts +4 -0
  256. package/project/sigdb/signature-db.js +8 -1
  257. package/queries/base-query-format.d.ts +7 -0
  258. package/queries/base-query-format.js +29 -0
  259. package/queries/catalog/absint-query/absint-query-executor.js +8 -6
  260. package/queries/catalog/absint-query/absint-query-format.d.ts +20 -9
  261. package/queries/catalog/absint-query/absint-query-format.js +32 -19
  262. package/queries/catalog/call-context-query/call-context-query-executor.js +3 -3
  263. package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
  264. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
  265. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
  266. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
  267. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
  268. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
  269. package/queries/catalog/dependencies-query/dependencies-query-executor.js +33 -7
  270. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
  271. package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +2 -2
  272. package/queries/catalog/dependencies-query/function-info/derived-functions.js +14 -4
  273. package/queries/catalog/dependencies-query/function-info/read-functions.js +7 -121
  274. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +1 -1
  275. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +2 -2
  276. package/queries/catalog/dependencies-query/function-info/visualize-functions.js +4 -46
  277. package/queries/catalog/dependencies-query/function-info/write-functions.js +3 -76
  278. package/queries/catalog/dependencies-query/implicit-echo.js +2 -2
  279. package/queries/catalog/dependencies-query/link-devices.d.ts +2 -2
  280. package/queries/catalog/dependencies-query/link-devices.js +6 -7
  281. package/queries/catalog/dice-query/dice-query-executor.js +1 -1
  282. package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
  283. package/queries/catalog/does-call-query/does-call-query-executor.js +4 -0
  284. package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -1
  285. package/queries/catalog/files-query/files-query-format.d.ts +1 -1
  286. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
  287. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -1
  288. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
  289. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
  290. package/queries/catalog/input-sources-query/input-source-functions.d.ts +1 -1
  291. package/queries/catalog/input-sources-query/input-source-functions.js +2 -2
  292. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -17
  293. package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -27
  294. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
  295. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +3 -8
  296. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -11
  297. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +4 -0
  298. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +60 -0
  299. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +35 -0
  300. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +63 -0
  301. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -6
  302. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +3 -8
  303. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -11
  304. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +3 -8
  305. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -12
  306. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
  307. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
  308. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  309. package/queries/catalog/project-query/project-query-format.d.ts +1 -1
  310. package/queries/catalog/provenance-query/provenance-query-format.d.ts +3 -8
  311. package/queries/catalog/provenance-query/provenance-query-format.js +2 -14
  312. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  313. package/queries/catalog/search-query/search-query-format.d.ts +1 -1
  314. package/queries/catalog/signature-query/signature-query-executor.d.ts +9 -9
  315. package/queries/catalog/signature-query/signature-query-executor.js +104 -95
  316. package/queries/catalog/signature-query/signature-query-format.d.ts +34 -8
  317. package/queries/catalog/signature-query/signature-query-format.js +16 -4
  318. package/queries/catalog/signature-query/signature-query-render.js +24 -4
  319. package/queries/catalog/slice-query-options.d.ts +14 -0
  320. package/queries/catalog/slice-query-options.js +15 -0
  321. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -1
  322. package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -2
  323. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -3
  324. package/queries/catalog/static-slice-query/static-slice-query-format.js +7 -5
  325. package/queries/query-function-filter.d.ts +8 -3
  326. package/queries/query-function-filter.js +16 -6
  327. package/queries/query.d.ts +38 -38
  328. package/queries/query.js +30 -4
  329. package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -0
  330. package/r-bridge/lang-4.x/ast/model/model.js +14 -0
  331. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  332. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
  333. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  334. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  335. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  336. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  337. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  338. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
  339. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  340. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  341. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  342. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  343. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  344. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
  345. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
  346. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  347. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  349. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  350. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  352. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +17 -9
  353. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +35 -27
  354. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -22
  355. package/reconstruct/reconstruct.d.ts +9 -20
  356. package/reconstruct/reconstruct.js +66 -28
  357. package/search/flowr-search-filters.d.ts +7 -6
  358. package/search/flowr-search-filters.js +6 -4
  359. package/search/search-executor/search-enrichers.d.ts +10 -10
  360. package/search/search-executor/search-enrichers.js +32 -3
  361. package/search/search-executor/search-transformer.js +15 -23
  362. package/slicing/criterion/parse.js +2 -12
  363. package/slicing/static/slice-call.js +1 -8
  364. package/slicing/static/static-slicer.js +1 -1
  365. package/util/collections/bimap.js +14 -6
  366. package/util/objects.js +16 -17
  367. package/util/r-value.d.ts +5 -4
  368. package/util/record.d.ts +38 -3
  369. package/util/record.js +48 -1
  370. package/util/simple-df/dfg-ascii.js +1 -1
  371. package/util/text/name-rank.js +8 -2
  372. package/util/text/strings.d.ts +5 -0
  373. package/util/text/strings.js +10 -0
  374. package/util/version.js +2 -2
  375. package/abstract-interpretation/absint-visitor.d.ts +0 -223
  376. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -19
  377. package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -151
  378. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +0 -287
  379. package/abstract-interpretation/data-frame/mappers/function-mapper.js +0 -1096
  380. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -15
  381. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -207
  382. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +0 -6
  383. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +0 -25
  384. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +0 -31
  385. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +0 -56
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.14.3",
3
+ "version": "2.15.0",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "engines": {
6
6
  "node": ">=22"
7
7
  },
8
- "types": "dist/src/index.d.ts",
8
+ "main": "index.js",
9
+ "types": "index.d.ts",
9
10
  "repository": {
10
11
  "type": "git",
11
12
  "url": "git+https://github.com/flowr-analysis/flowr.git"
@@ -14,49 +15,6 @@
14
15
  "bugs": {
15
16
  "url": "https://github.com/flowr-analysis/flowr/issues"
16
17
  },
17
- "scripts": {
18
- "setup:dev": "npm ci && ts-node --transpile-only scripts/setup-dev.ts",
19
- "flowr": "npm run main --",
20
- "flowr:dev": "npm run sync:sigdb && npm run gen:base-packages && npm run main-dev --",
21
- "main": "npm run build:bundle-flowr && node dist/src/cli/flowr.min.js",
22
- "main-dev": "node -r ts-node/register --watch src/cli/flowr.ts",
23
- "slicer": "ts-node src/cli/slicer-app.ts",
24
- "benchmark": "npm run build:dev && node dist/src/cli/benchmark-app.js",
25
- "benchmark-helper": "ts-node src/cli/benchmark-helper-app.ts",
26
- "summarizer": "ts-node src/cli/summarizer-app.ts",
27
- "build": "npm run gen:base-packages && tsc --project . && npm run build:copy-data",
28
- "build:dev": "npm run build && npm run build:copy-wasm",
29
- "build:bundle-flowr": "npm run build && esbuild --bundle dist/src/cli/flowr.js --platform=node --tree-shaking=true --minify --external:clipboardy --target=node22 --outfile=dist/src/cli/flowr.min.js && npm run build:copy-wasm",
30
- "build:copy-data": "ts-node --transpile-only scripts/sigdb-copy.ts",
31
- "build:copy-wasm": "mkdir -p dist/node_modules/@davisvaughan/tree-sitter-r/ && mkdir -p dist/node_modules/web-tree-sitter && cp node_modules/@davisvaughan/tree-sitter-r/tree-sitter-r.wasm dist/node_modules/@davisvaughan/tree-sitter-r/ && cp node_modules/web-tree-sitter/tree-sitter.wasm dist/node_modules/web-tree-sitter/",
32
- "gen:base-packages": "ts-node --transpile-only scripts/gen-base-packages.ts",
33
- "gen:landing": "ts-node --transpile-only scripts/gen-landing.ts && ts-node --transpile-only scripts/gen-sigdb-index.ts && ts-node --transpile-only scripts/gen-playground.ts",
34
- "gen:sigdb-remote": "ts-node --transpile-only scripts/sigdb-remote.ts",
35
- "sync:sigdb": "ts-node --transpile-only scripts/sigdb-sync.ts",
36
- "publish:sigdb": "ts-node scripts/publish-sigdb.ts",
37
- "wiki": "ts-node src/cli/wiki.ts",
38
- "wiki:watch": "node -r ts-node/register --watch src/cli/wiki.ts --keep-alive",
39
- "doc": "node --max-old-space-size=8192 node_modules/typedoc/dist/cli.js",
40
- "typecheck": "tsc --noEmit --project .",
41
- "lint": "npm run license-compat -- --summary && npm run typecheck && npx eslint --version && npx eslint src/ test/ scripts/ --concurrency=auto --cache --cache-location node_modules/.cache/eslint",
42
- "lint-local": "npm run typecheck && npx eslint --version && npx eslint src/ test/ scripts/ --concurrency=auto --cache --cache-location node_modules/.cache/eslint-local --rule \"no-warning-comments: off\"",
43
- "license-compat": "license-checker-rseidelsohn --onlyAllow 'MIT;MPL-2.0;MIT OR X11;GPLv2;LGPL;GNUGPL;ISC;Apache-2.0;FreeBSD;BSD-2-Clause;clearbsd;ModifiedBSD;BSD-3-Clause;Python-2.0;Unlicense;WTFPL;BlueOak-1.0.0;CC-BY-4.0;CC-BY-3.0;CC0-1.0;0BSD' --clarificationsFile license-clarifications.json",
44
- "check:generic-labels": "ts-node --transpile-only scripts/check-generic-labels.ts",
45
- "detect-circular-deps": "npx madge --extensions ts,tsx --circular src/",
46
- "checkup": "ts-node scripts/checkup-parallel.ts",
47
- "test": "vitest --exclude \"test/system-tests/**\" --config test/vitest.config.mts",
48
- "test:full": "npm run test:coverage -- --no-watch --reporter=default --reporter=json --outputFile.json=coverage/flowr-test-results.json -- --make-summary --test-installation",
49
- "test:coverage": "npm run test -- --coverage",
50
- "test:verbose": "FLOWR_VERBOSE=true vitest --exclude \"test/system-tests/**\" --config test/vitest.config.mts",
51
- "test:system": "vitest --dir test/system-tests --config test/system-tests/vitest.config.mts",
52
- "test:bench": "vitest bench --config test/vitest.config.mts",
53
- "test:performance": "func() { cd test/performance/ && bash run-all-suites.sh \"$@\"; }; func",
54
- "test:docker": "func() { b() { docker build ${1:+--network=$1} -t flowr-docker-test -f \"$2\" .; }; r() { docker run --rm ${1:+--network=$1} flowr-docker-test --version; }; for df in scripts/Dockerfile scripts/Dockerfile-NoR; do echo \"=== building $df ===\"; b '' \"$df\" || { echo '(retrying with --network=host: bridge networking unavailable)'; b host \"$df\"; } || return 1; echo \"=== smoke-testing $df ===\"; r '' || r host || return 1; done; }; func",
55
- "benchmark:test-counts": "ts-node --transpile-only scripts/test-label-counts.ts",
56
- "benchmark:compact": "ts-node --transpile-only scripts/compact-benchmark-data.ts",
57
- "publish-library": "cp .npmignore package.json README.md LICENSE dist/src/ && cd dist/src && npm publish --access public",
58
- "release": "npx release-it --ci"
59
- },
60
18
  "keywords": [
61
19
  "static code analysis",
62
20
  "R programming language",
@@ -67,152 +25,6 @@
67
25
  ],
68
26
  "author": "Florian Sihler",
69
27
  "license": "ISC",
70
- "typedocOptions": {
71
- "includeVersion": true,
72
- "plugin": [
73
- "typedoc-umlclass",
74
- "typedoc-plugin-missing-exports"
75
- ],
76
- "entryPoints": [
77
- "src",
78
- "test/functionality/_helper"
79
- ],
80
- "entryPointStrategy": "expand",
81
- "exclude": [
82
- "**/node_modules/**/*",
83
- "**/index.ts"
84
- ],
85
- "highlightLanguages": [
86
- "bash",
87
- "console",
88
- "css",
89
- "html",
90
- "javascript",
91
- "json",
92
- "jsonc",
93
- "json5",
94
- "tsx",
95
- "typescript",
96
- "r"
97
- ],
98
- "out": "doc",
99
- "readme": "README.md",
100
- "umlClassDiagram": {
101
- "type": "detailed",
102
- "location": "local",
103
- "format": "svg",
104
- "position": "below",
105
- "legendType": "none",
106
- "hideEmptyMembers": true,
107
- "generatorProcessCount": 4
108
- },
109
- "maxTypeConversionDepth": 4,
110
- "skipErrorChecking": true,
111
- "lightHighlightTheme": "light-plus",
112
- "darkHighlightTheme": "dark-plus",
113
- "hideGenerator": false,
114
- "searchInComments": true,
115
- "useTsLinkResolution": true,
116
- "categorizeByGroup": true,
117
- "sort": [
118
- "static-first",
119
- "alphabetical"
120
- ],
121
- "visibilityFilters": {
122
- "protected": true,
123
- "private": true,
124
- "inherited": true,
125
- "external": true
126
- },
127
- "validation": {
128
- "notExported": true,
129
- "invalidLink": true,
130
- "notDocumented": true
131
- },
132
- "treatValidationWarningsAsErrors": false
133
- },
134
- "release-it": {
135
- "git": {
136
- "commitMessage": "[skip ci] Release v${version}",
137
- "requireCleanWorkingDir": true,
138
- "tagName": "v${version}",
139
- "commit": true,
140
- "tag": true,
141
- "push": true
142
- },
143
- "github": {
144
- "release": true,
145
- "tokenRef": "RELEASE_TOKEN",
146
- "releaseName": "Release v${version}",
147
- "web": false,
148
- "autoGenerate": true,
149
- "comments": {
150
- "submit": true,
151
- "issue": "_This issue has been resolved in v${version} (see [${releaseName}](${releaseUrl}))._",
152
- "pr": "_This pull request is included in v${version} (see [${releaseName}](${releaseUrl}))._"
153
- }
154
- },
155
- "npm": {
156
- "publish": false
157
- },
158
- "hooks": {
159
- "before:init": [
160
- "npm run lint",
161
- "npm run test:full"
162
- ],
163
- "after:bump": "npm run build:dev",
164
- "after:git:release": "echo After git push, before github release",
165
- "after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
166
- },
167
- "plugins": {
168
- "@j-ulrich/release-it-regex-bumper": {
169
- "out": [
170
- {
171
- "file": "src/util/version.ts",
172
- "search": "const version = '[\\d.]+'",
173
- "replace": "const version = '{{version}}'"
174
- },
175
- {
176
- "file": "src/util/version.ts",
177
- "search": "const versionDate = '[\\d-]+'",
178
- "replace": "const versionDate = '{{now}}'",
179
- "dateFormat": "yyyy-MM-dd"
180
- }
181
- ]
182
- }
183
- }
184
- },
185
- "devDependencies": {
186
- "@codemirror/legacy-modes": "^6.5.3",
187
- "@commitlint/cli": "^20.5.0",
188
- "@commitlint/config-angular": "^20.5.0",
189
- "@eagleoutice/eslint-config-flowr": "^2.1.3",
190
- "@j-ulrich/release-it-regex-bumper": "^5.6.0",
191
- "@types/command-line-args": "^5.2.3",
192
- "@types/command-line-usage": "^5.0.4",
193
- "@types/commonmark": "^0.27.10",
194
- "@types/dagre": "^0.7.53",
195
- "@types/n-readlines": "^1.0.6",
196
- "@types/n3": "^1.26.0",
197
- "@types/object-hash": "^3.0.6",
198
- "@types/seedrandom": "^3.0.8",
199
- "@types/semver": "^7.7.0",
200
- "@types/tmp": "^0.2.6",
201
- "@types/ws": "^8.18.1",
202
- "@vitest/coverage-v8": "^4.1.8",
203
- "codemirror": "^6.0.2",
204
- "esbuild": "^0.28.1",
205
- "eslint": "^10.8.0",
206
- "license-checker-rseidelsohn": "^4.4.2",
207
- "release-it": "^21.0.2",
208
- "seedrandom": "^3.0.5",
209
- "ts-node": "^10.9.2",
210
- "typedoc": "^0.28.17",
211
- "typedoc-plugin-missing-exports": "^4.1.2",
212
- "typedoc-umlclass": "^0.10.2",
213
- "typescript": "^5.9.3",
214
- "vitest": "^4.1.8"
215
- },
216
28
  "dependencies": {
217
29
  "@davisvaughan/tree-sitter-r": "^1.2.0",
218
30
  "@jupyterlab/nbformat": "^4.5.4",
@@ -235,13 +47,6 @@
235
47
  "web-tree-sitter": "^0.24.7",
236
48
  "ws": "^8.18.0"
237
49
  },
238
- "allowScripts": {
239
- "@davisvaughan/tree-sitter-r@1.2.0": true,
240
- "core-js-pure@3.40.0": true,
241
- "esbuild@0.28.1": true,
242
- "plantuml-pipe@1.6.0": true,
243
- "unrs-resolver@1.12.2": true
244
- },
245
50
  "optionalDependencies": {
246
51
  "clipboardy": "^4.0.0",
247
52
  "dagre": "^0.8.5",
@@ -3,7 +3,7 @@ import type { IEnvironment, REnvironmentInformation } from '../../dataflow/envir
3
3
  import type { DeepReadonly } from 'ts-essentials';
4
4
  import type { IdentifierDefinition } from '../../dataflow/environments/identifier';
5
5
  import { Identifier } from '../../dataflow/environments/identifier';
6
- import type { BuiltInIdentifierDefinition } from '../../dataflow/environments/built-in';
6
+ import type { BuiltInIdentifierDefinition, BuiltInMemory } from '../../dataflow/environments/built-in';
7
7
  import type { Fingerprint } from '../../slicing/static/fingerprint';
8
8
  /**
9
9
  * Read-only interface to the {@link FlowrAnalyzerEnvironmentContext}.
@@ -35,6 +35,7 @@ export interface ReadOnlyFlowrAnalyzerEnvironmentContext {
35
35
  get emptyBuiltInEnvironment(): DeepReadonly<IEnvironment>;
36
36
  /**
37
37
  * Create a new {@link REnvironmentInformation|environment} with the configured built-in environment as base.
38
+ * Knows only the built-ins, no attached package, so prefer {@link cleanEnvOf} wherever an environment is at hand.
38
39
  */
39
40
  makeCleanEnv(): REnvironmentInformation;
40
41
  /**
@@ -49,6 +50,10 @@ export interface ReadOnlyFlowrAnalyzerEnvironmentContext {
49
50
  * A completely empty {@link REnvironmentInformation|environment}.
50
51
  */
51
52
  makeEmptyEnv(): REnvironmentInformation;
53
+ /** What the configuration states about `pkg`'s exports, `undefined` when it states nothing (these are not in the built-in environment: attaching the package brings them into scope). */
54
+ statedFor(pkg: string): BuiltInMemory | undefined;
55
+ /** The definitions the configuration states for `name` without any package attached: its namespace's when it names one, otherwise what every package together states for the bare name. */
56
+ statedDefinitionsOf(name: Identifier): readonly IdentifierDefinition[] | undefined;
52
57
  }
53
58
  /**
54
59
  * Provides the built-in environment, created from the {@link FlowrAnalyzerContext} configuration.
@@ -57,10 +62,16 @@ export declare class FlowrAnalyzerEnvironmentContext implements ReadOnlyFlowrAna
57
62
  readonly name = "flowr-analyzer-environment-context";
58
63
  private readonly builtInEnv;
59
64
  private readonly emptyBuiltInEnv;
65
+ /** what the configuration states about packages R does not attach on startup, see {@link statedFor} */
66
+ private readonly stated;
60
67
  private builtInEnvFingerprint;
61
68
  /** the packages {@link knowsPackage} answers for, collected from the built-in environment on first use */
62
69
  private knownPackages;
70
+ /** {@link stated} by bare name across all packages, for {@link statedDefinitionsOf}; built on first use */
71
+ private statedByName;
63
72
  constructor(ctx: FlowrAnalyzerContext);
73
+ statedFor(pkg: string): BuiltInMemory | undefined;
74
+ statedDefinitionsOf(name: Identifier): readonly IdentifierDefinition[] | undefined;
64
75
  get builtInEnvironment(): DeepReadonly<IEnvironment>;
65
76
  get emptyBuiltInEnvironment(): DeepReadonly<IEnvironment>;
66
77
  builtInDefinitionsOf(name: Identifier): readonly IdentifierDefinition[];
@@ -12,9 +12,13 @@ class FlowrAnalyzerEnvironmentContext {
12
12
  name = 'flowr-analyzer-environment-context';
13
13
  builtInEnv;
14
14
  emptyBuiltInEnv;
15
+ /** what the configuration states about packages R does not attach on startup, see {@link statedFor} */
16
+ stated;
15
17
  builtInEnvFingerprint;
16
18
  /** the packages {@link knowsPackage} answers for, collected from the built-in environment on first use */
17
19
  knownPackages;
20
+ /** {@link stated} by bare name across all packages, for {@link statedDefinitionsOf}; built on first use */
21
+ statedByName;
18
22
  constructor(ctx) {
19
23
  const builtInsConfig = ctx.config.semantics.environment.overwriteBuiltIns;
20
24
  const builtIns = (0, built_in_config_1.getBuiltInDefinitions)(builtInsConfig.definitions, builtInsConfig.loadDefaults);
@@ -22,6 +26,34 @@ class FlowrAnalyzerEnvironmentContext {
22
26
  this.builtInEnv.memory = builtIns.builtInMemory;
23
27
  this.emptyBuiltInEnv = new environment_1.Environment(undefined, true);
24
28
  this.emptyBuiltInEnv.memory = builtIns.emptyBuiltInMemory;
29
+ this.stated = builtIns.packageMemory;
30
+ /* `pkg::fn` resolves whether or not the package is attached, so the built-in env answers for it */
31
+ this.builtInEnv.namespaces = builtIns.packageMemory;
32
+ }
33
+ statedFor(pkg) {
34
+ return this.stated.get(pkg);
35
+ }
36
+ statedDefinitionsOf(name) {
37
+ const bare = identifier_1.Identifier.getName(name);
38
+ const namespace = identifier_1.Identifier.getNamespace(name);
39
+ if (namespace !== undefined) {
40
+ return this.stated.get(String(namespace))?.get(bare);
41
+ }
42
+ if (this.statedByName === undefined) {
43
+ this.statedByName = new Map();
44
+ for (const memory of this.stated.values()) {
45
+ for (const [key, definitions] of memory) {
46
+ const known = this.statedByName.get(key);
47
+ if (known === undefined) {
48
+ this.statedByName.set(key, [...definitions]);
49
+ }
50
+ else {
51
+ known.push(...definitions);
52
+ }
53
+ }
54
+ }
55
+ }
56
+ return this.statedByName.get(bare);
25
57
  }
26
58
  get builtInEnvironment() {
27
59
  return this.builtInEnv;
@@ -30,7 +62,7 @@ class FlowrAnalyzerEnvironmentContext {
30
62
  return this.emptyBuiltInEnv;
31
63
  }
32
64
  builtInDefinitionsOf(name) {
33
- return this.builtInEnv.memory.get(identifier_1.Identifier.getName(name)) ?? [];
65
+ return this.builtInEnv.memory.get(identifier_1.Identifier.getName(name)) ?? this.statedDefinitionsOf(name) ?? [];
34
66
  }
35
67
  knowsPackage(pkg) {
36
68
  if (this.knownPackages === undefined) {
@@ -8,6 +8,10 @@ import type { FlowrDescriptionFile } from '../plugins/file-plugins/files/flowr-d
8
8
  import type { FlowrNewsFile } from '../plugins/file-plugins/files/flowr-news-file';
9
9
  import type { FlowrNamespaceFile } from '../plugins/file-plugins/files/flowr-namespace-file';
10
10
  import type { FlowrManifestFile } from '../plugins/file-plugins/files/flowr-manifest-files';
11
+ import type { FlowrRdFile, FlowrRdIndexFile, FlowrRdMacroFile, FlowrRdMetaFile, FlowrRdTopicIndexFile, RdIndex } from '../plugins/file-plugins/files/flowr-rd-file';
12
+ import { FlowrDataListFile } from '../plugins/file-plugins/files/flowr-rd-file';
13
+ import type { SysdataObject } from '../plugins/file-plugins/files/flowr-sysdata-file';
14
+ import { FlowrSysdataFile } from '../plugins/file-plugins/files/flowr-sysdata-file';
11
15
  import type { ProjectKind } from './project-kind';
12
16
  import type { FlowrAnalyzerContext } from './flowr-analyzer-context';
13
17
  import type { InvalidationEvent, InvalidationEventReceiver } from '../cache/flowr-cache';
@@ -27,6 +31,8 @@ export type RoleBasedFiles = {
27
31
  [FileRole.News]: FlowrNewsFile[];
28
32
  [FileRole.Namespace]: FlowrNamespaceFile[];
29
33
  [FileRole.Manifest]: FlowrManifestFile[];
34
+ /** what states which manual page documents a name: the `man/` pages and macros, an `INDEX`, and an installed package's `help/AnIndex` or `Meta/Rd.rds` */
35
+ [FileRole.Documentation]: (FlowrRdFile | FlowrRdIndexFile | FlowrRdMacroFile | FlowrRdTopicIndexFile | FlowrRdMetaFile)[];
30
36
  [FileRole.Vignette]: FlowrFileProvider[];
31
37
  [FileRole.Test]: FlowrFileProvider[];
32
38
  [FileRole.Install]: FlowrFileProvider[];
@@ -35,7 +41,8 @@ export type RoleBasedFiles = {
35
41
  [FileRole.Startup]: FlowrFileProvider[];
36
42
  [FileRole.Environment]: FlowrFileProvider[];
37
43
  [FileRole.Source]: FlowrFileProvider[];
38
- [FileRole.Data]: FlowrFileProvider[];
44
+ /** a `data/datalist` ({@link FlowrDataListFile}), a package's system data ({@link FlowrSysdataFile}), or any other data file, which has no special support */
45
+ [FileRole.Data]: (FlowrDataListFile | FlowrSysdataFile | FlowrFileProvider)[];
39
46
  [FileRole.Other]: FlowrFileProvider[];
40
47
  };
41
48
  /**
@@ -60,6 +67,15 @@ export interface ReadOnlyFlowrAnalyzerFilesContext {
60
67
  * ```
61
68
  */
62
69
  getFilesByRole<Role extends FileRole>(role: Role): RoleBasedFiles[Role];
70
+ /**
71
+ * The project's manual, built from every {@link FileRole.Documentation} file loaded, answering which page
72
+ * documents a name. Built on each call rather than kept, so hold on to the result instead of asking per name.
73
+ */
74
+ documentation(): RdIndex;
75
+ /** The R objects `data(dataset)` brings into scope, per the project's `data/datalist`. Empty when no list mentions `dataset`, including projects that ship none. */
76
+ datasetObjects(dataset: string): readonly string[];
77
+ /** The objects a package's system data (`R/sysdata.rda`/`.rdx`) lazy-loads into its namespace: available package-internally, neither exported nor reachable through `data()`. Empty for a project that ships none. */
78
+ sysdataObjects(): readonly SysdataObject[];
63
79
  /**
64
80
  * Get all files known to this context.
65
81
  * @returns An array of all files.
@@ -185,6 +201,10 @@ export declare class FlowrAnalyzerFilesContext extends AbstractFlowrAnalyzerCont
185
201
  * User-registered discovery plugins replace the built-in default; if none are registered, the default runs.
186
202
  */
187
203
  private addRequest;
204
+ /** The registered discovery plugins, or the built-in default when none are registered. */
205
+ private activeDiscoveryPlugins;
206
+ /** Adds a request a discovery plugin produced: expands it further if it is itself a parse request, otherwise adds the file directly. */
207
+ private addDiscovered;
188
208
  /**
189
209
  * A single-file request otherwise skips project discovery entirely, so a sibling `project.implicitSources`
190
210
  * entry (e.g. a shiny app's `s.R` next to the analyzed `t.R`) would never be found. If `implicitSources` is
@@ -217,6 +237,9 @@ export declare class FlowrAnalyzerFilesContext extends AbstractFlowrAnalyzerCont
217
237
  * This is a convenience method that calls {@link FlowrAnalyzerLoadingOrderContext.getLoadingOrder}.
218
238
  */
219
239
  computeLoadingOrder(): readonly RParseRequest[];
240
+ documentation(): RdIndex;
241
+ datasetObjects(dataset: string): readonly string[];
242
+ sysdataObjects(): readonly SysdataObject[];
220
243
  getFilesByRole<Role extends FileRole>(role: Role): RoleBasedFiles[Role];
221
244
  getAllFiles(): FlowrFileProvider[];
222
245
  getFileByPath(path: string): FlowrFileProvider | undefined;
@@ -15,6 +15,8 @@ const fs_1 = __importDefault(require("fs"));
15
15
  const path_1 = __importDefault(require("path"));
16
16
  const files_1 = require("../../util/files");
17
17
  const glob_1 = require("../../util/glob");
18
+ const flowr_rd_file_1 = require("../plugins/file-plugins/files/flowr-rd-file");
19
+ const flowr_sysdata_file_1 = require("../plugins/file-plugins/files/flowr-sysdata-file");
18
20
  const classify_project_kind_1 = require("./classify-project-kind");
19
21
  const flowr_cache_1 = require("../cache/flowr-cache");
20
22
  const fileLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-files-context' });
@@ -177,17 +179,21 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
177
179
  return;
178
180
  }
179
181
  this.requestedRoots.push(request.content);
180
- const active = this.discoveryPlugins.length > 0
181
- ? this.discoveryPlugins
182
- : [flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin()];
183
- const expandedRequests = active.flatMap(p => p.processor(this.ctx, request));
184
- for (const req of expandedRequests) {
185
- if ((0, retriever_1.isParseRequest)(req)) {
186
- this.addRequest(req);
187
- }
188
- else {
189
- this.addFile(req, req.roles);
190
- }
182
+ for (const req of this.activeDiscoveryPlugins().flatMap(p => p.processor(this.ctx, request))) {
183
+ this.addDiscovered(req);
184
+ }
185
+ }
186
+ /** The registered discovery plugins, or the built-in default when none are registered. */
187
+ activeDiscoveryPlugins() {
188
+ return this.discoveryPlugins.length > 0 ? this.discoveryPlugins : [flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin()];
189
+ }
190
+ /** Adds a request a discovery plugin produced: expands it further if it is itself a parse request, otherwise adds the file directly. */
191
+ addDiscovered(req) {
192
+ if ((0, retriever_1.isParseRequest)(req)) {
193
+ this.addRequest(req);
194
+ }
195
+ else {
196
+ this.addFile(req, req.roles);
191
197
  }
192
198
  }
193
199
  /**
@@ -209,20 +215,12 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
209
215
  return;
210
216
  }
211
217
  const matchers = implicit.map(entry => (0, glob_1.globMatcher)(entry));
212
- const active = this.discoveryPlugins.length > 0
213
- ? this.discoveryPlugins
214
- : [flowr_analyzer_project_discovery_plugin_1.FlowrAnalyzerProjectDiscoveryPlugin.defaultPlugin()];
215
- for (const req of active.flatMap(p => p.processor(this.ctx, { request: 'project', content: dir }))) {
218
+ for (const req of this.activeDiscoveryPlugins().flatMap(p => p.processor(this.ctx, { request: 'project', content: dir }))) {
216
219
  const filePath = (0, retriever_1.isParseRequest)(req) ? (req.request === 'file' ? req.content : undefined) : req.path();
217
220
  if (filePath === undefined || filePath === fileContent || !matchers.some(m => m(filePath))) {
218
221
  continue;
219
222
  }
220
- if ((0, retriever_1.isParseRequest)(req)) {
221
- this.addRequest(req);
222
- }
223
- else {
224
- this.addFile(req, req.roles);
225
- }
223
+ this.addDiscovered(req);
226
224
  }
227
225
  }
228
226
  /**
@@ -368,6 +366,29 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
368
366
  computeLoadingOrder() {
369
367
  return this.loadingOrder.getLoadingOrder();
370
368
  }
369
+ documentation() {
370
+ return (0, flowr_rd_file_1.rdIndexOf)(this.getFilesByRole(flowr_file_1.FileRole.Documentation));
371
+ }
372
+ datasetObjects(dataset) {
373
+ for (const file of this.getFilesByRole(flowr_file_1.FileRole.Data)) {
374
+ if (file instanceof flowr_rd_file_1.FlowrDataListFile) {
375
+ const objects = file.objectsOf(dataset);
376
+ if (objects.length > 0) {
377
+ return objects;
378
+ }
379
+ }
380
+ }
381
+ return [];
382
+ }
383
+ sysdataObjects() {
384
+ const objects = [];
385
+ for (const file of this.getFilesByRole(flowr_file_1.FileRole.Data)) {
386
+ if (file instanceof flowr_sysdata_file_1.FlowrSysdataFile) {
387
+ objects.push(...file.content());
388
+ }
389
+ }
390
+ return objects;
391
+ }
371
392
  getFilesByRole(role) {
372
393
  return this.byRole[role];
373
394
  }
@@ -12,6 +12,14 @@ export interface FunctionInfo {
12
12
  isExported: boolean;
13
13
  isS3Generic: boolean;
14
14
  s3TypeDispatch?: string;
15
+ /**
16
+ * The name is an S4 method the package registered (its NAMESPACE `exportMethods()`): it is exported because
17
+ * the package answers a generic for one of its classes, not because it defines a function of its own.
18
+ * The S4 counterpart of {@link isS3Generic}/{@link s3TypeDispatch}.
19
+ */
20
+ isS4Method?: boolean;
21
+ /** The name is an S4 class the package owns, i.e. its NAMESPACE lists it in `exportClasses()`. */
22
+ isS4Class?: boolean;
15
23
  inferredType?: string;
16
24
  }
17
25
  /**
@@ -51,6 +51,8 @@ class FlowrAnalyzerFunctionsContext extends abstract_flowr_analyzer_context_1.Ab
51
51
  }
52
52
  functionInfo.isExported ||= other.isExported;
53
53
  functionInfo.isS3Generic ||= other.isS3Generic;
54
+ functionInfo.isS4Method ||= other.isS4Method;
55
+ functionInfo.isS4Class ||= other.isS4Class;
54
56
  }
55
57
  getFunctionInfo(pkg, name, s3TypeDispatch) {
56
58
  if (s3TypeDispatch) {
@@ -1,4 +1,4 @@
1
- import { type FlowrGasConfig, GasLevel, type GasOverrides } from '../../gas';
1
+ import { type FlowrGasConfig, GasLevel, type GasOverrides, DataflowBudgetTracker } from '../../gas';
2
2
  import type { FlowrAnalyzerGasPlugin } from '../plugins/gas-plugins/flowr-analyzer-gas-plugin';
3
3
  import type { FlowrAnalyzerContext } from './flowr-analyzer-context';
4
4
  import type { InvalidationEvent, InvalidationEventReceiver } from '../cache/flowr-cache';
@@ -14,6 +14,11 @@ export interface ReadOnlyFlowrAnalyzerGasContext {
14
14
  * (see {@link GasThresholdSpec}), not one allowance shared by everything the analyzer does.
15
15
  */
16
16
  checkGas(key: string): GasLevel;
17
+ /**
18
+ * The counted bounds of `key`, resolved once against the current contingent, or `undefined` when disabled or
19
+ * unbounded. Arming counterpart of {@link checkGas} for the dataflow fold, see {@link GasFeatureKey.Dataflow}.
20
+ */
21
+ budget(key: string): DataflowBudgetTracker | undefined;
17
22
  /**
18
23
  * A view with a fresh contingent, measured from this call, for one operation to run against.
19
24
  * The enclosing bounds still apply, `overrides` winning over them. Derives a new object rather than
@@ -78,5 +83,8 @@ export declare class FlowrAnalyzerGasContext implements WriteableFlowrAnalyzerGa
78
83
  private static maxLevel;
79
84
  private timeLevel;
80
85
  checkGas(key: string): GasLevel;
86
+ budget(key: string): DataflowBudgetTracker | undefined;
87
+ /** The bounds `key` is armed with, pre-divided by its factor so the tracker only ever compares, never multiplies. */
88
+ private budgetFor;
81
89
  private levelFor;
82
90
  }
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.FlowrAnalyzerGasContext = void 0;
4
+ const gas_1 = require("../../gas");
5
+ const config_1 = require("../../config");
4
6
  const log_1 = require("../../util/log");
5
7
  let heapStatisticsProvider = undefined;
6
8
  /**
@@ -127,6 +129,7 @@ class FlowrAnalyzerGasContext {
127
129
  return {
128
130
  name: `${this.name}:scope`,
129
131
  checkGas: key => this.levelFor(key, scope),
132
+ budget: key => this.budgetFor(key, scope),
130
133
  scope: o => this.viewOf(this.derive(o, scope))
131
134
  };
132
135
  }
@@ -195,6 +198,24 @@ class FlowrAnalyzerGasContext {
195
198
  checkGas(key) {
196
199
  return this.levelFor(key, this.activeScope());
197
200
  }
201
+ budget(key) {
202
+ return this.budgetFor(key, this.activeScope());
203
+ }
204
+ /** The bounds `key` is armed with, pre-divided by its factor so the tracker only ever compares, never multiplies. */
205
+ budgetFor(key, scope) {
206
+ const factor = this.factorFor(scope, key);
207
+ if (!factor) {
208
+ return undefined; // disabled, which is what keeps an unarmed run free of the guard entirely
209
+ }
210
+ const cap = (dim) => {
211
+ const bound = this.bound(scope, key, dim, 'critical');
212
+ return Number.isFinite(bound) ? Math.max(1, Math.floor(bound / factor)) : 0;
213
+ };
214
+ const budget = { steps: cap('steps'), vertices: cap('vertices'), timeMs: cap('timeMs') };
215
+ return (0, gas_1.isBoundedBudget)(budget)
216
+ ? new gas_1.DataflowBudgetTracker(budget, scope.startTime, this.config?.countedCheckEvery ?? config_1.DefaultCountedCheckEvery)
217
+ : undefined;
218
+ }
198
219
  levelFor(key, scope) {
199
220
  const factor = this.factorFor(scope, key);
200
221
  if (!factor && this.plugins.length === 0) {
@@ -27,8 +27,13 @@ export declare enum FileRole {
27
27
  * These are not part of the package namespace source, so tooling may want to treat them separately.
28
28
  */
29
29
  Install = "install",
30
- /** Data files, e.g., `R/sysdata.rda`, currently not specially supported. */
30
+ /**
31
+ * Data files: a `data/datalist`, a package's system data (`R/sysdata.rda`, or the `R/sysdata.rdx` of an
32
+ * installed package), and any other data file, which has no special support.
33
+ */
31
34
  Data = "data",
35
+ /** Manual pages (`man/*.Rd`) and an installed package's `help/AnIndex`, i.e. what documents a name. */
36
+ Documentation = "documentation",
32
37
  /** Signals separate license files, but please note, that DESCRIPTION files may contain license info too */
33
38
  License = "license",
34
39
  /** Files describing a project's virtual/pinned package environment, e.g., `renv.lock`, `rv.lock` or `uvr.lock`. */
@@ -163,3 +168,13 @@ export declare class FlowrInlineTextFile extends FlowrFile<string> {
163
168
  */
164
169
  updateInlineContent(newContent: string): void;
165
170
  }
171
+ /**
172
+ * A {@link FlowrFile} that decorates another file to expose its raw content as something parsed.
173
+ * Prefer the static {@link FlowrWrappedFile.from|from}, which avoids re-wrapping and handles roles.
174
+ */
175
+ export declare abstract class FlowrWrappedFile<Content extends StringableContent = StringableContent> extends FlowrFile<Content> {
176
+ protected readonly wrapped: FlowrFileProvider;
177
+ constructor(wrapped: FlowrFileProvider);
178
+ /** Lifts a file to the class this is called on, reusing it if already one and assigning `role`. */
179
+ static from<T>(this: new (file: FlowrFileProvider) => T, file: FlowrFileProvider, role?: FileRole): T;
180
+ }