@eagleoutice/flowr 2.14.3 → 2.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (385) hide show
  1. package/README.md +76 -63
  2. package/abstract-interpretation/absint-inference.d.ts +347 -0
  3. package/abstract-interpretation/{absint-visitor.js → absint-inference.js} +327 -97
  4. package/abstract-interpretation/abstract-semantics.d.ts +246 -0
  5. package/abstract-interpretation/abstract-semantics.js +3 -0
  6. package/abstract-interpretation/data-frame/{mappers/arguments.d.ts → arguments.d.ts} +18 -16
  7. package/abstract-interpretation/data-frame/{mappers/arguments.js → arguments.js} +20 -21
  8. package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +52 -0
  9. package/abstract-interpretation/data-frame/dataframe-semantics.js +1656 -0
  10. package/abstract-interpretation/data-frame/resolve-args.js +4 -4
  11. package/abstract-interpretation/data-frame/semantics.d.ts +15 -21
  12. package/abstract-interpretation/data-frame/semantics.js +27 -29
  13. package/abstract-interpretation/data-frame/shape-inference.d.ts +28 -24
  14. package/abstract-interpretation/data-frame/shape-inference.js +14 -79
  15. package/abstract-interpretation/domains/interval-domain.d.ts +5 -1
  16. package/abstract-interpretation/domains/interval-domain.js +25 -33
  17. package/abstract-interpretation/domains/multi-value-state-domain.d.ts +6 -3
  18. package/abstract-interpretation/domains/multi-value-state-domain.js +24 -4
  19. package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -6
  20. package/abstract-interpretation/domains/partial-product-domain.js +26 -43
  21. package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -6
  22. package/abstract-interpretation/domains/positive-interval-domain.js +3 -29
  23. package/abstract-interpretation/domains/product-domain.d.ts +1 -1
  24. package/abstract-interpretation/domains/set-range-domain.d.ts +6 -0
  25. package/abstract-interpretation/domains/set-range-domain.js +29 -62
  26. package/abstract-interpretation/domains/state-abstract-domain.d.ts +9 -2
  27. package/abstract-interpretation/domains/state-abstract-domain.js +26 -37
  28. package/abstract-interpretation/domains/{state-domain-like.d.ts → state-domain.d.ts} +10 -6
  29. package/abstract-interpretation/domains/{state-domain-like.js → state-domain.js} +1 -1
  30. package/abstract-interpretation/value-semantics.d.ts +113 -0
  31. package/abstract-interpretation/value-semantics.js +115 -0
  32. package/benchmark/slicer.js +12 -6
  33. package/benchmark/stats/feature-counts.d.ts +2 -1
  34. package/benchmark/stats/feature-counts.js +25 -1
  35. package/benchmark/stats/stats.d.ts +4 -0
  36. package/benchmark/summarizer/second-phase/graph.js +7 -0
  37. package/cli/repl/commands/repl-parse.js +11 -22
  38. package/cli/repl/parser/slice-query-parser.d.ts +2 -0
  39. package/cli/repl/parser/slice-query-parser.js +1 -0
  40. package/config.d.ts +30 -205
  41. package/config.js +37 -3
  42. package/control-flow/cfg-properties.d.ts +5 -0
  43. package/control-flow/cfg-properties.js +25 -7
  44. package/control-flow/control-flow-graph.d.ts +11 -37
  45. package/control-flow/control-flow-graph.js +33 -77
  46. package/control-flow/semantic-cfg-guided-visitor.d.ts +63 -320
  47. package/control-flow/semantic-cfg-guided-visitor.js +65 -320
  48. package/dataflow/environments/built-in-config.d.ts +2 -0
  49. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  50. package/dataflow/environments/built-in-proc-name.js +4 -0
  51. package/dataflow/environments/built-in-props.d.ts +192 -82
  52. package/dataflow/environments/built-in-props.js +336 -106
  53. package/dataflow/environments/built-in.d.ts +21 -9
  54. package/dataflow/environments/built-in.js +43 -12
  55. package/dataflow/environments/default-builtin-config.d.ts +3219 -328
  56. package/dataflow/environments/default-builtin-config.js +804 -1031
  57. package/dataflow/environments/environment.d.ts +26 -49
  58. package/dataflow/environments/environment.js +34 -47
  59. package/dataflow/environments/group-generics.d.ts +36 -0
  60. package/dataflow/environments/group-generics.js +58 -0
  61. package/dataflow/environments/identifier.d.ts +106 -6
  62. package/dataflow/environments/identifier.js +19 -1
  63. package/dataflow/environments/query-fn-props.d.ts +16 -8
  64. package/dataflow/environments/query-fn-props.js +45 -21
  65. package/dataflow/environments/resolve-by-name.js +9 -2
  66. package/dataflow/environments/scoping.d.ts +5 -0
  67. package/dataflow/environments/scoping.js +11 -0
  68. package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
  69. package/dataflow/eval/resolve/alias-tracking.js +20 -2
  70. package/dataflow/eval/resolve/resolve-numbers.d.ts +182 -7
  71. package/dataflow/eval/resolve/resolve-numbers.js +44 -9
  72. package/dataflow/eval/resolve/resolve-strings.d.ts +79 -2
  73. package/dataflow/eval/resolve/resolve-strings.js +16 -7
  74. package/dataflow/eval/resolve/resolve.d.ts +5 -22
  75. package/dataflow/eval/resolve/resolve.js +24 -34
  76. package/dataflow/eval/values/general.d.ts +7 -1
  77. package/dataflow/eval/values/general.js +17 -3
  78. package/dataflow/eval/values/string/string-constants.d.ts +16 -15
  79. package/dataflow/eval/values/string/string-constants.js +59 -27
  80. package/dataflow/extractor.d.ts +2 -1
  81. package/dataflow/extractor.js +16 -4
  82. package/dataflow/fn/argument-roles.d.ts +35 -0
  83. package/dataflow/fn/argument-roles.js +252 -0
  84. package/dataflow/fn/class-declaration.d.ts +148 -0
  85. package/dataflow/fn/class-declaration.js +317 -0
  86. package/dataflow/fn/condition-handlers.d.ts +5 -0
  87. package/dataflow/fn/condition-handlers.js +13 -0
  88. package/dataflow/fn/exceptions-of-function.d.ts +21 -7
  89. package/dataflow/fn/exceptions-of-function.js +74 -43
  90. package/dataflow/fn/frame-reflection.d.ts +46 -0
  91. package/dataflow/fn/frame-reflection.js +169 -0
  92. package/dataflow/fn/function-props.d.ts +32 -0
  93. package/dataflow/fn/function-props.js +160 -0
  94. package/dataflow/fn/higher-order-function.d.ts +23 -5
  95. package/dataflow/fn/higher-order-function.js +64 -18
  96. package/dataflow/fn/strict-function.d.ts +24 -2
  97. package/dataflow/fn/strict-function.js +49 -19
  98. package/dataflow/graph/call-graph.js +10 -2
  99. package/dataflow/graph/df-helper.d.ts +1 -12
  100. package/dataflow/graph/df-helper.js +2 -19
  101. package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
  102. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  103. package/dataflow/graph/graph.d.ts +39 -188
  104. package/dataflow/graph/graph.js +46 -163
  105. package/dataflow/graph/match-args.d.ts +34 -2
  106. package/dataflow/graph/match-args.js +45 -12
  107. package/dataflow/graph/vertex.d.ts +8 -0
  108. package/dataflow/info.d.ts +7 -5
  109. package/dataflow/info.js +1 -5
  110. package/dataflow/internal/control-flow.js +20 -17
  111. package/dataflow/internal/linker.d.ts +8 -37
  112. package/dataflow/internal/linker.js +22 -55
  113. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -2
  114. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -8
  115. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -4
  116. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +8 -14
  117. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +43 -50
  118. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +4 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +5 -2
  120. package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +23 -0
  121. package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.js +24 -0
  122. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -2
  123. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
  124. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +0 -4
  125. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +73 -27
  126. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -11
  127. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +131 -92
  128. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +17 -12
  129. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +187 -99
  130. package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +4 -0
  131. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -0
  132. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +2 -3
  133. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +4 -3
  134. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
  135. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -2
  136. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +0 -1
  137. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -1
  138. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +31 -0
  139. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +101 -0
  140. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -1
  141. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -0
  142. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +23 -21
  143. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +1 -2
  144. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -2
  145. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +22 -1
  146. package/dataflow/internal/process/functions/call/common.d.ts +4 -6
  147. package/dataflow/internal/process/functions/call/common.js +2 -2
  148. package/dataflow/internal/process/functions/call/deferred.d.ts +1 -1
  149. package/dataflow/internal/process/functions/call/deferred.js +2 -2
  150. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +5 -3
  151. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -4
  152. package/dataflow/internal/process/functions/call/named-call-handling.js +19 -13
  153. package/dataflow/internal/process/functions/call/quoted.d.ts +2 -2
  154. package/dataflow/internal/process/functions/call/quoted.js +144 -28
  155. package/dataflow/origin/dfg-get-origin.js +23 -10
  156. package/dataflow/processor.d.ts +2 -1
  157. package/dataflow/processor.js +6 -0
  158. package/documentation/data/interface/doc-writing-code.js +2 -0
  159. package/documentation/doc-util/doc-search.js +1 -1
  160. package/documentation/wiki-absint.d.ts +11 -14
  161. package/documentation/wiki-absint.js +73 -59
  162. package/documentation/wiki-core.js +64 -24
  163. package/documentation/wiki-linter.js +1 -0
  164. package/documentation/wiki-query.js +82 -264
  165. package/documentation/wiki-signature-database.js +23 -6
  166. package/gas.d.ts +91 -47
  167. package/gas.js +97 -13
  168. package/index.d.ts +31 -0
  169. package/index.js +52 -0
  170. package/linter/linter-rules.d.ts +87 -23
  171. package/linter/linter-rules.js +3 -1
  172. package/linter/rules/absolute-path.d.ts +1 -1
  173. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  174. package/linter/rules/dataframe-access-validation.js +10 -8
  175. package/linter/rules/dead-code.d.ts +1 -1
  176. package/linter/rules/deprecated-functions.js +14 -5
  177. package/linter/rules/file-path-validity.d.ts +1 -1
  178. package/linter/rules/naming-convention.d.ts +1 -1
  179. package/linter/rules/naming-convention.js +13 -2
  180. package/linter/rules/network-functions.d.ts +10 -5
  181. package/linter/rules/network-functions.js +48 -36
  182. package/linter/rules/no-leaked-credentials.d.ts +1 -1
  183. package/linter/rules/problematic-inputs.d.ts +1 -1
  184. package/linter/rules/problematic-inputs.js +1 -1
  185. package/linter/rules/seeded-randomness.d.ts +3 -2
  186. package/linter/rules/seeded-randomness.js +7 -3
  187. package/linter/rules/software-has-license.d.ts +1 -1
  188. package/linter/rules/software-has-tests.d.ts +1 -1
  189. package/linter/rules/stop-with-call-arg.d.ts +1 -1
  190. package/linter/rules/syntactically-valid.d.ts +1 -1
  191. package/linter/rules/unclosed-connection.d.ts +3 -3
  192. package/linter/rules/unclosed-connection.js +3 -4
  193. package/linter/rules/undefined-symbol.d.ts +1 -1
  194. package/linter/rules/unescaped-arguments.d.ts +161 -0
  195. package/linter/rules/unescaped-arguments.js +293 -0
  196. package/linter/rules/unused-definition.d.ts +1 -1
  197. package/linter/rules/unused-definition.js +51 -6
  198. package/linter/rules/unused-import.d.ts +1 -1
  199. package/linter/rules/useless-loop.d.ts +1 -1
  200. package/package.json +3 -198
  201. package/project/context/flowr-analyzer-environment-context.d.ts +12 -1
  202. package/project/context/flowr-analyzer-environment-context.js +33 -1
  203. package/project/context/flowr-analyzer-files-context.d.ts +24 -1
  204. package/project/context/flowr-analyzer-files-context.js +42 -21
  205. package/project/context/flowr-analyzer-functions-context.d.ts +8 -0
  206. package/project/context/flowr-analyzer-functions-context.js +2 -0
  207. package/project/context/flowr-analyzer-gas-context.d.ts +9 -1
  208. package/project/context/flowr-analyzer-gas-context.js +21 -0
  209. package/project/context/flowr-file.d.ts +16 -1
  210. package/project/context/flowr-file.js +26 -2
  211. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +19 -20
  212. package/project/plugins/file-plugins/files/flowr-description-file.js +55 -41
  213. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +9 -4
  214. package/project/plugins/file-plugins/files/flowr-jupyter-file.js +11 -3
  215. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +6 -9
  216. package/project/plugins/file-plugins/files/flowr-manifest-files.js +5 -21
  217. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +11 -12
  218. package/project/plugins/file-plugins/files/flowr-namespace-file.js +48 -61
  219. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +3 -12
  220. package/project/plugins/file-plugins/files/flowr-news-file.js +2 -19
  221. package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +145 -0
  222. package/project/plugins/file-plugins/files/flowr-rd-file.js +676 -0
  223. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +122 -422
  224. package/project/plugins/file-plugins/files/flowr-rda-file.js +517 -1005
  225. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +8 -2
  226. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +10 -1
  227. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +7 -2
  228. package/project/plugins/file-plugins/files/flowr-sweave-file.js +9 -1
  229. package/project/plugins/file-plugins/files/flowr-sysdata-file.d.ts +17 -0
  230. package/project/plugins/file-plugins/files/flowr-sysdata-file.js +40 -0
  231. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -0
  232. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +3 -1
  233. package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.d.ts +58 -0
  234. package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.js +95 -0
  235. package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.d.ts +23 -0
  236. package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.js +33 -0
  237. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +33 -72
  238. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +17 -15
  239. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +20 -37
  240. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +29 -53
  241. package/project/plugins/package-version-plugins/package.js +2 -1
  242. package/project/plugins/plugin-registry.d.ts +3 -1
  243. package/project/plugins/plugin-registry.js +11 -0
  244. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +20 -4
  245. package/project/sigdb/build.d.ts +9 -15
  246. package/project/sigdb/build.js +63 -42
  247. package/project/sigdb/decode.d.ts +10 -4
  248. package/project/sigdb/decode.js +60 -21
  249. package/project/sigdb/memory-source.d.ts +4 -0
  250. package/project/sigdb/memory-source.js +8 -0
  251. package/project/sigdb/reader.d.ts +50 -100
  252. package/project/sigdb/reader.js +84 -105
  253. package/project/sigdb/schema.d.ts +102 -26
  254. package/project/sigdb/schema.js +14 -6
  255. package/project/sigdb/signature-db.d.ts +4 -0
  256. package/project/sigdb/signature-db.js +8 -1
  257. package/queries/base-query-format.d.ts +7 -0
  258. package/queries/base-query-format.js +29 -0
  259. package/queries/catalog/absint-query/absint-query-executor.js +8 -6
  260. package/queries/catalog/absint-query/absint-query-format.d.ts +20 -9
  261. package/queries/catalog/absint-query/absint-query-format.js +32 -19
  262. package/queries/catalog/call-context-query/call-context-query-executor.js +3 -3
  263. package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
  264. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
  265. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
  266. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
  267. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
  268. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
  269. package/queries/catalog/dependencies-query/dependencies-query-executor.js +33 -7
  270. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
  271. package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +2 -2
  272. package/queries/catalog/dependencies-query/function-info/derived-functions.js +14 -4
  273. package/queries/catalog/dependencies-query/function-info/read-functions.js +7 -121
  274. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +1 -1
  275. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +2 -2
  276. package/queries/catalog/dependencies-query/function-info/visualize-functions.js +4 -46
  277. package/queries/catalog/dependencies-query/function-info/write-functions.js +3 -76
  278. package/queries/catalog/dependencies-query/implicit-echo.js +2 -2
  279. package/queries/catalog/dependencies-query/link-devices.d.ts +2 -2
  280. package/queries/catalog/dependencies-query/link-devices.js +6 -7
  281. package/queries/catalog/dice-query/dice-query-executor.js +1 -1
  282. package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
  283. package/queries/catalog/does-call-query/does-call-query-executor.js +4 -0
  284. package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -1
  285. package/queries/catalog/files-query/files-query-format.d.ts +1 -1
  286. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
  287. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -1
  288. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
  289. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
  290. package/queries/catalog/input-sources-query/input-source-functions.d.ts +1 -1
  291. package/queries/catalog/input-sources-query/input-source-functions.js +2 -2
  292. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -17
  293. package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -27
  294. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
  295. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +3 -8
  296. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -11
  297. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +4 -0
  298. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +60 -0
  299. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +35 -0
  300. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +63 -0
  301. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -6
  302. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +3 -8
  303. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -11
  304. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +3 -8
  305. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -12
  306. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
  307. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
  308. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  309. package/queries/catalog/project-query/project-query-format.d.ts +1 -1
  310. package/queries/catalog/provenance-query/provenance-query-format.d.ts +3 -8
  311. package/queries/catalog/provenance-query/provenance-query-format.js +2 -14
  312. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  313. package/queries/catalog/search-query/search-query-format.d.ts +1 -1
  314. package/queries/catalog/signature-query/signature-query-executor.d.ts +9 -9
  315. package/queries/catalog/signature-query/signature-query-executor.js +104 -95
  316. package/queries/catalog/signature-query/signature-query-format.d.ts +34 -8
  317. package/queries/catalog/signature-query/signature-query-format.js +16 -4
  318. package/queries/catalog/signature-query/signature-query-render.js +24 -4
  319. package/queries/catalog/slice-query-options.d.ts +14 -0
  320. package/queries/catalog/slice-query-options.js +15 -0
  321. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -1
  322. package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -2
  323. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -3
  324. package/queries/catalog/static-slice-query/static-slice-query-format.js +7 -5
  325. package/queries/query-function-filter.d.ts +8 -3
  326. package/queries/query-function-filter.js +16 -6
  327. package/queries/query.d.ts +38 -38
  328. package/queries/query.js +30 -4
  329. package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -0
  330. package/r-bridge/lang-4.x/ast/model/model.js +14 -0
  331. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  332. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
  333. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  334. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  335. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  336. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  337. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  338. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
  339. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  340. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  341. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  342. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  343. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  344. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
  345. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
  346. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  347. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  349. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  350. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  352. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +17 -9
  353. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +35 -27
  354. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -22
  355. package/reconstruct/reconstruct.d.ts +9 -20
  356. package/reconstruct/reconstruct.js +66 -28
  357. package/search/flowr-search-filters.d.ts +7 -6
  358. package/search/flowr-search-filters.js +6 -4
  359. package/search/search-executor/search-enrichers.d.ts +10 -10
  360. package/search/search-executor/search-enrichers.js +32 -3
  361. package/search/search-executor/search-transformer.js +15 -23
  362. package/slicing/criterion/parse.js +2 -12
  363. package/slicing/static/slice-call.js +1 -8
  364. package/slicing/static/static-slicer.js +1 -1
  365. package/util/collections/bimap.js +14 -6
  366. package/util/objects.js +16 -17
  367. package/util/r-value.d.ts +5 -4
  368. package/util/record.d.ts +38 -3
  369. package/util/record.js +48 -1
  370. package/util/simple-df/dfg-ascii.js +1 -1
  371. package/util/text/name-rank.js +8 -2
  372. package/util/text/strings.d.ts +5 -0
  373. package/util/text/strings.js +10 -0
  374. package/util/version.js +2 -2
  375. package/abstract-interpretation/absint-visitor.d.ts +0 -223
  376. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -19
  377. package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -151
  378. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +0 -287
  379. package/abstract-interpretation/data-frame/mappers/function-mapper.js +0 -1096
  380. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -15
  381. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -207
  382. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +0 -6
  383. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +0 -25
  384. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +0 -31
  385. package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +0 -56
@@ -6,26 +6,14 @@ import { FlowrFile } from '../../../context/flowr-file';
6
6
  export declare class FlowrRDAFile extends FlowrFile<RObjectData[]> {
7
7
  private readonly wrapped;
8
8
  private readonly shortcut;
9
- /**
10
- * Prefer the static {@link FlowrRDAFile.from} method to create instances of this class as it will not re-create if already a description file
11
- * and handle role assignments.
12
- * @param file - The underlying file provider whose path points to an RDA file.
13
- * @param shortcut - When `true`, only top-level object names and types are
14
- * collected during parsing. Payload data is skipped.
15
- */
9
+ /** Prefer {@link FlowrRDAFile.from}, which avoids re-wrapping and handles roles. `shortcut` collects only top-level names/types and skips payloads when `true`. */
16
10
  constructor(file: FlowrFileProvider, shortcut?: boolean);
17
- /**
18
- * Loads and parses the content of the wrapped file as an RDA structure.
19
- * @see {@link parse} for details on the parsing logic.
20
- * @returns An array of top-level {@link RObjectData}s or `[{}]` when the
21
- * file contains no R objects.
22
- */
11
+ /** See {@link RDAParser.parse}. Answers top-level {@link RObjectData}s, or `[{}]` when the file holds no R objects. */
23
12
  protected loadContent(): RObjectData[];
24
13
  /**
25
- * RDA file lifter, this does not re-create if already an RDA file.
26
- * @param file - A raw {@link FlowrFileProvider} or an existing {@link FlowrRDAFile}.
27
- * @param role - Optional {@link FileRole} to assign before returning.
28
- * @returns The (possibly newly created) {@link FlowrRDAFile}.
14
+ * Lifts a file to a {@link FlowrRDAFile}, reusing it if already one and assigning roles.
15
+ * @param file - The file to lift or return if already an RDA file
16
+ * @param role - An optional role to assign to the file
29
17
  */
30
18
  static from(file: FlowrFileProvider | FlowrRDAFile, role?: FileRole): FlowrRDAFile;
31
19
  }
@@ -60,7 +48,7 @@ export declare enum SerializationTypeTag {
60
48
  MagicMaybeTooNew = "R_MAGIC_MAYBE_TOONEW"
61
49
  }
62
50
  type SerializationTypes = SerializationTypeTag | number;
63
- type RObject = RValues.NilValue | RObjectData;
51
+ export type RObject = RValues.NilValue | RObjectData;
64
52
  type Real = number | RValues.NilValue | RValues.NaReal | RValues.NaN | RValues.PosInf | RValues.NegInf;
65
53
  type Complex = {
66
54
  r: Real;
@@ -198,542 +186,254 @@ export declare class RDAParser {
198
186
  private format;
199
187
  private readonly refTable;
200
188
  private Registry;
201
- /**
202
- * @param file - The RDA file to read.
203
- * @param shortcut - When `true`, only top-level object names and types are collected, payloads are skipped.
204
- */
205
189
  constructor(file: FlowrFileProvider, shortcut?: boolean);
206
- /**
207
- * Parses an RDA file.
208
- *
209
- * The file is decompressed, deserialized, and converted into a flattened object representation,
210
- * as far as the `shortcut` the parser was constructed with asks for.
211
- * @returns List of found {@link RObjectData} or `null` if the file is empty.
212
- */
190
+ /** Decompresses, deserializes, and flattens (per the constructor's `shortcut`) the file. Answers found {@link RObjectData}s, `null` if the file is empty. */
213
191
  parse(): RObjectData[] | null;
214
192
  /**
215
- * Detects the compression algorithm used for an RDA file.
216
- * @param buf - Raw file buffer.
217
- * @param withZlib - Whether a bare zlib header should count as gzip, see {@link CompressionSignatures}.
218
- * @returns The first {@link CompressionSignatures} entry the buffer matches, {@link CompressionType.CompUnknownOrNo} if none does.
219
- * @throws Error if the file is of a recognized but unreadable kind.
220
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/connections.c#L2675-L2710 | R source: comp_type_from_memory}
193
+ * Parses the file into the single R object it serializes (what an `.rds` holds), without the flattening
194
+ * {@link parse} applies. Answers the deserialized object, {@link RValues.NilValue} for an empty file.
221
195
  */
222
- detectCompression(buf: Buffer, withZlib?: boolean): CompressionType;
196
+ parseObject(): RObject;
223
197
  /**
224
- * Decompresses the given RDA file buffer.
225
- * @param fileContent - Raw compressed file buffer.
226
- * @param compressionType - {@link CompressionType} as returned by {@link detectCompression}.
227
- * @returns Decompressed buffer.
228
- * @throws Error for unsupported compression types.
198
+ * First {@link CompressionSignatures} entry `buf` matches, {@link CompressionType.CompUnknownOrNo} if none does.
199
+ * Throws Error if the file is of a recognized but unreadable kind. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/connections.c#L2675-L2710 | R source: comp_type_from_memory}
229
200
  */
201
+ detectCompression(buf: Buffer, withZlib?: boolean): CompressionType;
202
+ /** Decompresses `fileContent` per the {@link detectCompression} result `compressionType`. Throws error for unsupported compression types. */
230
203
  decompress(fileContent: Buffer, compressionType: CompressionType): Buffer;
231
204
  /**
232
- * Detects the serialization type used for the RDA-file.
233
- * @param buf - Buffer with decompressed RDA-file content
234
- * @returns The identified {@link SerializationTypes} of decompressed RDA-file
205
+ * Identifies the {@link SerializationTypes} of a decompressed RDA-file buffer.
235
206
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/saveload.c#L1808-L1858 | R source: R_ReadMagic}
236
207
  */
237
208
  determineSerializationType(buf: Buffer): SerializationTypes;
238
209
  /**
239
- * Deserializes a decompressed RDA-file.
240
- * @returns Deserialized RDA-file as {@link RObject} or {@link RValues.NilValue}, if the deserialization fails
210
+ * Deserializes a decompressed RDA-file. Answers {@link RObject}, or {@link RValues.NilValue} if deserialization fails.
241
211
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/saveload.c#L1923-L1972 | R source: R_LoadFromFile}
242
212
  */
243
213
  deserialize2(): RObject;
244
- /**
245
- * Deserializes a decompressed RDA-file.
246
- * @returns Deserialized RDA-file as {@link RObject}
247
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2237-L2292 | R source: R_Unserialize}
248
- */
214
+ /** Deserializes a decompressed RDA-file. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2237-L2292 | R source: R_Unserialize} */
249
215
  deserialize(): RObject;
250
- /**
251
- * Reads a serialized integer value from the current buffer position.
252
- * @returns Parsed integer value or {@link RValues.NaInteger}.
253
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L396-L420 | R source: inInteger}
254
- */
216
+ /** Reads a serialized integer. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L396-L420 | R source: inInteger} */
255
217
  inInteger(): number | RValues.NaInteger;
256
- /**
257
- * Advances the buffer offset past a serialized integer value.
258
- *
259
- * Mirrors {@link inInteger}.
260
- */
218
+ /** Advances past a serialized integer. Mirrors {@link inInteger}. */
261
219
  skipInteger(): void;
262
- /**
263
- * Ensures that the given value is not {@link RValues.NaInteger}.
264
- * @param value - Integer value to be tested.
265
- * @returns The validated integer value.
266
- * @throws Error if the value equals `RValues.NaInteger`.
267
- */
220
+ /**. Throws error if `value` is {@link RValues.NaInteger}. */
268
221
  assertInteger(value: number | RValues.NaInteger): number;
269
- /**
270
- * Ensures that the given object is not {@link RValues.NilValue}.
271
- * @param obj - R object to validate.
272
- * @returns The validated {@link RObjectData}.
273
- * @throws Error if the object equals {@link RValues.NilValue}.
274
- */
222
+ /**. Throws error if `obj` is {@link RValues.NilValue}. */
275
223
  assertRObjectData(obj: RObject): RObjectData;
276
224
  /**
277
- * Reads an ASCII word from the input buffer.
278
- * @param size - Maximum allowed word size.
279
- * @returns The parsed word.
280
- * @throws Error if EOF is reached or the word exceeds the allowed size.
225
+ * Reads an ASCII word of at most `size` bytes. Throws error on EOF or overflow.
281
226
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L378-L394 | R source: inWord}
282
227
  */
283
228
  inWord(size: number): string;
284
- /**
285
- * Skips an ASCII word in the input buffer.
286
- *
287
- * Mirrors {@link inWord}
288
- * @returns An empty string.
289
- * @throws Error if EOF is reached or the word exceeds {@link RDAParser.WORD_SIZE}.
290
- */
229
+ /** Skips an ASCII word. Mirrors {@link inWord}. Throws error on EOF or overflow past {@link RDAParser.WORD_SIZE}. */
291
230
  skipWord(): string;
292
- /**
293
- * Reads the next character from the input buffer.
294
- * @returns The next character or `-1` on EOF.
295
- */
231
+ /**. Answers the next character, or `-1` on EOF. */
296
232
  inChar(): number;
297
- /**
298
- * Checks whether the given byte represents a whitespace character.
299
- * @param c - Character code to check.
300
- * @returns `true` if the character is whitespace.
301
- */
233
+ /** Whether `c` is a whitespace byte. */
302
234
  isSpace(c: number): boolean;
303
235
  /**
304
- * Reads a serialized string from the buffer.
305
- * @param len - Length of the serialized string.
306
- * @returns Decoded string.
236
+ * Reads a serialized string of `len` bytes.
307
237
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L505-L550 | R source: inString}
308
238
  */
309
239
  inString(len: number): string;
310
- /**
311
- * Skips a serialized string depending on the current serialization format.
312
- *
313
- * Mirrors {@link inString}
314
- * @param len - Length of the serialized string.
315
- */
240
+ /** Skips a serialized string of `len` bytes. Mirrors {@link inString}. */
316
241
  skipString(len: number): void;
317
242
  /**
318
- * Decodes an R writer version integer into v, p, and s.
319
- * @param writerVersion - Encoded writer version.
320
- * @returns Tuple containing version components `[v,p,s]`.
243
+ * Decodes an encoded R writer version into `[v, p, s]`.
321
244
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2230-L2235 | R source: decodeVersion}
322
245
  */
323
246
  decodeVersion(writerVersion: number): number[];
324
247
  /**
325
- * Reads the next flags and dispatches to {@link readItemRecursive}.
326
- * This is the main recursive entry point called for every R object encountered
327
- * during deserialization.
248
+ * Reads the next flags and dispatches to {@link readItemRecursive}; the main recursive entry point for every R
249
+ * object encountered during deserialization.
328
250
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2117-L2121 | R source: ReadItem}
329
251
  */
330
252
  readItem(): RObject;
253
+ /** Runs `code` in R and answers an `EnvSxp`, `value` set to {@link RValues.GlobalEnv} when the result names it. Shared by {@link R_FindNamespace} and {@link R_FindNamespace1}. */
254
+ private runNamespaceLookup;
331
255
  /**
332
- * Resolves a namespace reference by name using `getNamespace()` in R.
333
- * Simpler variant of {@link R_FindNamespace1}.
334
- * @param info - The {@link RObjectData} holding the namespace/package info.
335
- * @returns An {@link RObjectData} of type {@link SexpType.EnvSxp} whose
336
- * `value` is set to the resolved environment. Currently only
337
- * `R_GlobalEnv` is handled; other results are logged as warnings.
256
+ * Resolves a namespace reference by name via `getNamespace()` in R. Simpler variant of {@link R_FindNamespace1}.
338
257
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/envir.c#L3795-L3804 | R source: R_FindNamespace}
339
258
  */
340
259
  R_FindNamespace(info: RObjectData): RObjectData;
341
260
  /**
342
- * Resolves a serialized namespace reference by executing R at runtime.
343
- * @param info - The {@link RObjectData} holding the namespace/package info.
344
- * @returns An {@link RObjectData} of type {@link SexpType.EnvSxp} whose
345
- * `value` is set to the resolved environment. Currently only
346
- * `R_GlobalEnv` is handled; other results are logged as warnings.
261
+ * Resolves a serialized namespace reference by executing R at runtime. See {@link R_FindNamespace} for the result shape.
347
262
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1785-L1796 | R source: R_FindNamespace1}
348
263
  */
349
264
  R_FindNamespace1(info: RObjectData): RObjectData;
350
265
  /**
351
- * Deserializes a single SEXP node recursively.
352
- *
353
- * The method dispatches to the corresponding deserialization logic
354
- * depending on the encoded {@link SexpType}.
355
- * @param flags - Serialized SEXP flags word.
356
- * @returns Deserialized {@link RObjectData}.
266
+ * Deserializes a single SEXP node, dispatching on its encoded {@link SexpType}.
357
267
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1871-L2115 | R source: ReadItem_Recursive}
358
268
  */
359
269
  readItemRecursive(flags: number): RObjectData;
270
+ /** Reads (or with `skip`, discards) a `SymSxp` symbol. Shared by {@link readItemRecursive} and {@link skipItem}. */
271
+ readOrSkipSym(skip: boolean): RObjectData;
360
272
  /**
361
- * Skips a serialized SEXP node, only filling in its type and calling other skip methods to
362
- * advance the buffer position.
363
- *
364
- * Mirrors the structure of {@link readItemRecursive} but skips payload data.
365
- * @returns A minimal {@link RObjectData} with little to no payload.
273
+ * Reads (or with `skip`, discards) an `AltRepSxp`. Only `skip === false` attempts {@link AltRepUnserializeEx};
274
+ * discarding it just derives the base type its payload triple encodes. Shared by {@link readItemRecursive} and {@link skipItem}.
366
275
  */
367
- skipItem(): RObjectData;
276
+ readOrSkipAltRep(object: boolean, levels: number, skip: boolean): RObjectData;
368
277
  /**
369
- * Reads `len` raw bytes from the buffer into a number array.
370
- * @param len - Number of raw bytes to read.
371
- * @returns Array of unsigned byte values.
372
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2062-L2084 | R source: ReadItem_Recursive}
278
+ * Reads (or with `skip`, discards) an `EnvSxp` environment frame; the locked/class-object bookkeeping only matters when kept.
279
+ * Shared by {@link readItemRecursive} and {@link skipItem}.
373
280
  */
374
- inRaw(len: number): number[];
281
+ readOrSkipEnv(skip: boolean): RObjectData;
375
282
  /**
376
- * Advances the buffer offset past `len` raw bytes without reading values.
377
- *
378
- * Mirrors {@link inRaw}.
379
- * @param len - Number of raw bytes to skip.
283
+ * Reads (or with `skip`, discards) the payload of a leaf SEXP node, shared by {@link readItemRecursive} and {@link skipItem}.
284
+ * `skip` mirrors their field-by-field differences exactly; see the branches below.
380
285
  */
381
- skipRaw(len: number): void;
286
+ readOrSkipLeaf(type: number, levels: number, object: boolean, hasAttribute: boolean, skip: boolean): RObjectData;
287
+ /** Advances past a serialized SEXP node, filling in only its type. Mirrors {@link readItemRecursive}'s structure, but skips payload data. */
288
+ skipItem(): RObjectData;
382
289
  /**
383
- * Resolves package environments.
384
- * @param s - String-vec {@link RObject} identifying the package.
385
- *
386
- * Not implemented yet!
387
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/envir.c#L3732-L3741 | R source: R_FindPackageEnv}
290
+ * Reads (or with `skip`, discards) `len` raw bytes into a number array.
291
+ * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2062-L2084 | R source: ReadItem_Recursive}
388
292
  */
293
+ inRaw(len: number, skip?: boolean): number[];
294
+ /** Resolves package environments. Not implemented yet!. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/envir.c#L3732-L3741 | R source: R_FindPackageEnv} */
389
295
  rFindPackageEnv(s: RObjectData): RObjectData;
390
- /**
391
- * Decodes the SEXP flags.
392
- * @param flags - Raw 32-bit flags word.
393
- * @returns `[type, levels, isObject, hasAttribute, hasTag]`.
394
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L748-L756 | R source: UnpackFlags}
395
- */
296
+ /** Decodes a raw SEXP flags word into `[type, levels, isObject, hasAttribute, hasTag]`. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L748-L756 | R source: UnpackFlags} */
396
297
  unpackFlags(flags: number): [number, number, boolean, boolean, boolean];
397
- /**
398
- * Retrieves an object from the reference table.
399
- * @param index - 1-based reference index.
400
- * @returns A registered {@link RObjectData}.
401
- * @throws Error if the index is out of range.
402
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1461-L1469 | R source: GetReadRef}
403
- */
298
+ /** Retrieves the registered object at 1-based reference `index`. Throws error if out of range. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1461-L1469 | R source: GetReadRef} */
404
299
  getReadRef(index: number): RObjectData;
405
300
  /**
406
- * Extracts the reference index from the given flags.
407
- *
408
- * When bits 8–31 are non-zero they encode the index directly;
409
- * otherwise the index is read as the next integer from the stream.
410
- * @param flags - Raw 32-bit flags word.
411
- * @returns A 1-based reference index.
301
+ * The 1-based reference index encoded in `flags`: bits 8-31 encode it directly when non-zero, otherwise it is read as the next stream integer.
412
302
  * @see {@link http://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L782-L789 | R source: InRefIndex}
413
303
  */
414
304
  inRefIndex(flags: number): number;
415
- /**
416
- * Appends an object to the reference table so it can be resolved later by {@link getReadRef}.
417
- * @param value - The {@link RObject} to register.
418
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1471-L1490 | R source: AddReadRef}
419
- */
305
+ /** Appends `value` to the reference table so it can be resolved later by {@link getReadRef}. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1471-L1490 | R source: AddReadRef} */
420
306
  addReadRef(value: RObject): void;
421
307
  /**
422
- * Reads a persistent string vector from the stream.
423
- * @returns An {@link RObjectData} of type `CharSxp` whose `value` array holds the deserialized string items.
424
- * @throws Error if the names flag is non-zero.
425
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1492-L1504 | R source: InStringVec}
426
- */
427
- inStringVec(): RObjectData;
428
- /**
429
- * Advances the buffer past a persistent string vector without reading values.
430
- *
431
- * Mirrors {@link inStringVec}.
432
- * @throws Error if the names flag is non-zero.
433
- */
434
- skipStringVec(): void;
435
- /**
436
- * Sets the enclosing environment of an environment object.
437
- * @param x - Environment whose enclosure should be set.
438
- * @param v - Parent environment.
439
- * @throws Error if the parent is invalid or would introduce a cycle.
440
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4677-L4690 | R source: SET_ENCLOS}
308
+ * Reads (or with `skip`, discards) a persistent string vector. Answers a `CharSxp` {@link RObjectData} whose
309
+ * `value` array holds the deserialized items, empty when skipped. Throws Error if the names flag is non-zero.
310
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1492-L1504 | R source: InStringVec}
441
311
  */
312
+ inStringVec(skip?: boolean): RObjectData;
313
+ /** Sets `x`'s enclosing environment to `v`. Throws error if `v` is invalid or would introduce a cycle. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4677-L4690 | R source: SET_ENCLOS} */
442
314
  SetEnClos(x: RObjectData, v: RObjectData): void;
443
315
  /**
444
- * Iteratively deserializes linked-list based SEXP structures.
445
- * @param flags - Initial flags.
446
- * @returns Head node of the reconstructed pairlist chain as {@link RObjectData}.
447
- * @throws Error if the initial type is not a valid pairlist type.
448
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1800-L1868 | R source: ReadItem_Iterative}
316
+ * Iteratively deserializes linked-list based SEXP structures. Answers head node of the reconstructed pairlist
317
+ * chain. Throws Error if the initial type is not a valid pairlist type.
318
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1800-L1868 | R source: ReadItem_Iterative}
449
319
  */
450
320
  readItemIterative(flags: number): RObjectData;
451
- /**
452
- * Creates a weak reference object.
453
- * @param key - Weak reference key object.
454
- * @param val - Referenced value.
455
- * @param fin - Finalizer function or NULL.
456
- * @param onexit - Whether the finalizer should run on exit.
457
- * @returns The created weak reference object as {@link RObject}.
458
- * @throws Error if the finalizer type is invalid.
459
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L1424-L1435 | R source: R_MakeWeakRef}
460
- */
321
+ /** Creates a weak reference object. Throws error if `fin` is not a function or NULL. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L1424-L1435 | R source: R_MakeWeakRef} */
461
322
  R_MakeWeakRef(key: RObjectData, val: RObject, fin: RObjectData, onexit: boolean): RObject;
323
+ /** Allocates and initializes a weak reference object. Throws error if `key`'s type is invalid. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L1388-L1422 | R source: NewWeakRef} */
324
+ newWeakRef(key: RObjectData, val: RObject, fin: RObjectData, _onexit: boolean): RObject;
462
325
  /**
463
- * Allocates and initializes a weak reference object.
464
- * @param key - Weak reference key object.
465
- * @param val - Referenced value.
466
- * @param fin - Finalizer function.
467
- * @param onexit - Whether the finalizer should run on exit.
468
- * @returns The initialized weak reference object as {@link RObject}.
469
- * @throws Error if the key type is invalid.
470
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L1388-L1422 | R source: NewWeakRef}
471
- */
472
- newWeakRef(key: RObjectData, val: RObject, fin: RObjectData, onexit: boolean): RObject;
473
- /**
474
- * Creates or retrieves a cached primitive function object.
475
- * @param index - Primitive function table index.
476
- * @param evaluation - Non-zero for {@link SexpType.BuiltInSxp}, zero for {@link SexpType.SpecialSxp}.
477
- * @returns of type {@link SexpType.BuiltInSxp} or {@link SexpType.SpecialSxp}.
478
- * @throws Error if the index is out of range or the cached type mismatches.
479
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/dstruct.c#L37-L68 | R source: mkPRIMSXP}
326
+ * Creates or retrieves a cached primitive function object of type {@link SexpType.BuiltInSxp} (`evaluation` non-zero)
327
+ * or {@link SexpType.SpecialSxp}, from `index` into the primitive function table. Throws Error if out of range.
328
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/dstruct.c#L37-L68 | R source: mkPRIMSXP}
480
329
  */
481
330
  mkPrimSxp(index: number, evaluation: number): RObjectData;
482
331
  /**
483
- * Reads `len` bytes as a character string and applies encoding from the GP bits.
484
- *
485
- * Encoding flags: bit 3 = UTF-8, bit 2 = Latin-1, bit 1 = raw bytes, bit 6 = ASCII (native-safe).
486
- * @param len - Number of bytes to read.
487
- * @param levels - GP levels bits from the `CharSxp` flags word.
488
- * @returns The decoded string, or `''` when the encoding is not yet handled.
489
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1689-L1759 | R source: ReadChar}
332
+ * Reads `len` bytes as a character string, decoded per the encoding flags in `levels` (bit 3 UTF-8, bit 2 Latin-1,
333
+ * bit 1 raw bytes, bit 6 ASCII); answers `''` for a native encoding, which is not yet handled.
334
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1689-L1759 | R source: ReadChar}
490
335
  */
491
336
  readChar(len: number, levels: number): string;
492
337
  /**
493
- * Reads a vector length from the stream.
494
- * @returns The vector length.
495
- * @throws Error for negative lengths or an invalid high-word value.
496
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1761-L1782 | R source: ReadLENGTH}
338
+ * Reads a vector length from the stream. Throws Error for negative lengths or an invalid high-word value.
339
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1761-L1782 | R source: ReadLENGTH}
497
340
  */
498
341
  readLength(): number;
499
342
  /**
500
- * Reads `len` integers from the buffer.
501
- * @param len - Number of integers to read.
502
- * @returns Array of integer values or {@link RValues.NaInteger}.
503
- * @throws Error for BINARY format or XDR buffer overrun.
504
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1507-L1541 | R source: InIntegerVec}
505
- */
506
- inIntegerVec(len: number): (number | RValues.NaInteger)[];
507
- /**
508
- * Advances the buffer past `len` serialized integers without reading values.
509
- *
510
- * Mirrors {@link inIntegerVec}.
511
- * @param len - Number of integers to skip.
512
- * @returns An empty array.
513
- * @throws Error for BINARY format or XDR buffer overrun.
514
- */
515
- skipIntegerVec(len: number): (number | RValues.NaInteger)[];
516
- /**
517
- * Reads `len` doubles from the buffer.
518
- * @param len - Number of doubles to read.
519
- * @returns Array of numbers or {@link RValues}.
520
- * @throws Error for BINARY format.
521
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1543-L1577 | R source: InRealVec}
522
- */
523
- inRealVec(len: number): (number | RValues)[] | null[];
524
- /**
525
- * Advances the buffer past `len` serialized doubles without reading values.
526
- *
527
- * Mirrors {@link inRealVec}.
528
- * @param len - Number of doubles to skip.
529
- * @returns An empty array.
530
- * @throws Error for BINARY format.
531
- */
532
- skipRealVec(len: number): (number | RValues)[] | null[];
533
- /**
534
- * Reads the next double from the buffer.
535
- * @returns A number or an {@link RValues}.
536
- * @throws TypeError if the ASCII token is not a valid float.
537
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L427-L463 | R source: InReal}
343
+ * Reads (or with `skip`, discards) `len` integers. Throws Error for BINARY format or XDR buffer overrun.
344
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1507-L1541 | R source: InIntegerVec}
538
345
  */
539
- inReal(): Real;
346
+ inIntegerVec(len: number, skip?: boolean): (number | RValues.NaInteger)[];
540
347
  /**
541
- * Advances the buffer past the next serialized double without reading it.
542
- *
543
- * Mirrors {@link inReal}.
348
+ * Reads (or with `skip`, discards) `len` doubles. Throws Error for BINARY format.
349
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1543-L1577 | R source: InRealVec}
544
350
  */
545
- skipReal(): void;
351
+ inRealVec(len: number, skip?: boolean): (number | RValues)[] | null[];
546
352
  /**
547
- * Reads `len` complex numbers from the buffer.
548
- *
549
- * Each value is read as two consecutive doubles via {@link inComplex}.
550
- * @param len - Number of complex values to read.
551
- * @returns Array of {@link Complex} objects.
552
- * @throws Error for BINARY format.
553
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1579-L1616 | R source: InComplexVec}
353
+ * Reads (or with `skip`, discards) the next double. Throws TypeError if the ASCII token is not a valid float.
354
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L427-L463 | R source: InReal}
554
355
  */
555
- inComplexVec(len: number): Complex[];
356
+ inReal(skip?: boolean): Real;
556
357
  /**
557
- * Advances the buffer past `len` serialized complex numbers.
558
- *
559
- * Mirrors {@link inComplexVec}.
560
- * @param len - Number of complex values to skip.
561
- * @throws Error for BINARY format.
358
+ * Reads (or with `skip`, discards) `len` complex numbers, each as two consecutive doubles via {@link inComplex}. Throws Error for BINARY format.
359
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1579-L1616 | R source: InComplexVec}
562
360
  */
563
- skipComplexVec(len: number): void;
361
+ inComplexVec(len: number, skip?: boolean): Complex[];
564
362
  /**
565
- * Reads a single complex number as two consecutive real values.
566
- * @returns A {@link Complex} object with `r` (real) and `i` (imaginary) parts.
363
+ * Reads (or with `skip`, discards) a single complex number as two consecutive real values.
567
364
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L465-L471 | R source: InComplex}
568
365
  */
569
- inComplex(): Complex;
366
+ inComplex(skip?: boolean): Complex;
570
367
  /**
571
- * Advances the buffer past a single serialized complex number (two doubles).
572
- *
573
- * Mirrors {@link inComplex}.
574
- */
575
- skipComplex(): void;
576
- /**
577
- * Sets the `i`-th element of a character vector.
578
- * @param x - The character vector with type {@link SexpType.StrSxp} to modify.
579
- * @param i - index to set.
580
- * @param v - The {@link SexpType.CharSxp} {@link RObjectData} whose `name` is stored.
581
- * @throws Error if `x` is not a {@link SexpType.StrSxp} or `i` is out of bounds.
582
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4283-L4301 | R source: SET_STRING_ELT}
368
+ * Sets the `i`-th element of a {@link SexpType.StrSxp} character vector to `v.name`. Throws Error if `x` is not
369
+ * a {@link SexpType.StrSxp} or `i` is out of bounds. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4283-L4301 | R source: SET_STRING_ELT}
583
370
  */
584
371
  SET_STRING_ELT(x: RObjectData, i: number, v: RObjectData): void;
585
372
  /**
586
- * Sets the `i`-th element of a generic list or vector.
587
- *
588
- * Mirrors R's `SET_VECTOR_ELT` macro.
589
- * @param x - The list or vector to modify.
590
- * @param i - index to set.
591
- * @param v - The {@link RObject} to store at position `i`.
592
- * @throws Error if `x` is not a list type or `i` is out of bounds.
593
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4303-L4322 | R source: SET_VECTOR_ELT}
373
+ * Sets the `i`-th element of a generic list or vector. Mirrors R's `SET_VECTOR_ELT` macro. Throws Error if `x`
374
+ * is not a list type or `i` is out of bounds. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4303-L4322 | R source: SET_VECTOR_ELT}
594
375
  */
595
376
  SET_VECTOR_ELT(x: RObjectData, i: number, v: RObject): void;
596
- /**
597
- * Deserializes an R bytecode object.
598
- * @returns A {@link SexpType.BcodesSxp} {@link RObject}.
599
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2221-L2228 | R source: ReadBC}
600
- */
377
+ /** Deserializes an R bytecode object. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2221-L2228 | R source: ReadBC} */
601
378
  readBC(): RObject;
602
- /**
603
- * Advances the buffer past a bytecode object without reading it.
604
- *
605
- * Mirrors {@link readBC}.
606
- */
379
+ /** Advances past a bytecode object. Mirrors {@link readBC}. */
607
380
  skipBC(): void;
608
- /**
609
- * Advances past a single bytecode.
610
- *
611
- * Mirrors {@link readBC1}.
612
- */
381
+ /** Advances past a single bytecode. Mirrors {@link readBC1}. */
613
382
  skipBC1(): void;
614
- /**
615
- * Advances past all bytecode constants.
616
- *
617
- * Mirrors {@link ReadBCConsts}.
618
- */
619
- skipBCConsts(): void;
620
383
  /**
621
384
  * Registers a bytecode object after encoding.
622
385
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L8820-L8885 | R source: R_registerBC}
623
386
  */
624
387
  R_registerBC(_bytes: RObject, _s: RObject): void;
625
- /**
626
- * Deserializes a single bytecode object.
627
- * @param reps - Pre-allocated repetition table shared across all constants.
628
- * @returns A {@link SexpType.BcodesSxp} {@link RObjectData}.
629
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2205-L2219 | R source: ReadBC1}
630
- */
388
+ /** Deserializes a single bytecode object, `reps` is the repetition table shared across all constants. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2205-L2219 | R source: ReadBC1} */
631
389
  readBC1(reps: RObjectData): RObjectData;
632
- /**
633
- * Encodes bytecode instructions.
634
- * @param _bytes - integer array
635
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L8723-L8771 | R source: R_bcEncode}
636
- */
390
+ /** Encodes bytecode instructions. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L8723-L8771 | R source: R_bcEncode} */
637
391
  _R_bcEncode(_bytes: Int32Array): void;
638
392
  /**
639
- * Reads the constants of a bytecode object.
640
- * @param reps - Shared repetition table for `BcRepDef`/`BcRepRef` resolution.
641
- * @returns A `VecSxp` {@link RObjectData} holding all `n` constants.
642
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2173-L2203 | R source: ReadBCConsts}
643
- */
644
- ReadBCConsts(reps: RObjectData): RObjectData;
645
- /**
646
- * Reads a single language object from bytecode constants.
647
- * @param type - {@link SexpType} read from the constants.
648
- * @param reps - Shared repetition table.
649
- * @returns The deserialized language {@link RObjectData}.
650
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2125-L2171 | R source: ReadBCLang}
393
+ * Reads (or with `skip`, discards) the `n` constants of a bytecode object into a `VecSxp`, `reps` resolves `BcRepDef`/`BcRepRef`.
394
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2173-L2203 | R source: ReadBCConsts}
651
395
  */
396
+ readOrSkipBCConsts(reps: RObjectData | undefined, skip: boolean): RObjectData;
397
+ /** Reads a single language object from bytecode constants, `reps` is the shared repetition table. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2125-L2171 | R source: ReadBCLang} */
652
398
  ReadBCLang(type: SexpType, reps: RObjectData): RObjectData;
653
- /**
654
- * Advances the buffer past a single language object.
655
- *
656
- * Mirrors {@link ReadBCLang}.
657
- * @param type - read {@link SexpType}.
658
- */
399
+ /** Advances past a single language object. Mirrors {@link ReadBCLang}. */
659
400
  skipBCLang(type: SexpType): void;
660
401
  /**
661
- * Retrieves the `i`-th element of a generic list or vector.
662
- * @param x - The list / expression / weak-ref vector.
663
- * @param i - The index to retrieve.
664
- * @returns The {@link RObject} at position `i`.
665
- * @throws Error if `x` is not a list type or `i` is out of bounds.
666
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4122-L4142 | R source: VECTOR_ELT}
402
+ * Retrieves the `i`-th element of a generic list or vector. Throws Error if `x` is not a list type or `i` is out of bounds.
403
+ * See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4122-L4142 | R source: VECTOR_ELT}
667
404
  */
668
405
  VECTOR_ELT(x: RObjectData, i: number): RObject;
669
- /**
670
- * Checks whether a bytecode object's version is within the supported range.
671
- * @param s - The {@link SexpType.BcodesSxp} {@link RObjectData} to check.
672
- * @returns `true` if the version is supported.
673
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L7166-L7175 | R source: R_BCVersionOK}
674
- */
406
+ /** Whether a {@link SexpType.BcodesSxp}'s version is within the supported range. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L7166-L7175 | R source: R_BCVersionOK} */
675
407
  R_BCVersionOK(s: RObjectData): boolean;
676
- /**
677
- * Returns the source-language expression for an unsupported bytecode object.
678
- * @param s - The {@link SexpType.BcodesSxp} {@link RObjectData}.
679
- * @returns First constant pool entry if available, otherwise {@link RValues.NilValue}.
680
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L5566-L5574 | R source: bytecodeExpr}
681
- */
408
+ /** Source-language expression for an unsupported bytecode object: its first constant pool entry, or {@link RValues.NilValue}. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L5566-L5574 | R source: bytecodeExpr} */
682
409
  R_BytecodeExpr(s: RObjectData): RObject;
683
410
  /**
684
- * Attempts to unserialize an ALTREP object.
685
- * @param info - The info to be unserialized.
686
- * @param _state - Serialized state.
687
- * @param _attr - Serialized attributes.
688
- * @param _objf - IS_OBJECT flag.
689
- * @param _levs - GP levels bits.
690
- * @returns The {@link RObjectData} or .
691
- * @throws Error if the base type is not a supported vector type.
411
+ * Attempts to unserialize an ALTREP object. Throws error if the base type is not a supported vector type.
692
412
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L298-L338 | R source: ALTREP_UNSERIALIZE_EX}
693
413
  */
694
414
  AltRepUnserializeEx(info: RObjectData, _state: RObjectData, _attr: RObjectData, _objf: boolean, _levs: number): RObjectData;
695
415
  /**
696
- * Looks up the ALTREP class for the given class/package symbol pair.
697
- * @param info - The info to be looked up.
698
- * @returns The class {@link RObjectData} when found, `undefined` if unregistered, or `null` if `info` is not a `ListSxp`.
416
+ * The ALTREP class registered for `info`'s class/package symbol pair, `undefined` if unregistered, `null` if `info` is not a `ListSxp`.
699
417
  * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L279-L296 | R source: ALTREP_UNSERIALIZE_CLASS}
700
418
  */
701
419
  ALTREP_UNSERIALIZE_CLASS(info: RObjectData): RObjectData | null | undefined;
702
- /**
703
- * Looks up an ALTREP class entry by class and package symbol.
704
- * @param cSym - Class symbol.
705
- * @param pSym - Package symbol.
706
- * @returns The {@link RObjectData} or `undefined` if not registered.
707
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L90-L94 | R source: LookupClass}
708
- */
420
+ /** ALTREP class entry for `cSym`/`pSym`, `undefined` if not registered. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L90-L94 | R source: LookupClass} */
709
421
  LookupClass(cSym: RObjectData, pSym: RObjectData): RObjectData | undefined;
710
- /**
711
- * Searches the ALTREP class registry for an entry matching the given symbols.
712
- * @param cSym - Class symbol to match.
713
- * @param pSym - Package symbol to match.
714
- * @returns The matching registry node or `null` if not found.
715
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L53-L59 | R source: LookupClassEntry}
716
- */
422
+ /** Searches the ALTREP class registry for an entry matching `cSym`/`pSym`. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L53-L59 | R source: LookupClassEntry} */
717
423
  LookupClassEntry(cSym: RObject, pSym: RObject): RObjectData | null;
718
- /**
719
- * Creates a length-1 character vector wrapping the given string.
720
- * @param x - The string value to wrap.
721
- * @returns A {@link SexpType.StrSxp} {@link RObjectData} with one element.
722
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/include/Rinlinedfuns.h#L1044-L1052 | R source: ScalarString}
723
- */
424
+ /** A length-1 {@link SexpType.StrSxp} character vector wrapping `x`. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/include/Rinlinedfuns.h#L1044-L1052 | R source: ScalarString} */
724
425
  ScalarString(x: string): RObjectData;
725
- /**
726
- * Recomputes and restores the cached hash-table priority count for an environment.
727
- * @param s - The {@link RObjectData} whose hash table is to be repaired.
728
- * @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/envir.c#L3685-L3698 | R source: R_RestoreHashCount}
729
- */
426
+ /** Recomputes and restores the cached hash-table priority count for environment `s`. See {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/envir.c#L3685-L3698 | R source: R_RestoreHashCount} */
730
427
  restoreHashCount(s: RObjectData): void;
731
- /**
732
- * Converts a linked-list based R object tree into a flat array representation.
733
- * @param node - Root node of the deserialized object tree.
734
- * @param shortcut - Whether payload values should be omitted.
735
- * @returns Flattened array of top-level objects.
736
- */
428
+ /** Converts a linked-list based R object tree into a flat array of top-level objects, omitting payloads when `shortcut`. */
737
429
  flattenRObject(node: RObject, shortcut: boolean): RObjectData[];
738
430
  }
431
+ /** the value of the R attribute `name`, which hangs off an object as a chain of pairlist cells */
432
+ export declare function attributeOf(obj: RObject | undefined, name: string): RObjectData | undefined;
433
+ /** the strings of a character vector, empty for anything that is not one */
434
+ export declare function stringsOf(obj: RObjectData | undefined): string[];
435
+ /** the `names` attribute of a serialized object, empty when it states none */
436
+ export declare function namesOf(obj: RObject | undefined): string[];
437
+ /** the element called `name` of a serialized named list */
438
+ export declare function elementOf(obj: RObject | undefined, name: string): RObject | undefined;
739
439
  export {};