@eagleoutice/flowr 2.16.1 → 2.16.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 (459) hide show
  1. package/README.md +10 -10
  2. package/abstract-interpretation/data-frame/arguments.js +4 -3
  3. package/abstract-interpretation/data-frame/dataframe-semantics.js +1 -2
  4. package/abstract-interpretation/data-frame/semantics.d.ts +2 -2
  5. package/abstract-interpretation/data-frame/semantics.js +2 -6
  6. package/benchmark/slicer.js +1 -3
  7. package/benchmark/summarizer/first-phase/input.js +1 -12
  8. package/benchmark/summarizer/second-phase/process.d.ts +7 -0
  9. package/benchmark/summarizer/second-phase/process.js +15 -12
  10. package/cli/repl/commands/repl-cfg.js +18 -49
  11. package/cli/repl/commands/repl-clipboard.d.ts +2 -0
  12. package/cli/repl/commands/repl-clipboard.js +5 -0
  13. package/cli/repl/commands/repl-commands.js +2 -2
  14. package/cli/repl/commands/repl-dataflow.js +21 -55
  15. package/cli/repl/commands/repl-normalize.js +15 -28
  16. package/cli/repl/commands/repl-parse.js +2 -2
  17. package/cli/repl/commands/repl-query.js +10 -10
  18. package/cli/repl/commands/repl-signature.js +4 -4
  19. package/cli/repl/server/connection.d.ts +1 -0
  20. package/cli/repl/server/connection.js +8 -30
  21. package/cli/repl/server/messages/message-analysis.js +1 -1
  22. package/config.d.ts +6 -0
  23. package/config.js +7 -4
  24. package/control-flow/cfg-dead-code.js +5 -14
  25. package/control-flow/cfg-to-basic-blocks.js +1 -6
  26. package/control-flow/control-flow-graph.d.ts +2 -16
  27. package/control-flow/control-flow-graph.js +8 -66
  28. package/control-flow/diff-cfg.js +10 -23
  29. package/control-flow/semantic-cfg-guided-visitor.js +5 -11
  30. package/control-flow/simple-visitor.js +2 -2
  31. package/core/steps/pipeline/default-pipelines.d.ts +138 -138
  32. package/data/r-base-packages.generated.js +0 -1
  33. package/data/r-base-primitives.generated.js +0 -1
  34. package/data/r-s3-generics.generated.d.ts +5 -0
  35. package/data/r-s3-generics.generated.js +103 -0
  36. package/dataflow/cluster.js +2 -1
  37. package/dataflow/environments/append.d.ts +1 -0
  38. package/dataflow/environments/built-in-props.d.ts +15 -2
  39. package/dataflow/environments/built-in-props.js +31 -4
  40. package/dataflow/environments/built-in.js +15 -9
  41. package/dataflow/environments/clone.d.ts +1 -0
  42. package/dataflow/environments/clone.js +1 -0
  43. package/dataflow/environments/default-builtin-config.d.ts +385 -25
  44. package/dataflow/environments/default-builtin-config.js +186 -106
  45. package/dataflow/environments/define.d.ts +1 -0
  46. package/dataflow/environments/define.js +1 -0
  47. package/dataflow/environments/environment.d.ts +27 -0
  48. package/dataflow/environments/environment.js +37 -16
  49. package/dataflow/environments/frame-memory.d.ts +9 -1
  50. package/dataflow/environments/frame-memory.js +12 -1
  51. package/dataflow/environments/identifier.d.ts +1 -2
  52. package/dataflow/environments/identifier.js +5 -7
  53. package/dataflow/environments/overwrite.js +1 -0
  54. package/dataflow/environments/query-fn-props.d.ts +3 -0
  55. package/dataflow/environments/query-fn-props.js +7 -0
  56. package/dataflow/environments/resolve-by-name.js +11 -4
  57. package/dataflow/environments/scoping.d.ts +3 -0
  58. package/dataflow/environments/scoping.js +3 -0
  59. package/dataflow/eval/resolve/alias-tracking.js +3 -3
  60. package/dataflow/eval/resolve/resolve-argument.d.ts +7 -3
  61. package/dataflow/eval/resolve/resolve-argument.js +21 -12
  62. package/dataflow/eval/resolve/resolve-numbers.js +5 -2
  63. package/dataflow/eval/resolve/resolve-strings.d.ts +1 -1
  64. package/dataflow/eval/resolve/resolve-working-directory.js +2 -2
  65. package/dataflow/eval/resolve/resolve.js +1 -2
  66. package/dataflow/eval/values/intervals/interval-constants.js +1 -6
  67. package/dataflow/eval/values/r-value.js +1 -6
  68. package/dataflow/extractor.js +17 -17
  69. package/dataflow/fn/argument-roles.js +15 -15
  70. package/dataflow/fn/class-declaration.js +7 -7
  71. package/dataflow/fn/frame-reflection.d.ts +1 -23
  72. package/dataflow/fn/frame-reflection.js +8 -95
  73. package/dataflow/fn/function-props.d.ts +0 -3
  74. package/dataflow/fn/function-props.js +9 -11
  75. package/dataflow/fn/function-semantics.d.ts +1 -0
  76. package/dataflow/fn/strict-function.js +15 -14
  77. package/dataflow/graph/call-graph.d.ts +8 -0
  78. package/dataflow/graph/call-graph.js +40 -25
  79. package/dataflow/graph/dataflowgraph-builder.d.ts +0 -60
  80. package/dataflow/graph/dataflowgraph-builder.js +15 -135
  81. package/dataflow/graph/df-helper.d.ts +56 -4
  82. package/dataflow/graph/df-helper.js +116 -1
  83. package/dataflow/graph/diff-dataflow-graph.js +13 -15
  84. package/dataflow/graph/graph-helper.d.ts +20 -0
  85. package/dataflow/graph/graph-helper.js +18 -0
  86. package/dataflow/graph/graph.js +15 -8
  87. package/dataflow/graph/match-args.d.ts +1 -1
  88. package/dataflow/graph/match-args.js +3 -3
  89. package/dataflow/internal/linker.d.ts +4 -10
  90. package/dataflow/internal/linker.js +21 -29
  91. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -8
  92. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +5 -2
  93. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +39 -22
  94. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -21
  95. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -7
  96. package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +6 -11
  97. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
  98. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -13
  99. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +27 -13
  100. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -8
  101. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +33 -35
  102. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -5
  103. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +6 -7
  104. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +12 -5
  105. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +3 -4
  106. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +7 -8
  107. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -6
  108. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +3 -4
  109. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -3
  110. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +14 -7
  111. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +6 -5
  112. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -2
  113. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -6
  114. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +4 -4
  115. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +7 -7
  116. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +1 -2
  117. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -3
  118. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +5 -7
  120. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
  121. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +4 -5
  122. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +8 -9
  123. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -5
  124. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +3 -3
  125. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +36 -38
  126. package/dataflow/internal/process/functions/call/common.d.ts +3 -1
  127. package/dataflow/internal/process/functions/call/common.js +6 -7
  128. package/dataflow/internal/process/functions/call/deferred.js +8 -8
  129. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +11 -4
  130. package/dataflow/internal/process/functions/call/known-call-handling.js +11 -7
  131. package/dataflow/internal/process/functions/call/named-call-handling.js +64 -11
  132. package/dataflow/internal/process/functions/call/nse.js +4 -4
  133. package/dataflow/internal/process/functions/call/quoted.js +16 -14
  134. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
  135. package/dataflow/internal/process/functions/process-parameter.js +2 -2
  136. package/dataflow/internal/process/process-named-call.js +1 -1
  137. package/dataflow/origin/dfg-get-origin.js +2 -2
  138. package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -0
  139. package/dataflow/origin/dfg-get-symbol-refs.js +3 -8
  140. package/documentation/data/faq/wiki-faq-store.js +2 -2
  141. package/documentation/doc-capabilities.js +2 -1
  142. package/documentation/doc-util/doc-functions.js +2 -2
  143. package/documentation/doc-util/doc-repl.js +4 -4
  144. package/documentation/doc-util/doc-types.js +2 -2
  145. package/documentation/wiki-absint.js +2 -1
  146. package/documentation/wiki-cfg.js +2 -1
  147. package/documentation/wiki-create-linting-rules.js +1 -1
  148. package/documentation/wiki-dataflow-graph.js +6 -6
  149. package/documentation/wiki-interface.js +3 -2
  150. package/documentation/wiki-linter.js +54 -4
  151. package/documentation/wiki-mk/doc-maker.js +1 -2
  152. package/documentation/wiki-query.js +25 -0
  153. package/documentation/wiki-search.js +2 -1
  154. package/documentation/wiki-signature-database.js +0 -2
  155. package/linter/linter-executor.js +4 -0
  156. package/linter/linter-rules.d.ts +526 -4
  157. package/linter/linter-rules.js +39 -1
  158. package/linter/linter-tags.d.ts +6 -0
  159. package/linter/linter-tags.js +6 -0
  160. package/linter/rules/absolute-path.js +4 -3
  161. package/linter/rules/cmd-check/bogus-return.d.ts +29 -0
  162. package/linter/rules/cmd-check/bogus-return.js +63 -0
  163. package/linter/rules/cmd-check/call-arguments.d.ts +63 -0
  164. package/linter/rules/cmd-check/call-arguments.js +211 -0
  165. package/linter/rules/cmd-check/class-string-comparison.d.ts +48 -0
  166. package/linter/rules/cmd-check/class-string-comparison.js +135 -0
  167. package/linter/rules/cmd-check/cmd-check-util.d.ts +67 -0
  168. package/linter/rules/cmd-check/cmd-check-util.js +169 -0
  169. package/linter/rules/cmd-check/compiled-code.d.ts +86 -0
  170. package/linter/rules/cmd-check/compiled-code.js +350 -0
  171. package/linter/rules/cmd-check/conformance.d.ts +47 -0
  172. package/linter/rules/cmd-check/conformance.js +166 -0
  173. package/linter/rules/cmd-check/dependency-declaration.d.ts +95 -0
  174. package/linter/rules/cmd-check/dependency-declaration.js +299 -0
  175. package/linter/rules/cmd-check/description-metadata.d.ts +63 -0
  176. package/linter/rules/cmd-check/description-metadata.js +393 -0
  177. package/linter/rules/cmd-check/documentation-mismatch.d.ts +54 -0
  178. package/linter/rules/cmd-check/documentation-mismatch.js +407 -0
  179. package/linter/rules/cmd-check/file-checks.d.ts +29 -0
  180. package/linter/rules/cmd-check/file-checks.js +34 -0
  181. package/linter/rules/cmd-check/foreign-function-calls.d.ts +54 -0
  182. package/linter/rules/cmd-check/foreign-function-calls.js +115 -0
  183. package/linter/rules/cmd-check/global-environment-modification.d.ts +61 -0
  184. package/linter/rules/cmd-check/global-environment-modification.js +237 -0
  185. package/linter/rules/cmd-check/namespace-tampering.d.ts +52 -0
  186. package/linter/rules/cmd-check/namespace-tampering.js +162 -0
  187. package/linter/rules/cmd-check/non-ascii-code.d.ts +51 -0
  188. package/linter/rules/cmd-check/non-ascii-code.js +112 -0
  189. package/linter/rules/cmd-check/package-code.d.ts +30 -0
  190. package/linter/rules/cmd-check/package-code.js +141 -0
  191. package/linter/rules/cmd-check/package-data.d.ts +49 -0
  192. package/linter/rules/cmd-check/package-data.js +181 -0
  193. package/linter/rules/cmd-check/package-files.d.ts +41 -0
  194. package/linter/rules/cmd-check/package-files.js +157 -0
  195. package/linter/rules/cmd-check/package-hooks.d.ts +57 -0
  196. package/linter/rules/cmd-check/package-hooks.js +165 -0
  197. package/linter/rules/cmd-check/package-metafiles.d.ts +49 -0
  198. package/linter/rules/cmd-check/package-metafiles.js +292 -0
  199. package/linter/rules/cmd-check/package-runtime.d.ts +67 -0
  200. package/linter/rules/cmd-check/package-runtime.js +284 -0
  201. package/linter/rules/cmd-check/package-structure.d.ts +85 -0
  202. package/linter/rules/cmd-check/package-structure.js +320 -0
  203. package/linter/rules/cmd-check/rd-files.d.ts +67 -0
  204. package/linter/rules/cmd-check/rd-files.js +621 -0
  205. package/linter/rules/cmd-check/s-three-method-consistency.d.ts +72 -0
  206. package/linter/rules/cmd-check/s-three-method-consistency.js +206 -0
  207. package/linter/rules/cmd-check/true-false-abbreviation.d.ts +45 -0
  208. package/linter/rules/cmd-check/true-false-abbreviation.js +121 -0
  209. package/linter/rules/deprecated-functions.js +4 -4
  210. package/linter/rules/function-finder-util.d.ts +1 -1
  211. package/linter/rules/function-finder-util.js +1 -3
  212. package/linter/rules/naming-convention.d.ts +1 -1
  213. package/linter/rules/naming-convention.js +13 -14
  214. package/linter/rules/network-functions.d.ts +4 -3
  215. package/linter/rules/network-functions.js +14 -12
  216. package/linter/rules/no-leaked-credentials.d.ts +8 -3
  217. package/linter/rules/no-leaked-credentials.js +134 -36
  218. package/linter/rules/problematic-inputs.d.ts +1 -1
  219. package/linter/rules/problematic-inputs.js +21 -14
  220. package/linter/rules/seeded-randomness.js +5 -5
  221. package/linter/rules/software-has-license.d.ts +1 -1
  222. package/linter/rules/software-has-license.js +1 -1
  223. package/linter/rules/unclosed-connection.js +3 -3
  224. package/linter/rules/undefined-symbol-util.js +16 -32
  225. package/linter/rules/undefined-symbol.d.ts +2 -0
  226. package/linter/rules/undefined-symbol.js +33 -3
  227. package/linter/rules/unescaped-arguments.d.ts +13 -2
  228. package/linter/rules/unescaped-arguments.js +104 -15
  229. package/linter/rules/unused-definition.js +13 -19
  230. package/package.json +1 -1
  231. package/project/cache/flowr-analyzer-cache.js +1 -1
  232. package/project/context/flowr-analyzer-context.js +1 -1
  233. package/project/context/flowr-analyzer-environment-context.d.ts +1 -1
  234. package/project/context/flowr-analyzer-files-context.d.ts +6 -0
  235. package/project/context/flowr-analyzer-files-context.js +3 -0
  236. package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +0 -2
  237. package/project/context/flowr-analyzer-incremental-analysis-context.js +0 -4
  238. package/project/context/flowr-file.d.ts +4 -0
  239. package/project/context/flowr-file.js +4 -0
  240. package/project/flowr-analyzer-builder.js +1 -1
  241. package/project/plugins/file-plugins/files/flowr-description-file.js +2 -2
  242. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -0
  243. package/project/plugins/file-plugins/files/flowr-jupyter-file.js +4 -0
  244. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +2 -0
  245. package/project/plugins/file-plugins/files/flowr-manifest-files.js +11 -14
  246. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +3 -0
  247. package/project/plugins/file-plugins/files/flowr-namespace-file.js +25 -15
  248. package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +44 -0
  249. package/project/plugins/file-plugins/files/flowr-rd-file.js +130 -61
  250. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +0 -1
  251. package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -16
  252. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -0
  253. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +4 -0
  254. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +2 -0
  255. package/project/plugins/file-plugins/files/flowr-sweave-file.js +4 -0
  256. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +0 -1
  257. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -5
  258. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +2 -0
  259. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -0
  260. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +3 -7
  261. package/project/sigdb/build.js +16 -30
  262. package/project/sigdb/dict.d.ts +4 -6
  263. package/project/sigdb/dict.js +125 -31
  264. package/project/sigdb/reader.js +2 -18
  265. package/project/sigdb/sigdb-download.js +14 -23
  266. package/queries/base-query-format.d.ts +2 -0
  267. package/queries/base-query-format.js +10 -2
  268. package/queries/catalog/absint-query/absint-query-format.d.ts +1 -1
  269. package/queries/catalog/absint-query/absint-query-format.js +5 -7
  270. package/queries/catalog/call-context-query/call-context-query-executor.js +26 -33
  271. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
  272. package/queries/catalog/call-context-query/call-context-query-format.js +1 -3
  273. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -4
  274. package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -4
  275. package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -3
  276. package/queries/catalog/config-query/config-query-format.js +3 -3
  277. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -3
  278. package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -3
  279. package/queries/catalog/dependencies-query/data-flow.d.ts +43 -0
  280. package/queries/catalog/dependencies-query/data-flow.js +173 -0
  281. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +18 -0
  282. package/queries/catalog/dependencies-query/dependencies-query-executor.js +108 -12
  283. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +17 -1
  284. package/queries/catalog/dependencies-query/dependencies-query-format.js +14 -11
  285. package/queries/catalog/dependencies-query/function-info/derived-functions.js +2 -1
  286. package/queries/catalog/dependencies-query/function-info/function-info.d.ts +2 -0
  287. package/queries/catalog/dependencies-query/function-info/library-functions.js +13 -13
  288. package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
  289. package/queries/catalog/dependencies-query/function-info/remote-functions.js +3 -3
  290. package/queries/catalog/dependencies-query/function-info/source-functions.js +2 -2
  291. package/queries/catalog/dependencies-query/function-info/test-functions.js +8 -8
  292. package/queries/catalog/dependencies-query/function-info/transform-functions.d.ts +8 -0
  293. package/queries/catalog/dependencies-query/function-info/transform-functions.js +17 -0
  294. package/queries/catalog/dependencies-query/function-info/write-functions.js +4 -0
  295. package/queries/catalog/dependencies-query/implicit-echo.d.ts +5 -3
  296. package/queries/catalog/dependencies-query/implicit-echo.js +33 -34
  297. package/queries/catalog/dependencies-query/link-devices.d.ts +3 -2
  298. package/queries/catalog/dependencies-query/link-devices.js +9 -6
  299. package/queries/catalog/dependencies-query/plot-description.d.ts +10 -0
  300. package/queries/catalog/dependencies-query/plot-description.js +119 -0
  301. package/queries/catalog/dependencies-query/plot-objects.d.ts +13 -0
  302. package/queries/catalog/dependencies-query/plot-objects.js +61 -0
  303. package/queries/catalog/dice-query/dice-query-format.d.ts +2 -2
  304. package/queries/catalog/dice-query/dice-query-format.js +3 -40
  305. package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
  306. package/queries/catalog/does-call-query/does-call-query-format.js +2 -2
  307. package/queries/catalog/function-info-query/function-info-query-format.js +2 -2
  308. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +2 -1
  309. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
  310. package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
  311. package/queries/catalog/id-map-query/id-map-query-format.js +1 -3
  312. package/queries/catalog/input-sources-query/input-source-functions.d.ts +6 -4
  313. package/queries/catalog/input-sources-query/input-source-functions.js +11 -6
  314. package/queries/catalog/input-sources-query/input-sources-query-executor.js +3 -3
  315. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +1 -1
  316. package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -5
  317. package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +12 -4
  318. package/queries/catalog/input-sources-query/simple-input-classifier.js +237 -40
  319. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +4 -7
  320. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +1 -1
  321. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +3 -2
  322. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +2 -2
  323. package/queries/catalog/linter-query/linter-query-executor.js +10 -3
  324. package/queries/catalog/linter-query/linter-query-format.d.ts +4 -1
  325. package/queries/catalog/linter-query/linter-query-format.js +32 -21
  326. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  327. package/queries/catalog/location-map-query/location-map-query-format.js +1 -3
  328. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -3
  329. package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
  330. package/queries/catalog/origin-query/origin-query-executor.js +3 -3
  331. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  332. package/queries/catalog/origin-query/origin-query-format.js +4 -5
  333. package/queries/catalog/project-query/project-query-format.js +2 -2
  334. package/queries/catalog/provenance-query/provenance-query-format.js +2 -3
  335. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  336. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -4
  337. package/queries/catalog/search-query/search-query-format.js +1 -3
  338. package/queries/catalog/signature-query/signature-query-executor.js +3 -3
  339. package/queries/catalog/signature-query/signature-query-format.js +2 -2
  340. package/queries/catalog/slice-query-options.d.ts +16 -0
  341. package/queries/catalog/slice-query-options.js +28 -0
  342. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
  343. package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -42
  344. package/queries/query-print.d.ts +4 -0
  345. package/queries/query-print.js +17 -1
  346. package/queries/query.d.ts +3 -3
  347. package/queries/query.js +3 -4
  348. package/r-bridge/lang-4.x/ast/model/model.d.ts +27 -3
  349. package/r-bridge/lang-4.x/ast/model/model.js +28 -1
  350. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  352. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +2 -0
  353. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
  354. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +20 -1
  355. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +25 -1
  356. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +2 -0
  357. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
  358. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -0
  359. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
  360. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -0
  361. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
  362. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -0
  363. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
  364. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +2 -0
  365. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
  366. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +18 -2
  367. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +15 -6
  368. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +2 -0
  369. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
  370. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +2 -0
  371. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
  372. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -0
  373. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
  374. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -0
  375. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
  376. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -0
  377. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
  378. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +2 -0
  379. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +1 -0
  380. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -0
  381. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
  382. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -0
  383. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
  384. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +2 -0
  385. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
  386. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +17 -0
  387. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +20 -0
  388. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -0
  389. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
  390. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +2 -0
  391. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
  392. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -0
  393. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
  394. package/r-bridge/lang-4.x/ast/model/operators.js +0 -2
  395. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -6
  396. package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -6
  397. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -3
  398. package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
  399. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +1 -5
  400. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -2
  401. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +4 -20
  402. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -5
  403. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +1 -5
  404. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -5
  405. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -9
  406. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -5
  407. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -10
  408. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -11
  409. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +3 -11
  410. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -5
  411. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -5
  412. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -5
  413. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +6 -1
  414. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +7 -0
  415. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +0 -10
  416. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +30 -82
  417. package/r-bridge/retriever.d.ts +0 -4
  418. package/r-bridge/retriever.js +0 -13
  419. package/r-bridge/roxygen2/documentation-provider.js +3 -7
  420. package/r-bridge/shell.js +3 -8
  421. package/reconstruct/auto-select/magic-comments.js +8 -7
  422. package/reconstruct/inline/source-inline-map.d.ts +3 -0
  423. package/reconstruct/inline/source-inline-map.js +8 -7
  424. package/reconstruct/reconstruct.d.ts +1 -1
  425. package/reconstruct/reconstruct.js +33 -109
  426. package/search/flowr-search-printer.js +4 -15
  427. package/search/search-executor/search-enrichers.js +5 -3
  428. package/search/search-executor/search-generators.js +1 -1
  429. package/slicing/criterion/filters/all-variables.js +1 -2
  430. package/slicing/static/fingerprint.js +11 -2
  431. package/slicing/static/slice-call.d.ts +2 -8
  432. package/slicing/static/slice-call.js +8 -18
  433. package/slicing/static/static-slicer.js +81 -6
  434. package/util/collections/arrays.js +1 -1
  435. package/util/collections/set.js +1 -1
  436. package/util/diff-graph.d.ts +4 -0
  437. package/util/diff-graph.js +12 -0
  438. package/util/files.js +2 -6
  439. package/util/json.js +1 -15
  440. package/util/mermaid/cfg.js +10 -17
  441. package/util/mermaid/dfg.js +6 -8
  442. package/util/objects.d.ts +1 -1
  443. package/util/quads.js +4 -13
  444. package/util/r-author.js +5 -5
  445. package/util/range.d.ts +9 -0
  446. package/util/range.js +11 -0
  447. package/util/schema.js +3 -3
  448. package/util/simple-df/dfg-view.js +2 -1
  449. package/util/text/ansi.js +1 -2
  450. package/util/text/playground-link.js +2 -1
  451. package/util/text/r-highlight.js +2 -1
  452. package/util/text/strings.d.ts +2 -0
  453. package/util/text/strings.js +5 -0
  454. package/util/text/time.js +1 -2
  455. package/util/version.js +4 -3
  456. package/dataflow/fn/recursive-function.d.ts +0 -6
  457. package/dataflow/fn/recursive-function.js +0 -32
  458. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +0 -16
  459. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +0 -27
@@ -4,6 +4,7 @@ import { Identifier, type IdentifierDefinition } from './identifier';
4
4
  * Define an identifier in the environment, possibly as a super assignment.
5
5
  * This recalculates the level.
6
6
  * With `append`, a super assignment keeps the definitions the name already has instead of replacing them.
7
+ * @useInstead {@link REnvironment.define}
7
8
  */
8
9
  export declare function define(definition: IdentifierDefinition & {
9
10
  name: Identifier;
@@ -6,6 +6,7 @@ const identifier_1 = require("./identifier");
6
6
  * Define an identifier in the environment, possibly as a super assignment.
7
7
  * This recalculates the level.
8
8
  * With `append`, a super assignment keeps the definitions the name already has instead of replacing them.
9
+ * @useInstead {@link REnvironment.define}
9
10
  */
10
11
  function define(definition, superAssign, { level, current }, append = false) {
11
12
  const newEnv = superAssign ? current.defineSuper(definition, append) : current.define(definition);
@@ -2,6 +2,11 @@ import type { BuiltInMemory } from './built-in';
2
2
  import type { BrandedIdentifier, IdentifierDefinition, ReferenceType } from './identifier';
3
3
  import { Identifier } from './identifier';
4
4
  import type { ControlDependency } from '../info';
5
+ import { appendEnvironment } from './append';
6
+ import { define as defineInEnvironment } from './define';
7
+ import { overwriteEnvironment } from './overwrite';
8
+ import { cloneEnvironmentInformation } from './clone';
9
+ import { cleanEnvOf, popLocalEnvironment, pushLocalEnvironment } from './scoping';
5
10
  import { Frame } from './frame-memory';
6
11
  import type { MemoryView } from './frame-memory';
7
12
  import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
@@ -128,6 +133,10 @@ export declare class Environment implements IEnvironment {
128
133
  }
129
134
  /** Walks up to the global environment (see {@link Environment#globalEnv}), falling back to the last non-builtin env. */
130
135
  declare function findGlobalEnvironment(this: void, env: Environment): Environment;
136
+ /** The frames from `env` outwards, excluding the built-in environment. */
137
+ declare function framesOf(this: void, env: Environment): Generator<Environment, void, undefined>;
138
+ /** The frames below the global environment of `env`, i.e. the layers of the `search()` path, innermost first. */
139
+ declare function searchPathOf(this: void, env: Environment): Generator<Environment, void, undefined>;
131
140
  /** Walks up to the built-in environment. */
132
141
  declare function findBuiltInEnvironment(this: void, env: Environment): Environment;
133
142
  /** The `search()` position directly below the global environment; where R attaches by default. */
@@ -161,12 +170,30 @@ export declare const REnvironment: {
161
170
  readonly findGlobal: typeof findGlobalEnvironment;
162
171
  /** Walks up to the built-in environment; see {@link findBuiltInEnvironment}. */
163
172
  readonly findBuiltIn: typeof findBuiltInEnvironment;
173
+ /** The frames from an environment outwards, without the built-in one; see {@link framesOf}. */
174
+ readonly frames: typeof framesOf;
175
+ /** The layers below the global environment, innermost first; see {@link searchPathOf}. */
176
+ readonly searchPath: typeof searchPathOf;
164
177
  /** Attaches a package block at a `search()` position, below the global by default; see {@link attachPackageAt}. */
165
178
  readonly attachAt: typeof attachPackageAt;
166
179
  /** The `search()` position of a named entry; see {@link searchPositionOf}. */
167
180
  readonly searchPosition: typeof searchPositionOf;
168
181
  /** The packages on the search path; see {@link attachedPackagesOf}. */
169
182
  readonly attachedPackages: typeof attachedPackagesOf;
183
+ /** Defines an identifier in the environment, as a super assignment if asked; returns the new environment information. */
184
+ readonly define: typeof defineInEnvironment;
185
+ /** Adds all writes of `next` to `base` as things that might happen; see {@link appendEnvironment}. */
186
+ readonly append: typeof appendEnvironment;
187
+ /** Lets the definitions of `next` replace those of `base` by name; see {@link overwriteEnvironment}. */
188
+ readonly overwrite: typeof overwriteEnvironment;
189
+ /** Clones the environment information, with or without its parents; see {@link cloneEnvironmentInformation}. */
190
+ readonly clone: typeof cloneEnvironmentInformation;
191
+ /** Adds a local scope on top, see {@link REnvironment.popLocal} for the counterpart; see {@link pushLocalEnvironment}. */
192
+ readonly pushLocal: typeof pushLocalEnvironment;
193
+ /** Removes the top local scope, see {@link REnvironment.pushLocal} for the counterpart; see {@link popLocalEnvironment}. */
194
+ readonly popLocal: typeof popLocalEnvironment;
195
+ /** The search path of the environment with an empty global frame: attached packages stay visible, global binds do not; see {@link cleanEnvOf}. */
196
+ readonly cleanOf: typeof cleanEnvOf;
170
197
  };
171
198
  /**
172
199
  * A ({@link IEnvironment#parent|scoped}) mapping of names to their definitions ({@link BuiltIns}).
@@ -12,6 +12,10 @@ const removal_marker_1 = require("./removal-marker");
12
12
  const identifier_1 = require("./identifier");
13
13
  const info_1 = require("../info");
14
14
  const append_1 = require("./append");
15
+ const define_1 = require("./define");
16
+ const overwrite_1 = require("./overwrite");
17
+ const clone_1 = require("./clone");
18
+ const scoping_1 = require("./scoping");
15
19
  const frame_memory_1 = require("./frame-memory");
16
20
  const log_1 = require("../../util/log");
17
21
  const defaultmap_1 = require("../../util/collections/defaultmap");
@@ -283,20 +287,14 @@ class Environment {
283
287
  if (old === undefined && applyCds === undefined) {
284
288
  frame.set(key, values);
285
289
  }
286
- else if (append) {
290
+ else if (append || applyCds === undefined) {
287
291
  frame.set(key, (0, append_1.uniqueMergeValuesInDefinitions)(old ?? [], values));
288
292
  }
289
293
  else {
290
294
  // we need to make a copy to avoid side effects for old reference in other environments
291
295
  const updated = old?.slice() ?? [];
292
296
  for (const v of values) {
293
- if (updated.some(o => o.nodeId === v.nodeId && o.definedAt === v.definedAt)) {
294
- continue;
295
- }
296
- if (applyCds === undefined) {
297
- updated.push(v);
298
- }
299
- else {
297
+ if (!updated.some(o => o.nodeId === v.nodeId && o.definedAt === v.definedAt)) {
300
298
  updated.push({ ...v, cds: v.cds ? applyCds.concat(v.cds) : applyCds.slice() });
301
299
  }
302
300
  }
@@ -424,6 +422,16 @@ function findGlobalEnvironment(env) {
424
422
  }
425
423
  return current;
426
424
  }
425
+ /** The frames from `env` outwards, excluding the built-in environment. */
426
+ function* framesOf(env) {
427
+ for (let e = env; !e.builtInEnv; e = e.parent) {
428
+ yield e;
429
+ }
430
+ }
431
+ /** The frames below the global environment of `env`, i.e. the layers of the `search()` path, innermost first. */
432
+ function searchPathOf(env) {
433
+ return framesOf(findGlobalEnvironment(env).parent);
434
+ }
427
435
  /** Walks up to the built-in environment. */
428
436
  function findBuiltInEnvironment(env) {
429
437
  let current = env;
@@ -470,7 +478,7 @@ function searchPositionOf(env, name) {
470
478
  return 1;
471
479
  }
472
480
  let pos = 1;
473
- for (let e = findGlobalEnvironment(env).parent; !e.builtInEnv; e = e.parent) {
481
+ for (const e of searchPathOf(env)) {
474
482
  if (e.t === EnvType.Imports) {
475
483
  continue; // internal layer, not a search-path entry
476
484
  }
@@ -487,7 +495,7 @@ function searchPositionOf(env, name) {
487
495
  */
488
496
  function attachedPackagesOf(env) {
489
497
  const attached = new Set(["base" /* PkgName.Base */]);
490
- for (let e = findGlobalEnvironment(env).parent; !e.builtInEnv; e = e.parent) {
498
+ for (const e of searchPathOf(env)) {
491
499
  if (e.t !== EnvType.Imports && e.n !== undefined) {
492
500
  attached.add(e.n);
493
501
  }
@@ -504,12 +512,30 @@ exports.REnvironment = {
504
512
  findGlobal: findGlobalEnvironment,
505
513
  /** Walks up to the built-in environment; see {@link findBuiltInEnvironment}. */
506
514
  findBuiltIn: findBuiltInEnvironment,
515
+ /** The frames from an environment outwards, without the built-in one; see {@link framesOf}. */
516
+ frames: framesOf,
517
+ /** The layers below the global environment, innermost first; see {@link searchPathOf}. */
518
+ searchPath: searchPathOf,
507
519
  /** Attaches a package block at a `search()` position, below the global by default; see {@link attachPackageAt}. */
508
520
  attachAt: attachPackageAt,
509
521
  /** The `search()` position of a named entry; see {@link searchPositionOf}. */
510
522
  searchPosition: searchPositionOf,
511
523
  /** The packages on the search path; see {@link attachedPackagesOf}. */
512
524
  attachedPackages: attachedPackagesOf,
525
+ /** Defines an identifier in the environment, as a super assignment if asked; returns the new environment information. */
526
+ define: define_1.define,
527
+ /** Adds all writes of `next` to `base` as things that might happen; see {@link appendEnvironment}. */
528
+ append: append_1.appendEnvironment,
529
+ /** Lets the definitions of `next` replace those of `base` by name; see {@link overwriteEnvironment}. */
530
+ overwrite: overwrite_1.overwriteEnvironment,
531
+ /** Clones the environment information, with or without its parents; see {@link cloneEnvironmentInformation}. */
532
+ clone: clone_1.cloneEnvironmentInformation,
533
+ /** Adds a local scope on top, see {@link REnvironment.popLocal} for the counterpart; see {@link pushLocalEnvironment}. */
534
+ pushLocal: scoping_1.pushLocalEnvironment,
535
+ /** Removes the top local scope, see {@link REnvironment.pushLocal} for the counterpart; see {@link popLocalEnvironment}. */
536
+ popLocal: scoping_1.popLocalEnvironment,
537
+ /** The search path of the environment with an empty global frame: attached packages stay visible, global binds do not; see {@link cleanEnvOf}. */
538
+ cleanOf: scoping_1.cleanEnvOf,
513
539
  };
514
540
  /**
515
541
  * Whether the package block `layers` ends with `tail` (a block grows at the front, so this is the shape two branches take
@@ -549,11 +575,6 @@ function splitLibraryLayers(env) {
549
575
  }
550
576
  /** Serializes an environment, replacing the built-in environment with a placeholder. */
551
577
  function builtInEnvJsonReplacer(k, v) {
552
- if (isDefaultBuiltInEnvironment(v)) {
553
- return '<BuiltInEnvironment>';
554
- }
555
- else {
556
- return (0, json_1.jsonReplacer)(k, v);
557
- }
578
+ return isDefaultBuiltInEnvironment(v) ? '<BuiltInEnvironment>' : (0, json_1.jsonReplacer)(k, v);
558
579
  }
559
580
  //# sourceMappingURL=environment.js.map
@@ -43,6 +43,8 @@ export declare class Frame implements MemoryView {
43
43
  * overlays again until the stack reaches {@link DefaultMaxOverlayDepth}, where a copy flattens it.
44
44
  */
45
45
  forWrite(): Frame;
46
+ /** The attached package this frame binds, as long as nothing was written to it, see {@link LazyBindings}. */
47
+ lazy(): LazyBindings | undefined;
46
48
  /** How many overlays are stacked below this one, which bounds what a lookup miss walks. */
47
49
  private stacked;
48
50
  set(name: BrandedIdentifier, defs: IdentifierDefinition[]): void;
@@ -75,8 +77,14 @@ export declare class Frame implements MemoryView {
75
77
  export declare class LazyBindings implements MemoryView {
76
78
  private readonly names;
77
79
  private readonly bind;
80
+ readonly origin: string;
78
81
  private readonly built;
79
- constructor(names: ReadonlySet<BrandedIdentifier>, bind: (name: BrandedIdentifier) => IdentifierDefinition[]);
82
+ /**
83
+ * @param names - the names this binds
84
+ * @param bind - builds the definitions of one name
85
+ * @param origin - what, besides the names, decides what `bind` returns, so the bindings can be told apart without building them
86
+ */
87
+ constructor(names: ReadonlySet<BrandedIdentifier>, bind: (name: BrandedIdentifier) => IdentifierDefinition[], origin: string);
80
88
  get(name: BrandedIdentifier): IdentifierDefinition[] | undefined;
81
89
  has(name: BrandedIdentifier): boolean;
82
90
  get size(): number;
@@ -74,6 +74,10 @@ class Frame {
74
74
  }
75
75
  return new Frame(new Map(this.bindings), false);
76
76
  }
77
+ /** The attached package this frame binds, as long as nothing was written to it, see {@link LazyBindings}. */
78
+ lazy() {
79
+ return this.base === undefined && this.bindings instanceof LazyBindings ? this.bindings : undefined;
80
+ }
77
81
  /** How many overlays are stacked below this one, which bounds what a lookup miss walks. */
78
82
  stacked() {
79
83
  let n = 0;
@@ -202,10 +206,17 @@ const EmptyFrame = Frame.of(new Map());
202
206
  class LazyBindings {
203
207
  names;
204
208
  bind;
209
+ origin;
205
210
  built = new Map();
206
- constructor(names, bind) {
211
+ /**
212
+ * @param names - the names this binds
213
+ * @param bind - builds the definitions of one name
214
+ * @param origin - what, besides the names, decides what `bind` returns, so the bindings can be told apart without building them
215
+ */
216
+ constructor(names, bind, origin) {
207
217
  this.names = names;
208
218
  this.bind = bind;
219
+ this.origin = origin;
209
220
  }
210
221
  get(name) {
211
222
  if (!this.names.has(name)) {
@@ -116,8 +116,6 @@ export declare const Identifier: {
116
116
  * If the first identifier is internal, it will match any target (internal or not).
117
117
  */
118
118
  readonly matches: (this: void, id: Identifier, target: Identifier, s3?: boolean) => boolean;
119
- /** The text as a regex matches it literally: `[`, `$` and `.` name functions in R, they are not pattern syntax. */
120
- readonly quote: (this: void, text: string) => string;
121
119
  /**
122
120
  * Helper to create a regular expression that matches against an array of {@link Identifier} values. If both the passed identifier and the matched identifier are namespaced, their namespaces are expected to match. If either is not namespaced, the namespace is ignored on both.
123
121
  */
@@ -272,6 +270,7 @@ export declare const enum PkgName {
272
270
  HtmlTools = "htmltools",
273
271
  HtmlWidgets = "htmlwidgets",
274
272
  Httr = "httr",
273
+ Httr2 = "httr2",
275
274
  Imager = "imager",
276
275
  Import = "import",
277
276
  Inferference = "inferference",
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ReferenceTypeReverseMapping = exports.ReferenceType = exports.IdentifierView = exports.Identifier = void 0;
4
4
  exports.isReferenceType = isReferenceType;
5
5
  exports.hasEnvState = hasEnvState;
6
+ const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
6
7
  const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
7
8
  const strings_1 = require("../../util/text/strings");
8
9
  const r_base_packages_1 = require("../../util/r-base-packages");
@@ -28,8 +29,9 @@ exports.Identifier = {
28
29
  * Prefer {@link Identifier.from} for static config entries where namespace is always present and name has no backticks.
29
30
  */
30
31
  make(name, namespace, internal = false) {
31
- if ((0, strings_1.startAndEndsWith)(name, '`')) {
32
- name = name.slice(1, -1);
32
+ const split = r_string_1.RString.splitQuotes(name);
33
+ if (split.quote === '`') {
34
+ name = split.content;
33
35
  }
34
36
  return namespace ? [name, namespace, internal] : name;
35
37
  },
@@ -157,10 +159,6 @@ exports.Identifier = {
157
159
  /* an omitted flag is the same as an explicit `false`, `pkg::fn` written either way is one identifier */
158
160
  return exports.Identifier.accessesInternal(target) !== true;
159
161
  },
160
- /** The text as a regex matches it literally: `[`, `$` and `.` name functions in R, they are not pattern syntax. */
161
- quote(text) {
162
- return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
163
- },
164
162
  /**
165
163
  * Helper to create a regular expression that matches against an array of {@link Identifier} values. If both the passed identifier and the matched identifier are namespaced, their namespaces are expected to match. If either is not namespaced, the namespace is ignored on both.
166
164
  */
@@ -168,7 +166,7 @@ exports.Identifier = {
168
166
  // if the passed identifier is not namespaced, we match against *any* namespace. if it is namespaced, we match against the correct namespace or no namespace
169
167
  return new RegExp(`^(${identifiers.map(i => {
170
168
  const namespace = exports.Identifier.getNamespace(i);
171
- return `(${namespace === undefined ? '.+' : exports.Identifier.quote(namespace)}:::?)?${exports.Identifier.quote(exports.Identifier.getName(i))}`;
169
+ return `(${namespace === undefined ? '.+' : (0, strings_1.escapeRegex)(namespace)}:::?)?${(0, strings_1.escapeRegex)(exports.Identifier.getName(i))}`;
172
170
  }).join('|')})$`);
173
171
  },
174
172
  /** Special identifier for the `...` argument */
@@ -4,6 +4,7 @@ exports.overwriteEnvironment = overwriteEnvironment;
4
4
  const scoping_1 = require("./scoping");
5
5
  /**
6
6
  * Definitions within `next` replace those in `base` by name; if all of `next`'s are maybe, they are appended instead (turning existing ones maybe too), like {@link appendEnvironment}.
7
+ * @useInstead {@link REnvironment.overwrite}
7
8
  * @see {@link Environment.overwrite} - for details on how definitions are handled.
8
9
  */
9
10
  function overwriteEnvironment(base, next, applyCds) {
@@ -13,6 +13,7 @@ import type { PackageSignatureSource } from '../../project/sigdb/reader';
13
13
  import type { DecodedFunction } from '../../project/sigdb/decode';
14
14
  import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
15
15
  import type { DataflowInformation } from '../info';
16
+ import type { DataflowGraph } from '../graph/graph';
16
17
  /**
17
18
  * Where to look up what flowR knows about a function, in that order:
18
19
  * the name as it resolves here, the built-in definitions, and the signature database for the rest.
@@ -43,6 +44,8 @@ export declare function builtInLookup(ctx?: ReadOnlyFlowrAnalyzerContext): (name
43
44
  export declare function callFnProps(id: NodeId, { graph, environment }: Pick<DataflowInformation, 'graph' | 'environment'>): (BuiltInFnInfo & {
44
45
  name: Identifier;
45
46
  }) | undefined;
47
+ /** Whether `id` is quoted only by calls shipping it to a worker (`future(expr)`, `%dopar%`), which still runs it. */
48
+ export declare function quotedForWorker(id: NodeId, graph: DataflowGraph, index: BuiltInIndex): boolean;
46
49
  /**
47
50
  * What the signature database implies for a package function: what its own entry states
48
51
  * (see {@link fnInfoFromSignature}) plus the {@link PropagatedProps} of everything it calls, transitively.
@@ -4,6 +4,7 @@ exports.BuiltInIndex = void 0;
4
4
  exports.queryFnProps = queryFnProps;
5
5
  exports.builtInLookup = builtInLookup;
6
6
  exports.callFnProps = callFnProps;
7
+ exports.quotedForWorker = quotedForWorker;
7
8
  exports.inferFnProps = inferFnProps;
8
9
  exports.fnInfo = fnInfo;
9
10
  exports.builtInNames = builtInNames;
@@ -22,6 +23,7 @@ const signature_db_1 = require("../../project/sigdb/signature-db");
22
23
  const resolve_helper_1 = require("./resolve-helper");
23
24
  const vertex_1 = require("../graph/vertex");
24
25
  const df_helper_1 = require("../graph/df-helper");
26
+ const edge_1 = require("../graph/edge");
25
27
  const r_base_packages_1 = require("../../util/r-base-packages");
26
28
  /**
27
29
  * What flowR states about the package export `definition` binds, `undefined` if it binds none or if flowR
@@ -135,6 +137,11 @@ function callFnProps(id, { graph, environment }) {
135
137
  })
136
138
  };
137
139
  }
140
+ /** Whether `id` is quoted only by calls shipping it to a worker (`future(expr)`, `%dopar%`), which still runs it. */
141
+ function quotedForWorker(id, graph, index) {
142
+ const quoting = df_helper_1.Dataflow.sourcesOf(graph, id, edge_1.EdgeType.NonStandardEvaluation);
143
+ return quoting.length > 0 && quoting.every(s => df_helper_1.Dataflow.targetsOf(graph, s, edge_1.EdgeType.Calls).some(t => node_id_1.NodeId.isBuiltIn(t) && ((index.propsOf(node_id_1.NodeId.fromBuiltIn(t)) ?? 0) & built_in_props_1.CallProp.Concurrent) !== 0));
144
+ }
138
145
  /**
139
146
  * What the signature database implies for a package function: what its own entry states
140
147
  * (see {@link fnInfoFromSignature}) plus the {@link PropagatedProps} of everything it calls, transitively.
@@ -10,6 +10,7 @@ const identifier_1 = require("./identifier");
10
10
  const info_1 = require("../info");
11
11
  const built_in_s_seven_dispatch_1 = require("../internal/process/functions/call/built-in/built-in-s-seven-dispatch");
12
12
  const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
13
+ const r_base_packages_1 = require("../../util/r-base-packages");
13
14
  /** how many answers a frozen layer memoizes before it starts over, so the memo cannot grow without bound */
14
15
  const TailCacheCap = 4096;
15
16
  /** A namespaced lookup only sees its matching layer; a bare lookup skips loaded-but-unattached namespaces (`requireNamespace`). */
@@ -18,10 +19,16 @@ function layerSkipped(layer, ns) {
18
19
  }
19
20
  /**
20
21
  * What the built-in environment states about `pkg::name` for a package nothing attached: `pkg::fn` reaches its
21
- * package in R whether or not it is on the search path, so a namespaced name has to find it here.
22
+ * package in R whether or not it is on the search path, so a namespaced name has to find it here. Failing that,
23
+ * a package outside of base R never hands out a function of base R, so `config::get` is no `base::get`.
22
24
  */
23
25
  function statedIn(builtIn, name, ns) {
24
- return ns === undefined ? undefined : builtIn.namespaces?.get(String(ns))?.get(name);
26
+ const stated = ns === undefined ? undefined : builtIn.namespaces?.get(String(ns))?.get(name);
27
+ if (stated !== undefined || ns === undefined || (0, r_base_packages_1.isBaseRPackage)(String(ns))) {
28
+ return stated ?? builtIn.lookup(name);
29
+ }
30
+ const foreign = builtIn.lookup(name)?.filter(d => !(0, r_base_packages_1.isBaseRPackage)(String(d.name === undefined ? undefined : identifier_1.Identifier.getNamespace(d.name))));
31
+ return foreign?.length ? foreign : undefined;
25
32
  }
26
33
  const FunctionTargetTypes = identifier_1.ReferenceType.Function | identifier_1.ReferenceType.BuiltInFunction | identifier_1.ReferenceType.Unknown | identifier_1.ReferenceType.Argument | identifier_1.ReferenceType.Parameter;
27
34
  const VariableTargetTypes = identifier_1.ReferenceType.Variable | identifier_1.ReferenceType.Parameter | identifier_1.ReferenceType.Argument | identifier_1.ReferenceType.Unknown;
@@ -155,7 +162,7 @@ function resolveByTargetType(id, environment, target) {
155
162
  } while (!current.builtInEnv);
156
163
  /* the built-in layer is handed over as it is, except to a value position: `filter(df, c > 2)` means the
157
164
  column `c`, never `base::c`, and only with nothing left does `ownDefinitions` have its say */
158
- const known = statedIn(current, name, ns) ?? current.lookup(name);
165
+ const known = statedIn(current, name, ns);
159
166
  const builtIns = target === identifier_1.ReferenceType.NonFunction ? known?.filter(wantedType) : known;
160
167
  const result = definitions
161
168
  ? (builtIns === undefined || builtIns.length === 0 ? definitions : definitions.concat(builtIns))
@@ -209,7 +216,7 @@ function resolveByNameAnyType(id, environment) {
209
216
  }
210
217
  current = current.parent;
211
218
  } while (!current.builtInEnv);
212
- const builtIns = statedIn(current, name, ns) ?? current.lookup(name);
219
+ const builtIns = statedIn(current, name, ns);
213
220
  if (definitions === undefined) {
214
221
  return remember(environment, id, builtIns);
215
222
  }
@@ -1,11 +1,13 @@
1
1
  import { type REnvironmentInformation } from './environment';
2
2
  /**
3
3
  * Add a new local environment scope to the stack, returns the modified variant (shares the original stack, no deep-clone).
4
+ * @useInstead {@link REnvironment.pushLocal}
4
5
  * @see {@link popLocalEnvironment} - to remove the local scope again
5
6
  */
6
7
  export declare function pushLocalEnvironment({ level, current }: REnvironmentInformation): REnvironmentInformation;
7
8
  /**
8
9
  * Remove the top local environment scope from the stack, returns the modified variant (shares the original stack, no deep-clone).
10
+ * @useInstead {@link REnvironment.popLocal}
9
11
  * @see {@link pushLocalEnvironment} - to add a local scope
10
12
  */
11
13
  export declare function popLocalEnvironment({ current, level }: REnvironmentInformation): REnvironmentInformation;
@@ -19,5 +21,6 @@ export declare function padToCommonScope(base: REnvironmentInformation, next: RE
19
21
  /**
20
22
  * The environment's search path with an empty global frame: attached packages stay visible, the global frame's
21
23
  * binds do not. Prefer this over `makeCleanEnv` wherever an environment is at hand; the chain below is shared.
24
+ * @useInstead {@link REnvironment.cleanOf}
22
25
  */
23
26
  export declare function cleanEnvOf({ current }: REnvironmentInformation): REnvironmentInformation;
@@ -8,6 +8,7 @@ const environment_1 = require("./environment");
8
8
  const assert_1 = require("../../util/assert");
9
9
  /**
10
10
  * Add a new local environment scope to the stack, returns the modified variant (shares the original stack, no deep-clone).
11
+ * @useInstead {@link REnvironment.pushLocal}
11
12
  * @see {@link popLocalEnvironment} - to remove the local scope again
12
13
  */
13
14
  function pushLocalEnvironment({ level, current }) {
@@ -18,6 +19,7 @@ function pushLocalEnvironment({ level, current }) {
18
19
  }
19
20
  /**
20
21
  * Remove the top local environment scope from the stack, returns the modified variant (shares the original stack, no deep-clone).
22
+ * @useInstead {@link REnvironment.popLocal}
21
23
  * @see {@link pushLocalEnvironment} - to add a local scope
22
24
  */
23
25
  function popLocalEnvironment({ current, level }) {
@@ -42,6 +44,7 @@ function padToCommonScope(base, next) {
42
44
  /**
43
45
  * The environment's search path with an empty global frame: attached packages stay visible, the global frame's
44
46
  * binds do not. Prefer this over `makeCleanEnv` wherever an environment is at hand; the chain below is shared.
47
+ * @useInstead {@link REnvironment.cleanOf}
45
48
  */
46
49
  function cleanEnvOf({ current }) {
47
50
  const inner = environment_1.REnvironment.findGlobal(current);
@@ -26,6 +26,7 @@ const r_symbol_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol"
26
26
  const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
27
27
  const resolve_helper_1 = require("../../environments/resolve-helper");
28
28
  const node_value_1 = require("./node-value");
29
+ const df_helper_1 = require("../../graph/df-helper");
29
30
  const AliasHandler = {
30
31
  [vertex_1.VertexType.Value]: (sourceId) => [sourceId],
31
32
  [vertex_1.VertexType.Use]: getUseAlias,
@@ -305,9 +306,8 @@ function parameterDefaultState(node, idMap, graph) {
305
306
  if (!r_parameter_1.RParameter.is(bound) || bound.info.parent === undefined) {
306
307
  return 'applies';
307
308
  }
308
- const count = (edges, type) => [...edges].filter(([, e]) => edge_1.DfEdge.includesType(e, type)).length;
309
- const calls = count(graph.edgesTo(bound.info.parent), edge_1.EdgeType.Calls);
310
- return calls === 0 ? 'unknown' : count(graph.edgesFrom(bound.name.info.id), edge_1.EdgeType.DefinedByOnCall) >= calls ? 'overridden' : 'applies';
309
+ const calls = df_helper_1.Dataflow.sourcesOf(graph, bound.info.parent, edge_1.EdgeType.Calls).length;
310
+ return calls === 0 ? 'unknown' : df_helper_1.Dataflow.targetsOf(graph, bound.name.info.id, edge_1.EdgeType.DefinedByOnCall).length >= calls ? 'overridden' : 'applies';
311
311
  }
312
312
  /**
313
313
  * The sequence a use of a `for` loop's variable runs over, `undefined` when `id` is no such use. Every
@@ -3,9 +3,13 @@ import type { DataflowGraphVertexFunctionCall } from '../../graph/vertex';
3
3
  import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
4
4
  import type { VariableResolve } from '../../../config';
5
5
  import type { ReadOnlyFlowrAnalyzerContext } from '../../../project/context/flowr-analyzer-context';
6
- /** The index of the argument of `vertex` that binds the formal `argumentName`, R's matching when the formals are known and the `argumentIndex`-th unnamed argument otherwise. */
7
- export declare function boundArgumentIndex<Idx extends number | 'unnamed' | undefined>(graph: DataflowGraph, vertex: DataflowGraphVertexFunctionCall, argumentIndex: Idx, argumentName: string, ctx: ReadOnlyFlowrAnalyzerContext): Idx | number;
6
+ /**
7
+ * The index of the argument of `vertex` that binds the formal `argumentName`, R's matching when the formals are known and the `argumentIndex`-th unnamed argument otherwise.
8
+ * Pass the `formals` of the call when they are known already, which saves looking them up again.
9
+ */
10
+ export declare function boundArgumentIndex<Idx extends number | 'unnamed' | undefined>(graph: DataflowGraph, vertex: DataflowGraphVertexFunctionCall, argumentIndex: Idx, argumentName: string, ctx: ReadOnlyFlowrAnalyzerContext, formals?: readonly string[]): Idx | number;
8
11
  /**
9
12
  * Get the values of all arguments matching the criteria, keyed by the id of the argument.
13
+ * Pass the `formals` of the call when they are known already, see {@link boundArgumentIndex}.
10
14
  */
11
- export declare function getArgumentStringValue(variableResolve: VariableResolve, graph: DataflowGraph, vertex: DataflowGraphVertexFunctionCall, argumentIndex: number | 'unnamed' | undefined, argumentName: string | undefined, resolveValue: boolean | 'library' | undefined, ctx: ReadOnlyFlowrAnalyzerContext): Map<NodeId, Set<string | undefined>> | undefined;
15
+ export declare function getArgumentStringValue(variableResolve: VariableResolve, graph: DataflowGraph, vertex: DataflowGraphVertexFunctionCall, argumentIndex: number | 'unnamed' | undefined, argumentName: string | undefined, resolveValue: boolean | 'library' | undefined, ctx: ReadOnlyFlowrAnalyzerContext, formals?: readonly string[]): Map<NodeId, Set<string | undefined>> | undefined;
@@ -21,19 +21,23 @@ const string_constants_1 = require("../values/string/string-constants");
21
21
  const resolve_helper_1 = require("../../environments/resolve-helper");
22
22
  const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
23
23
  const r_symbol_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
24
- /** The index of the argument of `vertex` that binds the formal `argumentName`, R's matching when the formals are known and the `argumentIndex`-th unnamed argument otherwise. */
25
- function boundArgumentIndex(graph, vertex, argumentIndex, argumentName, ctx) {
26
- const call = graph.idMap?.get(vertex.id);
27
- const formals = r_function_call_1.RFunctionCall.is(call) ? match_args_1.MatchArgs.formalsOf(call, graph, ctx) : undefined;
24
+ /**
25
+ * The index of the argument of `vertex` that binds the formal `argumentName`, R's matching when the formals are known and the `argumentIndex`-th unnamed argument otherwise.
26
+ * Pass the `formals` of the call when they are known already, which saves looking them up again.
27
+ */
28
+ function boundArgumentIndex(graph, vertex, argumentIndex, argumentName, ctx, formals) {
29
+ /* an exact name binds its formal whatever else the call does, so this needs no formals */
30
+ const exact = vertex.args.findIndex(arg => arg !== r_function_call_1.EmptyArgument && arg.name === argumentName);
31
+ if (exact >= 0) {
32
+ return exact;
33
+ }
34
+ const call = formals === undefined ? graph.idMap?.get(vertex.id) : undefined;
35
+ formals ??= r_function_call_1.RFunctionCall.is(call) ? match_args_1.MatchArgs.formalsOf(call, graph, ctx) : undefined;
28
36
  if (formals?.includes(argumentName)) {
29
37
  const bound = match_args_1.MatchArgs.toSpec(vertex.args, Object.fromEntries(formals.map(f => [f, f]))).get(argumentName)?.[0];
30
38
  return bound === undefined ? vertex.args.length : vertex.args.findIndex(a => a !== r_function_call_1.EmptyArgument && a.nodeId === bound);
31
39
  }
32
- const arg = vertex.args.findIndex(arg => arg !== r_function_call_1.EmptyArgument && arg.name === argumentName);
33
- if (arg >= 0) {
34
- return arg;
35
- }
36
- else if (typeof argumentIndex === 'number') {
40
+ if (typeof argumentIndex === 'number') {
37
41
  /* a named argument takes no position, so the parameter binds the matching unnamed one */
38
42
  const unnamed = vertex.args.flatMap((a, i) => a === r_function_call_1.EmptyArgument || !a.name ? [i] : []);
39
43
  return unnamed[argumentIndex] ?? vertex.args.length;
@@ -42,10 +46,11 @@ function boundArgumentIndex(graph, vertex, argumentIndex, argumentName, ctx) {
42
46
  }
43
47
  /**
44
48
  * Get the values of all arguments matching the criteria, keyed by the id of the argument.
49
+ * Pass the `formals` of the call when they are known already, see {@link boundArgumentIndex}.
45
50
  */
46
- function getArgumentStringValue(variableResolve, graph, vertex, argumentIndex, argumentName, resolveValue, ctx) {
51
+ function getArgumentStringValue(variableResolve, graph, vertex, argumentIndex, argumentName, resolveValue, ctx, formals) {
47
52
  if (argumentName && argumentIndex !== 'unnamed') {
48
- argumentIndex = boundArgumentIndex(graph, vertex, argumentIndex, argumentName, ctx);
53
+ argumentIndex = boundArgumentIndex(graph, vertex, argumentIndex, argumentName, ctx, formals);
49
54
  }
50
55
  if (argumentIndex === undefined) {
51
56
  return undefined;
@@ -86,9 +91,13 @@ function openedResourceOf(variableResolve, graph, argument, ctx) {
86
91
  const vertex = graph.getVertex(id);
87
92
  const info = vertex_1.DfgVertex.isFunctionCall(vertex) ? (0, query_fn_props_1.callFnProps)(id, { graph, environment: ctx.env.cleanEnv() }) : undefined;
88
93
  const resource = info?.sig?.findIndex(([, p]) => (p & built_in_props_1.ArgProp.Resource) !== 0) ?? -1;
89
- if (vertex === undefined || resource < 0 || !function_semantics_1.FunctionSemantics.call.props.hasAll(info, [built_in_props_1.SemanticCallTag.Opens])) {
94
+ if (vertex === undefined || !function_semantics_1.FunctionSemantics.call.props.hasAll(info, [built_in_props_1.SemanticCallTag.Opens]) || (resource < 0 && info?.sig === undefined)) {
90
95
  continue;
91
96
  }
97
+ else if (resource < 0) {
98
+ /* a handle on data in memory (`textConnection(x)`) names no resource at all */
99
+ return [dependencies_query_format_1.Constant];
100
+ }
92
101
  const values = getArgumentStringValue(variableResolve, graph, vertex, resource, info?.sig?.[resource][0], true, ctx);
93
102
  return values === undefined ? undefined : [...values.values()].flatMap(v => [...v]).filter(assert_1.isNotUndefined);
94
103
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NumericFold = exports.NumericFns = void 0;
4
4
  const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
5
5
  const identifier_1 = require("../../environments/identifier");
6
+ const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
6
7
  const r_value_1 = require("../../../util/r-value");
7
8
  const r_value_2 = require("../values/r-value");
8
9
  const interval_constants_1 = require("../values/intervals/interval-constants");
@@ -126,8 +127,10 @@ function calledName(node) {
126
127
  case type_1.RType.UnaryOp:
127
128
  case type_1.RType.BinaryOp:
128
129
  return node.operator;
129
- case type_1.RType.FunctionCall:
130
- return node.named ? identifier_1.Identifier.getName(node.functionName.content) : undefined;
130
+ case type_1.RType.FunctionCall: {
131
+ const name = r_function_call_1.RFunctionCall.calledName(node);
132
+ return name === undefined ? undefined : identifier_1.Identifier.getName(name);
133
+ }
131
134
  default:
132
135
  return undefined;
133
136
  }
@@ -24,7 +24,7 @@ export interface StringFn {
24
24
  /** parameters a call may supply that change nothing for the single strings we fold, like `paste`'s `collapse` */
25
25
  readonly ignored?: readonly string[];
26
26
  /** the fold over the supplied arguments, in declaration order */
27
- readonly fold: (...args: any[]) => string | number | undefined;
27
+ fold(...args: unknown[]): string | number | undefined;
28
28
  }
29
29
  /**
30
30
  * Every string built-in the value solver folds, the joining ones included: `paste` is an entry like `toupper`
@@ -10,12 +10,12 @@ const dependencies_query_format_1 = require("../../../queries/catalog/dependenci
10
10
  const strings_1 = require("../../../util/text/strings");
11
11
  const info_1 = require("../../info");
12
12
  const edge_1 = require("../../graph/edge");
13
- const frame_reflection_1 = require("../../fn/frame-reflection");
14
13
  const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
15
14
  const defaultmap_1 = require("../../../util/collections/defaultmap");
16
15
  const files_1 = require("../../../util/files");
17
16
  const built_in_source_1 = require("../../internal/process/functions/call/built-in/built-in-source");
18
17
  const arrays_1 = require("../../../util/collections/arrays");
18
+ const df_helper_1 = require("../../graph/df-helper");
19
19
  /** functions recognized as changing the working directory; a registry so more (e.g. `withr::with_dir`) can be added */
20
20
  const ChangeFunctions = [
21
21
  { name: 'setwd', namespace: 'base', argIdx: 0, argName: 'dir' }
@@ -130,7 +130,7 @@ function collect(graph, ctx) {
130
130
  // a function's setwd is propagated to its call sites; only a lone unconditional setwd has a site-independent effect
131
131
  for (const [fn, setwds] of byFn.entries()) {
132
132
  const net = setwds.length === 1 && setwds[0].cds.length === 0 && !setwds[0].iterated ? setwds[0].dir : undefined;
133
- for (const site of (0, frame_reflection_1.edgeSources)(graph, fn, edge_1.EdgeType.Calls)) {
133
+ for (const site of df_helper_1.Dataflow.sourcesOf(graph, fn, edge_1.EdgeType.Calls)) {
134
134
  const cds = graph.getVertex(site)?.cds ?? [];
135
135
  out.push({ id: site, dir: net, cds, iterated: isIterated(cds, graph.idMap), enclosedInFunction: enclosingFunction(graph.idMap, site) !== undefined });
136
136
  }
@@ -60,8 +60,7 @@ function evalNameOf({ node, graph, environment, ctx }) {
60
60
  }
61
61
  else if (graph === undefined) {
62
62
  const named = r_expression_list_1.RExpressionList.is(node) ? r_expression_list_1.RExpressionList.groupStart(node)?.content
63
- : r_function_call_1.RFunctionCall.isNamed(node) ? node.functionName.content
64
- : (r_binary_op_1.RBinaryOp.is(node) || r_unary_op_1.RUnaryOp.is(node)) && onlyLiterals(node) ? identifier_1.Identifier.make(node.operator) : undefined;
63
+ : r_function_call_1.RFunctionCall.calledName(node) ?? ((r_binary_op_1.RBinaryOp.is(node) || r_unary_op_1.RUnaryOp.is(node)) && onlyLiterals(node) ? identifier_1.Identifier.make(node.operator) : undefined);
65
64
  return named !== undefined && environment !== undefined && foldsThroughBuiltIn(named, ctx)
66
65
  && resolve_helper_1.Resolve.isBuiltIn(named, environment, identifier_1.ReferenceType.Function) ? named : undefined;
67
66
  }