@eagleoutice/flowr 2.14.1 → 2.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (419) hide show
  1. package/README.md +142 -87
  2. package/abstract-interpretation/absint-visitor.d.ts +132 -25
  3. package/abstract-interpretation/absint-visitor.js +459 -99
  4. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +1 -1
  5. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  6. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
  7. package/abstract-interpretation/data-frame/mappers/arguments.js +1 -1
  8. package/abstract-interpretation/data-frame/mappers/function-mapper.js +107 -254
  9. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +5 -5
  10. package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -1
  11. package/abstract-interpretation/data-frame/resolve-args.js +6 -4
  12. package/abstract-interpretation/data-frame/shape-inference.d.ts +4 -9
  13. package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -0
  14. package/abstract-interpretation/domains/bounded-set-domain.js +1 -0
  15. package/abstract-interpretation/domains/partial-product-domain.js +1 -1
  16. package/abstract-interpretation/domains/set-range-domain.d.ts +3 -2
  17. package/abstract-interpretation/domains/set-range-domain.js +3 -2
  18. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +3 -2
  19. package/abstract-interpretation/domains/set-upper-bound-domain.js +3 -2
  20. package/benchmark/calibration.d.ts +11 -6
  21. package/benchmark/calibration.js +19 -8
  22. package/benchmark/slicer.d.ts +7 -1
  23. package/benchmark/slicer.js +38 -34
  24. package/benchmark/stats/count-comments.d.ts +16 -0
  25. package/benchmark/stats/count-comments.js +30 -0
  26. package/benchmark/stats/print.js +2 -0
  27. package/benchmark/stats/size-of.d.ts +7 -3
  28. package/benchmark/stats/size-of.js +7 -3
  29. package/benchmark/stats/stats.d.ts +7 -0
  30. package/benchmark/summarizer/first-phase/process.js +2 -19
  31. package/benchmark/summarizer/second-phase/graph.js +13 -3
  32. package/benchmark/summarizer/second-phase/process.js +2 -0
  33. package/cli/repl/commands/repl-dataflow.js +70 -27
  34. package/cli/repl/core.d.ts +1 -1
  35. package/cli/repl/core.js +1 -1
  36. package/cli/repl/parser/slice-query-parser.js +2 -1
  37. package/cli/repl/server/connection.d.ts +4 -0
  38. package/cli/repl/server/connection.js +19 -16
  39. package/cli/repl/server/messages/message-analysis.d.ts +1 -1
  40. package/config.d.ts +21 -8
  41. package/config.js +12 -5
  42. package/control-flow/basic-cfg-guided-visitor.d.ts +7 -2
  43. package/control-flow/basic-cfg-guided-visitor.js +37 -24
  44. package/control-flow/cfg-dead-code.js +44 -33
  45. package/control-flow/cfg-properties.js +2 -2
  46. package/control-flow/cfg-simplification.js +6 -5
  47. package/control-flow/cfg-to-basic-blocks.js +11 -13
  48. package/control-flow/control-flow-graph.d.ts +179 -189
  49. package/control-flow/control-flow-graph.js +400 -263
  50. package/control-flow/dfg-cfg-guided-visitor.d.ts +21 -3
  51. package/control-flow/dfg-cfg-guided-visitor.js +17 -13
  52. package/control-flow/diff-cfg.js +6 -14
  53. package/control-flow/happens-before.js +5 -4
  54. package/control-flow/semantic-cfg-guided-visitor.d.ts +44 -101
  55. package/control-flow/semantic-cfg-guided-visitor.js +6 -3
  56. package/control-flow/simple-visitor.js +14 -15
  57. package/control-flow/syntax-cfg-guided-visitor.d.ts +2 -1
  58. package/control-flow/useless-loop.js +18 -14
  59. package/core/steps/all/core/20-dataflow.d.ts +1 -3
  60. package/core/steps/pipeline/default-pipelines.d.ts +141 -157
  61. package/dataflow/cluster.js +7 -0
  62. package/dataflow/environments/apply-kill.d.ts +6 -0
  63. package/dataflow/environments/apply-kill.js +63 -31
  64. package/dataflow/environments/built-in-props.d.ts +5 -1
  65. package/dataflow/environments/built-in-props.js +4 -0
  66. package/dataflow/environments/built-in.d.ts +6 -3
  67. package/dataflow/environments/built-in.js +8 -5
  68. package/dataflow/environments/clone.d.ts +3 -3
  69. package/dataflow/environments/clone.js +5 -5
  70. package/dataflow/environments/default-builtin-config.d.ts +114 -3
  71. package/dataflow/environments/default-builtin-config.js +137 -35
  72. package/dataflow/environments/environment.d.ts +5 -5
  73. package/dataflow/environments/environment.js +5 -5
  74. package/dataflow/environments/identifier.d.ts +11 -1
  75. package/dataflow/environments/identifier.js +4 -1
  76. package/dataflow/environments/resolve-by-name.d.ts +7 -0
  77. package/dataflow/environments/resolve-by-name.js +12 -0
  78. package/dataflow/environments/resolve-helper.d.ts +3 -1
  79. package/dataflow/environments/resolve-helper.js +2 -0
  80. package/dataflow/eval/resolve/alias-tracking.d.ts +3 -3
  81. package/dataflow/eval/resolve/alias-tracking.js +3 -3
  82. package/dataflow/eval/resolve/match-arguments.js +7 -5
  83. package/dataflow/eval/resolve/node-value.d.ts +3 -1
  84. package/dataflow/eval/resolve/node-value.js +12 -0
  85. package/dataflow/eval/resolve/resolve-argument.js +5 -4
  86. package/dataflow/eval/resolve/resolve-operators.js +9 -6
  87. package/dataflow/eval/resolve/resolve-strings.js +2 -2
  88. package/dataflow/eval/resolve/resolve-working-directory.js +4 -3
  89. package/dataflow/eval/resolve/resolve.js +3 -2
  90. package/dataflow/eval/values/general.js +8 -5
  91. package/dataflow/extractor.d.ts +1 -4
  92. package/dataflow/extractor.js +11 -10
  93. package/dataflow/fn/exceptions-of-function.d.ts +3 -1
  94. package/dataflow/fn/strict-function.js +7 -5
  95. package/dataflow/graph/call-graph.js +2 -2
  96. package/dataflow/graph/df-helper.d.ts +8 -1
  97. package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
  98. package/dataflow/graph/diff-dataflow-graph.js +19 -2
  99. package/dataflow/graph/edge.d.ts +38 -2
  100. package/dataflow/graph/edge.js +32 -2
  101. package/dataflow/graph/graph.d.ts +4 -3
  102. package/dataflow/graph/graph.js +6 -2
  103. package/dataflow/graph/match-args.d.ts +69 -0
  104. package/dataflow/graph/match-args.js +167 -0
  105. package/dataflow/info.d.ts +15 -6
  106. package/dataflow/info.js +0 -17
  107. package/dataflow/internal/control-flow.d.ts +114 -0
  108. package/dataflow/internal/control-flow.js +224 -0
  109. package/dataflow/internal/linker.d.ts +6 -31
  110. package/dataflow/internal/linker.js +24 -81
  111. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
  112. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +3 -3
  113. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +2 -2
  114. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +9 -6
  115. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
  116. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +6 -4
  117. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -10
  118. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +18 -37
  119. package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
  120. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -3
  121. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +1 -1
  122. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +11 -7
  123. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
  124. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
  125. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +18 -14
  126. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +18 -2
  127. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +12 -1
  128. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
  129. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +38 -30
  130. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -2
  131. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
  132. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +36 -8
  133. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
  134. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +20 -17
  135. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +1 -1
  136. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +6 -4
  137. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +4 -3
  138. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +9 -4
  139. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +2 -2
  140. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +5 -5
  141. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.d.ts +1 -1
  142. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +5 -4
  143. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +7 -5
  144. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +1 -1
  145. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +15 -13
  146. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +1 -1
  147. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +11 -2
  148. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
  149. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +4 -3
  150. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +1 -1
  151. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +26 -4
  152. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
  153. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +17 -4
  154. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
  155. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +71 -33
  156. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +6 -15
  157. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +13 -14
  158. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  159. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +14 -11
  160. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +15 -1
  161. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
  162. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +12 -8
  163. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +6 -5
  164. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.d.ts +1 -1
  165. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +5 -4
  166. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
  167. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +50 -10
  168. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
  169. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +20 -4
  170. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +6 -2
  171. package/dataflow/internal/process/functions/call/common.js +5 -6
  172. package/dataflow/internal/process/functions/call/deferred.js +2 -2
  173. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +12 -2
  174. package/dataflow/internal/process/functions/call/known-call-handling.js +41 -15
  175. package/dataflow/internal/process/functions/call/named-call-handling.js +2 -0
  176. package/dataflow/internal/process/functions/call/nse.d.ts +1 -1
  177. package/dataflow/internal/process/functions/call/nse.js +6 -1
  178. package/dataflow/internal/process/functions/call/quoted.js +2 -2
  179. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +19 -6
  180. package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
  181. package/dataflow/internal/process/functions/process-argument.js +12 -4
  182. package/dataflow/internal/process/functions/process-parameter.js +13 -0
  183. package/dataflow/internal/process/process-named-call.d.ts +2 -2
  184. package/dataflow/internal/process/process-named-call.js +9 -7
  185. package/documentation/data/server/doc-data-server-messages.js +4 -4
  186. package/documentation/doc-readme.js +33 -0
  187. package/documentation/doc-util/doc-cfg.d.ts +8 -7
  188. package/documentation/doc-util/doc-cfg.js +10 -10
  189. package/documentation/doc-util/doc-playground.d.ts +12 -0
  190. package/documentation/doc-util/doc-playground.js +21 -0
  191. package/documentation/doc-util/doc-query.d.ts +4 -1
  192. package/documentation/doc-util/doc-query.js +4 -2
  193. package/documentation/wiki-absint.d.ts +3 -4
  194. package/documentation/wiki-absint.js +17 -5
  195. package/documentation/wiki-analyzer.js +2 -2
  196. package/documentation/wiki-cfg.js +101 -106
  197. package/documentation/wiki-dataflow-graph.js +84 -53
  198. package/documentation/wiki-interface.js +1 -0
  199. package/documentation/wiki-linter.js +15 -1
  200. package/documentation/wiki-linting-and-testing.js +1 -16
  201. package/documentation/wiki-mk/doc-maker.js +6 -4
  202. package/documentation/wiki-query.js +14 -4
  203. package/documentation/wiki-signature-database.js +28 -2
  204. package/linter/linter-fix.d.ts +16 -0
  205. package/linter/linter-fix.js +104 -0
  206. package/linter/linter-format.d.ts +18 -1
  207. package/linter/linter-format.js +31 -1
  208. package/linter/linter-output.js +46 -10
  209. package/linter/linter-rules.d.ts +40 -9
  210. package/linter/linter-rules.js +2 -0
  211. package/linter/rules/absolute-path.js +4 -2
  212. package/linter/rules/dataframe-access-validation.js +6 -7
  213. package/linter/rules/deprecated-functions.d.ts +107 -10
  214. package/linter/rules/deprecated-functions.js +311 -23
  215. package/linter/rules/file-path-validity.js +5 -4
  216. package/linter/rules/function-finder-util.d.ts +6 -0
  217. package/linter/rules/function-finder-util.js +21 -13
  218. package/linter/rules/naming-convention.js +1 -1
  219. package/linter/rules/network-functions.d.ts +2 -2
  220. package/linter/rules/stop-with-call-arg.js +2 -2
  221. package/linter/rules/unclosed-connection.js +2 -2
  222. package/linter/rules/undefined-symbol-util.js +6 -4
  223. package/linter/rules/undefined-symbol.js +2 -2
  224. package/linter/rules/unused-definition.js +8 -4
  225. package/linter/rules/unused-import.d.ts +60 -0
  226. package/linter/rules/unused-import.js +179 -0
  227. package/package.json +2 -2
  228. package/project/attached-packages.js +2 -1
  229. package/project/cache/flowr-analyzer-cache.d.ts +2 -5
  230. package/project/cache/flowr-analyzer-cache.js +4 -7
  231. package/project/cache/flowr-analyzer-controlflow-cache.d.ts +9 -8
  232. package/project/cache/flowr-analyzer-controlflow-cache.js +17 -34
  233. package/project/cache/flowr-cache.d.ts +9 -0
  234. package/project/cache/flowr-cache.js +19 -0
  235. package/project/context/flowr-analyzer-context.d.ts +7 -3
  236. package/project/context/flowr-analyzer-context.js +15 -9
  237. package/project/context/flowr-analyzer-dependencies-context.d.ts +24 -3
  238. package/project/context/flowr-analyzer-dependencies-context.js +9 -14
  239. package/project/context/flowr-analyzer-files-context.js +15 -17
  240. package/project/context/flowr-analyzer-meta-context.js +2 -12
  241. package/project/dependency-version-space.d.ts +1 -7
  242. package/project/dependency-version-space.js +9 -8
  243. package/project/flowr-analyzer-builder.d.ts +4 -4
  244. package/project/flowr-analyzer.d.ts +4 -6
  245. package/project/flowr-analyzer.js +4 -5
  246. package/project/plugins/file-plugins/files/flowr-namespace-file.js +22 -34
  247. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +13 -13
  248. package/project/plugins/file-plugins/files/flowr-rda-file.js +131 -286
  249. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +1 -0
  250. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +1 -0
  251. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +2 -5
  252. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +2 -8
  253. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +32 -0
  254. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +43 -1
  255. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +4 -12
  256. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +3 -16
  257. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +5 -8
  258. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +4 -10
  259. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +3 -10
  260. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +1 -13
  261. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +3 -6
  262. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -8
  263. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +2 -5
  264. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +2 -8
  265. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +2 -5
  266. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +2 -8
  267. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +3 -4
  268. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +3 -6
  269. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +4 -12
  270. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +3 -16
  271. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +4 -12
  272. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +3 -16
  273. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +4 -12
  274. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -16
  275. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +2 -5
  276. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +2 -8
  277. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.d.ts +2 -6
  278. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.js +1 -10
  279. package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.d.ts +2 -5
  280. package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.js +2 -8
  281. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-library-plugin.js +2 -1
  282. package/project/sigdb/build.d.ts +2 -2
  283. package/project/sigdb/decode.d.ts +0 -5
  284. package/project/sigdb/decode.js +0 -8
  285. package/project/sigdb/index-format.d.ts +4 -4
  286. package/project/sigdb/manifest.d.ts +2 -2
  287. package/project/sigdb/reader.d.ts +54 -13
  288. package/project/sigdb/reader.js +4 -3
  289. package/project/sigdb/schema.d.ts +3 -1
  290. package/project/sigdb/signature-db.d.ts +69 -0
  291. package/project/sigdb/signature-db.js +54 -0
  292. package/project/sigdb/signature-match.d.ts +10 -5
  293. package/project/sigdb/signature-match.js +13 -8
  294. package/queries/catalog/absint-query/absint-query-executor.js +1 -2
  295. package/queries/catalog/call-context-query/call-context-query-executor.js +2 -4
  296. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
  297. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +33 -6
  298. package/queries/catalog/control-flow-query/control-flow-query-executor.js +1 -2
  299. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  300. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +8 -7
  301. package/queries/catalog/dependencies-query/dependencies-query-format.js +22 -35
  302. package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +13 -1
  303. package/queries/catalog/dependencies-query/function-info/library-functions.js +26 -22
  304. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +9 -0
  305. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +19 -0
  306. package/queries/catalog/dependencies-query/implicit-echo.d.ts +13 -0
  307. package/queries/catalog/dependencies-query/implicit-echo.js +133 -0
  308. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
  309. package/queries/catalog/happens-before-query/happens-before-query-executor.js +1 -2
  310. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
  311. package/queries/catalog/signature-query/signature-query-executor.js +4 -3
  312. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
  313. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  314. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  315. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  316. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
  317. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +4 -1
  318. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +5 -2
  319. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  320. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
  321. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  322. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
  323. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  324. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
  325. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  326. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
  327. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  328. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
  329. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +6 -4
  330. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +6 -4
  331. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  332. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
  333. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  334. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
  335. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  336. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
  337. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  338. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
  339. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  340. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
  341. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +6 -0
  342. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +13 -0
  343. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +8 -0
  344. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +8 -0
  345. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  346. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
  347. package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +1 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +1 -0
  349. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  350. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  352. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +1 -0
  353. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  354. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
  355. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  356. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
  357. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  358. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
  359. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
  360. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -1
  361. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +0 -5
  362. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
  363. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +3 -2
  364. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then-else.js +2 -1
  365. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +2 -1
  366. package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
  367. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
  368. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.d.ts +2 -2
  369. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +6 -3
  370. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +2 -1
  371. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +2 -1
  372. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +5 -3
  373. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +2 -1
  374. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -1
  375. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
  376. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +5 -3
  377. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -1
  378. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.d.ts +1 -1
  379. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -1
  380. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +3 -1
  381. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +1 -1
  382. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +2 -1
  383. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +5 -3
  384. package/reconstruct/inline/source-inline-map.js +3 -3
  385. package/reconstruct/reconstruct.js +6 -4
  386. package/search/flowr-search-builder.d.ts +8 -8
  387. package/search/flowr-search-builder.js +4 -4
  388. package/search/flowr-search-filters.d.ts +2 -2
  389. package/search/flowr-search-filters.js +3 -2
  390. package/search/search-executor/search-enrichers.d.ts +6 -0
  391. package/search/search-executor/search-enrichers.js +44 -5
  392. package/slicing/criterion/filters/all-variables.js +2 -1
  393. package/slicing/criterion/parse.js +8 -6
  394. package/slicing/static/slice-call.js +2 -2
  395. package/util/arg-matching.d.ts +3 -0
  396. package/util/arg-matching.js +12 -1
  397. package/util/collections/arrays.d.ts +0 -4
  398. package/util/collections/arrays.js +4 -26
  399. package/util/diff-graph.d.ts +1 -1
  400. package/util/diff-graph.js +17 -3
  401. package/util/diff.d.ts +6 -0
  402. package/util/mermaid/ast.d.ts +1 -1
  403. package/util/mermaid/ast.js +5 -4
  404. package/util/mermaid/cfg.js +130 -24
  405. package/util/mermaid/dfg.js +31 -10
  406. package/util/mermaid/mermaid.js +2 -0
  407. package/util/objects.d.ts +24 -4
  408. package/util/objects.js +12 -0
  409. package/util/prefix.d.ts +1 -1
  410. package/util/text/playground-link.d.ts +131 -0
  411. package/util/text/playground-link.js +214 -0
  412. package/util/text/strings.js +7 -3
  413. package/util/version.js +1 -1
  414. package/control-flow/cfg-builder.d.ts +0 -30
  415. package/control-flow/cfg-builder.js +0 -79
  416. package/control-flow/extract-cfg.d.ts +0 -36
  417. package/control-flow/extract-cfg.js +0 -693
  418. package/project/cfg-kind.d.ts +0 -21
  419. package/project/cfg-kind.js +0 -26
@@ -1,34 +1,159 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DEPRECATED_FUNCTIONS = void 0;
4
- const vertex_1 = require("../../dataflow/graph/vertex");
5
- const df_helper_1 = require("../../dataflow/graph/df-helper");
3
+ exports.DEPRECATED_FUNCTIONS = exports.DeprecationState = void 0;
6
4
  const identifier_1 = require("../../dataflow/environments/identifier");
7
- const flowr_search_builder_1 = require("../../search/flowr-search-builder");
5
+ const graph_1 = require("../../dataflow/graph/graph");
6
+ const vertex_1 = require("../../dataflow/graph/vertex");
7
+ const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
8
+ const arrays_1 = require("../../util/collections/arrays");
8
9
  const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
10
+ const assert_1 = require("../../util/assert");
9
11
  const range_1 = require("../../util/range");
10
12
  const linter_format_1 = require("../linter-format");
11
13
  const linter_tags_1 = require("../linter-tags");
14
+ const r_version_1 = require("../../util/r-version");
15
+ const flowr_search_builder_1 = require("../../search/flowr-search-builder");
16
+ const df_helper_1 = require("../../dataflow/graph/df-helper");
12
17
  const function_finder_util_1 = require("./function-finder-util");
18
+ const logic_1 = require("../../util/logic");
19
+ const default_builtin_config_1 = require("../../dataflow/environments/default-builtin-config");
20
+ const built_in_props_1 = require("../../dataflow/environments/built-in-props");
21
+ const dependencies_query_format_1 = require("../../queries/catalog/dependencies-query/dependencies-query-format");
22
+ var DeprecationState;
23
+ (function (DeprecationState) {
24
+ /** A better alternative is available, but the function is kept (softer alternative to deprecated) {@link https://lifecycle.r-lib.org/articles/stages.html#superseded} */
25
+ DeprecationState["Superseded"] = "superseded";
26
+ /** A better alternative is available, and the function is marked for removal {@link https://lifecycle.r-lib.org/articles/stages.html#deprecated} */
27
+ DeprecationState["Deprecated"] = "deprecated";
28
+ /** No longer works and is removed and replaced by another function {@link https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/Defunct} */
29
+ DeprecationState["Defunct"] = "defunct";
30
+ })(DeprecationState || (exports.DeprecationState = DeprecationState = {}));
31
+ /**
32
+ * `size` names the stroke width of every line-based geom until ggplot2 4.0.0 renamed it: it gained
33
+ * `linewidth` beside it in 3.4.0, and 4.0.0 drops `size`.
34
+ */
35
+ const GgplotLinewidth = {
36
+ whenArgs: [{ argName: 'size', state: DeprecationState.Deprecated, replacedBy: 'linewidth', sinceVersion: r_version_1.RRange.parse('>= 3.4.0') }]
37
+ };
38
+ const ConditionallyDeprecated = {
39
+ /* https://tidyverse.org/blog/2025/09/ggplot2-4-0-0/#violin--quantiles */
40
+ 'ggplot2::geom_violin': { whenArgs: [{ argName: 'draw_quantiles', state: DeprecationState.Deprecated, replacedBy: 'quantile.linetype', sinceVersion: r_version_1.RRange.parse('>= 4.0.0') }] },
41
+ 'ggplot2::element_line': GgplotLinewidth,
42
+ 'ggplot2::element_rect': GgplotLinewidth
43
+ };
44
+ /** The entries by bare name, as a call names its package only when written `pkg::fn`. */
45
+ function indexConditionals(conditionally) {
46
+ const index = new Map();
47
+ for (const [key, info] of Object.entries(conditionally)) {
48
+ const id = identifier_1.Identifier.parse(key);
49
+ const name = identifier_1.Identifier.getName(id);
50
+ const known = index.get(name);
51
+ const entry = { info, pkg: identifier_1.Identifier.getNamespace(id) };
52
+ if (known === undefined) {
53
+ index.set(name, [entry]);
54
+ }
55
+ else {
56
+ known.push(entry);
57
+ }
58
+ }
59
+ return index;
60
+ }
61
+ /** The entry for `target`: its own package's, else a bare one; a call naming no package takes the first. */
62
+ function conditionalFor(index, target) {
63
+ const found = index.get(identifier_1.Identifier.getName(target));
64
+ if (found === undefined) {
65
+ return undefined;
66
+ }
67
+ const namespace = identifier_1.Identifier.getNamespace(target);
68
+ return namespace === undefined ? found[0] : found.find(e => e.pkg === namespace) ?? found.find(e => e.pkg === undefined);
69
+ }
70
+ /** The packages each `always` name belongs to; `undefined` for an entry claiming none. */
71
+ function indexAlways(always) {
72
+ const index = new Map();
73
+ for (const entry of always) {
74
+ const name = identifier_1.Identifier.getName(entry);
75
+ const known = index.get(name);
76
+ const namespace = identifier_1.Identifier.getNamespace(entry);
77
+ if (known === undefined) {
78
+ index.set(name, [namespace]);
79
+ }
80
+ else if (!known.includes(namespace)) {
81
+ known.push(namespace);
82
+ }
83
+ }
84
+ return index;
85
+ }
86
+ /** The packages the code attaches; `undefined` when one of them cannot be named, so nothing is ruled out. */
87
+ async function attachedPackages(analyzer) {
88
+ const attached = new Set();
89
+ for (const lib of (await analyzer.query([{ type: 'dependencies', enabledCategories: ['library'] }]))['dependencies'].library) {
90
+ if (lib.value === undefined || lib.value === dependencies_query_format_1.Unknown) {
91
+ return undefined;
92
+ }
93
+ attached.add(lib.value);
94
+ }
95
+ return attached;
96
+ }
97
+ /** A call naming its package, or whose package is attached, is that function; any other is a guess. */
98
+ function certaintyOf(target, owners, attached) {
99
+ const namespace = identifier_1.Identifier.getNamespace(target);
100
+ const sure = owners.some(owner => owner === undefined || owner === namespace || attached === undefined || attached.has(owner));
101
+ return sure ? linter_format_1.LintingResultCertainty.Certain : linter_format_1.LintingResultCertainty.Uncertain;
102
+ }
103
+ function functionListFromBuiltinConfig() {
104
+ return default_builtin_config_1.DefaultBuiltinConfig.filter(def => def.type === 'function'
105
+ && def.config?.props !== undefined
106
+ && (def.config.props & built_in_props_1.CallProp.Deprecated) !== 0)
107
+ .flatMap(def => def.names);
108
+ }
13
109
  exports.DEPRECATED_FUNCTIONS = {
14
110
  // unlike functionFinderUtil.createSearch(config.fns), this does not pre-filter to the hardcoded list: the
15
111
  // sigdb-driven pass below needs every resolved call, so the `fns` filtering happens in processSearchResult instead
16
112
  createSearch: (_config) => flowr_search_builder_1.Q.all().filter(vertex_1.VertexType.FunctionCall).with(search_enrichers_1.Enrichment.CallTargets, {
17
113
  onlyBuiltin: true,
18
- qualifyNames: false // we don't use qualified names for this rule yet
114
+ qualifyNames: true
19
115
  }),
20
116
  processSearchResult: async (elements, config, data) => {
21
- const matchesConfiguredFns = identifier_1.Identifier.regex(...config.fns);
22
- const hardcoded = await function_finder_util_1.functionFinderUtil.processSearchResult(elements, config, data, es => es.filter(e => (0, search_enrichers_1.enrichmentContent)(e, search_enrichers_1.Enrichment.CallTargets)?.targets
23
- .some(t => typeof t === 'string' && matchesConfiguredFns.test(t))));
117
+ const always = indexAlways(config.always);
118
+ const conditionals = indexConditionals(config.conditionally);
119
+ const graph = (await data.dataflow()).graph;
120
+ const idMap = (await data.normalize()).idMap;
121
+ // 1. Collect all function call targets from detected function calls
122
+ const detectedFunctions = elements.getElements().flatMap(e => {
123
+ return (0, search_enrichers_1.enrichmentContent)(e, search_enrichers_1.Enrichment.CallTargets).targets.map(target => {
124
+ const sourceLocation = range_1.SourceLocation.fromNode(e.node);
125
+ if (sourceLocation !== undefined) {
126
+ return {
127
+ node: e.node, target: identifier_1.Identifier.parse(target), sourceLocation
128
+ };
129
+ }
130
+ });
131
+ }).filter(p => (0, assert_1.isNotUndefined)(p));
132
+ // 2. Uses hardcoded information about deprecated arguments and deprecated functions
133
+ const matched = detectedFunctions.map(candidate => ({
134
+ candidate,
135
+ conditional: conditionalFor(conditionals, candidate.target),
136
+ owners: always.get(identifier_1.Identifier.getName(candidate.target))
137
+ })).filter(m => m.conditional !== undefined || m.owners !== undefined);
138
+ /* only asked once something matched, so a clean file queries nothing */
139
+ const attached = matched.length === 0 ? undefined : await attachedPackages(data);
140
+ const packageVersions = await inferPackageVersions(data, matched.map(m => m.conditional));
141
+ const results = matched.map(({ candidate, conditional, owners }) => {
142
+ if (conditional !== undefined) {
143
+ return deprecateFunctionConditionally(candidate, graph, idMap, data, conditional, packageVersions, attached);
144
+ }
145
+ else {
146
+ return deprecateFunctionAlways(candidate, owners, attached);
147
+ }
148
+ }).flat();
149
+ // 3. If available, use sigdb to flag deprecated functions
24
150
  const deps = data.inspectContext().deps;
25
151
  if (deps.signatureSources().length === 0) {
26
- return hardcoded;
152
+ return { results, '.meta': { builtin: results.length, sigdb: 0 } };
27
153
  }
28
154
  // sigdb-driven detection: flag any resolved call whose signature-database entry marks it deprecated,
29
155
  // even when it is not part of the hardcoded `fns` list above
30
- const graph = (await data.dataflow()).graph;
31
- const alreadyFlagged = new Set(hardcoded.results.map(r => r.involvedId));
156
+ const alreadyFlagged = new Set(results.map(r => r.involvedId));
32
157
  const deprecatedByName = new Map();
33
158
  const sigdbFlagged = [];
34
159
  for (const element of elements.getElements()) {
@@ -43,7 +168,7 @@ exports.DEPRECATED_FUNCTIONS = {
43
168
  const name = identifier_1.Identifier.toString(qualified);
44
169
  let deprecated = deprecatedByName.get(name);
45
170
  if (deprecated === undefined) {
46
- deprecated = deps.signatureOf(qualified)?.props.includes('deprecated') === true;
171
+ deprecated = deps.signatures().functionOf(qualified)?.props.includes('deprecated') === true;
47
172
  deprecatedByName.set(name, deprecated);
48
173
  }
49
174
  if (!deprecated) {
@@ -55,31 +180,194 @@ exports.DEPRECATED_FUNCTIONS = {
55
180
  }
56
181
  alreadyFlagged.add(id);
57
182
  sigdbFlagged.push({
183
+ type: 'deprecated-function',
58
184
  certainty: linter_format_1.LintingResultCertainty.Certain,
59
185
  involvedId: id,
60
- function: name,
186
+ function: qualified,
61
187
  loc
62
188
  });
63
189
  }
64
190
  return {
65
- results: [...hardcoded.results, ...sigdbFlagged],
66
- '.meta': {
67
- totalCalls: hardcoded['.meta'].totalCalls + sigdbFlagged.length,
68
- totalFunctionDefinitions: hardcoded['.meta'].totalFunctionDefinitions + sigdbFlagged.length
69
- }
191
+ results: results.concat(sigdbFlagged),
192
+ '.meta': { builtin: results.length, sigdb: sigdbFlagged.length }
70
193
  };
71
194
  },
72
- prettyPrint: function_finder_util_1.functionFinderUtil.prettyPrint('deprecated'),
195
+ prettyPrint: {
196
+ [linter_format_1.LintingPrettyPrintContext.Query]: (result) => `${result.type === 'deprecated-argument' ? `Argument \`${result.arg}\` of ` : ''}function \`${identifier_1.Identifier.toString(result.function)}\` at ${range_1.SourceLocation.format(result.loc)}`,
197
+ [linter_format_1.LintingPrettyPrintContext.Full]: (result) => {
198
+ const str = [];
199
+ if (result.type === 'deprecated-argument') {
200
+ const argStr = typeof result.arg === 'number' ? `at position \`${result.arg}\`` : result.arg;
201
+ str.push(`Argument \`${argStr}\` of`);
202
+ }
203
+ str.push(`Function \`${identifier_1.Identifier.toString(result.function)}\` is ${result.state ?? 'deprecated'}`);
204
+ if (result.sinceVersion) {
205
+ str.push(`since version ${result.sinceVersion.format()}`);
206
+ }
207
+ if (result.replacedBy) {
208
+ str.push(`and is replaced by \`${result.replacedBy}\``);
209
+ }
210
+ return str.join(' ');
211
+ }
212
+ },
73
213
  info: {
74
214
  name: 'Deprecated Functions',
75
- tags: [linter_tags_1.LintingRuleTag.Deprecated, linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Usability, linter_tags_1.LintingRuleTag.Reproducibility],
76
- // the hardcoded `fns` list ensures every reported hit is real, but the list is pre-crawled and hence
215
+ tags: [linter_tags_1.LintingRuleTag.Deprecated, linter_tags_1.LintingRuleTag.Smell, linter_tags_1.LintingRuleTag.Usability, linter_tags_1.LintingRuleTag.Reproducibility, linter_tags_1.LintingRuleTag.QuickFix],
216
+ // the hardcoded `always` and `conditionally` list ensures every reported hit is real, but the list is pre-crawled and hence
77
217
  // incomplete; the signature-database pass above adds recall for whichever packages are resolved
78
218
  certainty: linter_format_1.LintingRuleCertainty.BestEffort,
79
- description: 'Marks deprecated functions that should not be used anymore.',
219
+ description: 'Marks deprecated functions and deprecated arguments of still-current functions, offering the replacement as a quick fix where one is known. A call to a bare name whose package the code never attaches is reported as uncertain, as any function of that name would answer to it.',
80
220
  defaultConfig: {
81
- fns: ['all_equal', 'arrange_all', 'distinct_all', 'filter_all', 'group_by_all', 'summarise_all', 'mutate_all', 'select_all', 'vars', 'all_vars', 'id', 'failwith', 'select_vars', 'rename_vars', 'select_var', 'current_vars', 'bench_tbls', 'compare_tbls', 'compare_tbls2', 'eval_tbls', 'eval_tbls2', 'location', 'changes', 'combine', 'do', 'funs', 'add_count_', 'add_tally_', 'arrange_', 'count_', 'distinct_', 'do_', 'filter_', 'funs_', 'group_by_', 'group_indices_', 'mutate_', 'tally_', 'transmute_', 'rename_', 'rename_vars_', 'select_', 'select_vars_', 'slice_', 'summarise_', 'summarize_', 'summarise_each', 'src_local', 'tbl_df', 'add_rownames', 'group_nest', 'group_split', 'with_groups', 'nest_by', 'progress_estimated', 'recode', 'sample_n', 'top_n', 'transmute', 'fct_explicit_na', 'aes_', 'aes_auto', 'annotation_logticks', 'is.Coord', 'coord_flip', 'coord_map', 'is.facet', 'fortify', 'is.ggproto', 'guide_train', 'is.ggplot', 'qplot', 'is.theme', 'gg_dep', 'liply', 'isplit2', 'list_along', 'cross', 'invoke', 'at_depth', 'prepend', 'rerun', 'splice', '`%@%`', 'rbernoulli', 'rdunif', 'when', 'update_list', 'map_raw', 'accumulate', 'reduce_right', 'flatten', 'map_dfr', 'as_vector', 'transpose', 'melt_delim', 'melt_fwf', 'melt_table', 'read_table2', 'str_interp', 'as_tibble', 'data_frame', 'tibble_', 'data_frame_', 'lst_', 'as_data_frame', 'as.tibble', 'frame_data', 'trunc_mat', 'is.tibble', 'tidy_names', 'set_tidy_names', 'repair_names', 'extract_numeric', 'complete_', 'drop_na_', 'expand_', 'crossing_', 'nesting_', 'extract_', 'fill_', 'gather_', 'nest_', 'separate_rows_', 'separate_', 'spread_', 'unite_', 'unnest_', 'extract', 'gather', 'nest_legacy', 'separate_rows', 'separate', 'spread']
221
+ always: functionListFromBuiltinConfig(),
222
+ conditionally: ConditionallyDeprecated
82
223
  }
83
224
  }
84
225
  };
226
+ /** The version of each package a matched entry constrains, asked for only when one does. */
227
+ async function inferPackageVersions(analyzer, matched) {
228
+ const packages = matched.filter(assert_1.isNotUndefined)
229
+ .filter(({ info }) => info.sinceVersion !== undefined || info.whenArgs?.some(arg => arg.sinceVersion) === true)
230
+ .map(({ pkg }) => pkg)
231
+ .filter(assert_1.isNotUndefined);
232
+ if (packages.length === 0) {
233
+ return new Map();
234
+ }
235
+ const queryResult = await analyzer.query([{
236
+ type: 'guess-dep-versions',
237
+ packages: (0, arrays_1.uniqueArray)(packages)
238
+ }]);
239
+ const versions = queryResult['guess-dep-versions'].dependencies
240
+ .map(d => [d.package, r_version_1.RRange.parse(d.range)])
241
+ .filter(([_, version]) => (0, assert_1.isNotUndefined)(version));
242
+ return new Map(versions);
243
+ }
244
+ /**
245
+ * The node of the deprecated argument, `undefined` when the call does not supply it. Matches as R does: a name
246
+ * binds wherever it stands, then the unnamed arguments fill the rest, so `f(other = 1, x)` supplies `x` at 0.
247
+ */
248
+ function isDeprecatedArgumentPresent(vertex, info, idMap) {
249
+ const named = info.argName === undefined ? undefined : vertex.args.find(arg => graph_1.FunctionArgument.hasName(arg, info.argName));
250
+ const arg = named ?? (info.argIdx === undefined ? undefined : vertex.args.filter(graph_1.FunctionArgument.isPositional)[info.argIdx]);
251
+ return arg === undefined ? undefined : idMap.get(arg.nodeId);
252
+ }
253
+ function doesPackageVersionMatch(derivedVersion, info, setUncertain) {
254
+ if (info.sinceVersion === undefined) {
255
+ return true;
256
+ }
257
+ if (derivedVersion == undefined) {
258
+ setUncertain();
259
+ return true;
260
+ }
261
+ else {
262
+ return info.sinceVersion.intersects(derivedVersion);
263
+ }
264
+ }
265
+ function doesArgumentValueMatch(info, vertex, analyzer, dataflow, setUncertain) {
266
+ if (info.ifValue === undefined) {
267
+ return true;
268
+ }
269
+ const hasArg = (0, function_finder_util_1.hasArgumentValue)(info.ifValue, vertex, analyzer, dataflow, true, info.argName, info.argIdx);
270
+ if (hasArg === logic_1.Ternary.Never) {
271
+ return false;
272
+ }
273
+ else if (hasArg === logic_1.Ternary.Maybe) {
274
+ setUncertain();
275
+ }
276
+ return true;
277
+ }
278
+ /** The rename that carries a finding out, when a replacement name is known. */
279
+ function renameFix(node, replacedBy, what) {
280
+ const loc = node === undefined ? undefined : range_1.SourceLocation.fromNode(node);
281
+ if (replacedBy === undefined || loc === undefined) {
282
+ return undefined;
283
+ }
284
+ return [{ type: 'replace', description: `Replace ${what} with \`${replacedBy}\``, replacement: replacedBy, loc }];
285
+ }
286
+ /** The name to rename, `undefined` for `pkg::fn` as the replacement states no package to put back. */
287
+ function calledName(node) {
288
+ return r_function_call_1.RFunctionCall.isNamed(node) && identifier_1.Identifier.getNamespace(node.functionName.content) === undefined
289
+ ? node.functionName : undefined;
290
+ }
291
+ /**
292
+ * This function is applied to function candidates that have an entry in the {@link DeprecatedFunctionsConfig.conditionally} map.
293
+ */
294
+ function deprecateFunctionConditionally(candidate, dataflow, idMap, analyzer, entry, packageVersions, attached) {
295
+ const { info, pkg } = entry;
296
+ const results = [];
297
+ const derivedRange = pkg === undefined ? undefined : packageVersions.get(pkg);
298
+ const known = certaintyOf(candidate.target, [pkg], attached);
299
+ // Deprecated Argument: If `whenArgs` is provided, only mark deprecated arguments
300
+ if (info.whenArgs) {
301
+ const vertex = dataflow.getVertex(candidate.node.info.id);
302
+ if (vertex === undefined || !vertex_1.FunctionCallVertex.is(vertex)) {
303
+ return results;
304
+ }
305
+ for (const deprecatedArgInfo of info.whenArgs) {
306
+ const argNode = isDeprecatedArgumentPresent(vertex, deprecatedArgInfo, idMap);
307
+ if (argNode === undefined) {
308
+ continue;
309
+ }
310
+ let certainty = known;
311
+ const setUncertain = () => {
312
+ certainty = linter_format_1.LintingResultCertainty.Uncertain;
313
+ };
314
+ // If `sinceVersion` is set, check package version before marking argument as deprecated
315
+ if (!doesPackageVersionMatch(derivedRange, deprecatedArgInfo, setUncertain)) {
316
+ continue;
317
+ }
318
+ // If `ifValue` is set, check argument value before marking argument as deprecate
319
+ if (!doesArgumentValueMatch(deprecatedArgInfo, vertex, analyzer, dataflow, setUncertain)) {
320
+ continue;
321
+ }
322
+ // If all checks passed, mark as deprecated
323
+ results.push({
324
+ type: 'deprecated-argument',
325
+ certainty: certainty,
326
+ involvedId: vertex.id,
327
+ function: candidate.target,
328
+ arg: (deprecatedArgInfo.argName ?? deprecatedArgInfo.argIdx),
329
+ state: deprecatedArgInfo.state,
330
+ replacedBy: deprecatedArgInfo.replacedBy,
331
+ sinceVersion: deprecatedArgInfo.sinceVersion,
332
+ loc: range_1.SourceLocation.fromNode(argNode) ?? candidate.sourceLocation,
333
+ quickFix: deprecatedArgInfo.argName === undefined ? undefined : renameFix(argNode, deprecatedArgInfo.replacedBy, `argument \`${deprecatedArgInfo.argName}\``)
334
+ });
335
+ }
336
+ }
337
+ // Deprecated Function: If `sinceVersion` is set, check package version before marking as deprecated
338
+ if (info.sinceVersion) {
339
+ const isDeprecatedVersion = derivedRange ? info.sinceVersion.intersects(derivedRange) : undefined;
340
+ if (isDeprecatedVersion === true || isDeprecatedVersion === undefined) {
341
+ results.push({
342
+ type: 'deprecated-function',
343
+ certainty: isDeprecatedVersion === undefined ? linter_format_1.LintingResultCertainty.Uncertain : known,
344
+ involvedId: candidate.node.info.id,
345
+ loc: candidate.sourceLocation,
346
+ function: candidate.target,
347
+ state: info.state,
348
+ replacedBy: info.replacedBy,
349
+ sinceVersion: info.sinceVersion,
350
+ quickFix: renameFix(calledName(candidate.node), info.replacedBy, 'the call')
351
+ });
352
+ }
353
+ }
354
+ return results;
355
+ }
356
+ /**
357
+ * This function is applied to function candidates that have an entry in the {@link DeprecatedFunctionsConfig.always} map.
358
+ * A call naming a package the list does not have under that name is another function and is left alone.
359
+ */
360
+ function deprecateFunctionAlways(candidate, owners, attached) {
361
+ const namespace = identifier_1.Identifier.getNamespace(candidate.target);
362
+ if (namespace !== undefined && !owners.some(owner => owner === undefined || owner === namespace)) {
363
+ return [];
364
+ }
365
+ return [{
366
+ type: 'deprecated-function',
367
+ certainty: certaintyOf(candidate.target, owners, attached),
368
+ involvedId: candidate.node.info.id,
369
+ loc: candidate.sourceLocation,
370
+ function: candidate.target,
371
+ }];
372
+ }
85
373
  //# sourceMappingURL=deprecated-functions.js.map
@@ -13,7 +13,6 @@ const linter_tags_1 = require("../linter-tags");
13
13
  const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
14
14
  const resolve_working_directory_1 = require("../../dataflow/eval/resolve/resolve-working-directory");
15
15
  const config_1 = require("../../config");
16
- const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
17
16
  const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
18
17
  const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
19
18
  async function urlExists(url) {
@@ -166,7 +165,7 @@ function samePath(a, b, ignoreCapitalization) {
166
165
  /** the string-literal path argument of a call whose resolved value is `value`, for anchoring a quick fix */
167
166
  function pathArgStringNode(idMap, callId, value) {
168
167
  const call = idMap.get(callId);
169
- if (call?.type !== type_1.RType.FunctionCall) {
168
+ if (!r_function_call_1.RFunctionCall.is(call)) {
170
169
  return undefined;
171
170
  }
172
171
  for (const arg of call.arguments) {
@@ -179,12 +178,14 @@ function pathArgStringNode(idMap, callId, value) {
179
178
  /** rewrite the read path to `found`, an existing file surfaced by the lax retry */
180
179
  function buildDidYouMeanFix(idMap, callId, value, found) {
181
180
  const str = pathArgStringNode(idMap, callId, value);
182
- if (!str) {
181
+ const loc = str === undefined ? undefined : range_1.SourceLocation.fromNode(str);
182
+ if (!str || loc === undefined) {
183
+ /* a fix that names no place cannot be carried out, so none is offered */
183
184
  return undefined;
184
185
  }
185
186
  return [{
186
187
  type: 'replace',
187
- loc: range_1.SourceLocation.fromNode(str) ?? range_1.SourceLocation.invalid(),
188
+ loc,
188
189
  description: `Replace with existing path \`${found}\``,
189
190
  replacement: str.content.quotes + found + str.content.quotes
190
191
  }];
@@ -2,11 +2,13 @@ import { type LintingResult, LintingResultCertainty } from '../linter-format';
2
2
  import type { FlowrSearchElement, FlowrSearchElements } from '../../search/flowr-search';
3
3
  import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
4
4
  import type { MergeableRecord } from '../../util/objects';
5
+ import type { DataflowGraphVertexFunctionCall } from '../../dataflow/graph/vertex';
5
6
  import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info';
6
7
  import { Identifier } from '../../dataflow/environments/identifier';
7
8
  import { Ternary } from '../../util/logic';
8
9
  import type { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer';
9
10
  import type { AsyncOrSync } from 'ts-essentials';
11
+ import type { DataflowGraph } from '../../dataflow/graph/graph';
10
12
  export interface FunctionsResult extends LintingResult {
11
13
  function: string;
12
14
  }
@@ -37,3 +39,7 @@ export declare const functionFinderUtil: {
37
39
  };
38
40
  requireArgumentValue(element: FlowrSearchElement<ParentInformation>, pool: ReadonlyMap<string, FunctionInfo>, analyzer: ReadonlyFlowrAnalysisProvider, requireValue: RegExp | string | undefined): Promise<Ternary>;
39
41
  };
42
+ /**
43
+ * Test if a function call has an argument with a specific value
44
+ */
45
+ export declare function hasArgumentValue(test: RegExp | string, fnVertex: DataflowGraphVertexFunctionCall, analyzer: ReadonlyFlowrAnalysisProvider, dataflow: DataflowGraph, resolveValue: boolean | 'library' | undefined, argName?: string, argIdx?: number | 'unnamed'): Ternary;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.functionFinderUtil = void 0;
4
+ exports.hasArgumentValue = hasArgumentValue;
4
5
  const flowr_search_builder_1 = require("../../search/flowr-search-builder");
5
6
  const flowr_search_filters_1 = require("../../search/flowr-search-filters");
6
7
  const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
@@ -68,7 +69,7 @@ exports.functionFinderUtil = {
68
69
  const dataflow = await analyzer.dataflow();
69
70
  const identifier = df_helper_1.Dataflow.qualify(element.node.info.id, dataflow.graph, true) ?? (element.node.lexeme !== undefined ? identifier_1.Identifier.parse(element.node.lexeme) : undefined);
70
71
  /* if we have no additional info, we assume they always access the network */
71
- if (identifier === undefined) {
72
+ if (identifier === undefined || requireValue === undefined) {
72
73
  return logic_1.Ternary.Always;
73
74
  }
74
75
  // we allow our function pool to contain non-namespaced functions
@@ -78,20 +79,27 @@ exports.functionFinderUtil = {
78
79
  }
79
80
  const vert = dataflow.graph.getVertex(element.node.info.id);
80
81
  if (vertex_1.FunctionCallVertex.is(vert)) {
81
- const args = (0, resolve_argument_1.getArgumentStringValue)(analyzer.flowrConfig.solver.variables, dataflow.graph, vert, info.argIdx, info.argName, info.resolveValue, analyzer.inspectContext());
82
- // we obtain all values, at least one of them has to trigger for the request
83
- const argValues = args ? args.values().flatMap(s => Array.from(s)).filter(assert_1.isNotUndefined).toArray() : [];
84
- if (argValues.length === 0) {
85
- return logic_1.Ternary.Maybe;
86
- }
87
- else if (argValues.some(v => requireValue instanceof RegExp ? requireValue.test(v) : v === requireValue)) {
88
- return logic_1.Ternary.Always;
89
- }
90
- else if (argValues.includes(dependencies_query_format_1.Unknown)) {
91
- return logic_1.Ternary.Maybe;
92
- }
82
+ return hasArgumentValue(requireValue, vert, analyzer, dataflow.graph, info.resolveValue, info.argName, info.argIdx);
93
83
  }
94
84
  return logic_1.Ternary.Never;
95
85
  }
96
86
  };
87
+ /**
88
+ * Test if a function call has an argument with a specific value
89
+ */
90
+ function hasArgumentValue(test, fnVertex, analyzer, dataflow, resolveValue, argName, argIdx) {
91
+ const args = (0, resolve_argument_1.getArgumentStringValue)(analyzer.flowrConfig.solver.variables, dataflow, fnVertex, argIdx, argName, resolveValue, analyzer.inspectContext());
92
+ // we obtain all values, at least one of them has to trigger for the request
93
+ const argValues = args ? args.values().flatMap(s => Array.from(s)).filter(assert_1.isNotUndefined).toArray() : [];
94
+ if (argValues.length === 0) {
95
+ return logic_1.Ternary.Maybe;
96
+ }
97
+ else if (argValues.some(v => test instanceof RegExp ? test.test(v) : v === test)) {
98
+ return logic_1.Ternary.Always;
99
+ }
100
+ else if (argValues.includes(dependencies_query_format_1.Unknown)) {
101
+ return logic_1.Ternary.Maybe;
102
+ }
103
+ return logic_1.Ternary.Never;
104
+ }
97
105
  //# sourceMappingURL=function-finder-util.js.map
@@ -85,7 +85,7 @@ function getMostUsedCasing(symbols) {
85
85
  const o = map.get(symbol.detectedCasing) ?? 0;
86
86
  map.set(symbol.detectedCasing, o + 1);
87
87
  }
88
- // Return element with most occurances
88
+ // Return element with most occurrences
89
89
  return [...map].reduce((p, c) => p[1] > c[1] ? p : c)[0];
90
90
  }
91
91
  /**
@@ -1,11 +1,11 @@
1
1
  import { LintingRuleCertainty } from '../linter-format';
2
- import { type FunctionsMetadata, type FunctionsResult } from './function-finder-util';
2
+ import type { FunctionsMetadata, FunctionsResult } from './function-finder-util';
3
3
  import { LintingRuleTag } from '../linter-tags';
4
- import type { MergeableRecord } from '../../util/objects';
5
4
  import type { FlowrSearchElement } from '../../search/flowr-search';
6
5
  import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
7
6
  import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info';
8
7
  import { Identifier } from '../../dataflow/environments/identifier';
8
+ import type { MergeableRecord } from '../../util/objects';
9
9
  export interface NetworkFunctionsConfig extends MergeableRecord {
10
10
  /**
11
11
  * The list of function names or more detailed {@link NetworkFunction} information that should be marked in the given context if their arguments match.
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.STOP_WITH_CALL_ARG = void 0;
4
+ const match_args_1 = require("../../dataflow/graph/match-args");
4
5
  const linter_format_1 = require("../linter-format");
5
6
  const range_1 = require("../../util/range");
6
7
  const flowr_search_builder_1 = require("../../search/flowr-search-builder");
7
8
  const linter_tags_1 = require("../linter-tags");
8
9
  const assert_1 = require("../../util/assert");
9
10
  const vertex_1 = require("../../dataflow/graph/vertex");
10
- const linker_1 = require("../../dataflow/internal/linker");
11
11
  const general_1 = require("../../dataflow/eval/values/general");
12
12
  const resolve_helper_1 = require("../../dataflow/environments/resolve-helper");
13
13
  const df_helper_1 = require("../../dataflow/graph/df-helper");
@@ -36,7 +36,7 @@ exports.STOP_WITH_CALL_ARG = {
36
36
  'call.': 'call.',
37
37
  'domain': 'domain'
38
38
  };
39
- const mapping = (0, linker_1.pMatch)(fCall.args, stopParamMap);
39
+ const mapping = match_args_1.MatchArgs.toSpec(fCall.args, stopParamMap);
40
40
  const mappedToStop = mapping.get('call.') ?? [];
41
41
  for (const argId of mappedToStop) {
42
42
  const res = resolve_helper_1.Resolve.toValue(argId, { graph: dataflow.graph, environment: fCall.environment, ctx: data.inspectContext() });
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UNCLOSED_CONNECTION = void 0;
4
4
  const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
5
- const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
6
5
  const graph_1 = require("../../dataflow/graph/graph");
7
6
  const edge_1 = require("../../dataflow/graph/edge");
8
7
  const vertex_1 = require("../../dataflow/graph/vertex");
@@ -15,6 +14,7 @@ const range_1 = require("../../util/range");
15
14
  const assert_1 = require("../../util/assert");
16
15
  const linter_format_1 = require("../linter-format");
17
16
  const linter_tags_1 = require("../linter-tags");
17
+ const r_expression_list_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-expression-list");
18
18
  /** the edges the connection flows along, from the call opening it to the argument of the call closing it */
19
19
  const ConnectionFlow = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall | edge_1.EdgeType.Returns | edge_1.EdgeType.Argument;
20
20
  /** The arguments holding the handle the call acts on, all of them if it does not state which. */
@@ -58,7 +58,7 @@ function enclosingStatement(idMap, id) {
58
58
  let node = idMap.get(id);
59
59
  while (node !== undefined) {
60
60
  const parent = node.info.parent === undefined ? undefined : idMap.get(node.info.parent);
61
- if (parent === undefined || parent.type === type_1.RType.ExpressionList) {
61
+ if (parent === undefined || r_expression_list_1.RExpressionList.is(parent)) {
62
62
  return node;
63
63
  }
64
64
  node = parent;
@@ -12,6 +12,8 @@ const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id"
12
12
  const vertex_1 = require("../../dataflow/graph/vertex");
13
13
  const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
14
14
  const graph_1 = require("../../dataflow/graph/graph");
15
+ const r_access_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-access");
16
+ const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
15
17
  /**
16
18
  * Path heuristic for an R package `inst/` resource (installed verbatim, not namespace source). Fallback for
17
19
  * the authoritative `FileRole.Install`, covering requests that bypass the file-role plugins.
@@ -60,10 +62,10 @@ function isInSubscript(graph, id) {
60
62
  let parentId = idMap.get(id)?.info.parent;
61
63
  for (let guard = 0; parentId !== undefined && guard < 64; guard++) {
62
64
  const parent = idMap.get(parentId);
63
- if (parent === undefined || parent.type === type_1.RType.FunctionDefinition) {
65
+ if (parent === undefined || r_function_definition_1.RFunctionDefinition.is(parent)) {
64
66
  return false;
65
67
  }
66
- if (parent.type === type_1.RType.Access && (parent.operator === '[' || parent.operator === '[[') && parent.accessed.info.id !== childId) {
68
+ if (r_access_1.RAccess.is(parent) && (parent.operator === '[' || parent.operator === '[[') && parent.accessed.info.id !== childId) {
67
69
  return true; // reached from a subscript, not the accessed object
68
70
  }
69
71
  childId = parentId;
@@ -87,7 +89,7 @@ function enclosingScope(idMap, startParent) {
87
89
  if (node === undefined) {
88
90
  break;
89
91
  }
90
- if (node.type === type_1.RType.FunctionDefinition) {
92
+ if (r_function_definition_1.RFunctionDefinition.is(node)) {
91
93
  return { scope: cur, unconditional };
92
94
  }
93
95
  if (ConditionalNodeTypes.has(node.type)) {
@@ -145,7 +147,7 @@ function isDefinedInEnclosingScope(graph, defined, useId, name) {
145
147
  if (node === undefined) {
146
148
  break;
147
149
  }
148
- if (node.type === type_1.RType.FunctionDefinition && defined.get(cur)?.has(name)) {
150
+ if (r_function_definition_1.RFunctionDefinition.is(node) && defined.get(cur)?.has(name)) {
149
151
  return true;
150
152
  }
151
153
  cur = node.info.parent;
@@ -9,12 +9,12 @@ const flowr_search_filters_1 = require("../../search/flowr-search-filters");
9
9
  const assert_1 = require("../../util/assert");
10
10
  const range_1 = require("../../util/range");
11
11
  const flowr_file_1 = require("../../project/context/flowr-file");
12
- const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
13
12
  const r_base_packages_1 = require("../../util/r-base-packages");
14
13
  const linter_format_1 = require("../linter-format");
15
14
  const linter_tags_1 = require("../linter-tags");
16
15
  const undefined_symbol_util_1 = require("./undefined-symbol-util");
17
16
  const df_helper_1 = require("../../dataflow/graph/df-helper");
17
+ const r_symbol_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
18
18
  /** calls that load a package; an unresolved one means we cannot enumerate all exports in scope */
19
19
  const LibraryLoadFunctions = new Set(['library', 'require', 'requireNamespace', 'loadNamespace', 'attachNamespace', 'load_all', 'use', 'p_load']);
20
20
  // standard packages attached by default; exports are in scope without library()
@@ -108,7 +108,7 @@ exports.UNDEFINED_SYMBOL = {
108
108
  // variable use: only plain symbols (not argument names, `...`, or empty)
109
109
  if (vertex_1.UseVertex.is(vtx) && config.checkVariables) {
110
110
  const node = element.node;
111
- if (node.type !== type_1.RType.Symbol || node.lexeme === '...' || node.lexeme === undefined) {
111
+ if (!r_symbol_1.RSymbol.is(node) || node.lexeme === '...' || node.lexeme === undefined) {
112
112
  return undefined;
113
113
  }
114
114
  meta.totalVariableUses++;