@eagleoutice/flowr 2.16.2 → 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 (445) 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 +10 -0
  39. package/dataflow/environments/built-in-props.js +25 -1
  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 +188 -14
  44. package/dataflow/environments/default-builtin-config.js +125 -65
  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 +0 -2
  52. package/dataflow/environments/identifier.js +5 -7
  53. package/dataflow/environments/overwrite.js +1 -0
  54. package/dataflow/environments/query-fn-props.js +2 -3
  55. package/dataflow/environments/scoping.d.ts +3 -0
  56. package/dataflow/environments/scoping.js +3 -0
  57. package/dataflow/eval/resolve/alias-tracking.js +3 -3
  58. package/dataflow/eval/resolve/resolve-argument.d.ts +7 -3
  59. package/dataflow/eval/resolve/resolve-argument.js +16 -11
  60. package/dataflow/eval/resolve/resolve-numbers.js +5 -2
  61. package/dataflow/eval/resolve/resolve-strings.d.ts +1 -1
  62. package/dataflow/eval/resolve/resolve-working-directory.js +2 -2
  63. package/dataflow/eval/resolve/resolve.js +1 -2
  64. package/dataflow/eval/values/intervals/interval-constants.js +1 -6
  65. package/dataflow/eval/values/r-value.js +1 -6
  66. package/dataflow/extractor.js +17 -17
  67. package/dataflow/fn/argument-roles.js +15 -15
  68. package/dataflow/fn/class-declaration.js +7 -7
  69. package/dataflow/fn/frame-reflection.d.ts +1 -23
  70. package/dataflow/fn/frame-reflection.js +8 -95
  71. package/dataflow/fn/function-props.d.ts +0 -3
  72. package/dataflow/fn/function-props.js +9 -11
  73. package/dataflow/fn/function-semantics.d.ts +1 -0
  74. package/dataflow/fn/strict-function.js +15 -14
  75. package/dataflow/graph/call-graph.d.ts +8 -0
  76. package/dataflow/graph/call-graph.js +40 -25
  77. package/dataflow/graph/dataflowgraph-builder.d.ts +0 -60
  78. package/dataflow/graph/dataflowgraph-builder.js +15 -135
  79. package/dataflow/graph/df-helper.d.ts +56 -4
  80. package/dataflow/graph/df-helper.js +116 -1
  81. package/dataflow/graph/diff-dataflow-graph.js +13 -15
  82. package/dataflow/graph/graph-helper.d.ts +20 -0
  83. package/dataflow/graph/graph-helper.js +18 -0
  84. package/dataflow/graph/graph.js +3 -8
  85. package/dataflow/graph/match-args.d.ts +1 -1
  86. package/dataflow/graph/match-args.js +3 -3
  87. package/dataflow/internal/linker.d.ts +4 -10
  88. package/dataflow/internal/linker.js +21 -29
  89. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -8
  90. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +5 -2
  91. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +39 -22
  92. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -21
  93. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -7
  94. package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +6 -11
  95. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
  96. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -13
  97. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +27 -13
  98. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -8
  99. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +33 -35
  100. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -5
  101. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +6 -7
  102. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +12 -5
  103. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +3 -4
  104. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +7 -8
  105. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -6
  106. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +3 -4
  107. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -3
  108. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -7
  109. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +6 -5
  110. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -2
  111. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -6
  112. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +4 -4
  113. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +7 -7
  114. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +1 -2
  115. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -3
  116. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  117. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +5 -7
  118. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +4 -5
  120. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +8 -9
  121. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -5
  122. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +3 -3
  123. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +36 -38
  124. package/dataflow/internal/process/functions/call/common.d.ts +3 -1
  125. package/dataflow/internal/process/functions/call/common.js +6 -7
  126. package/dataflow/internal/process/functions/call/deferred.js +8 -8
  127. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +11 -4
  128. package/dataflow/internal/process/functions/call/known-call-handling.js +11 -7
  129. package/dataflow/internal/process/functions/call/named-call-handling.js +4 -3
  130. package/dataflow/internal/process/functions/call/nse.js +4 -4
  131. package/dataflow/internal/process/functions/call/quoted.js +16 -14
  132. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
  133. package/dataflow/internal/process/functions/process-parameter.js +2 -2
  134. package/dataflow/internal/process/process-named-call.js +1 -1
  135. package/dataflow/origin/dfg-get-origin.js +2 -2
  136. package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -0
  137. package/dataflow/origin/dfg-get-symbol-refs.js +3 -8
  138. package/documentation/data/faq/wiki-faq-store.js +2 -2
  139. package/documentation/doc-capabilities.js +2 -1
  140. package/documentation/doc-util/doc-functions.js +2 -2
  141. package/documentation/doc-util/doc-repl.js +4 -4
  142. package/documentation/doc-util/doc-types.js +2 -2
  143. package/documentation/wiki-absint.js +2 -1
  144. package/documentation/wiki-cfg.js +2 -1
  145. package/documentation/wiki-create-linting-rules.js +1 -1
  146. package/documentation/wiki-dataflow-graph.js +6 -6
  147. package/documentation/wiki-interface.js +3 -2
  148. package/documentation/wiki-linter.js +54 -4
  149. package/documentation/wiki-mk/doc-maker.js +1 -2
  150. package/documentation/wiki-query.js +25 -0
  151. package/documentation/wiki-search.js +2 -1
  152. package/documentation/wiki-signature-database.js +0 -2
  153. package/linter/linter-executor.js +4 -0
  154. package/linter/linter-rules.d.ts +518 -1
  155. package/linter/linter-rules.js +39 -1
  156. package/linter/linter-tags.d.ts +6 -0
  157. package/linter/linter-tags.js +6 -0
  158. package/linter/rules/absolute-path.js +4 -3
  159. package/linter/rules/cmd-check/bogus-return.d.ts +29 -0
  160. package/linter/rules/cmd-check/bogus-return.js +63 -0
  161. package/linter/rules/cmd-check/call-arguments.d.ts +63 -0
  162. package/linter/rules/cmd-check/call-arguments.js +211 -0
  163. package/linter/rules/cmd-check/class-string-comparison.d.ts +48 -0
  164. package/linter/rules/cmd-check/class-string-comparison.js +135 -0
  165. package/linter/rules/cmd-check/cmd-check-util.d.ts +67 -0
  166. package/linter/rules/cmd-check/cmd-check-util.js +169 -0
  167. package/linter/rules/cmd-check/compiled-code.d.ts +86 -0
  168. package/linter/rules/cmd-check/compiled-code.js +350 -0
  169. package/linter/rules/cmd-check/conformance.d.ts +47 -0
  170. package/linter/rules/cmd-check/conformance.js +166 -0
  171. package/linter/rules/cmd-check/dependency-declaration.d.ts +95 -0
  172. package/linter/rules/cmd-check/dependency-declaration.js +299 -0
  173. package/linter/rules/cmd-check/description-metadata.d.ts +63 -0
  174. package/linter/rules/cmd-check/description-metadata.js +393 -0
  175. package/linter/rules/cmd-check/documentation-mismatch.d.ts +54 -0
  176. package/linter/rules/cmd-check/documentation-mismatch.js +407 -0
  177. package/linter/rules/cmd-check/file-checks.d.ts +29 -0
  178. package/linter/rules/cmd-check/file-checks.js +34 -0
  179. package/linter/rules/cmd-check/foreign-function-calls.d.ts +54 -0
  180. package/linter/rules/cmd-check/foreign-function-calls.js +115 -0
  181. package/linter/rules/cmd-check/global-environment-modification.d.ts +61 -0
  182. package/linter/rules/cmd-check/global-environment-modification.js +237 -0
  183. package/linter/rules/cmd-check/namespace-tampering.d.ts +52 -0
  184. package/linter/rules/cmd-check/namespace-tampering.js +162 -0
  185. package/linter/rules/cmd-check/non-ascii-code.d.ts +51 -0
  186. package/linter/rules/cmd-check/non-ascii-code.js +112 -0
  187. package/linter/rules/cmd-check/package-code.d.ts +30 -0
  188. package/linter/rules/cmd-check/package-code.js +141 -0
  189. package/linter/rules/cmd-check/package-data.d.ts +49 -0
  190. package/linter/rules/cmd-check/package-data.js +181 -0
  191. package/linter/rules/cmd-check/package-files.d.ts +41 -0
  192. package/linter/rules/cmd-check/package-files.js +157 -0
  193. package/linter/rules/cmd-check/package-hooks.d.ts +57 -0
  194. package/linter/rules/cmd-check/package-hooks.js +165 -0
  195. package/linter/rules/cmd-check/package-metafiles.d.ts +49 -0
  196. package/linter/rules/cmd-check/package-metafiles.js +292 -0
  197. package/linter/rules/cmd-check/package-runtime.d.ts +67 -0
  198. package/linter/rules/cmd-check/package-runtime.js +284 -0
  199. package/linter/rules/cmd-check/package-structure.d.ts +85 -0
  200. package/linter/rules/cmd-check/package-structure.js +320 -0
  201. package/linter/rules/cmd-check/rd-files.d.ts +67 -0
  202. package/linter/rules/cmd-check/rd-files.js +621 -0
  203. package/linter/rules/cmd-check/s-three-method-consistency.d.ts +72 -0
  204. package/linter/rules/cmd-check/s-three-method-consistency.js +206 -0
  205. package/linter/rules/cmd-check/true-false-abbreviation.d.ts +45 -0
  206. package/linter/rules/cmd-check/true-false-abbreviation.js +121 -0
  207. package/linter/rules/deprecated-functions.js +4 -4
  208. package/linter/rules/naming-convention.d.ts +1 -1
  209. package/linter/rules/naming-convention.js +13 -14
  210. package/linter/rules/no-leaked-credentials.js +4 -4
  211. package/linter/rules/problematic-inputs.js +2 -1
  212. package/linter/rules/seeded-randomness.js +5 -5
  213. package/linter/rules/software-has-license.d.ts +1 -1
  214. package/linter/rules/software-has-license.js +1 -1
  215. package/linter/rules/unclosed-connection.js +3 -3
  216. package/linter/rules/undefined-symbol-util.js +16 -32
  217. package/linter/rules/undefined-symbol.d.ts +2 -0
  218. package/linter/rules/undefined-symbol.js +33 -3
  219. package/linter/rules/unescaped-arguments.js +10 -9
  220. package/linter/rules/unused-definition.js +13 -19
  221. package/package.json +1 -1
  222. package/project/cache/flowr-analyzer-cache.js +1 -1
  223. package/project/context/flowr-analyzer-context.js +1 -1
  224. package/project/context/flowr-analyzer-environment-context.d.ts +1 -1
  225. package/project/context/flowr-analyzer-files-context.d.ts +6 -0
  226. package/project/context/flowr-analyzer-files-context.js +3 -0
  227. package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +0 -2
  228. package/project/context/flowr-analyzer-incremental-analysis-context.js +0 -4
  229. package/project/context/flowr-file.d.ts +4 -0
  230. package/project/context/flowr-file.js +4 -0
  231. package/project/flowr-analyzer-builder.js +1 -1
  232. package/project/plugins/file-plugins/files/flowr-description-file.js +2 -2
  233. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -0
  234. package/project/plugins/file-plugins/files/flowr-jupyter-file.js +4 -0
  235. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +2 -0
  236. package/project/plugins/file-plugins/files/flowr-manifest-files.js +11 -14
  237. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +3 -0
  238. package/project/plugins/file-plugins/files/flowr-namespace-file.js +25 -15
  239. package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +44 -0
  240. package/project/plugins/file-plugins/files/flowr-rd-file.js +130 -61
  241. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +0 -1
  242. package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -16
  243. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -0
  244. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +4 -0
  245. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +2 -0
  246. package/project/plugins/file-plugins/files/flowr-sweave-file.js +4 -0
  247. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +0 -1
  248. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -5
  249. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +2 -0
  250. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -0
  251. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +3 -7
  252. package/project/sigdb/build.js +16 -30
  253. package/project/sigdb/dict.d.ts +4 -6
  254. package/project/sigdb/dict.js +125 -31
  255. package/project/sigdb/reader.js +2 -18
  256. package/project/sigdb/sigdb-download.js +14 -23
  257. package/queries/base-query-format.d.ts +2 -0
  258. package/queries/base-query-format.js +10 -2
  259. package/queries/catalog/absint-query/absint-query-format.d.ts +1 -1
  260. package/queries/catalog/absint-query/absint-query-format.js +5 -7
  261. package/queries/catalog/call-context-query/call-context-query-executor.js +24 -32
  262. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
  263. package/queries/catalog/call-context-query/call-context-query-format.js +1 -3
  264. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -4
  265. package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -4
  266. package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -3
  267. package/queries/catalog/config-query/config-query-format.js +3 -3
  268. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -3
  269. package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -3
  270. package/queries/catalog/dependencies-query/data-flow.d.ts +43 -0
  271. package/queries/catalog/dependencies-query/data-flow.js +173 -0
  272. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +18 -0
  273. package/queries/catalog/dependencies-query/dependencies-query-executor.js +108 -12
  274. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +17 -1
  275. package/queries/catalog/dependencies-query/dependencies-query-format.js +14 -11
  276. package/queries/catalog/dependencies-query/function-info/derived-functions.js +2 -1
  277. package/queries/catalog/dependencies-query/function-info/function-info.d.ts +2 -0
  278. package/queries/catalog/dependencies-query/function-info/library-functions.js +13 -13
  279. package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
  280. package/queries/catalog/dependencies-query/function-info/remote-functions.js +3 -3
  281. package/queries/catalog/dependencies-query/function-info/source-functions.js +2 -2
  282. package/queries/catalog/dependencies-query/function-info/test-functions.js +8 -8
  283. package/queries/catalog/dependencies-query/function-info/transform-functions.d.ts +8 -0
  284. package/queries/catalog/dependencies-query/function-info/transform-functions.js +17 -0
  285. package/queries/catalog/dependencies-query/function-info/write-functions.js +4 -0
  286. package/queries/catalog/dependencies-query/implicit-echo.d.ts +5 -3
  287. package/queries/catalog/dependencies-query/implicit-echo.js +33 -34
  288. package/queries/catalog/dependencies-query/link-devices.d.ts +3 -2
  289. package/queries/catalog/dependencies-query/link-devices.js +9 -6
  290. package/queries/catalog/dependencies-query/plot-description.d.ts +10 -0
  291. package/queries/catalog/dependencies-query/plot-description.js +119 -0
  292. package/queries/catalog/dependencies-query/plot-objects.d.ts +13 -0
  293. package/queries/catalog/dependencies-query/plot-objects.js +61 -0
  294. package/queries/catalog/dice-query/dice-query-format.d.ts +2 -2
  295. package/queries/catalog/dice-query/dice-query-format.js +3 -40
  296. package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
  297. package/queries/catalog/does-call-query/does-call-query-format.js +2 -2
  298. package/queries/catalog/function-info-query/function-info-query-format.js +2 -2
  299. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +2 -1
  300. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
  301. package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
  302. package/queries/catalog/id-map-query/id-map-query-format.js +1 -3
  303. package/queries/catalog/input-sources-query/input-sources-query-executor.js +2 -2
  304. package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -3
  305. package/queries/catalog/input-sources-query/simple-input-classifier.js +28 -29
  306. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +4 -7
  307. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +1 -1
  308. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +3 -2
  309. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +2 -2
  310. package/queries/catalog/linter-query/linter-query-executor.js +10 -3
  311. package/queries/catalog/linter-query/linter-query-format.d.ts +4 -1
  312. package/queries/catalog/linter-query/linter-query-format.js +32 -21
  313. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  314. package/queries/catalog/location-map-query/location-map-query-format.js +1 -3
  315. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -3
  316. package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
  317. package/queries/catalog/origin-query/origin-query-executor.js +3 -3
  318. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  319. package/queries/catalog/origin-query/origin-query-format.js +4 -5
  320. package/queries/catalog/project-query/project-query-format.js +2 -2
  321. package/queries/catalog/provenance-query/provenance-query-format.js +2 -3
  322. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  323. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -4
  324. package/queries/catalog/search-query/search-query-format.js +1 -3
  325. package/queries/catalog/signature-query/signature-query-executor.js +3 -3
  326. package/queries/catalog/signature-query/signature-query-format.js +2 -2
  327. package/queries/catalog/slice-query-options.d.ts +16 -0
  328. package/queries/catalog/slice-query-options.js +28 -0
  329. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
  330. package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -42
  331. package/queries/query-print.d.ts +4 -0
  332. package/queries/query-print.js +17 -1
  333. package/queries/query.d.ts +3 -3
  334. package/queries/query.js +3 -4
  335. package/r-bridge/lang-4.x/ast/model/model.d.ts +27 -3
  336. package/r-bridge/lang-4.x/ast/model/model.js +28 -1
  337. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  338. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  339. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +2 -0
  340. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
  341. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +20 -1
  342. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +25 -1
  343. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +2 -0
  344. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
  345. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -0
  346. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
  347. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
  349. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -0
  350. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +2 -0
  352. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
  353. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +18 -2
  354. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +15 -6
  355. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +2 -0
  356. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
  357. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +2 -0
  358. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
  359. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -0
  360. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
  361. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -0
  362. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
  363. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -0
  364. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
  365. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +2 -0
  366. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +1 -0
  367. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -0
  368. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
  369. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -0
  370. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
  371. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +2 -0
  372. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
  373. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +17 -0
  374. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +20 -0
  375. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -0
  376. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
  377. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +2 -0
  378. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
  379. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -0
  380. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
  381. package/r-bridge/lang-4.x/ast/model/operators.js +0 -2
  382. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -6
  383. package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -6
  384. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -3
  385. package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
  386. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +1 -5
  387. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -2
  388. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +4 -20
  389. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -5
  390. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +1 -5
  391. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -5
  392. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -9
  393. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -5
  394. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -10
  395. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -11
  396. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +3 -11
  397. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -5
  398. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -5
  399. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -5
  400. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +6 -1
  401. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +7 -0
  402. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +0 -10
  403. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +30 -82
  404. package/r-bridge/retriever.d.ts +0 -4
  405. package/r-bridge/retriever.js +0 -13
  406. package/r-bridge/roxygen2/documentation-provider.js +3 -7
  407. package/r-bridge/shell.js +3 -8
  408. package/reconstruct/auto-select/magic-comments.js +8 -7
  409. package/reconstruct/inline/source-inline-map.d.ts +3 -0
  410. package/reconstruct/inline/source-inline-map.js +8 -7
  411. package/reconstruct/reconstruct.d.ts +1 -1
  412. package/reconstruct/reconstruct.js +33 -109
  413. package/search/flowr-search-printer.js +4 -15
  414. package/search/search-executor/search-generators.js +1 -1
  415. package/slicing/criterion/filters/all-variables.js +1 -2
  416. package/slicing/static/fingerprint.js +11 -2
  417. package/slicing/static/slice-call.d.ts +2 -8
  418. package/slicing/static/slice-call.js +8 -18
  419. package/slicing/static/static-slicer.js +81 -6
  420. package/util/collections/arrays.js +1 -1
  421. package/util/collections/set.js +1 -1
  422. package/util/diff-graph.d.ts +4 -0
  423. package/util/diff-graph.js +12 -0
  424. package/util/files.js +2 -6
  425. package/util/json.js +1 -15
  426. package/util/mermaid/cfg.js +10 -17
  427. package/util/mermaid/dfg.js +6 -8
  428. package/util/objects.d.ts +1 -1
  429. package/util/quads.js +4 -13
  430. package/util/r-author.js +5 -5
  431. package/util/range.d.ts +9 -0
  432. package/util/range.js +11 -0
  433. package/util/schema.js +3 -3
  434. package/util/simple-df/dfg-view.js +2 -1
  435. package/util/text/ansi.js +1 -2
  436. package/util/text/playground-link.js +2 -1
  437. package/util/text/r-highlight.js +2 -1
  438. package/util/text/strings.d.ts +2 -0
  439. package/util/text/strings.js +5 -0
  440. package/util/text/time.js +1 -2
  441. package/util/version.js +4 -3
  442. package/dataflow/fn/recursive-function.d.ts +0 -6
  443. package/dataflow/fn/recursive-function.js +0 -32
  444. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +0 -16
  445. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +0 -27
@@ -9,7 +9,6 @@ const control_flow_1 = require("../../../../control-flow");
9
9
  const info_1 = require("../../../../../info");
10
10
  const linker_1 = require("../../../../linker");
11
11
  const known_call_handling_1 = require("../known-call-handling");
12
- const unpack_argument_1 = require("../argument/unpack-argument");
13
12
  const assert_1 = require("../../../../../../util/assert");
14
13
  const logger_1 = require("../../../../../logger");
15
14
  const built_in_list_1 = require("./built-in-list");
@@ -21,11 +20,10 @@ const model_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/model");
21
20
  const program_order_1 = require("../../../../program-order");
22
21
  const graph_1 = require("../../../../../graph/graph");
23
22
  const identifier_1 = require("../../../../../environments/identifier");
24
- const overwrite_1 = require("../../../../../environments/overwrite");
25
23
  const vertex_1 = require("../../../../../graph/vertex");
26
24
  const class_declaration_1 = require("../../../../../fn/class-declaration");
27
25
  const built_in_new_env_1 = require("./built-in-new-env");
28
- const scoping_1 = require("../../../../../environments/scoping");
26
+ const environment_1 = require("../../../../../environments/environment");
29
27
  const edge_1 = require("../../../../../graph/edge");
30
28
  const built_in_library_1 = require("./built-in-library");
31
29
  const r_number_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-number");
@@ -43,7 +41,7 @@ const arrays_1 = require("../../../../../../util/collections/arrays");
43
41
  const group_generics_1 = require("../../../../../environments/group-generics");
44
42
  const arg_matching_1 = require("../../../../../../util/arg-matching");
45
43
  const defaultmap_1 = require("../../../../../../util/collections/defaultmap");
46
- const frame_reflection_1 = require("../../../../../fn/frame-reflection");
44
+ const df_helper_1 = require("../../../../../graph/df-helper");
47
45
  /**
48
46
  * Process a function definition, i.e., `function(a, b) { ... }`
49
47
  */
@@ -54,7 +52,7 @@ function processFunctionDefinition(name, args, rootId, data) {
54
52
  }
55
53
  /* we remove the last argument, as it is the body */
56
54
  const parameters = args.slice(0, -1);
57
- const bodyArg = (0, unpack_argument_1.unpackNonameArg)(args.at(-1));
55
+ const bodyArg = r_argument_1.RArgument.unnamedValueOf(args.at(-1));
58
56
  (0, assert_1.guard)(bodyArg !== undefined, () => `Function Definition ${JSON.stringify(args)} has no body! This is bad!`);
59
57
  const originalEnvironment = data.environment;
60
58
  const idMap = data.completeAst.idMap;
@@ -76,12 +74,12 @@ function processFunctionDefinition(name, args, rootId, data) {
76
74
  const read = processed.in.concat(processed.unknownReferences);
77
75
  allParameterReads.push(...read);
78
76
  (0, linker_1.linkInputs)(read, data.environment, readInParameters, subgraph, false);
79
- data.environment = (0, overwrite_1.overwriteEnvironment)(data.environment, processed.environment);
77
+ data.environment = environment_1.REnvironment.overwrite(data.environment, processed.environment);
80
78
  }
81
79
  const paramsEnvironments = data.environment;
82
80
  const body = (0, processor_1.processDataflowFor)(bodyArg, data);
83
81
  for (const [, v] of body.graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
84
- const envir = v.origin.includes(built_in_proc_name_1.BuiltInProcName.Rm) ? v.args.find(a => graph_1.FunctionArgument.hasName(a, 'envir')) : undefined;
82
+ const envir = vertex_1.DfgVertex.hasOrigin(v, built_in_proc_name_1.BuiltInProcName.Rm) ? v.args.find(a => graph_1.FunctionArgument.hasName(a, 'envir')) : undefined;
85
83
  const offset = envir && parseSysFrameOffset(idMap.get(envir.valueId ?? envir.nodeId));
86
84
  if (offset === undefined || offset > 0) {
87
85
  continue;
@@ -89,7 +87,7 @@ function processFunctionDefinition(name, args, rootId, data) {
89
87
  const targetLevel = offset === 0 ? 0 : originalEnvironment.level + 1 + offset;
90
88
  let targetEnv = originalEnvironment;
91
89
  while (targetEnv.level > targetLevel && targetEnv.level > 0) {
92
- targetEnv = (0, scoping_1.popLocalEnvironment)(targetEnv);
90
+ targetEnv = environment_1.REnvironment.popLocal(targetEnv);
93
91
  }
94
92
  if (targetEnv.level !== targetLevel) {
95
93
  continue;
@@ -124,7 +122,7 @@ function processFunctionDefinition(name, args, rootId, data) {
124
122
  if (parameter?.defaultValue === undefined) {
125
123
  continue;
126
124
  }
127
- const forcedAt = (0, frame_reflection_1.edgeSources)(subgraph, parameter.name.info.id, edge_1.EdgeType.Reads);
125
+ const forcedAt = df_helper_1.Dataflow.sourcesOf(subgraph, parameter.name.info.id, edge_1.EdgeType.Reads);
128
126
  model_1.RNode.visitAst(parameter.defaultValue, inner => {
129
127
  if (r_symbol_1.RSymbol.is(inner) && vertex_1.DfgVertex.isUse(subgraph.getVertex(inner.info.id))
130
128
  && linkParameterReadToBodyWrites(subgraph, { nodeId: inner.info.id, name: inner.content, cds: undefined, type: identifier_1.ReferenceType.Variable }, writesByName)) {
@@ -136,7 +134,7 @@ function processFunctionDefinition(name, args, rootId, data) {
136
134
  });
137
135
  }
138
136
  // parameter names are unique, so overwriting their environments here is correct even with non-`=` arguments
139
- let outEnvironment = (0, overwrite_1.overwriteEnvironment)(paramsEnvironments, body.environment);
137
+ let outEnvironment = environment_1.REnvironment.overwrite(paramsEnvironments, body.environment);
140
138
  for (const read of remainingRead) {
141
139
  if (read.name) {
142
140
  subgraph.addVertex({
@@ -169,9 +167,9 @@ function processFunctionDefinition(name, args, rootId, data) {
169
167
  }
170
168
  let hookEnvironment = vert.subflow.environment;
171
169
  while (hookEnvironment.level > outEnvironment.level) {
172
- hookEnvironment = (0, scoping_1.popLocalEnvironment)(hookEnvironment);
170
+ hookEnvironment = environment_1.REnvironment.popLocal(hookEnvironment);
173
171
  }
174
- outEnvironment = (0, overwrite_1.overwriteEnvironment)(outEnvironment, hookEnvironment);
172
+ outEnvironment = environment_1.REnvironment.overwrite(outEnvironment, hookEnvironment);
175
173
  /* the jumps and errors of an exit hook overrule the exit points of the body */
176
174
  subgraph.addEdge(rootId, hook.id, edge_1.EdgeType.Calls);
177
175
  const hookExitPoints = vert.exitPoints.filter(e => e.type === 1 /* ExitPointType.Return */ || e.type === 4 /* ExitPointType.Error */);
@@ -207,7 +205,7 @@ function processFunctionDefinition(name, args, rootId, data) {
207
205
  updateNestedFunctionClosures(subgraph, outEnvironment, remainingRead);
208
206
  const readParams = {};
209
207
  for (const paramId of paramIds) {
210
- readParams[paramId] = (0, frame_reflection_1.edgeSources)(subgraph, paramId, edge_1.EdgeType.Reads).length > 0;
208
+ readParams[paramId] = df_helper_1.Dataflow.sourcesOf(subgraph, paramId, edge_1.EdgeType.Reads).length > 0;
211
209
  }
212
210
  const returnEnvState = data.ctx.config.solver.trackEnvironments
213
211
  ? afterHookExitPoints.values().map(({ nodeId }) => envStateReturnedAt(nodeId, subgraph, outEnvironment, data)).find(assert_1.isNotUndefined)
@@ -216,7 +214,7 @@ function processFunctionDefinition(name, args, rootId, data) {
216
214
  graph.addVertex({
217
215
  tag: vertex_1.VertexType.FunctionDefinition,
218
216
  id: name.info.id,
219
- environment: (0, scoping_1.popLocalEnvironment)(outEnvironment),
217
+ environment: environment_1.REnvironment.popLocal(outEnvironment),
220
218
  cds: data.cds,
221
219
  params: readParams,
222
220
  subflow: flow,
@@ -261,12 +259,12 @@ function envStateReturnedAt(nodeId, graph, outEnvironment, data) {
261
259
  function retrieveActiveEnvironment(callerEnvironment, baseEnvironment, ctx) {
262
260
  callerEnvironment ??= ctx.env.makeCleanEnv();
263
261
  while (baseEnvironment.level < callerEnvironment.level) {
264
- baseEnvironment = (0, scoping_1.pushLocalEnvironment)(baseEnvironment);
262
+ baseEnvironment = environment_1.REnvironment.pushLocal(baseEnvironment);
265
263
  }
266
264
  while (baseEnvironment.level > callerEnvironment.level) {
267
- callerEnvironment = (0, scoping_1.pushLocalEnvironment)(callerEnvironment);
265
+ callerEnvironment = environment_1.REnvironment.pushLocal(callerEnvironment);
268
266
  }
269
- return (0, overwrite_1.overwriteEnvironment)(baseEnvironment, callerEnvironment);
267
+ return environment_1.REnvironment.overwrite(baseEnvironment, callerEnvironment);
270
268
  }
271
269
  /**
272
270
  * Whether the dispatch takes its object from the first formal, which is what R does unless the call names
@@ -280,7 +278,7 @@ function dispatchesOnFirstParameter(id, idMap) {
280
278
  function updateDispatches(graph, myArgs, idMap) {
281
279
  for (const [, info] of graph.vertices(false)) {
282
280
  const isDispatch = vertex_1.DfgVertex.isFunctionCall(info)
283
- && (info.origin.includes(built_in_proc_name_1.BuiltInProcName.S3Dispatch) || info.origin.includes(built_in_proc_name_1.BuiltInProcName.S7Dispatch));
281
+ && (vertex_1.DfgVertex.hasOrigin(info, built_in_proc_name_1.BuiltInProcName.S3Dispatch) || vertex_1.DfgVertex.hasOrigin(info, built_in_proc_name_1.BuiltInProcName.S7Dispatch));
284
282
  if (!isDispatch || info.args.length > 0) {
285
283
  continue;
286
284
  }
@@ -353,7 +351,7 @@ function* superAssignedTargets(graph, nodes) {
353
351
  if (!vertex_1.DfgVertex.hasOrigin(graph.getVertex(nodeId), built_in_proc_name_1.BuiltInProcName.SuperAssignment)) {
354
352
  continue;
355
353
  }
356
- for (const target of (0, frame_reflection_1.edgeTargets)(graph, nodeId, edge_1.EdgeType.Returns)) {
354
+ for (const target of df_helper_1.Dataflow.targetsOf(graph, nodeId, edge_1.EdgeType.Returns)) {
357
355
  const node = graph.idMap?.get(target);
358
356
  if (vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(target)) && r_symbol_1.RSymbol.is(node)) {
359
357
  yield [target, node.content];
@@ -368,7 +366,7 @@ function* superAssignedTargets(graph, nodes) {
368
366
  function namesShadowingBuiltIns(environment) {
369
367
  const shadowing = new Set();
370
368
  const generics = new Set();
371
- for (let env = environment.current; env !== undefined && !env.builtInEnv; env = env.parent) {
369
+ for (const env of environment_1.REnvironment.frames(environment.current)) {
372
370
  for (const [identifier, definitions] of env.memory) {
373
371
  if (definitions.every(d => node_id_1.NodeId.isBuiltIn(d.nodeId))) {
374
372
  continue;
@@ -407,9 +405,9 @@ function linkOwnS3Methods(call, name, graph, environment, statement, ctx) {
407
405
  /* the dispatch looks the method up by name, just like a call written out would */
408
406
  graph.addEdge(call.id, def.nodeId, edge_1.EdgeType.Reads);
409
407
  }
410
- return linkedDefinitions(dispatched, graph);
408
+ return linkedFunctionIds(dispatched, graph);
411
409
  }
412
- function linkedDefinitions(defs, graph) {
410
+ function linkedFunctionIds(defs, graph) {
413
411
  return (0, linker_1.getAllLinkedFunctionDefinitions)(new Set(defs.map(d => d.nodeId)), graph)[0].values().map(d => d.id).toArray();
414
412
  }
415
413
  /**
@@ -445,9 +443,9 @@ function dispatchedS3Methods(call, name, methods, graph, environment, statement,
445
443
  }
446
444
  }
447
445
  }
448
- const callsNext = linkedDefinitions([...picked], graph).some(d => {
446
+ const callsNext = linkedFunctionIds([...picked], graph).some(d => {
449
447
  const v = graph.getVertex(d);
450
- return vertex_1.DfgVertex.isFunctionDefinition(v) && (0, frame_reflection_1.callsIn)(v, graph).some(([, c]) => c.origin.includes(built_in_proc_name_1.BuiltInProcName.S3DispatchNext));
448
+ return vertex_1.DfgVertex.isFunctionDefinition(v) && df_helper_1.Dataflow.callsIn(v, graph).some(([, c]) => vertex_1.DfgVertex.hasOrigin(c, built_in_proc_name_1.BuiltInProcName.S3DispatchNext));
451
449
  });
452
450
  return callsNext ? undefined : [...picked];
453
451
  }
@@ -465,7 +463,7 @@ function updateNestedFunctionCalls(graph, outEnvironment, ctx) {
465
463
  const runsOnceAt = (0, defaultmap_1.memoize)((id) => program_order_1.ProgramOrder.runsOnceAt(id, graph));
466
464
  const environmentAt = (0, defaultmap_1.memoize)((id) => {
467
465
  const environment = graph.getVertex(id).environment;
468
- return environment ? (0, overwrite_1.overwriteEnvironment)(outEnvironment, environment) : outEnvironment;
466
+ return environment ? environment_1.REnvironment.overwrite(outEnvironment, environment) : outEnvironment;
469
467
  });
470
468
  for (let i = 0; i < calls.length; i++) {
471
469
  const [id, vertex] = calls[i];
@@ -481,7 +479,7 @@ function updateNestedFunctionCalls(graph, outEnvironment, ctx) {
481
479
  const effectiveEnvironment = environmentAt(id);
482
480
  /* a call the program runs once, at the top and outside any loop, cannot see what is defined after it */
483
481
  const definedLater = (definition) => program_order_1.ProgramOrder.definedLater(definition, runsOnceAt(id), graph);
484
- const targets = new Set((0, linker_1.getAllFunctionCallTargets)(id, graph, effectiveEnvironment));
482
+ const targets = new Set(df_helper_1.Dataflow.callTargetsOf(id, graph, effectiveEnvironment));
485
483
  /* a call of a parameter sees what it is bound to only once the calls handing it down are linked */
486
484
  if (!deferred.has(id) && targets.size > 0 && targets.values().every(t => !node_id_1.NodeId.isBuiltIn(t) && vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(t)))) {
487
485
  deferred.add(id);
@@ -492,7 +490,7 @@ function updateNestedFunctionCalls(graph, outEnvironment, ctx) {
492
490
  let treatAsS3 = origin.includes(built_in_proc_name_1.BuiltInProcName.S3Dispatch);
493
491
  if (treatAsS3 && !graph.isRoot(id)) {
494
492
  /* a body dispatches where it is called, which may see a method the end of the script has replaced */
495
- rootDefinitions ??= (0, frame_reflection_1.definitionsByName)(graph);
493
+ rootDefinitions ??= df_helper_1.Dataflow.definitionsByName(graph);
496
494
  const prefix = identifier_1.Identifier.getName(name) + '.';
497
495
  for (const [defined, ids] of rootDefinitions.entries()) {
498
496
  if (defined.startsWith(prefix)) {
@@ -537,8 +535,8 @@ function updateNestedFunctionCalls(graph, outEnvironment, ctx) {
537
535
  targetVertex.mode.push('s3');
538
536
  }
539
537
  // collect all next method calls to link them to the same targets!
540
- for (const [next, v] of (0, frame_reflection_1.callsIn)(targetVertex, graph)) {
541
- if (v.origin.includes(built_in_proc_name_1.BuiltInProcName.S3DispatchNext)) {
538
+ for (const [next, v] of df_helper_1.Dataflow.callsIn(targetVertex, graph)) {
539
+ if (vertex_1.DfgVertex.hasOrigin(v, built_in_proc_name_1.BuiltInProcName.S3DispatchNext)) {
542
540
  collectedNextMethods.add(next);
543
541
  }
544
542
  }
@@ -551,7 +549,7 @@ function updateNestedFunctionCalls(graph, outEnvironment, ctx) {
551
549
  }
552
550
  /* only writes from within functions (`<<-`) are left, and the call may run before them, seeing what they replace */
553
551
  if (resolved.every(d => !graph.isRoot(d.nodeId)) && ingoing.name !== undefined) {
554
- rootDefinitions ??= (0, frame_reflection_1.definitionsByName)(graph);
552
+ rootDefinitions ??= df_helper_1.Dataflow.definitionsByName(graph);
555
553
  for (const def of rootDefinitions.get(identifier_1.Identifier.getName(ingoing.name)).filter(d => graph.isRoot(d))) {
556
554
  graph.addEdge(ingoing.nodeId, def, edge_1.EdgeType.Reads);
557
555
  }
@@ -585,7 +583,7 @@ function updateNestedFunctionCalls(graph, outEnvironment, ctx) {
585
583
  }
586
584
  }
587
585
  linkLiftedReads(graph, lifted, enclosingOf, environmentAt, runsOnceAt);
588
- const called = new Set(graph.verticesOfType(vertex_1.VertexType.FunctionCall).flatMap(([id]) => (0, frame_reflection_1.edgeTargets)(graph, id, edge_1.EdgeType.Calls)));
586
+ const called = new Set(graph.verticesOfType(vertex_1.VertexType.FunctionCall).flatMap(([id]) => df_helper_1.Dataflow.targetsOf(graph, id, edge_1.EdgeType.Calls)));
589
587
  for (const [id, vertex] of graph.verticesOfType(vertex_1.VertexType.FunctionDefinition)) {
590
588
  if (called.has(id)) {
591
589
  continue;
@@ -610,7 +608,7 @@ function linkLiftedReads(graph, lifted, enclosingOf, environmentAt, runsOnceAt)
610
608
  continue;
611
609
  }
612
610
  known.add(read.nodeId);
613
- for (const call of (0, frame_reflection_1.edgeSources)(graph, definition, edge_1.EdgeType.Calls)) {
611
+ for (const call of df_helper_1.Dataflow.sourcesOf(graph, definition, edge_1.EdgeType.Calls)) {
614
612
  if (!vertex_1.DfgVertex.isFunctionCall(graph.getVertex(call))) {
615
613
  continue;
616
614
  }
@@ -634,7 +632,7 @@ function linkLiftedReads(graph, lifted, enclosingOf, environmentAt, runsOnceAt)
634
632
  }
635
633
  }
636
634
  function parseSysFrameOffset(node) {
637
- if (!r_function_call_1.RFunctionCall.isNamed(node) || identifier_1.Identifier.getName(node.functionName.content) !== 'sys.frame' || node.arguments.length !== 1) {
635
+ if (!r_function_call_1.RFunctionCall.isNamed(node, 'sys.frame') || node.arguments.length !== 1) {
638
636
  return undefined;
639
637
  }
640
638
  return r_number_1.RNumber.literalValueOf(r_argument_1.RArgument.valueOf(node.arguments[0]));
@@ -662,9 +660,9 @@ function prepareFunctionEnvironment(data, rootId) {
662
660
  for (let frame = data.environment.current; enclosing.length < level; frame = frame.parent) {
663
661
  enclosing.push(frame);
664
662
  }
665
- let env = (0, scoping_1.cleanEnvOf)(data.environment);
663
+ let env = environment_1.REnvironment.cleanOf(data.environment);
666
664
  for (let i = 0; i < level + 1; i++) {
667
- env = (0, scoping_1.pushLocalEnvironment)(env);
665
+ env = environment_1.REnvironment.pushLocal(env);
668
666
  if (i === level) {
669
667
  env.current.setClosureNodeId(rootId);
670
668
  }
@@ -2,11 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.processGet = processGet;
4
4
  const known_call_handling_1 = require("../known-call-handling");
5
- const unpack_argument_1 = require("../argument/unpack-argument");
6
5
  const make_argument_1 = require("../argument/make-argument");
7
6
  const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
8
7
  const logger_1 = require("../../../../../logger");
9
- const retriever_1 = require("../../../../../../r-bridge/retriever");
10
8
  const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
11
9
  const edge_1 = require("../../../../../graph/edge");
12
10
  const unknown_side_effect_1 = require("../../../../../graph/unknown-side-effect");
@@ -24,7 +22,7 @@ function namesDenotedBy(node, data) {
24
22
  if (folded !== undefined) {
25
23
  return [folded];
26
24
  }
27
- if (r_function_call_1.RFunctionCall.isNamed(node) && identifier_1.Identifier.getName(node.functionName.content) === 'c'
25
+ if (r_function_call_1.RFunctionCall.isNamed(node, 'c')
28
26
  && resolve_helper_1.Resolve.isBuiltIn(node.functionName.content, data.environment, identifier_1.ReferenceType.Function)) {
29
27
  const parts = node.arguments.map(arg => {
30
28
  const value = r_argument_1.RArgument.valueOf(arg);
@@ -37,7 +35,7 @@ function namesDenotedBy(node, data) {
37
35
  /** One symbol per constant name the first argument of `get` denotes, so the lookup is processed like a plain read of them. */
38
36
  function synthesizeTargets(retrieve, name, rootId, data) {
39
37
  const literal = r_string_1.RString.is(retrieve);
40
- const names = literal ? [(0, retriever_1.removeRQuotes)(retrieve.lexeme)] : namesDenotedBy(retrieve, data);
38
+ const names = literal ? [r_string_1.RString.unquote(retrieve.lexeme)] : namesDenotedBy(retrieve, data);
41
39
  const location = literal ? retrieve.location : retrieve.location ?? name.location ?? range_1.SourceRange.invalid();
42
40
  const literalLexeme = literal ? retrieve.lexeme : undefined;
43
41
  return names.map((resolvedName, i) => {
@@ -63,7 +61,7 @@ function synthesizeTargets(retrieve, name, rootId, data) {
63
61
  */
64
62
  function processGet(name, args, rootId, data, config = {}) {
65
63
  const resolution = (0, built_in_envir_utils_1.resolveFirstEnvirArg)(args, data, config.sig, ['envir', ...built_in_envir_utils_1.EnvirPositionFormals]);
66
- const retrieve = (0, unpack_argument_1.unpackNonameArg)(args[0]);
64
+ const retrieve = r_argument_1.RArgument.unnamedValueOf(args[0]);
67
65
  const targets = retrieve === undefined ? [] : synthesizeTargets(retrieve, name, rootId, data);
68
66
  if (targets.length === 0) {
69
67
  logger_1.dataflowLogger.warn(`symbol access with ${identifier_1.Identifier.toString(name.content)} has no resolvable name argument, skipping`);
@@ -6,12 +6,10 @@ const function_semantics_1 = require("../../../../../fn/function-semantics");
6
6
  const resolve_1 = require("../../../../../eval/resolve/resolve");
7
7
  const known_call_handling_1 = require("../known-call-handling");
8
8
  const common_1 = require("../common");
9
- const unpack_argument_1 = require("../argument/unpack-argument");
10
9
  const logger_1 = require("../../../../../logger");
11
10
  const edge_1 = require("../../../../../graph/edge");
12
11
  const control_flow_1 = require("../../../../control-flow");
13
12
  const built_in_ambient_state_1 = require("./built-in-ambient-state");
14
- const append_1 = require("../../../../../environments/append");
15
13
  const identifier_1 = require("../../../../../environments/identifier");
16
14
  const node_value_1 = require("../../../../../eval/resolve/node-value");
17
15
  const reference_to_maybe_1 = require("../../../../../environments/reference-to-maybe");
@@ -20,9 +18,10 @@ const model_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/model");
20
18
  const r_function_definition_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
21
19
  const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
22
20
  const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
23
- function getArguments(config, args) {
21
+ const environment_1 = require("../../../../../environments/environment");
22
+ function conditionalArgsOf(config, args) {
24
23
  if (!config?.args) {
25
- return args.map(e => (0, unpack_argument_1.unpackArg)(e));
24
+ return args.map(e => r_argument_1.RArgument.valueOf(e));
26
25
  }
27
26
  const params = {
28
27
  [config.args.cond]: 'cond',
@@ -31,7 +30,7 @@ function getArguments(config, args) {
31
30
  '...': '...'
32
31
  };
33
32
  const argMaps = function_semantics_1.FunctionSemantics.call.match.toSpec((0, common_1.convertFnArguments)(args), params);
34
- return ['cond', 'yes', 'no'].map(k => (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get(k)?.[0])));
33
+ return ['cond', 'yes', 'no'].map(k => r_argument_1.RArgument.valueOf(r_argument_1.RArgument.getWithId(args, argMaps.get(k)?.[0])));
35
34
  }
36
35
  /** Whether `id` may run again in the same frame, as part of a loop not left through a function definition. */
37
36
  function withinLoop(id, idMap) {
@@ -48,7 +47,7 @@ function processIfThenElse(name, args, rootId, data, config) {
48
47
  logger_1.dataflowLogger.warn(`If-then-else ${identifier_1.Identifier.toString(name.content)} has something different from 2 or 3 arguments, skipping`);
49
48
  return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
50
49
  }
51
- const [condArg, thenArg, otherwiseArg] = getArguments(config, args);
50
+ const [condArg, thenArg, otherwiseArg] = conditionalArgsOf(config, args);
52
51
  if (condArg === undefined || thenArg === undefined) {
53
52
  logger_1.dataflowLogger.warn(`If-then-else ${identifier_1.Identifier.toString(name.content)} has empty condition or then case in ${JSON.stringify(args)}, skipping`);
54
53
  return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
@@ -96,7 +95,7 @@ function processIfThenElse(name, args, rootId, data, config) {
96
95
  finalEnvironment = thenEnvironment;
97
96
  }
98
97
  else {
99
- finalEnvironment = (0, append_1.appendEnvironment)(thenEnvironment, otherwiseEnvironment);
98
+ finalEnvironment = environment_1.REnvironment.append(thenEnvironment, otherwiseEnvironment);
100
99
  }
101
100
  const whenTrue = { id: rootId, when: true };
102
101
  const whenFalse = { id: rootId, when: false };
@@ -164,7 +164,7 @@ function stringLiterals(node) {
164
164
  if (r_string_1.RString.is(node)) {
165
165
  return [node.content.str];
166
166
  }
167
- return r_function_call_1.RFunctionCall.isNamed(node) && identifier_1.Identifier.getName(node.functionName.content) === 'c'
167
+ return r_function_call_1.RFunctionCall.isNamed(node, 'c')
168
168
  ? node.arguments.flatMap(a => a !== r_function_call_1.EmptyArgument && r_string_1.RString.is(a.value) ? [a.value.content.str] : [])
169
169
  : [];
170
170
  }
@@ -294,7 +294,10 @@ function loadNodesForNamespace(env, pack) {
294
294
  if (env.current.builtInEnv) {
295
295
  return nodes; // resolving straight in the built-in environment (`get(x, envir = baseenv())`): no search path above it
296
296
  }
297
- for (let e = environment_1.REnvironment.findGlobal(env.current).parent; e.t !== undefined && !e.builtInEnv; e = e.parent) {
297
+ for (const e of environment_1.REnvironment.searchPath(env.current)) {
298
+ if (e.t === undefined) {
299
+ break;
300
+ }
298
301
  if (e.n !== pack) {
299
302
  continue;
300
303
  }
@@ -340,7 +343,8 @@ function selectExports(callables, spec) {
340
343
  */
341
344
  function lazyExports(pack, exports, ctx, definedAt) {
342
345
  const byName = new Map(exports.map(exp => [identifier_1.Identifier.getName(identifier_1.Identifier.make(exp.as, pack)), exp]));
343
- return new frame_memory_1.LazyBindings(new Set(byName.keys()), name => [exportDefinition(pack, byName.get(name), ctx, definedAt)]);
346
+ const aliases = exports.filter(exp => exp.as !== exp.exported).map(exp => `${exp.as}=${exp.exported}`);
347
+ return new frame_memory_1.LazyBindings(new Set(byName.keys()), name => [exportDefinition(pack, byName.get(name), ctx, definedAt)], `${pack}|${String(definedAt)}|${aliases.join(',')}`);
344
348
  }
345
349
  /**
346
350
  * The identifier definition binding a package export (or its alias) to its built-in function-definition.
@@ -430,7 +434,7 @@ function startupAttachPosition(pack, env) {
430
434
  return undefined;
431
435
  }
432
436
  let pos = environment_1.DefaultAttachPosition;
433
- for (let e = environment_1.REnvironment.findGlobal(env).parent; !e.builtInEnv; e = e.parent) {
437
+ for (const e of environment_1.REnvironment.searchPath(env)) {
434
438
  if (e.t === environment_1.EnvType.Imports) {
435
439
  continue; // internal layer, not a search-path entry
436
440
  }
@@ -444,7 +448,10 @@ function startupAttachPosition(pack, env) {
444
448
  }
445
449
  /** Whether package `pack` is already attached below the global env in a way that makes this (re-)attach a no-op. */
446
450
  function isAttached(env, pack, namespaceOnly) {
447
- for (let e = environment_1.REnvironment.findGlobal(env).parent; e.t !== undefined && !e.builtInEnv; e = e.parent) {
451
+ for (const e of environment_1.REnvironment.searchPath(env)) {
452
+ if (e.t === undefined) {
453
+ break;
454
+ }
448
455
  if (e.n === pack && blocksAttach(e, namespaceOnly)) {
449
456
  return true;
450
457
  }
@@ -8,11 +8,10 @@ const r_symbol_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/
8
8
  const known_call_handling_1 = require("../known-call-handling");
9
9
  const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
10
10
  const identifier_1 = require("../../../../../environments/identifier");
11
- const define_1 = require("../../../../../environments/define");
12
- const scoping_1 = require("../../../../../environments/scoping");
13
11
  const resolve_helper_1 = require("../../../../../environments/resolve-helper");
14
12
  const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
15
13
  const r_function_definition_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
14
+ const environment_1 = require("../../../../../environments/environment");
16
15
  /**
17
16
  * Process a list call.
18
17
  *
@@ -39,7 +38,7 @@ function resolveListToEnvState(source, data, values = false) {
39
38
  if (!r_function_call_1.RFunctionCall.isNamed(source)) {
40
39
  return undefined;
41
40
  }
42
- let envState = (0, scoping_1.pushLocalEnvironment)(data.environment);
41
+ let envState = environment_1.REnvironment.pushLocal(data.environment);
43
42
  let found = false;
44
43
  let position = 0;
45
44
  for (const arg of source.arguments) {
@@ -60,7 +59,7 @@ function resolveListToEnvState(source, data, values = false) {
60
59
  };
61
60
  for (const name of [arg.name?.content, identifier_1.Identifier.make(String(position))]) {
62
61
  if (name !== undefined) {
63
- envState = (0, define_1.define)({ ...definition, name }, false, envState);
62
+ envState = environment_1.REnvironment.define({ ...definition, name }, false, envState);
64
63
  }
65
64
  }
66
65
  found = true;
@@ -2,18 +2,17 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.processLoadCall = processLoadCall;
4
4
  exports.sexpTypeToReferenceType = sexpTypeToReferenceType;
5
+ const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
5
6
  const function_semantics_1 = require("../../../../../fn/function-semantics");
6
7
  const known_call_handling_1 = require("../known-call-handling");
7
8
  const identifier_1 = require("../../../../../environments/identifier");
8
9
  const flowr_rda_file_1 = require("../../../../../../project/plugins/file-plugins/files/flowr-rda-file");
9
10
  const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
10
- const retriever_1 = require("../../../../../../r-bridge/retriever");
11
11
  const built_in_source_1 = require("./built-in-source");
12
12
  const vertex_1 = require("../../../../../graph/vertex");
13
13
  const logger_1 = require("../../../../../logger");
14
14
  const unknown_side_effect_1 = require("../../../../../graph/unknown-side-effect");
15
15
  const edge_1 = require("../../../../../graph/edge");
16
- const unpack_argument_1 = require("../argument/unpack-argument");
17
16
  const node_value_1 = require("../../../../../eval/resolve/node-value");
18
17
  const r_value_1 = require("../../../../../eval/values/r-value");
19
18
  const assert_1 = require("../../../../../../util/assert");
@@ -27,7 +26,7 @@ const r_string_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/
27
26
  * adds control dependencies between the variables and the loaded file.
28
27
  */
29
28
  function processLoadCall(name, args, rootId, data) {
30
- const { fileArg, envirArg } = getArguments(args, data);
29
+ const { fileArg, envirArg } = loadArgsOf(args, data);
31
30
  if (!fileArg) {
32
31
  const fn = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' });
33
32
  (0, unknown_side_effect_1.handleUnknownSideEffect)(fn.information.graph, fn.information.environment, rootId);
@@ -45,7 +44,7 @@ function processLoadCall(name, args, rootId, data) {
45
44
  }
46
45
  let sourceFile;
47
46
  if (r_string_1.RString.is(fileArg)) {
48
- sourceFile = [(0, retriever_1.removeRQuotes)(fileArg.lexeme)];
47
+ sourceFile = [r_string_1.RString.unquote(fileArg.lexeme)];
49
48
  }
50
49
  else {
51
50
  const resolved = node_value_1.NodeValue.setOf(fileArg.info.id, data, { environment: envirResolution?.envirData.environment ?? data.environment });
@@ -53,7 +52,7 @@ function processLoadCall(name, args, rootId, data) {
53
52
  }
54
53
  if (sourceFile) {
55
54
  for (const candidate of sourceFile) {
56
- const path = (0, retriever_1.removeRQuotes)(candidate);
55
+ const path = r_string_1.RString.unquote(candidate);
57
56
  let filepath = path ? (0, built_in_source_1.findSource)(data.ctx.config.solver.resolveSource, path, data) : path;
58
57
  if (Array.isArray(filepath)) {
59
58
  if (filepath.length > 1) {
@@ -221,15 +220,15 @@ function sexpTypeToReferenceType(type) {
221
220
  return identifier_1.ReferenceType.Unknown;
222
221
  }
223
222
  }
224
- function getArguments(args, data) {
223
+ function loadArgsOf(args, data) {
225
224
  // prefer R's real `base::load` signature from the database, falling back to the known formals when it is absent
226
225
  const loadParams = (0, built_in_envir_utils_1.signatureParamNames)(data, identifier_1.Identifier.make('load', "base" /* PkgName.Base */), ['file', 'envir', 'verbose']);
227
226
  const bound = function_semantics_1.FunctionSemantics.call.match.toNames(args, loadParams);
228
227
  const fileArgBound = bound.get('file');
229
228
  const envirArg = bound.get('envir');
230
229
  const verboseArgBound = bound.get('verbose');
231
- const fileArg = fileArgBound ? (0, unpack_argument_1.unpackArg)(fileArgBound) : undefined;
232
- const verboseArg = verboseArgBound ? (0, unpack_argument_1.unpackArg)(verboseArgBound) : undefined;
230
+ const fileArg = fileArgBound ? r_argument_1.RArgument.valueOf(fileArgBound) : undefined;
231
+ const verboseArg = verboseArgBound ? r_argument_1.RArgument.valueOf(verboseArgBound) : undefined;
233
232
  return { fileArg, envirArg, verboseArg };
234
233
  }
235
234
  //# sourceMappingURL=built-in-load.js.map
@@ -9,13 +9,12 @@ const edge_1 = require("../../../../../graph/edge");
9
9
  const known_call_handling_1 = require("../known-call-handling");
10
10
  const control_flow_1 = require("../../../../control-flow");
11
11
  const common_1 = require("../common");
12
- const unpack_argument_1 = require("../argument/unpack-argument");
13
- const scoping_1 = require("../../../../../environments/scoping");
14
12
  const identifier_1 = require("../../../../../environments/identifier");
15
13
  const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
16
14
  const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
17
15
  const built_in_envir_utils_1 = require("./built-in-envir-utils");
18
16
  const resolve_helper_1 = require("../../../../../environments/resolve-helper");
17
+ const environment_1 = require("../../../../../environments/environment");
19
18
  /** Processes a built-in 'local' function call. */
20
19
  function processLocal(name, args, rootId, data, config) {
21
20
  if (args.length === 0) {
@@ -27,8 +26,8 @@ function processLocal(name, args, rootId, data, config) {
27
26
  '...': '...'
28
27
  });
29
28
  const envArg = r_argument_1.RArgument.getWithId(args, argMaps.get('env')?.[0]);
30
- const env = (0, unpack_argument_1.unpackArg)(envArg);
31
- const expr = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('expr')?.[0]));
29
+ const env = r_argument_1.RArgument.valueOf(envArg);
30
+ const expr = r_argument_1.RArgument.valueOf(r_argument_1.RArgument.getWithId(args, argMaps.get('expr')?.[0]));
32
31
  if (!expr) {
33
32
  return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
34
33
  }
@@ -49,7 +48,7 @@ function processLocal(name, args, rootId, data, config) {
49
48
  }
50
49
  const baseEnvironment = envirResolution
51
50
  ? envirResolution.envirData.environment // evaluate in the tracked custom env
52
- : (0, scoping_1.pushLocalEnvironment)(data.environment); // normal new local scope
51
+ : environment_1.REnvironment.pushLocal(data.environment); // normal new local scope
53
52
  const dfExpr = (0, processor_1.processDataflowFor)(expr, { ...data, environment: baseEnvironment });
54
53
  (0, common_1.patchFunctionCall)({
55
54
  nextGraph: dfEnv.graph,
@@ -59,7 +58,7 @@ function processLocal(name, args, rootId, data, config) {
59
58
  argumentProcessResult: env ? [dfExpr, dfEnv] : [dfExpr],
60
59
  origin: built_in_proc_name_1.BuiltInProcName.Local
61
60
  });
62
- const resultEnvironment = envirResolution ? data.environment : (0, scoping_1.popLocalEnvironment)(dfExpr.environment);
61
+ const resultEnvironment = envirResolution ? data.environment : environment_1.REnvironment.popLocal(dfExpr.environment);
63
62
  /* definitions of the local scope vanish with it, only what escaped it (e.g. via `<<-`) may bubble up */
64
63
  const escaping = envirResolution ? dfExpr.out : dfExpr.out.filter(o => o.name !== undefined && resolve_helper_1.Resolve.byNameAndType(o.name, resultEnvironment, o.type)?.some(d => d.nodeId === o.nodeId));
65
64
  const graph = dfEnv.graph.mergeWith(dfExpr.graph);
@@ -6,13 +6,12 @@ const known_call_handling_1 = require("../known-call-handling");
6
6
  const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
7
7
  const r_symbol_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
8
8
  const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
9
- const scoping_1 = require("../../../../../environments/scoping");
10
9
  const environment_1 = require("../../../../../environments/environment");
11
- const unpack_argument_1 = require("../argument/unpack-argument");
12
10
  const vertex_1 = require("../../../../../graph/vertex");
13
11
  const convert_values_1 = require("../../../../../../r-bridge/lang-4.x/convert-values");
14
12
  const built_in_envir_utils_1 = require("./built-in-envir-utils");
15
13
  const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
14
+ const environment_2 = require("../../../../../environments/environment");
16
15
  const EmptyParentEnvFunctions = new Set(['emptyenv', 'baseenv']);
17
16
  /**
18
17
  * Processes `new.env()` and `rlang::new_environment()`.
@@ -50,7 +49,7 @@ function resolveNewEnvParentArg(args, data) {
50
49
  if (r_argument_1.RArgument.isEmpty(arg) || arg.name?.content !== 'parent') {
51
50
  continue;
52
51
  }
53
- const node = (0, unpack_argument_1.unpackArg)(arg);
52
+ const node = r_argument_1.RArgument.valueOf(arg);
54
53
  if (!node) {
55
54
  return undefined;
56
55
  }
@@ -93,6 +92,6 @@ function createFreshEnvState(data, sourceInfo) {
93
92
  };
94
93
  }
95
94
  }
96
- return (0, scoping_1.pushLocalEnvironment)(data.environment);
95
+ return environment_2.REnvironment.pushLocal(data.environment);
97
96
  }
98
97
  //# sourceMappingURL=built-in-new-env.js.map
@@ -5,7 +5,6 @@ const function_semantics_1 = require("../../../../../fn/function-semantics");
5
5
  const known_call_handling_1 = require("../known-call-handling");
6
6
  const nse_1 = require("../nse");
7
7
  const assert_1 = require("../../../../../../util/assert");
8
- const unpack_argument_1 = require("../argument/unpack-argument");
9
8
  const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
10
9
  const data_masking_functions_1 = require("../../../../../environments/data-masking-functions");
11
10
  const r_symbol_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
@@ -46,7 +45,7 @@ function processPipe(name, args, rootId, data, { pipePlaceholderName, assignLhs,
46
45
  logger_1.dataflowLogger.warn(`Pipe ${identifier_1.Identifier.toString(name.content)} has something else than 2 arguments, skipping`);
47
46
  return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Pipe }).information;
48
47
  }
49
- const [lhs, rhs] = args.map(e => (0, unpack_argument_1.unpackNonameArg)(e));
48
+ const [lhs, rhs] = args.map(e => r_argument_1.RArgument.unnamedValueOf(e));
50
49
  (0, assert_1.guard)(lhs !== undefined && rhs !== undefined, () => `lhs and rhs must be present, but ${JSON.stringify(lhs)} and ${JSON.stringify(rhs)} were found instead.`);
51
50
  const occurrenceIds = [];
52
51
  model_1.RNode.visitAst(rhs, (node) => {
@@ -126,7 +125,7 @@ function processPipe(name, args, rootId, data, { pipePlaceholderName, assignLhs,
126
125
  });
127
126
  information.graph.addEdge(functionCallNode.id, argId, edge_1.EdgeType.Argument | edge_1.EdgeType.Reads);
128
127
  }
129
- if (r_function_call_1.RFunctionCall.isNamed(rhs) && data_masking_functions_1.DataMaskingFunctionNames.has(identifier_1.Identifier.getName(rhs.functionName.content))) {
128
+ if (r_function_call_1.RFunctionCall.isNamed(rhs, data_masking_functions_1.DataMaskingFunctionNames)) {
130
129
  markPipedDataMask(rhs, information.graph);
131
130
  }
132
131
  }