@eagleoutice/flowr 2.14.3 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/README.md +76 -63
  2. package/abstract-interpretation/absint-inference.d.ts +347 -0
  3. package/abstract-interpretation/{absint-visitor.js → absint-inference.js} +327 -97
  4. package/abstract-interpretation/abstract-semantics.d.ts +246 -0
  5. package/abstract-interpretation/abstract-semantics.js +3 -0
  6. package/abstract-interpretation/data-frame/{mappers/arguments.d.ts → arguments.d.ts} +18 -16
  7. package/abstract-interpretation/data-frame/{mappers/arguments.js → arguments.js} +20 -21
  8. package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +52 -0
  9. package/abstract-interpretation/data-frame/dataframe-semantics.js +1656 -0
  10. package/abstract-interpretation/data-frame/resolve-args.js +4 -4
  11. package/abstract-interpretation/data-frame/semantics.d.ts +15 -21
  12. package/abstract-interpretation/data-frame/semantics.js +27 -29
  13. package/abstract-interpretation/data-frame/shape-inference.d.ts +28 -24
  14. package/abstract-interpretation/data-frame/shape-inference.js +14 -79
  15. package/abstract-interpretation/domains/interval-domain.d.ts +5 -1
  16. package/abstract-interpretation/domains/interval-domain.js +25 -33
  17. package/abstract-interpretation/domains/multi-value-state-domain.d.ts +6 -3
  18. package/abstract-interpretation/domains/multi-value-state-domain.js +24 -4
  19. package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -6
  20. package/abstract-interpretation/domains/partial-product-domain.js +26 -43
  21. package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -6
  22. package/abstract-interpretation/domains/positive-interval-domain.js +3 -29
  23. package/abstract-interpretation/domains/product-domain.d.ts +1 -1
  24. package/abstract-interpretation/domains/set-range-domain.d.ts +6 -0
  25. package/abstract-interpretation/domains/set-range-domain.js +29 -62
  26. package/abstract-interpretation/domains/state-abstract-domain.d.ts +9 -2
  27. package/abstract-interpretation/domains/state-abstract-domain.js +26 -37
  28. package/abstract-interpretation/domains/{state-domain-like.d.ts → state-domain.d.ts} +10 -6
  29. package/abstract-interpretation/domains/{state-domain-like.js → state-domain.js} +1 -1
  30. package/abstract-interpretation/value-semantics.d.ts +113 -0
  31. package/abstract-interpretation/value-semantics.js +115 -0
  32. package/benchmark/slicer.js +12 -6
  33. package/benchmark/stats/feature-counts.d.ts +2 -1
  34. package/benchmark/stats/feature-counts.js +25 -1
  35. package/benchmark/stats/stats.d.ts +4 -0
  36. package/benchmark/summarizer/second-phase/graph.js +7 -0
  37. package/cli/repl/commands/repl-parse.js +11 -22
  38. package/cli/repl/parser/slice-query-parser.d.ts +2 -0
  39. package/cli/repl/parser/slice-query-parser.js +1 -0
  40. package/config.d.ts +30 -205
  41. package/config.js +37 -3
  42. package/control-flow/cfg-properties.d.ts +5 -0
  43. package/control-flow/cfg-properties.js +25 -7
  44. package/control-flow/control-flow-graph.d.ts +11 -37
  45. package/control-flow/control-flow-graph.js +33 -77
  46. package/control-flow/semantic-cfg-guided-visitor.d.ts +63 -320
  47. package/control-flow/semantic-cfg-guided-visitor.js +65 -320
  48. package/dataflow/environments/built-in-config.d.ts +2 -0
  49. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  50. package/dataflow/environments/built-in-proc-name.js +4 -0
  51. package/dataflow/environments/built-in-props.d.ts +192 -82
  52. package/dataflow/environments/built-in-props.js +336 -106
  53. package/dataflow/environments/built-in.d.ts +21 -9
  54. package/dataflow/environments/built-in.js +43 -12
  55. package/dataflow/environments/default-builtin-config.d.ts +3219 -328
  56. package/dataflow/environments/default-builtin-config.js +804 -1031
  57. package/dataflow/environments/environment.d.ts +26 -49
  58. package/dataflow/environments/environment.js +34 -47
  59. package/dataflow/environments/group-generics.d.ts +36 -0
  60. package/dataflow/environments/group-generics.js +58 -0
  61. package/dataflow/environments/identifier.d.ts +106 -6
  62. package/dataflow/environments/identifier.js +19 -1
  63. package/dataflow/environments/query-fn-props.d.ts +16 -8
  64. package/dataflow/environments/query-fn-props.js +45 -21
  65. package/dataflow/environments/resolve-by-name.js +9 -2
  66. package/dataflow/environments/scoping.d.ts +5 -0
  67. package/dataflow/environments/scoping.js +11 -0
  68. package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
  69. package/dataflow/eval/resolve/alias-tracking.js +20 -2
  70. package/dataflow/eval/resolve/resolve-numbers.d.ts +182 -7
  71. package/dataflow/eval/resolve/resolve-numbers.js +44 -9
  72. package/dataflow/eval/resolve/resolve-strings.d.ts +79 -2
  73. package/dataflow/eval/resolve/resolve-strings.js +16 -7
  74. package/dataflow/eval/resolve/resolve.d.ts +5 -22
  75. package/dataflow/eval/resolve/resolve.js +24 -34
  76. package/dataflow/eval/values/general.d.ts +7 -1
  77. package/dataflow/eval/values/general.js +17 -3
  78. package/dataflow/eval/values/string/string-constants.d.ts +16 -15
  79. package/dataflow/eval/values/string/string-constants.js +59 -27
  80. package/dataflow/extractor.d.ts +2 -1
  81. package/dataflow/extractor.js +16 -4
  82. package/dataflow/fn/argument-roles.d.ts +35 -0
  83. package/dataflow/fn/argument-roles.js +252 -0
  84. package/dataflow/fn/class-declaration.d.ts +148 -0
  85. package/dataflow/fn/class-declaration.js +317 -0
  86. package/dataflow/fn/condition-handlers.d.ts +5 -0
  87. package/dataflow/fn/condition-handlers.js +13 -0
  88. package/dataflow/fn/exceptions-of-function.d.ts +21 -7
  89. package/dataflow/fn/exceptions-of-function.js +74 -43
  90. package/dataflow/fn/frame-reflection.d.ts +46 -0
  91. package/dataflow/fn/frame-reflection.js +169 -0
  92. package/dataflow/fn/function-props.d.ts +32 -0
  93. package/dataflow/fn/function-props.js +160 -0
  94. package/dataflow/fn/higher-order-function.d.ts +23 -5
  95. package/dataflow/fn/higher-order-function.js +64 -18
  96. package/dataflow/fn/strict-function.d.ts +24 -2
  97. package/dataflow/fn/strict-function.js +49 -19
  98. package/dataflow/graph/call-graph.js +10 -2
  99. package/dataflow/graph/df-helper.d.ts +1 -12
  100. package/dataflow/graph/df-helper.js +2 -19
  101. package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
  102. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  103. package/dataflow/graph/graph.d.ts +39 -188
  104. package/dataflow/graph/graph.js +46 -163
  105. package/dataflow/graph/match-args.d.ts +34 -2
  106. package/dataflow/graph/match-args.js +45 -12
  107. package/dataflow/graph/vertex.d.ts +8 -0
  108. package/dataflow/info.d.ts +7 -5
  109. package/dataflow/info.js +1 -5
  110. package/dataflow/internal/control-flow.js +20 -17
  111. package/dataflow/internal/linker.d.ts +8 -37
  112. package/dataflow/internal/linker.js +22 -55
  113. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -2
  114. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -8
  115. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -4
  116. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +8 -14
  117. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +43 -50
  118. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +4 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +5 -2
  120. package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +23 -0
  121. package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.js +24 -0
  122. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -2
  123. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
  124. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +0 -4
  125. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +73 -27
  126. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -11
  127. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +131 -92
  128. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +17 -12
  129. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +187 -99
  130. package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +4 -0
  131. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -0
  132. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +2 -3
  133. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +4 -3
  134. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
  135. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -2
  136. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +0 -1
  137. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -1
  138. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +31 -0
  139. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +101 -0
  140. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -1
  141. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -0
  142. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +23 -21
  143. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +1 -2
  144. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -2
  145. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +22 -1
  146. package/dataflow/internal/process/functions/call/common.d.ts +4 -6
  147. package/dataflow/internal/process/functions/call/common.js +2 -2
  148. package/dataflow/internal/process/functions/call/deferred.d.ts +1 -1
  149. package/dataflow/internal/process/functions/call/deferred.js +2 -2
  150. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +5 -3
  151. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -4
  152. package/dataflow/internal/process/functions/call/named-call-handling.js +19 -13
  153. package/dataflow/internal/process/functions/call/quoted.d.ts +2 -2
  154. package/dataflow/internal/process/functions/call/quoted.js +144 -28
  155. package/dataflow/origin/dfg-get-origin.js +23 -10
  156. package/dataflow/processor.d.ts +2 -1
  157. package/dataflow/processor.js +6 -0
  158. package/documentation/data/interface/doc-writing-code.js +2 -0
  159. package/documentation/doc-util/doc-search.js +1 -1
  160. package/documentation/wiki-absint.d.ts +11 -14
  161. package/documentation/wiki-absint.js +73 -59
  162. package/documentation/wiki-core.js +64 -24
  163. package/documentation/wiki-linter.js +1 -0
  164. package/documentation/wiki-query.js +82 -264
  165. package/documentation/wiki-signature-database.js +23 -6
  166. package/gas.d.ts +91 -47
  167. package/gas.js +97 -13
  168. package/index.d.ts +31 -0
  169. package/index.js +52 -0
  170. package/linter/linter-rules.d.ts +87 -23
  171. package/linter/linter-rules.js +3 -1
  172. package/linter/rules/absolute-path.d.ts +1 -1
  173. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  174. package/linter/rules/dataframe-access-validation.js +10 -8
  175. package/linter/rules/dead-code.d.ts +1 -1
  176. package/linter/rules/deprecated-functions.js +14 -5
  177. package/linter/rules/file-path-validity.d.ts +1 -1
  178. package/linter/rules/naming-convention.d.ts +1 -1
  179. package/linter/rules/naming-convention.js +13 -2
  180. package/linter/rules/network-functions.d.ts +10 -5
  181. package/linter/rules/network-functions.js +48 -36
  182. package/linter/rules/no-leaked-credentials.d.ts +1 -1
  183. package/linter/rules/problematic-inputs.d.ts +1 -1
  184. package/linter/rules/problematic-inputs.js +1 -1
  185. package/linter/rules/seeded-randomness.d.ts +3 -2
  186. package/linter/rules/seeded-randomness.js +7 -3
  187. package/linter/rules/software-has-license.d.ts +1 -1
  188. package/linter/rules/software-has-tests.d.ts +1 -1
  189. package/linter/rules/stop-with-call-arg.d.ts +1 -1
  190. package/linter/rules/syntactically-valid.d.ts +1 -1
  191. package/linter/rules/unclosed-connection.d.ts +3 -3
  192. package/linter/rules/unclosed-connection.js +3 -4
  193. package/linter/rules/undefined-symbol.d.ts +1 -1
  194. package/linter/rules/unescaped-arguments.d.ts +161 -0
  195. package/linter/rules/unescaped-arguments.js +293 -0
  196. package/linter/rules/unused-definition.d.ts +1 -1
  197. package/linter/rules/unused-definition.js +51 -6
  198. package/linter/rules/unused-import.d.ts +1 -1
  199. package/linter/rules/useless-loop.d.ts +1 -1
  200. package/package.json +3 -198
  201. package/project/context/flowr-analyzer-environment-context.d.ts +12 -1
  202. package/project/context/flowr-analyzer-environment-context.js +33 -1
  203. package/project/context/flowr-analyzer-files-context.d.ts +24 -1
  204. package/project/context/flowr-analyzer-files-context.js +42 -21
  205. package/project/context/flowr-analyzer-functions-context.d.ts +8 -0
  206. package/project/context/flowr-analyzer-functions-context.js +2 -0
  207. package/project/context/flowr-analyzer-gas-context.d.ts +9 -1
  208. package/project/context/flowr-analyzer-gas-context.js +21 -0
  209. package/project/context/flowr-file.d.ts +16 -1
  210. package/project/context/flowr-file.js +26 -2
  211. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +19 -20
  212. package/project/plugins/file-plugins/files/flowr-description-file.js +55 -41
  213. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +9 -4
  214. package/project/plugins/file-plugins/files/flowr-jupyter-file.js +11 -3
  215. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +6 -9
  216. package/project/plugins/file-plugins/files/flowr-manifest-files.js +5 -21
  217. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +11 -12
  218. package/project/plugins/file-plugins/files/flowr-namespace-file.js +48 -61
  219. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +3 -12
  220. package/project/plugins/file-plugins/files/flowr-news-file.js +2 -19
  221. package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +145 -0
  222. package/project/plugins/file-plugins/files/flowr-rd-file.js +676 -0
  223. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +122 -422
  224. package/project/plugins/file-plugins/files/flowr-rda-file.js +517 -1005
  225. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +8 -2
  226. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +10 -1
  227. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +7 -2
  228. package/project/plugins/file-plugins/files/flowr-sweave-file.js +9 -1
  229. package/project/plugins/file-plugins/files/flowr-sysdata-file.d.ts +17 -0
  230. package/project/plugins/file-plugins/files/flowr-sysdata-file.js +40 -0
  231. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -0
  232. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +3 -1
  233. package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.d.ts +58 -0
  234. package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.js +95 -0
  235. package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.d.ts +23 -0
  236. package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.js +33 -0
  237. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +33 -72
  238. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +17 -15
  239. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +20 -37
  240. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +29 -53
  241. package/project/plugins/package-version-plugins/package.js +2 -1
  242. package/project/plugins/plugin-registry.d.ts +3 -1
  243. package/project/plugins/plugin-registry.js +11 -0
  244. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +20 -4
  245. package/project/sigdb/build.d.ts +9 -15
  246. package/project/sigdb/build.js +63 -42
  247. package/project/sigdb/decode.d.ts +10 -4
  248. package/project/sigdb/decode.js +60 -21
  249. package/project/sigdb/memory-source.d.ts +4 -0
  250. package/project/sigdb/memory-source.js +8 -0
  251. package/project/sigdb/reader.d.ts +50 -100
  252. package/project/sigdb/reader.js +84 -105
  253. package/project/sigdb/schema.d.ts +102 -26
  254. package/project/sigdb/schema.js +14 -6
  255. package/project/sigdb/signature-db.d.ts +4 -0
  256. package/project/sigdb/signature-db.js +8 -1
  257. package/queries/base-query-format.d.ts +7 -0
  258. package/queries/base-query-format.js +29 -0
  259. package/queries/catalog/absint-query/absint-query-executor.js +8 -6
  260. package/queries/catalog/absint-query/absint-query-format.d.ts +20 -9
  261. package/queries/catalog/absint-query/absint-query-format.js +32 -19
  262. package/queries/catalog/call-context-query/call-context-query-executor.js +3 -3
  263. package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
  264. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
  265. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
  266. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
  267. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
  268. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
  269. package/queries/catalog/dependencies-query/dependencies-query-executor.js +33 -7
  270. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
  271. package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +2 -2
  272. package/queries/catalog/dependencies-query/function-info/derived-functions.js +14 -4
  273. package/queries/catalog/dependencies-query/function-info/read-functions.js +7 -121
  274. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +1 -1
  275. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +2 -2
  276. package/queries/catalog/dependencies-query/function-info/visualize-functions.js +4 -46
  277. package/queries/catalog/dependencies-query/function-info/write-functions.js +3 -76
  278. package/queries/catalog/dependencies-query/implicit-echo.js +2 -2
  279. package/queries/catalog/dependencies-query/link-devices.d.ts +2 -2
  280. package/queries/catalog/dependencies-query/link-devices.js +6 -7
  281. package/queries/catalog/dice-query/dice-query-executor.js +1 -1
  282. package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
  283. package/queries/catalog/does-call-query/does-call-query-executor.js +4 -0
  284. package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -1
  285. package/queries/catalog/files-query/files-query-format.d.ts +1 -1
  286. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
  287. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -1
  288. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
  289. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
  290. package/queries/catalog/input-sources-query/input-source-functions.d.ts +1 -1
  291. package/queries/catalog/input-sources-query/input-source-functions.js +2 -2
  292. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -17
  293. package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -27
  294. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
  295. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +3 -8
  296. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -11
  297. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +4 -0
  298. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +60 -0
  299. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +35 -0
  300. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +63 -0
  301. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -6
  302. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +3 -8
  303. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -11
  304. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +3 -8
  305. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -12
  306. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
  307. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
  308. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  309. package/queries/catalog/project-query/project-query-format.d.ts +1 -1
  310. package/queries/catalog/provenance-query/provenance-query-format.d.ts +3 -8
  311. package/queries/catalog/provenance-query/provenance-query-format.js +2 -14
  312. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  313. package/queries/catalog/search-query/search-query-format.d.ts +1 -1
  314. package/queries/catalog/signature-query/signature-query-executor.d.ts +9 -9
  315. package/queries/catalog/signature-query/signature-query-executor.js +104 -95
  316. package/queries/catalog/signature-query/signature-query-format.d.ts +34 -8
  317. package/queries/catalog/signature-query/signature-query-format.js +16 -4
  318. package/queries/catalog/signature-query/signature-query-render.js +24 -4
  319. package/queries/catalog/slice-query-options.d.ts +14 -0
  320. package/queries/catalog/slice-query-options.js +15 -0
  321. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -1
  322. package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -2
  323. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -3
  324. package/queries/catalog/static-slice-query/static-slice-query-format.js +7 -5
  325. package/queries/query-function-filter.d.ts +8 -3
  326. package/queries/query-function-filter.js +16 -6
  327. package/queries/query.d.ts +38 -38
  328. package/queries/query.js +30 -4
  329. package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -0
  330. package/r-bridge/lang-4.x/ast/model/model.js +14 -0
  331. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  332. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
  333. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  334. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  335. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  336. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  337. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  338. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
  339. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  340. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  341. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  342. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  343. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  344. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
  345. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
  346. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  347. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  349. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  350. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  352. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +17 -9
  353. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +35 -27
  354. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -22
  355. package/reconstruct/reconstruct.d.ts +9 -20
  356. package/reconstruct/reconstruct.js +66 -28
  357. package/search/flowr-search-filters.d.ts +7 -6
  358. package/search/flowr-search-filters.js +6 -4
  359. package/search/search-executor/search-enrichers.d.ts +10 -10
  360. package/search/search-executor/search-enrichers.js +32 -3
  361. package/search/search-executor/search-transformer.js +15 -23
  362. package/slicing/criterion/parse.js +2 -12
  363. package/slicing/static/slice-call.js +1 -8
  364. package/slicing/static/static-slicer.js +1 -1
  365. package/util/collections/bimap.js +14 -6
  366. package/util/objects.js +16 -17
  367. package/util/r-value.d.ts +5 -4
  368. package/util/record.d.ts +38 -3
  369. package/util/record.js +48 -1
  370. package/util/simple-df/dfg-ascii.js +1 -1
  371. package/util/text/name-rank.js +8 -2
  372. package/util/text/strings.d.ts +5 -0
  373. package/util/text/strings.js +10 -0
  374. package/util/version.js +2 -2
  375. package/abstract-interpretation/absint-visitor.d.ts +0 -223
  376. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -19
  377. package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -151
  378. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +0 -287
  379. package/abstract-interpretation/data-frame/mappers/function-mapper.js +0 -1096
  380. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -15
  381. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -207
  382. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +0 -6
  383. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +0 -25
  384. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +0 -31
  385. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +0 -56
@@ -34,11 +34,8 @@ export declare function pMatch<Targets extends NodeId>(args: readonly FunctionAr
34
34
  */
35
35
  export declare function linkFunctionCallWithSingleTarget(graph: DataflowGraph, { subflow: fnSubflow, exitPoints, id: fnId, params }: DataflowGraphVertexFunctionDefinition, info: DataflowGraphVertexFunctionCall, idMap: AstIdMap): ExitPoint[];
36
36
  /**
37
- * Returns the called functions within the current graph, which can be used to merge the environments with the call.
38
- * Furthermore, it links the corresponding arguments.
39
- * @param graph - The graph to use for search and resolution traversals (ideally a superset of the `thisGraph`)
40
- * @param idMap - The map to resolve ids to names
41
- * @param thisGraph - The graph to search for function calls in
37
+ * Returns the called functions within `graph` (ideally a superset of `thisGraph`, the graph searched for calls), which
38
+ * can be used to merge the environments with the call; also links the corresponding arguments.
42
39
  */
43
40
  export declare function linkFunctionCalls(graph: DataflowGraph, idMap: AstIdMap, thisGraph: DataflowGraph): {
44
41
  functionCall: NodeId;
@@ -50,19 +47,8 @@ export declare function linkFunctionCalls(graph: DataflowGraph, idMap: AstIdMap,
50
47
  */
51
48
  export declare function getAllFunctionCallTargets(call: NodeId, graph: DataflowGraph, environment?: REnvironmentInformation): NodeId[];
52
49
  /**
53
- * Finds all linked function definitions starting from the given set of read ids.
54
- * This is a complicated function, please only call it if you know what you are doing.
55
- * For example, if you are interested in the called functions of a function call, use {@link getAllFunctionCallTargets} instead.
56
- * This function here expects you to handle the accessed objects yourself (e.g,. already resolve the first layer of reads/returns/calls/... or resolve the identifier by name)
57
- * and then pass in the relevant read ids.
58
- * @example
59
- * Consider a scenario like this:
60
- * ```R
61
- * x <- function() 3
62
- * x()
63
- * ```
64
- * To resolve the call `x` in the second line, use {@link getAllFunctionCallTargets}!
65
- * To know what fdefs the definition of `x` in the first line links to, you can use {@link getAllLinkedFunctionDefinitions|this function}.
50
+ * Finds all linked function definitions starting from the given read ids; expects the caller to already have resolved
51
+ * the accessed objects (first layer of reads/returns/calls/...). For call targets, use {@link getAllFunctionCallTargets} instead.
66
52
  */
67
53
  export declare function getAllLinkedFunctionDefinitions(functionDefinitionReadIds: ReadonlySet<NodeId>, dataflowGraph: DataflowGraph): [Set<Required<DataflowGraphVertexFunctionDefinition>>, Set<BuiltIn>];
68
54
  /**
@@ -72,28 +58,13 @@ export declare function getAllLinkedFunctionDefinitions(functionDefinitionReadId
72
58
  */
73
59
  export declare function linkExpressionIn<Info>(this: void, graph: DataflowGraph, expr: NodeId, environment: REnvironmentInformation, idMap: AstIdMap<Info & ParentInformation>): readonly IdentifierReference[];
74
60
  /**
75
- * This method links a set of read variables to definitions in an environment.
76
- * @param referencesToLinkAgainstEnvironment - The set of references to link against the environment
77
- * @param environmentInformation - The environment information to link against
78
- * @param givenInputs - The existing list of inputs that might be extended
79
- * @param graph - The graph to enter the found links
80
- * @param maybeForRemaining - Each input that can not be linked, will be added to `givenInputs`. If this flag is `true`, it will be marked as `maybe`.
81
- * @returns the given inputs, possibly extended with the remaining inputs (those of `referencesToLinkAgainstEnvironment` that could not be linked against the environment)
61
+ * Links a set of read variables to definitions in `environmentInformation`; each reference that cannot be linked is
62
+ * added to `givenInputs` (marked maybe if `maybeForRemaining`), and the extended list is returned.
82
63
  */
83
64
  export declare function linkInputs(referencesToLinkAgainstEnvironment: readonly IdentifierReference[], environmentInformation: REnvironmentInformation, givenInputs: IdentifierReference[], graph: DataflowGraph, maybeForRemaining: boolean): IdentifierReference[];
84
65
  /**
85
- * all loops variables which are open read (not already bound by a redefinition within the loop) get a maybe read marker to their last definition within the loop
86
- * e.g. with:
87
- * ```R
88
- * for(i in 1:10) {
89
- * x_1 <- x_2 + 1
90
- * }
91
- * ```
92
- * `x_2` must get a read marker to `x_1` as `x_1` is the active redefinition in the second loop iteration.
93
- *
94
- * When `environment` is supplied the function uses it to discover ALL definitions that are still live at the
95
- * loop exit, so sequential overwrites contribute a single candidate while if-else branches contribute one
96
- * candidate per branch.
66
+ * A loop variable read before its within-loop redefinition gets a maybe marker to that def (e.g. `x_2` may read the
67
+ * prior iteration's `x_1` in `for(...) { x_1 <- x_2 + 1 }`); with `environment`, this uses all defs live at loop exit.
97
68
  */
98
69
  export declare function linkCircularRedefinitionsWithinALoop(graph: DataflowGraph, openIns: NameIdMap, outgoing: readonly IdentifierReference[], environment?: REnvironmentInformation): void;
99
70
  /**
@@ -46,7 +46,7 @@ function findNonLocalReads(graph, ignores = new Set()) {
46
46
  }
47
47
  const outgoing = graph.outgoingEdges(nodeId);
48
48
  const origin = graph.getVertex(nodeId);
49
- const name = (0, node_id_1.recoverName)(nodeId, graph.idMap);
49
+ const name = node_id_1.NodeId.recoverName(nodeId, graph.idMap);
50
50
  const type = vertex_2.FunctionCallVertex.is(origin) ? identifier_1.ReferenceType.Function : identifier_1.ReferenceType.Variable;
51
51
  const identifierRef = { nodeId, name, type };
52
52
  /* control flow edges say nothing about what a name resolves to, so they do not count as a link */
@@ -102,7 +102,6 @@ function pMatch(args, params) {
102
102
  * Links the function call arguments to the target function definition and returns a map from argument ids to parameter ids.
103
103
  */
104
104
  function linkFunctionCallArguments(targetId, idMap, functionCallName, functionRootId, callArgs, finalGraph) {
105
- // we get them by just choosing the rhs of the definition
106
105
  const linkedFunction = idMap.get(targetId);
107
106
  if (linkedFunction === undefined) {
108
107
  logger_1.dataflowLogger.trace(`no fdef found for ${functionCallName} (${functionRootId})`);
@@ -134,7 +133,6 @@ function linkFunctionCallWithSingleTarget(graph, { subflow: fnSubflow, exitPoint
134
133
  for (const v of value) {
135
134
  graph.addEdge(id, v, edge_1.EdgeType.Calls);
136
135
  graph.addEdge(ingoing.nodeId, v, edge_1.EdgeType.Calls);
137
- // add s7 to vertex
138
136
  const vInfo = graph.getVertex(v);
139
137
  if (vInfo && vertex_2.FunctionDefinitionVertex.is(vInfo)) {
140
138
  vInfo.mode ??= [];
@@ -152,12 +150,11 @@ function linkFunctionCallWithSingleTarget(graph, { subflow: fnSubflow, exitPoint
152
150
  for (const exitPoint of exitPoints) {
153
151
  graph.addEdge(id, exitPoint.nodeId, edge_1.EdgeType.Returns);
154
152
  if ((0, info_1.doesExitPointPropagateCalls)(exitPoint.type)) {
155
- // add the exit point to the call!
156
153
  propagateExitPoints.push(exitPoint);
157
154
  }
158
155
  }
159
- const defName = (0, node_id_1.recoverName)(fnId, idMap);
160
- (0, log_1.expensiveTrace)(logger_1.dataflowLogger, () => `recording expr-list-level call from ${(0, node_id_1.recoverName)(info.id, idMap)} to ${defName}`);
156
+ const defName = node_id_1.NodeId.recoverName(fnId, idMap);
157
+ (0, log_1.expensiveTrace)(logger_1.dataflowLogger, () => `recording expr-list-level call from ${node_id_1.NodeId.recoverName(info.id, idMap)} to ${defName}`);
161
158
  graph.addEdge(id, fnId, edge_1.EdgeType.Calls);
162
159
  applyForForcedArgs(graph, info.id, params, linkFunctionCallArguments(fnId, idMap, defName, id, info.args, graph));
163
160
  return propagateExitPoints;
@@ -178,7 +175,6 @@ const FCallLinkReadBits = edge_1.EdgeType.Reads | edge_1.EdgeType.Calls | edge_1
178
175
  function linkFunctionCall(graph, id, info, idMap, thisGraph, calledFunctionDefinitions) {
179
176
  const edges = graph.outgoingEdges(id);
180
177
  if (edges === undefined) {
181
- /* no outgoing edges */
182
178
  return;
183
179
  }
184
180
  const functionDefinitionReadIds = new Set();
@@ -204,11 +200,8 @@ function linkFunctionCall(graph, id, info, idMap, thisGraph, calledFunctionDefin
204
200
  }
205
201
  }
206
202
  /**
207
- * Returns the called functions within the current graph, which can be used to merge the environments with the call.
208
- * Furthermore, it links the corresponding arguments.
209
- * @param graph - The graph to use for search and resolution traversals (ideally a superset of the `thisGraph`)
210
- * @param idMap - The map to resolve ids to names
211
- * @param thisGraph - The graph to search for function calls in
203
+ * Returns the called functions within `graph` (ideally a superset of `thisGraph`, the graph searched for calls), which
204
+ * can be used to merge the environments with the call; also links the corresponding arguments.
212
205
  */
213
206
  function linkFunctionCalls(graph, idMap, thisGraph) {
214
207
  const calledFunctionDefinitions = [];
@@ -232,18 +225,22 @@ function getAllFunctionCallTargets(call, graph, environment) {
232
225
  if (!vertex_2.FunctionCallVertex.is(info)) {
233
226
  return [];
234
227
  }
235
- if (environment !== undefined || info.environment !== undefined) {
236
- let functionCallDefs = [];
228
+ const known = environment ?? info.environment;
229
+ let functionCallDefs = [];
230
+ if (known !== undefined) {
237
231
  const refType = info.origin.includes(built_in_proc_name_1.BuiltInProcName.S3Dispatch) ? identifier_1.ReferenceType.S3MethodPrefix :
238
232
  info.origin.includes(built_in_proc_name_1.BuiltInProcName.S7Dispatch) ? identifier_1.ReferenceType.S7MethodPrefix : identifier_1.ReferenceType.Function;
239
233
  if (info.name !== undefined && !identifier_1.Identifier.getName(info.name).startsWith(unnamed_call_handling_1.UnnamedFunctionCallPrefix)) {
240
- functionCallDefs = resolve_helper_1.Resolve.byNameAndType(info.name, environment ?? info.environment, refType)?.map(d => d.nodeId) ?? [];
234
+ functionCallDefs = resolve_helper_1.Resolve.byNameAndType(info.name, known, refType)?.map(d => d.nodeId) ?? [];
241
235
  }
242
- for (const [target, outgoingEdge] of outgoingEdges.entries()) {
243
- if (edge_1.DfEdge.includesType(outgoingEdge, edge_1.EdgeType.Calls)) {
244
- functionCallDefs.push(target);
245
- }
236
+ }
237
+ /* a call that kept no environment still knows the user definitions it was linked to, and those are targets */
238
+ for (const [target, outgoingEdge] of outgoingEdges.entries()) {
239
+ if (edge_1.DfEdge.includesType(outgoingEdge, edge_1.EdgeType.Calls) && (known !== undefined || !node_id_1.NodeId.isBuiltIn(target))) {
240
+ functionCallDefs.push(target);
246
241
  }
242
+ }
243
+ if (functionCallDefs.length > 0) {
247
244
  const [functionCallTargets, builtInTargets] = getAllLinkedFunctionDefinitions(new Set(functionCallDefs), graph);
248
245
  for (const target of functionCallTargets) {
249
246
  found.add(target.id);
@@ -258,19 +255,8 @@ function getAllFunctionCallTargets(call, graph, environment) {
258
255
  }
259
256
  const LinkedFnFollowBits = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall;
260
257
  /**
261
- * Finds all linked function definitions starting from the given set of read ids.
262
- * This is a complicated function, please only call it if you know what you are doing.
263
- * For example, if you are interested in the called functions of a function call, use {@link getAllFunctionCallTargets} instead.
264
- * This function here expects you to handle the accessed objects yourself (e.g,. already resolve the first layer of reads/returns/calls/... or resolve the identifier by name)
265
- * and then pass in the relevant read ids.
266
- * @example
267
- * Consider a scenario like this:
268
- * ```R
269
- * x <- function() 3
270
- * x()
271
- * ```
272
- * To resolve the call `x` in the second line, use {@link getAllFunctionCallTargets}!
273
- * To know what fdefs the definition of `x` in the first line links to, you can use {@link getAllLinkedFunctionDefinitions|this function}.
258
+ * Finds all linked function definitions starting from the given read ids; expects the caller to already have resolved
259
+ * the accessed objects (first layer of reads/returns/calls/...). For call targets, use {@link getAllFunctionCallTargets} instead.
274
260
  */
275
261
  function getAllLinkedFunctionDefinitions(functionDefinitionReadIds, dataflowGraph) {
276
262
  const result = new Set();
@@ -291,7 +277,6 @@ function getAllLinkedFunctionDefinitions(functionDefinitionReadIds, dataflowGrap
291
277
  if (vertex === undefined) {
292
278
  continue;
293
279
  }
294
- // Found a function definition
295
280
  if (vertex.subflow !== undefined) {
296
281
  result.add(vertex);
297
282
  continue;
@@ -349,13 +334,8 @@ function linkExpressionIn(graph, expr, environment, idMap) {
349
334
  return unresolved;
350
335
  }
351
336
  /**
352
- * This method links a set of read variables to definitions in an environment.
353
- * @param referencesToLinkAgainstEnvironment - The set of references to link against the environment
354
- * @param environmentInformation - The environment information to link against
355
- * @param givenInputs - The existing list of inputs that might be extended
356
- * @param graph - The graph to enter the found links
357
- * @param maybeForRemaining - Each input that can not be linked, will be added to `givenInputs`. If this flag is `true`, it will be marked as `maybe`.
358
- * @returns the given inputs, possibly extended with the remaining inputs (those of `referencesToLinkAgainstEnvironment` that could not be linked against the environment)
337
+ * Links a set of read variables to definitions in `environmentInformation`; each reference that cannot be linked is
338
+ * added to `givenInputs` (marked maybe if `maybeForRemaining`), and the extended list is returned.
359
339
  */
360
340
  function linkInputs(referencesToLinkAgainstEnvironment, environmentInformation, givenInputs, graph, maybeForRemaining) {
361
341
  for (const bodyInput of referencesToLinkAgainstEnvironment) {
@@ -369,7 +349,6 @@ function linkInputs(referencesToLinkAgainstEnvironment, environmentInformation,
369
349
  else {
370
350
  let allBuiltIn = true;
371
351
  for (const target of probableTarget) {
372
- // we can stick with maybe even if readId.attribute is always
373
352
  graph.addEdge(bodyInput.nodeId, target.nodeId, edge_1.EdgeType.Reads);
374
353
  if (!(0, identifier_1.isReferenceType)(target.type, identifier_1.ReferenceType.BuiltInConstant | identifier_1.ReferenceType.BuiltInFunction)) {
375
354
  allBuiltIn = false;
@@ -380,22 +359,11 @@ function linkInputs(referencesToLinkAgainstEnvironment, environmentInformation,
380
359
  }
381
360
  }
382
361
  }
383
- // data.graph.get(node.id).definedAtPosition = false
384
362
  return givenInputs;
385
363
  }
386
364
  /**
387
- * all loops variables which are open read (not already bound by a redefinition within the loop) get a maybe read marker to their last definition within the loop
388
- * e.g. with:
389
- * ```R
390
- * for(i in 1:10) {
391
- * x_1 <- x_2 + 1
392
- * }
393
- * ```
394
- * `x_2` must get a read marker to `x_1` as `x_1` is the active redefinition in the second loop iteration.
395
- *
396
- * When `environment` is supplied the function uses it to discover ALL definitions that are still live at the
397
- * loop exit, so sequential overwrites contribute a single candidate while if-else branches contribute one
398
- * candidate per branch.
365
+ * A loop variable read before its within-loop redefinition gets a maybe marker to that def (e.g. `x_2` may read the
366
+ * prior iteration's `x_1` in `for(...) { x_1 <- x_2 + 1 }`); with `environment`, this uses all defs live at loop exit.
399
367
  */
400
368
  function linkCircularRedefinitionsWithinALoop(graph, openIns, outgoing, environment) {
401
369
  if (environment !== undefined) {
@@ -437,7 +405,6 @@ function linkCircularRedefinitionsWithinALoop(graph, openIns, outgoing, environm
437
405
  * Reapplies the loop exit points' control dependencies to the given identifier references.
438
406
  */
439
407
  function reapplyLoopExitPoints(exits, references, graph) {
440
- // just apply the cds of all exit points not already present
441
408
  const exitCds = exits.flatMap(e => e.cds?.map(info_1.negateControlDependency))
442
409
  .filter(assert_1.isNotUndefined)
443
410
  .map(cd => ({ ...cd, byIteration: true }));
@@ -4,7 +4,6 @@ import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/
4
4
  import type { PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
5
5
  import { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
6
6
  import { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
7
- import type { ForceArguments } from '../common';
8
7
  /**
9
8
  * Processes different types of access operations.
10
9
  *
@@ -19,7 +18,7 @@ import type { ForceArguments } from '../common';
19
18
  export declare function processAccess<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: {
20
19
  treatIndicesAsString: boolean;
21
20
  resolveField?: boolean;
22
- } & ForceArguments): DataflowInformation;
21
+ }): DataflowInformation;
23
22
  /**
24
23
  * Converts symbol arguments to string arguments within the specified range.
25
24
  */
@@ -37,21 +37,21 @@ function tableAssignmentProcessor(name, args, rootId, data, outInfo) {
37
37
  function processAccess(name, args, rootId, data, config) {
38
38
  if (args.length < 1) {
39
39
  logger_1.dataflowLogger.warn(`Access ${identifier_1.Identifier.getName(name.content)} has less than 1 argument, skipping`);
40
- return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: 'default' }).information;
40
+ return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
41
41
  }
42
42
  const head = args[0];
43
43
  let fnCall;
44
44
  if (r_argument_1.RArgument.isEmpty(head)) {
45
45
  // in this case we may be within a pipe
46
- fnCall = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: built_in_proc_name_1.BuiltInProcName.Access });
46
+ fnCall = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Access });
47
47
  }
48
48
  else if (config.treatIndicesAsString) {
49
- fnCall = processStringBasedAccess(args, data, name, rootId, config);
49
+ fnCall = processStringBasedAccess(args, data, name, rootId);
50
50
  }
51
51
  else {
52
52
  /* within an access operation which treats its fields, we redefine the table assignment ':=' as a trigger if this is to be treated as a definition */
53
53
  // do we have a local definition that needs to be recovered?
54
- fnCall = processNumberBasedAccess(data, name, args, rootId, config, head);
54
+ fnCall = processNumberBasedAccess(data, name, args, rootId, head);
55
55
  }
56
56
  const info = fnCall.information;
57
57
  if (head !== r_function_call_1.EmptyArgument) {
@@ -119,7 +119,7 @@ function processAccess(name, args, rootId, data, config) {
119
119
  * a[[i]]
120
120
  * ```
121
121
  */
122
- function processNumberBasedAccess(data, name, args, rootId, config, head) {
122
+ function processNumberBasedAccess(data, name, args, rootId, head) {
123
123
  const existing = data.environment.current.memory.get(':=');
124
124
  const outInfo = { definitionRootNodes: [] };
125
125
  const tableAssignId = node_id_1.NodeId.toBuiltIn(':=-table');
@@ -131,7 +131,7 @@ function processNumberBasedAccess(data, name, args, rootId, config, head) {
131
131
  name: ':=',
132
132
  nodeId: tableAssignId
133
133
  }]);
134
- const fnCall = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: built_in_proc_name_1.BuiltInProcName.Access });
134
+ const fnCall = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Access });
135
135
  /* recover the environment */
136
136
  if (existing !== undefined) {
137
137
  data.environment.current.writableMemory.set(':=', existing);
@@ -176,13 +176,12 @@ function symbolArgumentsToStrings(args, firstIndexInclusive = 1, lastIndexInclus
176
176
  * a@foo
177
177
  * ```
178
178
  */
179
- function processStringBasedAccess(args, data, name, rootId, config) {
179
+ function processStringBasedAccess(args, data, name, rootId) {
180
180
  return (0, known_call_handling_1.processKnownFunctionCall)({
181
181
  name,
182
182
  args: symbolArgumentsToStrings(args),
183
183
  rootId,
184
184
  data,
185
- forceArgs: config.forceArgs,
186
185
  origin: built_in_proc_name_1.BuiltInProcName.Access
187
186
  });
188
187
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.resolveFunctionArgument = resolveFunctionArgument;
4
4
  exports.processApply = processApply;
5
+ const built_in_props_1 = require("../../../../../environments/built-in-props");
5
6
  const known_call_handling_1 = require("../known-call-handling");
6
7
  const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
7
8
  const r_symbol_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
@@ -38,11 +39,9 @@ function resolveFunctionArgument(val, data, opts) {
38
39
  */
39
40
  function processApply(name, args, rootId, data, config) {
40
41
  const { indexOfFunction = 1, nameOfFunctionArgument, unquoteFunction, resolveInEnvironment, resolveValue, hasUnknownSideEffects } = config;
41
- /* as the length is one-based and the argument filter mapping is zero-based, we do not have to subtract 1 */
42
- const forceArgsMask = new Array(indexOfFunction).fill(false);
43
- forceArgsMask.push(true);
42
+ /* the length is one-based and the argument mapping zero-based, so the function sits at `indexOfFunction` */
44
43
  const resFn = (0, known_call_handling_1.processKnownFunctionCall)({
45
- name, args, rootId, data, forceArgs: forceArgsMask, origin: built_in_proc_name_1.BuiltInProcName.Apply
44
+ name, args, rootId, data, sig: built_in_props_1.FnSig.only(indexOfFunction, nameOfFunctionArgument ?? 'FUN'), origin: built_in_proc_name_1.BuiltInProcName.Apply
46
45
  });
47
46
  let information = resFn.information;
48
47
  if (hasUnknownSideEffects) {
@@ -7,10 +7,9 @@ import type { PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-
7
7
  import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
8
8
  import { Identifier, type InGraphIdentifierDefinition } from '../../../../../environments/identifier';
9
9
  import type { DataflowGraphVertexFunctionDefinition } from '../../../../../graph/vertex';
10
- import type { ForceArguments } from '../common';
11
10
  import type { REnvironmentInformation } from '../../../../../environments/environment';
12
11
  import type { DataflowGraph } from '../../../../../graph/graph';
13
- export interface AssignmentConfiguration extends ForceArguments {
12
+ export interface AssignmentConfiguration {
14
13
  readonly superAssignment?: boolean;
15
14
  readonly swapSourceAndTarget?: boolean;
16
15
  /** Make maybe if assigned to symbol */
@@ -22,9 +21,8 @@ export interface AssignmentConfiguration extends ForceArguments {
22
21
  readonly mayHaveMoreArgs?: boolean;
23
22
  readonly modesForFn?: DataflowGraphVertexFunctionDefinition['mode'];
24
23
  /**
25
- * The name of the argument that selects the target environment (e.g. `'envir'` for `assign`).
26
- * When present and the argument resolves to a variable with a tracked {@link InGraphIdentifierDefinition#envState},
27
- * the assignment is routed into that environment instead of the current scope.
24
+ * Name of the arg selecting the target env (e.g. `'envir'` for `assign`); if it resolves to a tracked
25
+ * {@link InGraphIdentifierDefinition#envState}, the assignment is routed there instead of the current scope.
28
26
  */
29
27
  readonly environmentArg?: string;
30
28
  }
@@ -38,14 +36,11 @@ export interface ExtendedAssignmentConfiguration extends AssignmentConfiguration
38
36
  name: string;
39
37
  };
40
38
  }
41
- /**
42
- * In contrast to `processAssignment`, this function allows more flexible handling of assignment-like functions.
43
- */
39
+ /** In contrast to `processAssignment`, this function allows more flexible handling of assignment-like functions. */
44
40
  export declare function processAssignmentLike<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: ExtendedAssignmentConfiguration): DataflowInformation;
45
41
  /**
46
- * Processes an assignment, i.e., `<target> <- <source>`.
47
- * Handling it as a function call \`&lt;-\` `(<target>, <source>)`.
48
- * This includes handling of replacement functions (e.g., `names(x) <- ...` as \`names&lt;-\` `(x, ...)`).
42
+ * Processes an assignment `<target> <- <source>` as the function call \`&lt;-\` `(<target>, <source>)`,
43
+ * including replacement functions (e.g., `names(x) <- ...` as \`names&lt;-\` `(x, ...)`).
49
44
  */
50
45
  export declare function processAssignment<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: AssignmentConfiguration): DataflowInformation;
51
46
  export interface AssignmentToSymbolParameters<OtherInfo> extends AssignmentConfiguration {
@@ -60,9 +55,8 @@ export interface AssignmentToSymbolParameters<OtherInfo> extends AssignmentConfi
60
55
  readonly information: DataflowInformation;
61
56
  }
62
57
  /**
63
- * Model a call like `Hmisc::getHdata(x)` that loads a dataset into the variable it is *given*: the argument symbol
64
- * `x` is both **read** (as the call's argument, its value comes from outside the code) and **defined** by the call.
65
- * Unlike {@link markAsAssignment} we keep the read edge.
58
+ * Models a call like `Hmisc::getHdata(x)` that loads a dataset into the variable it is *given*: `x` is both
59
+ * **read** (its value comes from outside) and **defined** by the call; unlike {@link markAsAssignment} we keep the read edge.
66
60
  */
67
61
  export declare function processDefineArgument<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: AssignmentConfiguration): DataflowInformation;
68
62
  /** Define `nodeToDefine` in the environment and wire the `DefinedBy` edges from it to its sources and the assignment root (dropping the child-added read edges). */
@@ -10,7 +10,6 @@ const data_masking_functions_1 = require("../../../../../environments/data-maski
10
10
  const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
11
11
  const log_1 = require("../../../../../../util/log");
12
12
  const unpack_argument_1 = require("../argument/unpack-argument");
13
- const process_named_call_1 = require("../../../process-named-call");
14
13
  const make_argument_1 = require("../argument/make-argument");
15
14
  const r_access_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-access");
16
15
  const r_symbol_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
@@ -59,30 +58,41 @@ function findRootAccess(node) {
59
58
  }
60
59
  return undefined;
61
60
  }
62
- function tryReplacement(rootId, functionName, data, name, args) {
61
+ function tryReplacement(rootId, functionName, data, superAssignment, args) {
63
62
  const resolved = resolve_helper_1.Resolve.byNameAndType(functionName.content, data.environment, identifier_1.ReferenceType.Function) ?? [];
64
- // yield for unsupported pass along!
65
- if (resolved.length !== 1 || resolved[0].type !== identifier_1.ReferenceType.BuiltInFunction) {
66
- return (0, process_named_call_1.processAsNamedCall)(functionName, data, name, args);
67
- }
63
+ const builtIn = resolved.length === 1 && resolved[0].type === identifier_1.ReferenceType.BuiltInFunction ? resolved[0] : undefined;
64
+ /* every replacement function rebinds its target, no matter whether we ship a built-in for it or the user wrote
65
+ * it; a user-defined one is only ever bound under its `<-` name, the `<<-` form stays in the configuration */
66
+ const name = builtIn ? functionName.content : identifier_1.Identifier.mapName(functionName.content, n => superAssignment ? n.slice(0, -'<<-'.length) + '<-' : n);
68
67
  const info = built_in_1.BuiltInProcessorMapper[built_in_proc_name_1.BuiltInProcName.Replacement]({
69
68
  type: type_1.RType.Symbol,
70
69
  info: functionName.info,
71
70
  content: name,
72
71
  lexeme: functionName.lexeme,
73
72
  location: functionName.location
74
- }, (0, make_argument_1.wrapArgumentsUnnamed)(args, data.completeAst.idMap), functionName.info.id, data, {
75
- ...resolved[0].config,
73
+ }, (0, make_argument_1.wrapArgumentsUnnamed)(args, data.completeAst.idMap), functionName.info.id, data, builtIn ? {
74
+ ...builtIn.config,
75
+ assignRootId: rootId
76
+ } : {
77
+ readIndices: true,
78
+ makeMaybe: true,
79
+ assignmentOperator: superAssignment ? '<<-' : '<-',
76
80
  assignRootId: rootId
77
81
  });
78
- (0, named_call_handling_1.markAsOnlyBuiltIn)(info.graph, functionName.info.id);
79
- return info;
82
+ if (builtIn) {
83
+ (0, named_call_handling_1.markAsOnlyBuiltIn)(info.graph, functionName.info.id);
84
+ return info;
85
+ }
86
+ /* the replacement marks its callee as an S3 prefix, which only ever resolves to `name.<class>`; a user-defined
87
+ * replacement is bound under the plain name, so we read that first to link the call to its definition */
88
+ return {
89
+ ...info,
90
+ in: [{ nodeId: functionName.info.id, name, cds: data.cds, type: identifier_1.ReferenceType.Function }, ...info.in]
91
+ };
80
92
  }
81
- /**
82
- * In contrast to `processAssignment`, this function allows more flexible handling of assignment-like functions.
83
- */
93
+ /** In contrast to `processAssignment`, this function allows more flexible handling of assignment-like functions. */
84
94
  function processAssignmentLike(name,
85
- /* we expect them to be ordered in the sense that we have (source, target): `<source> <- <target>` */
95
+ /* args may come in any order; matched via config.source/config.target, then normalized to processAssignment's convention below */
86
96
  args, rootId, data, config) {
87
97
  const argsWithNames = new Map();
88
98
  const argsWithoutNames = [];
@@ -134,9 +144,8 @@ function processMaskedNamePair(name, args, rootId, data) {
134
144
  return information;
135
145
  }
136
146
  /**
137
- * Processes an assignment, i.e., `<target> <- <source>`.
138
- * Handling it as a function call \`&lt;-\` `(<target>, <source>)`.
139
- * This includes handling of replacement functions (e.g., `names(x) <- ...` as \`names&lt;-\` `(x, ...)`).
147
+ * Processes an assignment `<target> <- <source>` as the function call \`&lt;-\` `(<target>, <source>)`,
148
+ * including replacement functions (e.g., `names(x) <- ...` as \`names&lt;-\` `(x, ...)`).
140
149
  */
141
150
  function processAssignment(name,
142
151
  /* we expect them to be ordered in the sense that we have (source, target): `<source> <- <target>` */
@@ -146,7 +155,7 @@ args, rootId, data, config) {
146
155
  }
147
156
  if (!config.mayHaveMoreArgs && args.length !== 2) {
148
157
  logger_1.dataflowLogger.warn(`Assignment ${identifier_1.Identifier.toString(name.content)} has something else than 2 arguments, skipping`);
149
- return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: 'default' }).information;
158
+ return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
150
159
  }
151
160
  /* route into a custom environment when envir resolves to a tracked env variable */
152
161
  if (config.environmentArg) {
@@ -156,10 +165,11 @@ args, rootId, data, config) {
156
165
  }
157
166
  }
158
167
  const effectiveArgs = getEffectiveOrder(config, args);
159
- const { target, source } = extractSourceAndTarget(effectiveArgs);
168
+ const target = (0, unpack_argument_1.unpackArg)(effectiveArgs[0]);
169
+ const source = (0, unpack_argument_1.unpackArg)(effectiveArgs[1]);
160
170
  if (target === undefined || source === undefined) {
161
171
  logger_1.dataflowLogger.warn(`Assignment ${identifier_1.Identifier.toString(name.content)} has an undefined target or source, skipping`);
162
- return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: 'default' }).information;
172
+ return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
163
173
  }
164
174
  const { type, named } = target;
165
175
  /** the target is a plain name, so the assignment defines it directly (with `targetName` set whenever the name had to be resolved first) */
@@ -170,7 +180,6 @@ args, rootId, data, config) {
170
180
  rootId,
171
181
  data,
172
182
  reverseOrder: !config.swapSourceAndTarget,
173
- forceArgs: config.forceArgs,
174
183
  origin: config.superAssignment ? built_in_proc_name_1.BuiltInProcName.SuperAssignment : built_in_proc_name_1.BuiltInProcName.Assignment
175
184
  });
176
185
  return processAssignmentToSymbol({
@@ -199,7 +208,7 @@ args, rootId, data, config) {
199
208
  /* as replacement functions take precedence over the lhs fn-call (i.e., `names(x) <- ...` is independent from the definition of `names`), we do not have to process the call */
200
209
  logger_1.dataflowLogger.debug(`Assignment ${identifier_1.Identifier.toString(name.content)} has a function call as target ==> replacement function ${target.lexeme}`);
201
210
  const replacement = toReplacementSymbol(target, target.functionName.content, config.superAssignment ?? false);
202
- return tryReplacement(rootId, replacement, data, replacement.content, [...target.arguments, source]);
211
+ return tryReplacement(rootId, replacement, data, config.superAssignment ?? false, [...target.arguments, source]);
203
212
  }
204
213
  else if (config.canBeReplacement && type === type_1.RType.Access) {
205
214
  logger_1.dataflowLogger.debug(`Assignment ${identifier_1.Identifier.toString(name.content)} has an access-type node as target ==> replacement function ${target.lexeme}`);
@@ -208,7 +217,7 @@ args, rootId, data, config) {
208
217
  if (envRouted !== undefined) {
209
218
  return envRouted;
210
219
  }
211
- return tryReplacement(rootId, replacement, data, replacement.content, [(0, make_argument_1.toUnnamedArgument)(target.accessed, data.completeAst.idMap), ...target.access, source]);
220
+ return tryReplacement(rootId, replacement, data, config.superAssignment ?? false, [(0, make_argument_1.toUnnamedArgument)(target.accessed, data.completeAst.idMap), ...target.access, source]);
212
221
  }
213
222
  else if (type === type_1.RType.Access) {
214
223
  const rootArg = findRootAccess(target);
@@ -219,7 +228,6 @@ args, rootId, data, config) {
219
228
  rootId,
220
229
  data,
221
230
  reverseOrder: !config.swapSourceAndTarget,
222
- forceArgs: config.forceArgs,
223
231
  origin: config.superAssignment ? built_in_proc_name_1.BuiltInProcName.SuperAssignment : built_in_proc_name_1.BuiltInProcName.Assignment
224
232
  });
225
233
  return processAssignmentToSymbol({
@@ -239,20 +247,13 @@ args, rootId, data, config) {
239
247
  }
240
248
  logger_1.dataflowLogger.warn(`Assignment ${identifier_1.Identifier.toString(name.content)} has an unknown target type ${target.type} => unknown impact`);
241
249
  const info = (0, known_call_handling_1.processKnownFunctionCall)({
242
- name, args: effectiveArgs, rootId, data, forceArgs: config.forceArgs,
250
+ name, args: effectiveArgs, rootId, data,
243
251
  origin: config.superAssignment ? built_in_proc_name_1.BuiltInProcName.SuperAssignment : built_in_proc_name_1.BuiltInProcName.Assignment
244
252
  }).information;
245
253
  (0, unknown_side_effect_1.handleUnknownSideEffect)(info.graph, info.environment, rootId);
246
254
  return info;
247
255
  }
248
- function extractSourceAndTarget(args) {
249
- const source = (0, unpack_argument_1.unpackArg)(args[1]);
250
- const target = (0, unpack_argument_1.unpackArg)(args[0]);
251
- return { source, target };
252
- }
253
- /**
254
- * Promotes the ingoing/unknown references of target (an assignment) to definitions
255
- */
256
+ /** Promotes the ingoing/unknown references of target (an assignment) to definitions. */
256
257
  function produceWrittenNodes(rootId, target, referenceType, data, makeMaybe, value) {
257
258
  const written = [];
258
259
  for (const refs of [target.in, target.unknownReferences]) {
@@ -289,7 +290,6 @@ function processAssignmentToString(target, args, name, rootId, data, config, sou
289
290
  rootId,
290
291
  data,
291
292
  reverseOrder: !config.swapSourceAndTarget,
292
- forceArgs: config.forceArgs,
293
293
  origin: config.superAssignment ? built_in_proc_name_1.BuiltInProcName.SuperAssignment : built_in_proc_name_1.BuiltInProcName.Assignment
294
294
  });
295
295
  return processAssignmentToSymbol({
@@ -332,9 +332,8 @@ function isEnvCreatorSource(sourceInfo) {
332
332
  return vertex_1.FunctionCallVertex.hasOrigin(vert, built_in_proc_name_1.BuiltInProcName.NewEnv);
333
333
  }
334
334
  /**
335
- * When `e$x <- val` and `e` holds a tracked {@link InGraphIdentifierDefinition#envState},
336
- * adds the field `x` into that envState instead of redefining the whole `e` object.
337
- * Returns `undefined` when routing is not applicable.
335
+ * When `e$x <- val` and `e` holds a tracked {@link InGraphIdentifierDefinition#envState}, adds field `x` into that
336
+ * envState instead of redefining `e`; returns `undefined` when routing is not applicable.
338
337
  */
339
338
  function tryRouteDollarEnvAssign(rootId, data, config, target, source, replacement) {
340
339
  if (target.operator !== '$' || !r_symbol_1.RSymbol.is(target.accessed)) {
@@ -349,7 +348,7 @@ function tryRouteDollarEnvAssign(rootId, data, config, target, source, replaceme
349
348
  return undefined;
350
349
  }
351
350
  const fieldName = (r_string_1.RString.is(fieldNode) ? fieldNode.content.str : fieldNode.lexeme);
352
- const normalResult = tryReplacement(rootId, replacement, data, replacement.content, [(0, make_argument_1.toUnnamedArgument)(target.accessed, data.completeAst.idMap), ...target.access, source]);
351
+ const normalResult = tryReplacement(rootId, replacement, data, config.superAssignment ?? false, [(0, make_argument_1.toUnnamedArgument)(target.accessed, data.completeAst.idMap), ...target.access, source]);
353
352
  const fieldDef = {
354
353
  type: identifier_1.ReferenceType.Variable,
355
354
  name: fieldName,
@@ -371,11 +370,8 @@ function tryRouteDollarEnvAssign(rootId, data, config, target, source, replaceme
371
370
  return { ...normalResult, environment: (0, define_1.define)(updatedEnvDef, false, strippedEnv) };
372
371
  }
373
372
  /**
374
- * When `config.environmentArg` identifies an `envir`-like parameter (e.g. `'envir'` for `assign`)
375
- * and that argument resolves to a variable with a tracked {@link InGraphIdentifierDefinition#envState},
376
- * this function routes the written definitions into that custom environment instead of the current
377
- * global scope.
378
- * @returns `undefined` if routing is not possible
373
+ * When `config.environmentArg` (e.g. `'envir'` for `assign`) resolves to a variable with a tracked
374
+ * {@link InGraphIdentifierDefinition#envState}, routes the written definitions there instead of the current scope; returns `undefined` if not possible.
379
375
  */
380
376
  function tryRouteToCustomEnv(name, args, rootId, data, config) {
381
377
  const resolution = (0, built_in_envir_utils_1.resolveEnvirArg)(args, data, config.environmentArg);
@@ -405,12 +401,11 @@ function tryRouteToCustomEnv(name, args, rootId, data, config) {
405
401
  return (0, built_in_envir_utils_1.routeWrittenToCustomEnv)(normalResult, resolution.envDef, rootId, rootId);
406
402
  }
407
403
  /**
408
- * Model a call like `Hmisc::getHdata(x)` that loads a dataset into the variable it is *given*: the argument symbol
409
- * `x` is both **read** (as the call's argument, its value comes from outside the code) and **defined** by the call.
410
- * Unlike {@link markAsAssignment} we keep the read edge.
404
+ * Models a call like `Hmisc::getHdata(x)` that loads a dataset into the variable it is *given*: `x` is both
405
+ * **read** (its value comes from outside) and **defined** by the call; unlike {@link markAsAssignment} we keep the read edge.
411
406
  */
412
407
  function processDefineArgument(name, args, rootId, data, config) {
413
- const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: built_in_proc_name_1.BuiltInProcName.DefineArgument });
408
+ const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.DefineArgument });
414
409
  const info = res.information;
415
410
  const targetArg = res.processedArguments[0]; // the read argument, e.g. `prostate`
416
411
  if (targetArg !== undefined) {
@@ -438,9 +433,7 @@ function markAsAssignment(information, nodeToDefine, sourceIds, rootIdOfAssignme
438
433
  information.graph.removeEdgeType(nodeToDefine.nodeId, id, edge_1.EdgeType.Reads);
439
434
  }
440
435
  }
441
- /**
442
- * Helper function whenever it is known that the _target_ of an assignment is a (single) symbol (i.e. `x <- ...`, but not `names(x) <- ...`).
443
- */
436
+ /** Helper for when the _target_ of an assignment is known to be a (single) symbol (i.e. `x <- ...`, not `names(x) <- ...`). */
444
437
  function processAssignmentToSymbol(config) {
445
438
  const { nameOfAssignmentFunction, source, args: [targetArg, sourceArg], targetId, targetName, rootId, data, information, makeMaybe, quoteSource } = config;
446
439
  const referenceType = checkTargetReferenceType(sourceArg, config.modesForFn);