@eagleoutice/flowr 2.16.2 → 2.16.4

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 (482) hide show
  1. package/README.md +15 -15
  2. package/abstract-interpretation/data-frame/arguments.js +4 -3
  3. package/abstract-interpretation/data-frame/dataframe-semantics.js +1 -2
  4. package/abstract-interpretation/data-frame/semantics.d.ts +2 -2
  5. package/abstract-interpretation/data-frame/semantics.js +2 -6
  6. package/benchmark/slicer.js +1 -3
  7. package/benchmark/summarizer/first-phase/input.js +1 -12
  8. package/benchmark/summarizer/second-phase/process.d.ts +7 -0
  9. package/benchmark/summarizer/second-phase/process.js +15 -12
  10. package/cli/repl/commands/repl-cfg.js +18 -49
  11. package/cli/repl/commands/repl-clipboard.d.ts +2 -0
  12. package/cli/repl/commands/repl-clipboard.js +5 -0
  13. package/cli/repl/commands/repl-commands.js +2 -2
  14. package/cli/repl/commands/repl-dataflow.js +21 -55
  15. package/cli/repl/commands/repl-normalize.js +15 -28
  16. package/cli/repl/commands/repl-parse.js +2 -2
  17. package/cli/repl/commands/repl-query.js +10 -10
  18. package/cli/repl/commands/repl-signature.js +4 -4
  19. package/cli/repl/server/connection.d.ts +1 -0
  20. package/cli/repl/server/connection.js +8 -30
  21. package/cli/repl/server/messages/message-analysis.js +1 -1
  22. package/config.d.ts +6 -0
  23. package/config.js +7 -4
  24. package/control-flow/cfg-dead-code.js +5 -14
  25. package/control-flow/cfg-to-basic-blocks.js +1 -6
  26. package/control-flow/control-flow-graph.d.ts +2 -16
  27. package/control-flow/control-flow-graph.js +8 -66
  28. package/control-flow/diff-cfg.js +10 -23
  29. package/control-flow/semantic-cfg-guided-visitor.js +5 -11
  30. package/control-flow/simple-visitor.js +2 -2
  31. package/core/steps/pipeline/default-pipelines.d.ts +138 -138
  32. package/data/r-base-packages.generated.js +0 -1
  33. package/data/r-base-primitives.generated.js +0 -1
  34. package/data/r-s3-generics.generated.d.ts +5 -0
  35. package/data/r-s3-generics.generated.js +103 -0
  36. package/dataflow/cluster.js +2 -1
  37. package/dataflow/environments/append.d.ts +1 -0
  38. package/dataflow/environments/built-in-props.d.ts +10 -0
  39. package/dataflow/environments/built-in-props.js +25 -1
  40. package/dataflow/environments/built-in.js +15 -9
  41. package/dataflow/environments/clone.d.ts +1 -0
  42. package/dataflow/environments/clone.js +1 -0
  43. package/dataflow/environments/default-builtin-config.d.ts +188 -14
  44. package/dataflow/environments/default-builtin-config.js +125 -65
  45. package/dataflow/environments/define.d.ts +1 -0
  46. package/dataflow/environments/define.js +1 -0
  47. package/dataflow/environments/environment.d.ts +27 -0
  48. package/dataflow/environments/environment.js +37 -16
  49. package/dataflow/environments/frame-memory.d.ts +9 -1
  50. package/dataflow/environments/frame-memory.js +12 -1
  51. package/dataflow/environments/identifier.d.ts +0 -2
  52. package/dataflow/environments/identifier.js +5 -7
  53. package/dataflow/environments/overwrite.js +1 -0
  54. package/dataflow/environments/query-fn-props.js +4 -4
  55. package/dataflow/environments/scoping.d.ts +3 -0
  56. package/dataflow/environments/scoping.js +3 -0
  57. package/dataflow/eval/resolve/alias-tracking.js +3 -3
  58. package/dataflow/eval/resolve/resolve-argument.d.ts +7 -3
  59. package/dataflow/eval/resolve/resolve-argument.js +16 -11
  60. package/dataflow/eval/resolve/resolve-numbers.js +5 -2
  61. package/dataflow/eval/resolve/resolve-strings.d.ts +1 -1
  62. package/dataflow/eval/resolve/resolve-working-directory.js +2 -2
  63. package/dataflow/eval/resolve/resolve.js +3 -8
  64. package/dataflow/eval/values/intervals/interval-constants.js +1 -6
  65. package/dataflow/eval/values/r-value.js +1 -6
  66. package/dataflow/extractor.js +17 -17
  67. package/dataflow/fn/argument-roles.js +15 -15
  68. package/dataflow/fn/class-declaration.js +7 -7
  69. package/dataflow/fn/frame-reflection.d.ts +1 -23
  70. package/dataflow/fn/frame-reflection.js +8 -95
  71. package/dataflow/fn/function-props.d.ts +0 -3
  72. package/dataflow/fn/function-props.js +9 -11
  73. package/dataflow/fn/function-semantics.d.ts +1 -0
  74. package/dataflow/fn/strict-function.js +15 -14
  75. package/dataflow/graph/call-graph.d.ts +8 -0
  76. package/dataflow/graph/call-graph.js +40 -25
  77. package/dataflow/graph/dataflowgraph-builder.d.ts +0 -60
  78. package/dataflow/graph/dataflowgraph-builder.js +15 -135
  79. package/dataflow/graph/df-helper.d.ts +56 -4
  80. package/dataflow/graph/df-helper.js +116 -1
  81. package/dataflow/graph/diff-dataflow-graph.js +13 -15
  82. package/dataflow/graph/graph-helper.d.ts +20 -0
  83. package/dataflow/graph/graph-helper.js +18 -0
  84. package/dataflow/graph/graph.js +3 -8
  85. package/dataflow/graph/match-args.d.ts +1 -1
  86. package/dataflow/graph/match-args.js +3 -3
  87. package/dataflow/internal/linker.d.ts +4 -10
  88. package/dataflow/internal/linker.js +21 -29
  89. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -8
  90. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +5 -2
  91. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +39 -22
  92. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -21
  93. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -7
  94. package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +6 -11
  95. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
  96. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -13
  97. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +27 -13
  98. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -8
  99. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +33 -35
  100. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -5
  101. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +6 -7
  102. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +12 -5
  103. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +3 -4
  104. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +7 -8
  105. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -6
  106. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +3 -4
  107. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -3
  108. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -7
  109. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +6 -5
  110. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -2
  111. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -6
  112. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +4 -4
  113. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +7 -7
  114. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +1 -2
  115. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -3
  116. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  117. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +5 -7
  118. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +4 -5
  120. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +8 -9
  121. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -5
  122. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +3 -3
  123. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +36 -38
  124. package/dataflow/internal/process/functions/call/common.d.ts +3 -1
  125. package/dataflow/internal/process/functions/call/common.js +6 -7
  126. package/dataflow/internal/process/functions/call/deferred.js +8 -8
  127. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +11 -4
  128. package/dataflow/internal/process/functions/call/known-call-handling.js +11 -7
  129. package/dataflow/internal/process/functions/call/named-call-handling.js +4 -3
  130. package/dataflow/internal/process/functions/call/nse.js +4 -4
  131. package/dataflow/internal/process/functions/call/quoted.js +16 -14
  132. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
  133. package/dataflow/internal/process/functions/process-parameter.js +2 -2
  134. package/dataflow/internal/process/process-named-call.js +1 -1
  135. package/dataflow/origin/dfg-get-origin.js +2 -2
  136. package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -0
  137. package/dataflow/origin/dfg-get-symbol-refs.js +3 -8
  138. package/documentation/data/faq/wiki-faq-store.js +2 -2
  139. package/documentation/doc-capabilities.js +2 -1
  140. package/documentation/doc-util/doc-functions.js +2 -2
  141. package/documentation/doc-util/doc-query.d.ts +1 -1
  142. package/documentation/doc-util/doc-query.js +3 -1
  143. package/documentation/doc-util/doc-repl.js +4 -4
  144. package/documentation/doc-util/doc-timings.js +3 -2
  145. package/documentation/doc-util/doc-types.js +2 -2
  146. package/documentation/wiki-absint.js +2 -1
  147. package/documentation/wiki-cfg.js +2 -1
  148. package/documentation/wiki-create-linting-rules.js +2 -2
  149. package/documentation/wiki-dataflow-graph.js +6 -6
  150. package/documentation/wiki-interface.js +3 -2
  151. package/documentation/wiki-linter.d.ts +14 -0
  152. package/documentation/wiki-linter.js +353 -88
  153. package/documentation/wiki-mk/doc-maker.js +1 -2
  154. package/documentation/wiki-query.js +25 -0
  155. package/documentation/wiki-search.js +2 -1
  156. package/documentation/wiki-signature-database.js +0 -2
  157. package/linter/linter-executor.js +4 -0
  158. package/linter/linter-rules.d.ts +552 -35
  159. package/linter/linter-rules.js +39 -1
  160. package/linter/linter-tags.d.ts +6 -0
  161. package/linter/linter-tags.js +6 -0
  162. package/linter/rules/absolute-path.d.ts +1 -1
  163. package/linter/rules/absolute-path.js +9 -6
  164. package/linter/rules/cmd-check/bogus-return.d.ts +29 -0
  165. package/linter/rules/cmd-check/bogus-return.js +63 -0
  166. package/linter/rules/cmd-check/call-arguments.d.ts +63 -0
  167. package/linter/rules/cmd-check/call-arguments.js +216 -0
  168. package/linter/rules/cmd-check/class-string-comparison.d.ts +48 -0
  169. package/linter/rules/cmd-check/class-string-comparison.js +135 -0
  170. package/linter/rules/cmd-check/cmd-check-util.d.ts +67 -0
  171. package/linter/rules/cmd-check/cmd-check-util.js +169 -0
  172. package/linter/rules/cmd-check/compiled-code.d.ts +86 -0
  173. package/linter/rules/cmd-check/compiled-code.js +350 -0
  174. package/linter/rules/cmd-check/conformance.d.ts +51 -0
  175. package/linter/rules/cmd-check/conformance.js +166 -0
  176. package/linter/rules/cmd-check/dependency-declaration.d.ts +95 -0
  177. package/linter/rules/cmd-check/dependency-declaration.js +299 -0
  178. package/linter/rules/cmd-check/description-metadata.d.ts +63 -0
  179. package/linter/rules/cmd-check/description-metadata.js +393 -0
  180. package/linter/rules/cmd-check/documentation-mismatch.d.ts +60 -0
  181. package/linter/rules/cmd-check/documentation-mismatch.js +407 -0
  182. package/linter/rules/cmd-check/file-checks.d.ts +29 -0
  183. package/linter/rules/cmd-check/file-checks.js +34 -0
  184. package/linter/rules/cmd-check/foreign-function-calls.d.ts +54 -0
  185. package/linter/rules/cmd-check/foreign-function-calls.js +115 -0
  186. package/linter/rules/cmd-check/global-environment-modification.d.ts +61 -0
  187. package/linter/rules/cmd-check/global-environment-modification.js +237 -0
  188. package/linter/rules/cmd-check/namespace-tampering.d.ts +52 -0
  189. package/linter/rules/cmd-check/namespace-tampering.js +162 -0
  190. package/linter/rules/cmd-check/non-ascii-code.d.ts +51 -0
  191. package/linter/rules/cmd-check/non-ascii-code.js +112 -0
  192. package/linter/rules/cmd-check/package-code.d.ts +30 -0
  193. package/linter/rules/cmd-check/package-code.js +141 -0
  194. package/linter/rules/cmd-check/package-data.d.ts +51 -0
  195. package/linter/rules/cmd-check/package-data.js +181 -0
  196. package/linter/rules/cmd-check/package-files.d.ts +41 -0
  197. package/linter/rules/cmd-check/package-files.js +157 -0
  198. package/linter/rules/cmd-check/package-hooks.d.ts +57 -0
  199. package/linter/rules/cmd-check/package-hooks.js +173 -0
  200. package/linter/rules/cmd-check/package-metafiles.d.ts +49 -0
  201. package/linter/rules/cmd-check/package-metafiles.js +292 -0
  202. package/linter/rules/cmd-check/package-runtime.d.ts +67 -0
  203. package/linter/rules/cmd-check/package-runtime.js +284 -0
  204. package/linter/rules/cmd-check/package-structure.d.ts +85 -0
  205. package/linter/rules/cmd-check/package-structure.js +320 -0
  206. package/linter/rules/cmd-check/rd-files.d.ts +83 -0
  207. package/linter/rules/cmd-check/rd-files.js +621 -0
  208. package/linter/rules/cmd-check/s-three-method-consistency.d.ts +72 -0
  209. package/linter/rules/cmd-check/s-three-method-consistency.js +206 -0
  210. package/linter/rules/cmd-check/true-false-abbreviation.d.ts +45 -0
  211. package/linter/rules/cmd-check/true-false-abbreviation.js +121 -0
  212. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  213. package/linter/rules/dataframe-access-validation.js +1 -1
  214. package/linter/rules/dead-code.d.ts +4 -4
  215. package/linter/rules/dead-code.js +19 -4
  216. package/linter/rules/deprecated-functions.d.ts +1 -1
  217. package/linter/rules/deprecated-functions.js +5 -5
  218. package/linter/rules/file-path-validity.d.ts +6 -2
  219. package/linter/rules/file-path-validity.js +7 -3
  220. package/linter/rules/namespace-access.d.ts +3 -3
  221. package/linter/rules/namespace-access.js +12 -3
  222. package/linter/rules/naming-convention.d.ts +2 -2
  223. package/linter/rules/naming-convention.js +14 -15
  224. package/linter/rules/network-functions.d.ts +1 -1
  225. package/linter/rules/network-functions.js +1 -1
  226. package/linter/rules/no-leaked-credentials.d.ts +1 -1
  227. package/linter/rules/no-leaked-credentials.js +5 -5
  228. package/linter/rules/problematic-inputs.d.ts +2 -2
  229. package/linter/rules/problematic-inputs.js +4 -3
  230. package/linter/rules/roxygen-arguments.d.ts +2 -2
  231. package/linter/rules/roxygen-arguments.js +2 -2
  232. package/linter/rules/seeded-randomness.d.ts +2 -2
  233. package/linter/rules/seeded-randomness.js +7 -7
  234. package/linter/rules/software-has-license.d.ts +3 -3
  235. package/linter/rules/software-has-license.js +3 -3
  236. package/linter/rules/software-has-tests.d.ts +2 -2
  237. package/linter/rules/software-has-tests.js +2 -2
  238. package/linter/rules/stop-with-call-arg.d.ts +3 -3
  239. package/linter/rules/stop-with-call-arg.js +21 -4
  240. package/linter/rules/syntactically-valid.d.ts +1 -1
  241. package/linter/rules/syntactically-valid.js +1 -1
  242. package/linter/rules/unclosed-connection.d.ts +2 -2
  243. package/linter/rules/unclosed-connection.js +5 -5
  244. package/linter/rules/undefined-symbol-util.js +16 -32
  245. package/linter/rules/undefined-symbol.d.ts +3 -1
  246. package/linter/rules/undefined-symbol.js +34 -4
  247. package/linter/rules/unescaped-arguments.d.ts +1 -1
  248. package/linter/rules/unescaped-arguments.js +11 -10
  249. package/linter/rules/unused-definition.d.ts +1 -1
  250. package/linter/rules/unused-definition.js +14 -20
  251. package/linter/rules/unused-import.d.ts +1 -1
  252. package/linter/rules/unused-import.js +1 -1
  253. package/linter/rules/useless-loop.d.ts +1 -1
  254. package/linter/rules/useless-loop.js +1 -1
  255. package/package.json +1 -1
  256. package/project/cache/flowr-analyzer-cache.js +1 -1
  257. package/project/context/flowr-analyzer-context.js +1 -1
  258. package/project/context/flowr-analyzer-environment-context.d.ts +2 -2
  259. package/project/context/flowr-analyzer-environment-context.js +2 -1
  260. package/project/context/flowr-analyzer-files-context.d.ts +6 -0
  261. package/project/context/flowr-analyzer-files-context.js +15 -11
  262. package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +0 -2
  263. package/project/context/flowr-analyzer-incremental-analysis-context.js +0 -4
  264. package/project/context/flowr-file.d.ts +4 -0
  265. package/project/context/flowr-file.js +4 -0
  266. package/project/flowr-analyzer-builder.js +1 -1
  267. package/project/plugins/file-plugins/files/flowr-description-file.js +2 -2
  268. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -0
  269. package/project/plugins/file-plugins/files/flowr-jupyter-file.js +4 -0
  270. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +2 -0
  271. package/project/plugins/file-plugins/files/flowr-manifest-files.js +11 -14
  272. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +3 -0
  273. package/project/plugins/file-plugins/files/flowr-namespace-file.js +25 -15
  274. package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +44 -0
  275. package/project/plugins/file-plugins/files/flowr-rd-file.js +130 -61
  276. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +0 -1
  277. package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -16
  278. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -0
  279. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +4 -0
  280. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +2 -0
  281. package/project/plugins/file-plugins/files/flowr-sweave-file.js +4 -0
  282. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
  283. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
  284. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +0 -1
  285. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -5
  286. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +2 -0
  287. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -0
  288. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +3 -7
  289. package/project/sigdb/build.js +16 -30
  290. package/project/sigdb/dict.d.ts +4 -6
  291. package/project/sigdb/dict.js +125 -31
  292. package/project/sigdb/reader.js +2 -18
  293. package/project/sigdb/sigdb-download.js +14 -23
  294. package/queries/base-query-format.d.ts +2 -0
  295. package/queries/base-query-format.js +10 -2
  296. package/queries/catalog/absint-query/absint-query-format.d.ts +1 -1
  297. package/queries/catalog/absint-query/absint-query-format.js +5 -7
  298. package/queries/catalog/call-context-query/call-context-query-executor.js +24 -32
  299. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
  300. package/queries/catalog/call-context-query/call-context-query-format.js +1 -3
  301. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -4
  302. package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -4
  303. package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -3
  304. package/queries/catalog/config-query/config-query-format.js +3 -3
  305. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -3
  306. package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -3
  307. package/queries/catalog/dependencies-query/data-flow.d.ts +45 -0
  308. package/queries/catalog/dependencies-query/data-flow.js +179 -0
  309. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +18 -0
  310. package/queries/catalog/dependencies-query/dependencies-query-executor.js +108 -12
  311. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +17 -1
  312. package/queries/catalog/dependencies-query/dependencies-query-format.js +14 -11
  313. package/queries/catalog/dependencies-query/function-info/derived-functions.js +2 -1
  314. package/queries/catalog/dependencies-query/function-info/function-info.d.ts +2 -0
  315. package/queries/catalog/dependencies-query/function-info/library-functions.js +13 -13
  316. package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
  317. package/queries/catalog/dependencies-query/function-info/remote-functions.js +3 -3
  318. package/queries/catalog/dependencies-query/function-info/source-functions.js +2 -2
  319. package/queries/catalog/dependencies-query/function-info/test-functions.js +8 -8
  320. package/queries/catalog/dependencies-query/function-info/transform-functions.d.ts +8 -0
  321. package/queries/catalog/dependencies-query/function-info/transform-functions.js +17 -0
  322. package/queries/catalog/dependencies-query/function-info/write-functions.js +4 -0
  323. package/queries/catalog/dependencies-query/implicit-echo.d.ts +5 -3
  324. package/queries/catalog/dependencies-query/implicit-echo.js +36 -35
  325. package/queries/catalog/dependencies-query/link-devices.d.ts +3 -2
  326. package/queries/catalog/dependencies-query/link-devices.js +9 -6
  327. package/queries/catalog/dependencies-query/plot-description.d.ts +10 -0
  328. package/queries/catalog/dependencies-query/plot-description.js +119 -0
  329. package/queries/catalog/dependencies-query/plot-objects.d.ts +13 -0
  330. package/queries/catalog/dependencies-query/plot-objects.js +61 -0
  331. package/queries/catalog/dice-query/dice-query-format.d.ts +2 -2
  332. package/queries/catalog/dice-query/dice-query-format.js +3 -40
  333. package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
  334. package/queries/catalog/does-call-query/does-call-query-format.js +2 -2
  335. package/queries/catalog/function-info-query/function-info-query-format.js +2 -2
  336. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +2 -1
  337. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
  338. package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
  339. package/queries/catalog/id-map-query/id-map-query-format.js +1 -3
  340. package/queries/catalog/input-sources-query/input-sources-query-executor.js +2 -2
  341. package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -3
  342. package/queries/catalog/input-sources-query/simple-input-classifier.js +28 -29
  343. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +4 -7
  344. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +1 -1
  345. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +3 -2
  346. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +2 -2
  347. package/queries/catalog/linter-query/linter-query-executor.js +10 -3
  348. package/queries/catalog/linter-query/linter-query-format.d.ts +4 -1
  349. package/queries/catalog/linter-query/linter-query-format.js +32 -21
  350. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  351. package/queries/catalog/location-map-query/location-map-query-format.js +1 -3
  352. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -3
  353. package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
  354. package/queries/catalog/origin-query/origin-query-executor.js +3 -3
  355. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  356. package/queries/catalog/origin-query/origin-query-format.js +4 -5
  357. package/queries/catalog/project-query/project-query-format.js +2 -2
  358. package/queries/catalog/provenance-query/provenance-query-format.js +2 -3
  359. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  360. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -4
  361. package/queries/catalog/search-query/search-query-format.js +1 -3
  362. package/queries/catalog/signature-query/signature-query-executor.js +3 -3
  363. package/queries/catalog/signature-query/signature-query-format.js +2 -2
  364. package/queries/catalog/slice-query-options.d.ts +16 -0
  365. package/queries/catalog/slice-query-options.js +28 -0
  366. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
  367. package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -42
  368. package/queries/query-print.d.ts +4 -0
  369. package/queries/query-print.js +17 -1
  370. package/queries/query.d.ts +3 -3
  371. package/queries/query.js +3 -4
  372. package/r-bridge/lang-4.x/ast/model/model.d.ts +27 -3
  373. package/r-bridge/lang-4.x/ast/model/model.js +28 -1
  374. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  375. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  376. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +2 -0
  377. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
  378. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +20 -1
  379. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +25 -1
  380. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +2 -0
  381. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
  382. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -0
  383. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
  384. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -0
  385. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
  386. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -0
  387. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
  388. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +2 -0
  389. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
  390. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +18 -2
  391. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +15 -6
  392. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +2 -0
  393. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
  394. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +2 -0
  395. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
  396. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -0
  397. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
  398. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -0
  399. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
  400. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -0
  401. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
  402. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +2 -0
  403. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +1 -0
  404. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -0
  405. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
  406. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -0
  407. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
  408. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +2 -0
  409. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
  410. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +17 -0
  411. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +20 -0
  412. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -0
  413. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
  414. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +2 -0
  415. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
  416. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -0
  417. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
  418. package/r-bridge/lang-4.x/ast/model/operators.js +0 -2
  419. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -6
  420. package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -6
  421. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -3
  422. package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
  423. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +1 -5
  424. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -2
  425. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +4 -20
  426. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -5
  427. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +1 -5
  428. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -5
  429. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -9
  430. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -5
  431. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -10
  432. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -11
  433. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +3 -11
  434. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -5
  435. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -5
  436. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -5
  437. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +6 -1
  438. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +7 -0
  439. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +0 -10
  440. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +30 -82
  441. package/r-bridge/retriever.d.ts +0 -4
  442. package/r-bridge/retriever.js +0 -13
  443. package/r-bridge/roxygen2/documentation-provider.js +3 -7
  444. package/r-bridge/shell.js +3 -8
  445. package/reconstruct/auto-select/magic-comments.js +8 -7
  446. package/reconstruct/inline/source-inline-map.d.ts +3 -0
  447. package/reconstruct/inline/source-inline-map.js +8 -7
  448. package/reconstruct/reconstruct.d.ts +1 -1
  449. package/reconstruct/reconstruct.js +33 -109
  450. package/search/flowr-search-printer.js +4 -15
  451. package/search/search-executor/search-generators.js +1 -1
  452. package/slicing/criterion/filters/all-variables.js +1 -2
  453. package/slicing/static/fingerprint.js +11 -2
  454. package/slicing/static/slice-call.d.ts +2 -8
  455. package/slicing/static/slice-call.js +8 -18
  456. package/slicing/static/static-slicer.js +81 -6
  457. package/util/collections/arrays.js +1 -1
  458. package/util/collections/set.js +1 -1
  459. package/util/diff-graph.d.ts +4 -0
  460. package/util/diff-graph.js +12 -0
  461. package/util/files.js +2 -6
  462. package/util/json.js +1 -15
  463. package/util/mermaid/cfg.js +10 -17
  464. package/util/mermaid/dfg.js +6 -8
  465. package/util/objects.d.ts +1 -1
  466. package/util/quads.js +4 -13
  467. package/util/r-author.js +5 -5
  468. package/util/range.d.ts +9 -0
  469. package/util/range.js +11 -0
  470. package/util/schema.js +3 -3
  471. package/util/simple-df/dfg-view.js +2 -1
  472. package/util/text/ansi.js +1 -2
  473. package/util/text/playground-link.js +2 -1
  474. package/util/text/r-highlight.js +2 -1
  475. package/util/text/strings.d.ts +2 -0
  476. package/util/text/strings.js +5 -0
  477. package/util/text/time.js +1 -2
  478. package/util/version.js +4 -3
  479. package/dataflow/fn/recursive-function.d.ts +0 -6
  480. package/dataflow/fn/recursive-function.js +0 -32
  481. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +0 -16
  482. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +0 -27
@@ -251,9 +251,9 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
251
251
  this.inlineFiles.push(f);
252
252
  }
253
253
  else {
254
- const exist = this.files.get(f.path());
254
+ const exist = this.files.get(files_1.RPath.of(f.path()));
255
255
  (0, assert_1.guard)(exist === undefined || exist === f, `File ${f.path()} already added to the context.`);
256
- this.files.set(f.path(), f);
256
+ this.files.set(files_1.RPath.of(f.path()), f);
257
257
  this.caseIndex = undefined;
258
258
  }
259
259
  if (f.roles) {
@@ -265,7 +265,7 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
265
265
  return f;
266
266
  }
267
267
  hasCached(path) {
268
- return this.files.has(path);
268
+ return this.files.has(files_1.RPath.of(path));
269
269
  }
270
270
  hasFile(path) {
271
271
  return this.hasCached(path) || (this.ctx.config.project.resolveUnknownPathsOnDisk && onDisk(path));
@@ -273,14 +273,15 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
273
273
  fileIndex() {
274
274
  if (this.caseIndex === undefined) {
275
275
  const index = new Map();
276
- for (const f of this.files.keys()) {
277
- const dir = path_1.default.dirname(f).toLowerCase();
276
+ for (const file of this.files.values()) {
277
+ const f = file.path();
278
+ const dir = files_1.RPath.dirname(f).toLowerCase();
278
279
  let entries = index.get(dir);
279
280
  if (entries === undefined) {
280
281
  entries = new Map();
281
282
  index.set(dir, entries);
282
283
  }
283
- const base = path_1.default.basename(f).toLowerCase();
284
+ const base = files_1.RPath.basename(f).toLowerCase();
284
285
  if (!entries.has(base)) {
285
286
  entries.set(base, f);
286
287
  }
@@ -314,14 +315,14 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
314
315
  if (this.hasFile(p)) {
315
316
  return p;
316
317
  }
317
- const dir = path_1.default.dirname(p);
318
- const file = path_1.default.basename(p).toLowerCase();
318
+ const file = files_1.RPath.basename(p).toLowerCase();
319
319
  // try to find in local known files first
320
- const known = this.fileIndex().get(dir.toLowerCase())?.get(file);
320
+ const known = this.fileIndex().get(files_1.RPath.dirname(p).toLowerCase())?.get(file);
321
321
  if (known !== undefined) {
322
322
  return known;
323
323
  }
324
324
  if (this.ctx.config.project.resolveUnknownPathsOnDisk) {
325
+ const dir = path_1.default.dirname(p);
325
326
  let realDir = dir;
326
327
  let files = this.readdir(dir);
327
328
  if (files === undefined) {
@@ -366,7 +367,7 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
366
367
  }
367
368
  /** Resolve the file at `path`, loading it from disk through the {@link FlowrAnalyzerFilePlugin}s if unknown. */
368
369
  resolveFile(path) {
369
- const file = this.files.get(path);
370
+ const file = this.files.get(files_1.RPath.of(path));
370
371
  if (file !== undefined && file !== null) {
371
372
  return file;
372
373
  }
@@ -430,11 +431,14 @@ class FlowrAnalyzerFilesContext extends abstract_flowr_analyzer_context_1.Abstra
430
431
  return [...this.files.values(), ...this.inlineFiles];
431
432
  }
432
433
  getFileByPath(path) {
433
- return this.files.get(path) ?? this.inlineFiles.find(f => f.path() === path);
434
+ return this.files.get(files_1.RPath.of(path)) ?? this.inlineFiles.find(f => f.path() === path);
434
435
  }
435
436
  getFileCount() {
436
437
  return this.files.size + this.inlineFiles.length;
437
438
  }
439
+ hasRequests() {
440
+ return this.loadingOrder.getUnorderedRequests().length > 0;
441
+ }
438
442
  }
439
443
  exports.FlowrAnalyzerFilesContext = FlowrAnalyzerFilesContext;
440
444
  //# sourceMappingURL=flowr-analyzer-files-context.js.map
@@ -16,14 +16,12 @@ export interface ReadOnlyFlowrAnalyzerIncrementalAnalysisContext {
16
16
  */
17
17
  export declare class FlowrAnalyzerIncrementalAnalysisContext implements ReadOnlyFlowrAnalyzerIncrementalAnalysisContext, InvalidationEventReceiver {
18
18
  readonly name = "flowr-analyzer-incremental-analysis-context";
19
- private readonly context;
20
19
  /**
21
20
  * The files that have been changed since the last analysis mapping to their old content.
22
21
  */
23
22
  private changedFilesWithOldContent;
24
23
  private oldParseResults;
25
24
  private readonly lastKnownMtime;
26
- constructor(context: FlowrAnalyzerContext);
27
25
  reset(): void;
28
26
  handleFileInvalidate(filePath: FilePath, oldContent: string | undefined): void;
29
27
  handleShouldReparse(filePath: FilePath, ctx: FlowrAnalyzerContext): boolean;
@@ -11,16 +11,12 @@ const fs_1 = __importDefault(require("fs"));
11
11
  */
12
12
  class FlowrAnalyzerIncrementalAnalysisContext {
13
13
  name = 'flowr-analyzer-incremental-analysis-context';
14
- context;
15
14
  /**
16
15
  * The files that have been changed since the last analysis mapping to their old content.
17
16
  */
18
17
  changedFilesWithOldContent = new Map();
19
18
  oldParseResults = new Map();
20
19
  lastKnownMtime = new Map();
21
- constructor(context) {
22
- this.context = context;
23
- }
24
20
  reset() {
25
21
  this.changedFilesWithOldContent = new Map();
26
22
  this.oldParseResults = new Map();
@@ -97,6 +97,8 @@ export interface FlowrFileProvider<Content extends {
97
97
  * So make sure your implementation closes the resource as soon as possible.
98
98
  */
99
99
  content(): Content;
100
+ /** The text the {@link content} was parsed from, for files whose content is not their text (e.g. a DESCRIPTION or an R Markdown document). */
101
+ rawText?(): string;
100
102
  /**
101
103
  * Assign a role to this file, this should be done by the loader plugins (cf. {@link PluginType}).
102
104
  * **Do not call this method yourself unless you are a file-loader plugin and/or really know what you are doing, this may break plugin assumptions!**
@@ -175,6 +177,8 @@ export declare class FlowrInlineTextFile extends FlowrFile<string> {
175
177
  export declare abstract class FlowrWrappedFile<Content extends StringableContent = StringableContent> extends FlowrFile<Content> {
176
178
  protected readonly wrapped: FlowrFileProvider;
177
179
  constructor(wrapped: FlowrFileProvider);
180
+ /** The text the content was parsed from, e.g. to locate what the parsed content holds in the file. */
181
+ rawText(): string;
178
182
  /** Lifts a file to the class this is called on, reusing it if already one and assigning `role`. */
179
183
  static from<T>(this: new (file: FlowrFileProvider) => T, file: FlowrFileProvider, role?: FileRole): T;
180
184
  }
@@ -177,6 +177,10 @@ class FlowrWrappedFile extends FlowrFile {
177
177
  super(wrapped.path(), wrapped.roles);
178
178
  this.wrapped = wrapped;
179
179
  }
180
+ /** The text the content was parsed from, e.g. to locate what the parsed content holds in the file. */
181
+ rawText() {
182
+ return this.wrapped.content().toString();
183
+ }
180
184
  /** Lifts a file to the class this is called on, reusing it if already one and assigning `role`. */
181
185
  static from(file, role) {
182
186
  if (role) {
@@ -58,7 +58,7 @@ class FlowrAnalyzerBuilder {
58
58
  * Per default, the value returned by {@link FlowrConfig.default} is used.
59
59
  * @param func - Receives the current configuration of the builder and allows for amendment.
60
60
  */
61
- // eslint-disable-next-line @typescript-eslint/no-invalid-void-type
61
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- amendments usually mutate in place and return nothing
62
62
  amendConfig(func) {
63
63
  this.flowrConfig = config_1.FlowrConfig.amend(this.flowrConfig, func);
64
64
  return this;
@@ -5,12 +5,12 @@ exports.parseRLicenseField = parseRLicenseField;
5
5
  exports.parseDCF = parseDCF;
6
6
  exports.parseDCFRecords = parseDCFRecords;
7
7
  exports.parsePackagesWithVersions = parsePackagesWithVersions;
8
+ const r_string_1 = require("../../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
8
9
  const flowr_file_1 = require("../../../context/flowr-file");
9
10
  const r_author_1 = require("../../../../util/r-author");
10
11
  const args_1 = require("../../../../util/text/args");
11
12
  const r_license_1 = require("../../../../util/r-license");
12
13
  const package_1 = require("../../package-version-plugins/package");
13
- const retriever_1 = require("../../../../r-bridge/retriever");
14
14
  const r_version_1 = require("../../../../util/r-version");
15
15
  /**
16
16
  * This decorates a text file and provides access to its content as a DCF (Debian Control File)-like structure.
@@ -83,7 +83,7 @@ class FlowrDescriptionFile extends flowr_file_1.FlowrWrappedFile {
83
83
  collate() {
84
84
  const c = this.content().get('Collate');
85
85
  // we join newlines, and then split quote sensitive:
86
- return c ? (0, args_1.splitAtEscapeSensitive)(c.join(' '), true, ' ').map(s => (0, retriever_1.removeRQuotes)(s).trim()).filter(s => s.length > 0) : undefined;
86
+ return c ? (0, args_1.splitAtEscapeSensitive)(c.join(' '), true, ' ').map(s => r_string_1.RString.unquote(s).trim()).filter(s => s.length > 0) : undefined;
87
87
  }
88
88
  /**
89
89
  * Returns the parsed dependencies from the 'Depends' field in the DESCRIPTION file.
@@ -11,6 +11,8 @@ export declare class FlowrJupyterFile extends FlowrFile {
11
11
  * @param wrapped - the file to load as Jupyter
12
12
  */
13
13
  constructor(wrapped: FlowrFileProvider<string>);
14
+ /** The text of the document itself, as its content is only the code it holds. */
15
+ rawText(): string;
14
16
  /**
15
17
  * Loads and parses the content of the wrapped file.
16
18
  * @returns RmdInfo
@@ -16,6 +16,10 @@ class FlowrJupyterFile extends flowr_file_1.FlowrFile {
16
16
  super(wrapped.path(), wrapped.roles ? [...wrapped.roles, flowr_file_1.FileRole.Source] : [flowr_file_1.FileRole.Source]);
17
17
  this.wrapped = wrapped;
18
18
  }
19
+ /** The text of the document itself, as its content is only the code it holds. */
20
+ rawText() {
21
+ return this.wrapped.content().toString();
22
+ }
19
23
  /**
20
24
  * Loads and parses the content of the wrapped file.
21
25
  * @returns RmdInfo
@@ -14,6 +14,8 @@ export declare abstract class FlowrManifestFile<Content extends StringableConten
14
14
  abstract rVersion(): string | undefined;
15
15
  /** grouped as a `DESCRIPTION` groups them */
16
16
  abstract declares(): DeclaredPackages;
17
+ /** the parsed TOML of the wrapped file, empty (with a warning) if it does not parse */
18
+ protected parseTomlContent(): Record<string, unknown>;
17
19
  }
18
20
  /** the `[project]` table of an `rproject.toml`, see https://a2-ai.github.io/rv-docs/config/ */
19
21
  interface RvProject {
@@ -11,20 +11,23 @@ exports.manifestFileLog = log_1.log.getSubLogger({ name: 'flowr-manifest-file' }
11
11
  * Prefer the static `from` method of the concrete subclass, which avoids re-wrapping and handles roles.
12
12
  */
13
13
  class FlowrManifestFile extends flowr_file_1.FlowrWrappedFile {
14
- }
15
- exports.FlowrManifestFile = FlowrManifestFile;
16
- /** The `rproject.toml` of an [rv](https://a2-ai.github.io/rv-docs/) project, lifted by {@link FlowrRProjectFile.from}. */
17
- class FlowrRProjectFile extends FlowrManifestFile {
18
- loadContent() {
14
+ /** the parsed TOML of the wrapped file, empty (with a warning) if it does not parse */
15
+ parseTomlContent() {
19
16
  try {
20
- const toml = (0, smol_toml_1.parse)(this.wrapped.content().toString());
21
- return toml.project ?? {};
17
+ return (0, smol_toml_1.parse)(this.wrapped.content().toString());
22
18
  }
23
19
  catch (e) {
24
20
  exports.manifestFileLog.warn(`Could not parse ${this.wrapped.path()}: ${e.message}`);
25
21
  return {};
26
22
  }
27
23
  }
24
+ }
25
+ exports.FlowrManifestFile = FlowrManifestFile;
26
+ /** The `rproject.toml` of an [rv](https://a2-ai.github.io/rv-docs/) project, lifted by {@link FlowrRProjectFile.from}. */
27
+ class FlowrRProjectFile extends FlowrManifestFile {
28
+ loadContent() {
29
+ return this.parseTomlContent().project ?? {};
30
+ }
28
31
  projectName() {
29
32
  const name = this.content().name;
30
33
  return typeof name === 'string' ? name : undefined;
@@ -58,13 +61,7 @@ exports.FlowrRProjectFile = FlowrRProjectFile;
58
61
  /** The `uvr.toml` of a [uvr](https://github.com/nbafrank/uvr) project, lifted by {@link FlowrUvrManifestFile.from}. */
59
62
  class FlowrUvrManifestFile extends FlowrManifestFile {
60
63
  loadContent() {
61
- try {
62
- return (0, smol_toml_1.parse)(this.wrapped.content().toString());
63
- }
64
- catch (e) {
65
- exports.manifestFileLog.warn(`Could not parse ${this.wrapped.path()}: ${e.message}`);
66
- return {};
67
- }
64
+ return this.parseTomlContent();
68
65
  }
69
66
  projectName() {
70
67
  const name = this.content().project?.name;
@@ -16,6 +16,8 @@ export interface NamespaceInfo {
16
16
  /** Classes listed by `exportClasses()`: the S4 classes the package owns. Separated like {@link exportedS4Methods}. */
17
17
  exportedS4Classes: string[];
18
18
  exportS3Generics: Map<string, string[]>;
19
+ /** For `S3method(generic, class, fun)`, the function registered as the method `generic.class` when it is not named so. */
20
+ s3MethodFunctions?: Map<string, string>;
19
21
  exportedPatterns: string[];
20
22
  importedPackages: Map<string, string[] | 'all'>;
21
23
  loadsWithSideEffects: boolean;
@@ -44,6 +46,7 @@ export declare class FlowrNamespaceFile extends FlowrFile<NamespaceFormat> {
44
46
  * @see {@link parseNamespaceComplex} for a more complex parser.
45
47
  */
46
48
  protected loadContent(): NamespaceFormat;
49
+ rawText(): string;
47
50
  /** See {@link isExportedInNamespaceFormat}, which this answers for the file's own content. */
48
51
  isExported(name: string, pkg?: string): boolean | RNode<ParentInformation>[];
49
52
  /**
@@ -6,10 +6,9 @@ exports.isExportedInInfo = isExportedInInfo;
6
6
  exports.getExportedNames = getExportedNames;
7
7
  exports.getCallables = getCallables;
8
8
  exports.setCallable = setCallable;
9
+ const r_string_1 = require("../../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
9
10
  const flowr_file_1 = require("../../../context/flowr-file");
10
11
  const resolve_args_1 = require("../../../../abstract-interpretation/data-frame/resolve-args");
11
- const retriever_1 = require("../../../../r-bridge/retriever");
12
- const strings_1 = require("../../../../util/text/strings");
13
12
  const fold_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/fold");
14
13
  const identifier_1 = require("../../../../dataflow/environments/identifier");
15
14
  const assert_1 = require("../../../../util/assert");
@@ -47,6 +46,9 @@ class FlowrNamespaceFile extends flowr_file_1.FlowrFile {
47
46
  loadContent() {
48
47
  return this.ctx ? parseNamespaceComplex(this.wrapped, this.ctx) : parseNamespaceSimple(this.wrapped);
49
48
  }
49
+ rawText() {
50
+ return this.wrapped.rawText?.() ?? this.wrapped.content().toString();
51
+ }
50
52
  /** See {@link isExportedInNamespaceFormat}, which this answers for the file's own content. */
51
53
  isExported(name, pkg = 'current') {
52
54
  const fmt = this.content();
@@ -240,10 +242,6 @@ function wrapRNodeInNotCall(node, idMap) {
240
242
  arguments: [(0, make_argument_1.toUnnamedArgument)(node, idMap)]
241
243
  };
242
244
  }
243
- /** the name a NAMESPACE directive lists, without the quotes or backticks R allows around it */
244
- function unquoteName(name) {
245
- return (0, strings_1.startAndEndsWith)(name, '`') ? name.slice(1, -1) : (0, retriever_1.removeRQuotes)(name);
246
- }
247
245
  /** Unquotes every lexeme of `args` (dropping empty/nameless arguments) and pushes the result onto `target`. */
248
246
  function pushUnquotedLexemes(target, args, unquote) {
249
247
  target.push(...args.filter(a => a !== r_function_call_1.EmptyArgument).map(a => a.lexeme ? unquote(a.lexeme) : undefined).filter(assert_1.isNotUndefined));
@@ -269,7 +267,7 @@ function markSideEffectLoader(fmt, pkg) {
269
267
  (fmt[pkg] ??= emptyNamespaceInfo()).loadsWithSideEffects = true;
270
268
  }
271
269
  function handleExportCall(g, args) {
272
- pushUnquotedLexemes(g.current.exportedSymbols, args, unquoteName);
270
+ pushUnquotedLexemes(g.current.exportedSymbols, args, r_string_1.RString.unquote);
273
271
  return g;
274
272
  }
275
273
  function handleExportPatternCall(g, args) {
@@ -286,14 +284,20 @@ function handleS3MethodCall(g, args) {
286
284
  if (r_argument_1.RArgument.isEmpty(pkgArg) || r_argument_1.RArgument.isEmpty(funcArg) || !pkgArg.lexeme || !funcArg.lexeme) {
287
285
  return g;
288
286
  }
289
- arrayAt(g.current.exportS3Generics, unquoteName(pkgArg.lexeme)).push(unquoteName(funcArg.lexeme));
287
+ const generic = r_string_1.RString.unquote(pkgArg.lexeme);
288
+ const cls = r_string_1.RString.unquote(funcArg.lexeme);
289
+ arrayAt(g.current.exportS3Generics, generic).push(cls);
290
+ const fun = args[2];
291
+ if (fun !== undefined && !r_argument_1.RArgument.isEmpty(fun) && fun.lexeme) {
292
+ (g.current.s3MethodFunctions ??= new Map()).set(`${generic}.${cls}`, r_string_1.RString.unquote(fun.lexeme));
293
+ }
290
294
  return g;
291
295
  }
292
296
  function handleImportCall(g, args) {
293
297
  /* `import(a, b)` imports both; a named argument like `except =` names no package */
294
298
  for (const arg of args) {
295
299
  if (arg !== r_function_call_1.EmptyArgument && arg.name === undefined && arg.lexeme) {
296
- g.current.importedPackages?.set(unquoteName(arg.lexeme), 'all');
300
+ g.current.importedPackages?.set(r_string_1.RString.unquote(arg.lexeme), 'all');
297
301
  }
298
302
  }
299
303
  return g;
@@ -306,13 +310,13 @@ function handleImportFromCall(g, args) {
306
310
  if (r_argument_1.RArgument.isEmpty(pkgArg) || !pkgArg.lexeme) {
307
311
  return g;
308
312
  }
309
- const arr = importArrayAt(g.current.importedPackages, unquoteName(pkgArg.lexeme));
313
+ const arr = importArrayAt(g.current.importedPackages, r_string_1.RString.unquote(pkgArg.lexeme));
310
314
  for (let i = 1; i < args.length; i++) {
311
315
  const symArg = args[i];
312
316
  if (r_argument_1.RArgument.isEmpty(symArg) || !symArg.lexeme) {
313
317
  continue;
314
318
  }
315
- arr.push(unquoteName(symArg.lexeme));
319
+ arr.push(r_string_1.RString.unquote(symArg.lexeme));
316
320
  }
317
321
  return g;
318
322
  }
@@ -324,12 +328,12 @@ function handleUseDynLibCall(g, args) {
324
328
  if (r_argument_1.RArgument.isEmpty(pkgArg) || !pkgArg.lexeme) {
325
329
  return g;
326
330
  }
327
- markSideEffectLoader(g, unquoteName(pkgArg.lexeme));
331
+ markSideEffectLoader(g, r_string_1.RString.unquote(pkgArg.lexeme));
328
332
  return g;
329
333
  }
330
334
  /** `exportClasses(A, B)` / `exportMethods(show, summary)`: a directive may list several names, and each goes to `into`. */
331
335
  function handleS4ExportCall(g, args, into) {
332
- pushUnquotedLexemes(g.current[into], args, unquoteName);
336
+ pushUnquotedLexemes(g.current[into], args, r_string_1.RString.unquote);
333
337
  return g;
334
338
  }
335
339
  const cleanLineCommentRegex = /^#.*$/gm;
@@ -408,7 +412,10 @@ function mergeNamespaceInfo(target, source) {
408
412
  mergedImportedPackages.set(key, value);
409
413
  }
410
414
  }
415
+ const s3MethodFunctions = target.s3MethodFunctions || source.s3MethodFunctions
416
+ ? new Map([...target.s3MethodFunctions ?? [], ...source.s3MethodFunctions ?? []]) : undefined;
411
417
  return {
418
+ ...(s3MethodFunctions ? { s3MethodFunctions } : {}),
412
419
  callable: [...target.callable, ...source.callable],
413
420
  exportedSymbols: [...target.exportedSymbols, ...source.exportedSymbols],
414
421
  exportedFunctions: [...target.exportedFunctions, ...source.exportedFunctions],
@@ -443,7 +450,7 @@ function splitNamespaceArgs(args) {
443
450
  const part = args.slice(start, i).trim();
444
451
  start = i + 1;
445
452
  if (part.length > 0 && !namedArgument.test(part)) {
446
- names.push(unquoteName(part));
453
+ names.push(r_string_1.RString.unquote(part));
447
454
  }
448
455
  }
449
456
  }
@@ -474,8 +481,11 @@ function parseNamespaceSimple(file) {
474
481
  if (parts.length !== 2 && parts.length !== 3) {
475
482
  continue;
476
483
  }
477
- const [pkg, func] = parts;
484
+ const [pkg, func, fun] = parts;
478
485
  arrayAt(result.current.exportS3Generics, pkg).push(func);
486
+ if (fun !== undefined) {
487
+ (result.current.s3MethodFunctions ??= new Map()).set(`${pkg}.${func}`, fun);
488
+ }
479
489
  break;
480
490
  }
481
491
  case 'export':
@@ -95,6 +95,50 @@ export interface RdMetaEntry {
95
95
  }
96
96
  /** Reads the `Meta/Rd.rds` data frame (as {@link RDAParser.parseObject} returns it) into one entry per page. */
97
97
  export declare function rdMetaOf(table: RObject): RdMetaEntry[];
98
+ /** How {@link scanRd} reads a group: `t` as text, `v` verbatim (no macros), `r` as R code (a string hides braces). */
99
+ export type RdMode = 't' | 'v' | 'r';
100
+ /** A node of {@link scanRd} at offset `at` of the scanned text; a text node never spans a line break. */
101
+ export type RdNode = {
102
+ readonly type: 'text';
103
+ readonly text: string;
104
+ readonly at: number;
105
+ readonly mode: RdMode;
106
+ } | {
107
+ readonly type: 'group';
108
+ readonly children: readonly RdNode[];
109
+ readonly at: number;
110
+ } | RdMacroUse;
111
+ /** A macro: its bracketed option, its argument groups, and the `[from, to)` span of each body (`to` is `-1` when it never closes). */
112
+ export type RdMacroUse = {
113
+ readonly type: 'macro';
114
+ readonly name: string;
115
+ readonly at: number;
116
+ readonly option?: string;
117
+ readonly args: readonly (readonly RdNode[])[];
118
+ readonly spans: readonly (readonly [number, number])[];
119
+ };
120
+ /** A scanned page: the comment-free text the offsets point into, its nodes, and where braces, strings or macros are wrong. */
121
+ export type RdScan = {
122
+ readonly text: string;
123
+ readonly nodes: readonly RdNode[];
124
+ readonly lineOf: (at: number) => number;
125
+ readonly problems: readonly {
126
+ readonly at: number;
127
+ readonly kind: 'syntax' | 'unknown';
128
+ readonly text: string;
129
+ }[];
130
+ };
131
+ /**
132
+ * How {@link scanRd} reads macros: `specOf` gives the modes of a macro's groups (lowercase required, uppercase optional, e.g. `vV`; `undefined` if unknown, the default),
133
+ * `lenient` reads an unknown macro with all groups that follow instead of reporting it and dropping its first group, and `macros` are expanded first.
134
+ */
135
+ export interface RdScanOptions {
136
+ readonly specOf?: (name: string, parent: string | undefined) => string | undefined;
137
+ readonly lenient?: boolean;
138
+ readonly macros?: RdMacros;
139
+ }
140
+ /** Scans an Rd source into a positioned tree, noting the problems the lexer of `R CMD check` reports. */
141
+ export declare function scanRd(content: string, { specOf, lenient, macros }?: RdScanOptions): RdScan;
98
142
  /** One `\newcommand` of a `man/macros/` file: the text it stands for, and how many arguments it takes. */
99
143
  export interface RdMacro {
100
144
  /** the highest `#n` the body uses, i.e. how many brace groups a use of the macro carries */