@eagleoutice/flowr 2.14.1 → 2.14.2

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 (413) hide show
  1. package/README.md +154 -87
  2. package/abstract-interpretation/absint-visitor.d.ts +91 -25
  3. package/abstract-interpretation/absint-visitor.js +235 -74
  4. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +1 -1
  5. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  6. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
  7. package/abstract-interpretation/data-frame/mappers/arguments.js +1 -1
  8. package/abstract-interpretation/data-frame/mappers/function-mapper.js +107 -254
  9. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +5 -5
  10. package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -1
  11. package/abstract-interpretation/data-frame/resolve-args.js +6 -4
  12. package/abstract-interpretation/data-frame/shape-inference.d.ts +4 -9
  13. package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -0
  14. package/abstract-interpretation/domains/bounded-set-domain.js +1 -0
  15. package/abstract-interpretation/domains/partial-product-domain.js +1 -1
  16. package/abstract-interpretation/domains/set-range-domain.d.ts +3 -2
  17. package/abstract-interpretation/domains/set-range-domain.js +3 -2
  18. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +3 -2
  19. package/abstract-interpretation/domains/set-upper-bound-domain.js +3 -2
  20. package/benchmark/calibration.d.ts +11 -6
  21. package/benchmark/calibration.js +19 -8
  22. package/benchmark/slicer.d.ts +7 -1
  23. package/benchmark/slicer.js +38 -34
  24. package/benchmark/stats/count-comments.d.ts +16 -0
  25. package/benchmark/stats/count-comments.js +30 -0
  26. package/benchmark/stats/print.js +2 -0
  27. package/benchmark/stats/size-of.d.ts +7 -3
  28. package/benchmark/stats/size-of.js +7 -3
  29. package/benchmark/stats/stats.d.ts +7 -0
  30. package/benchmark/summarizer/first-phase/process.js +2 -19
  31. package/benchmark/summarizer/second-phase/graph.js +13 -3
  32. package/benchmark/summarizer/second-phase/process.js +2 -0
  33. package/cli/repl/commands/repl-dataflow.js +70 -27
  34. package/cli/repl/core.d.ts +1 -1
  35. package/cli/repl/core.js +1 -1
  36. package/cli/repl/parser/slice-query-parser.js +2 -1
  37. package/cli/repl/server/connection.d.ts +4 -0
  38. package/cli/repl/server/connection.js +19 -16
  39. package/cli/repl/server/messages/message-analysis.d.ts +1 -1
  40. package/config.d.ts +6 -0
  41. package/config.js +8 -4
  42. package/control-flow/basic-cfg-guided-visitor.d.ts +7 -2
  43. package/control-flow/basic-cfg-guided-visitor.js +37 -24
  44. package/control-flow/cfg-dead-code.js +44 -33
  45. package/control-flow/cfg-properties.js +2 -2
  46. package/control-flow/cfg-simplification.js +6 -5
  47. package/control-flow/cfg-to-basic-blocks.js +11 -13
  48. package/control-flow/control-flow-graph.d.ts +179 -189
  49. package/control-flow/control-flow-graph.js +400 -263
  50. package/control-flow/dfg-cfg-guided-visitor.d.ts +21 -3
  51. package/control-flow/dfg-cfg-guided-visitor.js +17 -13
  52. package/control-flow/diff-cfg.js +6 -14
  53. package/control-flow/happens-before.js +5 -4
  54. package/control-flow/semantic-cfg-guided-visitor.d.ts +44 -101
  55. package/control-flow/semantic-cfg-guided-visitor.js +6 -26
  56. package/control-flow/simple-visitor.js +14 -15
  57. package/control-flow/syntax-cfg-guided-visitor.d.ts +2 -1
  58. package/control-flow/useless-loop.js +18 -14
  59. package/core/steps/all/core/20-dataflow.d.ts +1 -3
  60. package/core/steps/pipeline/default-pipelines.d.ts +141 -157
  61. package/dataflow/cluster.js +7 -0
  62. package/dataflow/environments/apply-kill.d.ts +6 -0
  63. package/dataflow/environments/apply-kill.js +63 -31
  64. package/dataflow/environments/built-in-props.d.ts +5 -1
  65. package/dataflow/environments/built-in-props.js +4 -0
  66. package/dataflow/environments/built-in.d.ts +6 -3
  67. package/dataflow/environments/built-in.js +8 -5
  68. package/dataflow/environments/clone.d.ts +3 -3
  69. package/dataflow/environments/clone.js +5 -5
  70. package/dataflow/environments/default-builtin-config.d.ts +112 -7
  71. package/dataflow/environments/default-builtin-config.js +82 -34
  72. package/dataflow/environments/environment.d.ts +5 -5
  73. package/dataflow/environments/environment.js +5 -5
  74. package/dataflow/environments/identifier.d.ts +11 -1
  75. package/dataflow/environments/identifier.js +4 -1
  76. package/dataflow/environments/resolve-by-name.d.ts +7 -0
  77. package/dataflow/environments/resolve-by-name.js +12 -0
  78. package/dataflow/environments/resolve-helper.d.ts +3 -1
  79. package/dataflow/environments/resolve-helper.js +2 -0
  80. package/dataflow/eval/resolve/alias-tracking.d.ts +2 -2
  81. package/dataflow/eval/resolve/alias-tracking.js +2 -2
  82. package/dataflow/eval/resolve/match-arguments.js +7 -5
  83. package/dataflow/eval/resolve/node-value.d.ts +3 -1
  84. package/dataflow/eval/resolve/node-value.js +12 -0
  85. package/dataflow/eval/resolve/resolve-argument.js +5 -4
  86. package/dataflow/eval/resolve/resolve-operators.js +9 -6
  87. package/dataflow/eval/resolve/resolve-strings.js +2 -2
  88. package/dataflow/eval/resolve/resolve-working-directory.js +4 -3
  89. package/dataflow/eval/resolve/resolve.js +3 -2
  90. package/dataflow/eval/values/general.js +8 -5
  91. package/dataflow/extractor.d.ts +1 -4
  92. package/dataflow/extractor.js +11 -10
  93. package/dataflow/fn/exceptions-of-function.d.ts +3 -1
  94. package/dataflow/fn/strict-function.js +7 -5
  95. package/dataflow/graph/call-graph.js +2 -2
  96. package/dataflow/graph/df-helper.d.ts +8 -1
  97. package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
  98. package/dataflow/graph/diff-dataflow-graph.js +19 -2
  99. package/dataflow/graph/edge.d.ts +38 -2
  100. package/dataflow/graph/edge.js +32 -2
  101. package/dataflow/graph/graph.d.ts +4 -3
  102. package/dataflow/graph/graph.js +6 -2
  103. package/dataflow/graph/match-args.d.ts +69 -0
  104. package/dataflow/graph/match-args.js +167 -0
  105. package/dataflow/info.d.ts +14 -0
  106. package/dataflow/internal/control-flow.d.ts +102 -0
  107. package/dataflow/internal/control-flow.js +200 -0
  108. package/dataflow/internal/linker.d.ts +6 -31
  109. package/dataflow/internal/linker.js +24 -81
  110. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
  111. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +3 -3
  112. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +2 -2
  113. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +9 -6
  114. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
  115. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +6 -4
  116. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -10
  117. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +18 -37
  118. package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -3
  120. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +1 -1
  121. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +11 -7
  122. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
  123. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
  124. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +18 -14
  125. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +8 -1
  126. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +11 -0
  127. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
  128. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +27 -20
  129. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -2
  130. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
  131. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +35 -6
  132. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
  133. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +20 -17
  134. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +1 -1
  135. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +6 -4
  136. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +4 -3
  137. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +8 -3
  138. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +2 -2
  139. package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +5 -5
  140. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.d.ts +1 -1
  141. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +5 -4
  142. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +7 -5
  143. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +1 -1
  144. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +15 -13
  145. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
  146. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
  147. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +4 -3
  148. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +1 -1
  149. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +26 -4
  150. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
  151. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +17 -4
  152. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
  153. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +71 -33
  154. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +6 -15
  155. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +12 -13
  156. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  157. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +14 -11
  158. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +15 -1
  159. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
  160. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +12 -8
  161. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +6 -5
  162. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.d.ts +1 -1
  163. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +5 -4
  164. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
  165. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +45 -10
  166. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
  167. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +19 -3
  168. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +6 -2
  169. package/dataflow/internal/process/functions/call/common.js +5 -6
  170. package/dataflow/internal/process/functions/call/deferred.js +2 -2
  171. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +12 -2
  172. package/dataflow/internal/process/functions/call/known-call-handling.js +23 -1
  173. package/dataflow/internal/process/functions/call/named-call-handling.js +2 -0
  174. package/dataflow/internal/process/functions/call/nse.d.ts +1 -1
  175. package/dataflow/internal/process/functions/call/nse.js +6 -1
  176. package/dataflow/internal/process/functions/call/quoted.js +2 -2
  177. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +19 -6
  178. package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
  179. package/dataflow/internal/process/functions/process-argument.js +12 -4
  180. package/dataflow/internal/process/functions/process-parameter.js +13 -0
  181. package/dataflow/internal/process/process-named-call.d.ts +2 -2
  182. package/dataflow/internal/process/process-named-call.js +9 -7
  183. package/documentation/data/server/doc-data-server-messages.js +4 -4
  184. package/documentation/doc-readme.js +45 -0
  185. package/documentation/doc-util/doc-cfg.d.ts +8 -7
  186. package/documentation/doc-util/doc-cfg.js +10 -10
  187. package/documentation/doc-util/doc-playground.d.ts +12 -0
  188. package/documentation/doc-util/doc-playground.js +21 -0
  189. package/documentation/doc-util/doc-query.d.ts +4 -1
  190. package/documentation/doc-util/doc-query.js +4 -2
  191. package/documentation/wiki-absint.d.ts +3 -4
  192. package/documentation/wiki-absint.js +12 -5
  193. package/documentation/wiki-analyzer.js +2 -2
  194. package/documentation/wiki-cfg.js +101 -106
  195. package/documentation/wiki-dataflow-graph.js +84 -53
  196. package/documentation/wiki-linter.js +15 -1
  197. package/documentation/wiki-linting-and-testing.js +1 -16
  198. package/documentation/wiki-mk/doc-maker.js +6 -4
  199. package/documentation/wiki-query.js +14 -4
  200. package/documentation/wiki-signature-database.js +28 -2
  201. package/linter/linter-fix.d.ts +16 -0
  202. package/linter/linter-fix.js +104 -0
  203. package/linter/linter-format.d.ts +18 -1
  204. package/linter/linter-format.js +31 -1
  205. package/linter/linter-output.js +46 -10
  206. package/linter/linter-rules.d.ts +40 -9
  207. package/linter/linter-rules.js +2 -0
  208. package/linter/rules/absolute-path.js +4 -2
  209. package/linter/rules/dataframe-access-validation.js +6 -7
  210. package/linter/rules/deprecated-functions.d.ts +107 -10
  211. package/linter/rules/deprecated-functions.js +309 -23
  212. package/linter/rules/file-path-validity.js +5 -4
  213. package/linter/rules/function-finder-util.d.ts +6 -0
  214. package/linter/rules/function-finder-util.js +21 -13
  215. package/linter/rules/naming-convention.js +1 -1
  216. package/linter/rules/network-functions.d.ts +2 -2
  217. package/linter/rules/stop-with-call-arg.js +2 -2
  218. package/linter/rules/unclosed-connection.js +2 -2
  219. package/linter/rules/undefined-symbol-util.js +6 -4
  220. package/linter/rules/undefined-symbol.js +2 -2
  221. package/linter/rules/unused-definition.js +8 -4
  222. package/linter/rules/unused-import.d.ts +60 -0
  223. package/linter/rules/unused-import.js +179 -0
  224. package/package.json +2 -2
  225. package/project/attached-packages.js +2 -1
  226. package/project/cache/flowr-analyzer-cache.d.ts +2 -5
  227. package/project/cache/flowr-analyzer-cache.js +4 -7
  228. package/project/cache/flowr-analyzer-controlflow-cache.d.ts +9 -8
  229. package/project/cache/flowr-analyzer-controlflow-cache.js +17 -34
  230. package/project/cache/flowr-cache.d.ts +9 -0
  231. package/project/cache/flowr-cache.js +19 -0
  232. package/project/context/flowr-analyzer-context.d.ts +7 -3
  233. package/project/context/flowr-analyzer-context.js +15 -9
  234. package/project/context/flowr-analyzer-dependencies-context.d.ts +24 -3
  235. package/project/context/flowr-analyzer-dependencies-context.js +9 -14
  236. package/project/context/flowr-analyzer-files-context.js +15 -17
  237. package/project/context/flowr-analyzer-meta-context.js +2 -12
  238. package/project/dependency-version-space.d.ts +0 -7
  239. package/project/dependency-version-space.js +8 -7
  240. package/project/flowr-analyzer.d.ts +4 -6
  241. package/project/flowr-analyzer.js +4 -5
  242. package/project/plugins/file-plugins/files/flowr-namespace-file.js +22 -34
  243. package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +13 -13
  244. package/project/plugins/file-plugins/files/flowr-rda-file.js +131 -286
  245. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +1 -0
  246. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +1 -0
  247. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +2 -5
  248. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +2 -8
  249. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +32 -0
  250. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +43 -1
  251. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +4 -12
  252. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +3 -16
  253. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +5 -8
  254. package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +4 -10
  255. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +3 -10
  256. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +1 -13
  257. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +3 -6
  258. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -8
  259. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +2 -5
  260. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +2 -8
  261. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +2 -5
  262. package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +2 -8
  263. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +3 -4
  264. package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +3 -6
  265. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +4 -12
  266. package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +3 -16
  267. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +4 -12
  268. package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +3 -16
  269. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +4 -12
  270. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -16
  271. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +2 -5
  272. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +2 -8
  273. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.d.ts +2 -6
  274. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.js +1 -10
  275. package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.d.ts +2 -5
  276. package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.js +2 -8
  277. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-library-plugin.js +2 -1
  278. package/project/sigdb/build.d.ts +2 -2
  279. package/project/sigdb/decode.d.ts +0 -5
  280. package/project/sigdb/decode.js +0 -8
  281. package/project/sigdb/index-format.d.ts +4 -4
  282. package/project/sigdb/manifest.d.ts +2 -2
  283. package/project/sigdb/reader.d.ts +48 -13
  284. package/project/sigdb/reader.js +2 -1
  285. package/project/sigdb/schema.d.ts +3 -1
  286. package/project/sigdb/signature-db.d.ts +69 -0
  287. package/project/sigdb/signature-db.js +54 -0
  288. package/project/sigdb/signature-match.d.ts +10 -5
  289. package/project/sigdb/signature-match.js +13 -8
  290. package/queries/catalog/absint-query/absint-query-executor.js +1 -2
  291. package/queries/catalog/call-context-query/call-context-query-executor.js +2 -4
  292. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
  293. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +33 -6
  294. package/queries/catalog/control-flow-query/control-flow-query-executor.js +1 -2
  295. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  296. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +8 -7
  297. package/queries/catalog/dependencies-query/dependencies-query-format.js +22 -35
  298. package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +13 -1
  299. package/queries/catalog/dependencies-query/function-info/library-functions.js +26 -22
  300. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +9 -0
  301. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +19 -0
  302. package/queries/catalog/dependencies-query/implicit-echo.d.ts +13 -0
  303. package/queries/catalog/dependencies-query/implicit-echo.js +133 -0
  304. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
  305. package/queries/catalog/happens-before-query/happens-before-query-executor.js +1 -2
  306. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
  307. package/queries/catalog/signature-query/signature-query-executor.js +4 -3
  308. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
  309. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  310. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  311. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
  312. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
  313. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +4 -1
  314. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +5 -2
  315. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
  316. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
  317. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  318. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
  319. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  320. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
  321. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  322. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
  323. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  324. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
  325. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +6 -4
  326. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +6 -4
  327. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  328. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
  329. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  330. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
  331. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  332. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
  333. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  334. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
  335. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  336. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
  337. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +6 -0
  338. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +13 -0
  339. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
  340. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
  341. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  342. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
  343. package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +1 -0
  344. package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +1 -0
  345. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  346. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
  347. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +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-symbol.js +1 -0
  351. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
  352. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
  353. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  354. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
  355. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
  356. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
  357. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +3 -2
  358. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then-else.js +2 -1
  359. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +2 -1
  360. package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
  361. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
  362. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.d.ts +2 -2
  363. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +6 -3
  364. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +2 -1
  365. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +2 -1
  366. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +5 -3
  367. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +2 -1
  368. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -1
  369. package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
  370. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +5 -3
  371. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -1
  372. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.d.ts +1 -1
  373. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -1
  374. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +3 -1
  375. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +1 -1
  376. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +2 -1
  377. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +5 -3
  378. package/reconstruct/inline/source-inline-map.js +3 -3
  379. package/reconstruct/reconstruct.js +6 -4
  380. package/search/flowr-search-builder.d.ts +8 -8
  381. package/search/flowr-search-builder.js +4 -4
  382. package/search/flowr-search-filters.d.ts +2 -2
  383. package/search/flowr-search-filters.js +3 -2
  384. package/search/search-executor/search-enrichers.d.ts +6 -4
  385. package/search/search-executor/search-enrichers.js +44 -5
  386. package/slicing/criterion/filters/all-variables.js +2 -1
  387. package/slicing/criterion/parse.js +8 -6
  388. package/slicing/static/slice-call.js +2 -2
  389. package/util/arg-matching.d.ts +3 -0
  390. package/util/arg-matching.js +12 -1
  391. package/util/collections/arrays.d.ts +0 -4
  392. package/util/collections/arrays.js +4 -26
  393. package/util/diff-graph.d.ts +1 -1
  394. package/util/diff-graph.js +17 -3
  395. package/util/diff.d.ts +6 -0
  396. package/util/mermaid/ast.d.ts +1 -1
  397. package/util/mermaid/ast.js +5 -4
  398. package/util/mermaid/cfg.js +130 -24
  399. package/util/mermaid/dfg.js +31 -10
  400. package/util/mermaid/mermaid.js +2 -0
  401. package/util/objects.d.ts +9 -0
  402. package/util/objects.js +12 -0
  403. package/util/prefix.d.ts +1 -1
  404. package/util/text/playground-link.d.ts +131 -0
  405. package/util/text/playground-link.js +214 -0
  406. package/util/text/strings.js +7 -3
  407. package/util/version.js +1 -1
  408. package/control-flow/cfg-builder.d.ts +0 -30
  409. package/control-flow/cfg-builder.js +0 -79
  410. package/control-flow/extract-cfg.d.ts +0 -36
  411. package/control-flow/extract-cfg.js +0 -693
  412. package/project/cfg-kind.d.ts +0 -21
  413. package/project/cfg-kind.js +0 -26
@@ -0,0 +1,13 @@
1
+ import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
2
+ import type { NormalizedAst } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
+ import type { DataflowInformation } from '../../../dataflow/info';
4
+ import type { DependencyInfo } from './dependencies-query-format';
5
+ /**
6
+ * Collects what the top level of the analyzed code prints on its own (as {@link DependencyInfo#implicit}
7
+ * outputs), given that it is echoed at all
8
+ * (`project.assumeImplicitEcho`). A statement is only an output if its value is visible: an assignment, a loop,
9
+ * and every {@link CallProp.Invisible} call hand back their result invisibly, while a bare symbol, a constant,
10
+ * or an ordinary call reaches stdout. Calls another category already reports (a plot, a write, an assertion)
11
+ * are left to it.
12
+ */
13
+ export declare function collectImplicitEchoes(ast: NormalizedAst, dataflow: DataflowInformation, accountedFor: ReadonlySet<NodeId>, result: DependencyInfo[]): void;
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.collectImplicitEchoes = collectImplicitEchoes;
4
+ const identifier_1 = require("../../../dataflow/environments/identifier");
5
+ const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
6
+ const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
7
+ const r_binary_op_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-binary-op");
8
+ const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
9
+ const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
10
+ const r_comment_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-comment");
11
+ const r_line_directive_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-line-directive");
12
+ const vertex_1 = require("../../../dataflow/graph/vertex");
13
+ const df_helper_1 = require("../../../dataflow/graph/df-helper");
14
+ const query_fn_props_1 = require("../../../dataflow/environments/query-fn-props");
15
+ const built_in_props_1 = require("../../../dataflow/environments/built-in-props");
16
+ const test_functions_1 = require("./function-info/test-functions");
17
+ /** the node whose value R echoes for a statement, `undefined` if the statement yields nothing visible */
18
+ function echoedValue(node, dataflow) {
19
+ switch (node?.type) {
20
+ /* the loops hand back an invisible NULL, and the jumps never hand back anything at all */
21
+ case undefined:
22
+ case type_1.RType.ForLoop:
23
+ case type_1.RType.WhileLoop:
24
+ case type_1.RType.RepeatLoop:
25
+ case type_1.RType.Break:
26
+ case type_1.RType.Next:
27
+ case type_1.RType.Comment:
28
+ case type_1.RType.LineDirective:
29
+ return undefined;
30
+ case type_1.RType.FunctionCall: {
31
+ if (callName(node, dataflow) === undefined) {
32
+ return undefined;
33
+ }
34
+ const handedOn = aliased(node, dataflow);
35
+ return handedOn === undefined ? node : echoedValue(handedOn, dataflow);
36
+ }
37
+ /* a block hands on the value of its last statement, a `( )` group that of what it holds, visibly:
38
+ which is what makes `(x <- 1)` print what it assigned */
39
+ case type_1.RType.ExpressionList:
40
+ return grouped(node) ? lastStatement(node) ?? node
41
+ : echoedValue(lastStatement(node), dataflow) ?? (node.children.length === 0 ? node : undefined);
42
+ case type_1.RType.Pipe:
43
+ return echoedValue(node.rhs, dataflow);
44
+ /* whichever branch runs decides; without an `else` a false condition yields an invisible NULL */
45
+ case type_1.RType.IfThenElse:
46
+ return echoedValue(node.then, dataflow) ?? echoedValue(node.otherwise, dataflow);
47
+ case type_1.RType.BinaryOp:
48
+ return r_binary_op_1.RBinaryOp.getOperatorInfo(node)?.usedAs === 'assignment' ? undefined : node;
49
+ /* a symbol, a constant, an access, a unary operator, or a function definition is printed as it stands */
50
+ default:
51
+ return node;
52
+ }
53
+ }
54
+ /** whether the list is a `( )` group rather than a `{ }` block, which is what makes its value visible */
55
+ function grouped(node) {
56
+ return node.grouping?.[0].content === '(';
57
+ }
58
+ /**
59
+ * The call whose result this one hands back unchanged, as its {@link ArgProp.Alias} argument states: a pipe
60
+ * is visible exactly when the call it feeds is. `undefined` when the call answers for itself.
61
+ */
62
+ function aliased(node, dataflow) {
63
+ const name = callName(node, dataflow);
64
+ const at = name === undefined ? -1 : (0, query_fn_props_1.queryFnProps)(name, { environment: dataflow.environment })?.sig
65
+ ?.findIndex(([, p]) => (p & built_in_props_1.ArgProp.Alias) !== 0) ?? -1;
66
+ const arg = at < 0 ? undefined : node.arguments[at];
67
+ const value = typeof arg === 'object' && r_argument_1.RArgument.is(arg) ? arg.value : undefined;
68
+ /* only a call of its own can be invisible where the one around it is not, a symbol says nothing new */
69
+ return r_function_call_1.RFunctionCall.is(value) ? value : undefined;
70
+ }
71
+ /** the last statement of a block, which is what its value comes from */
72
+ function lastStatement(node) {
73
+ for (let i = node.children.length - 1; i >= 0; i--) {
74
+ const child = node.children[i];
75
+ if (!r_comment_1.RComment.is(child) && !r_line_directive_1.RLineDirective.is(child)) {
76
+ return child;
77
+ }
78
+ }
79
+ return undefined;
80
+ }
81
+ /** the name the call goes by, with its package when it has one */
82
+ function qualifiedName(node, dataflow) {
83
+ const vertex = dataflow.graph.getVertex(node.info.id);
84
+ return vertex_1.FunctionCallVertex.is(vertex)
85
+ ? df_helper_1.Dataflow.qualify(node.info.id, dataflow.graph, false) ?? vertex.name : undefined;
86
+ }
87
+ /** the name of a call that reaches stdout, `undefined` if it returns invisibly, draws, or asserts */
88
+ function callName(node, dataflow) {
89
+ const name = qualifiedName(node, dataflow);
90
+ if (name === undefined) {
91
+ return undefined;
92
+ }
93
+ const props = (0, query_fn_props_1.queryFnProps)(name, { environment: dataflow.environment })?.props ?? 0;
94
+ return (props & (built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Graphics)) !== 0 || test_functions_1.ExpectFunctionNames.test(identifier_1.Identifier.getName(name))
95
+ ? undefined : name;
96
+ }
97
+ /** what to report the echo under: the called name, or the operator or lexeme producing the value */
98
+ function echoName(node, dataflow) {
99
+ switch (node.type) {
100
+ case type_1.RType.FunctionCall:
101
+ return qualifiedName(node, dataflow) ?? '';
102
+ case type_1.RType.BinaryOp:
103
+ case type_1.RType.UnaryOp:
104
+ case type_1.RType.Access:
105
+ return node.operator;
106
+ case type_1.RType.FunctionDefinition:
107
+ return 'function';
108
+ case type_1.RType.ExpressionList:
109
+ return grouped(node) ? '(' : '{';
110
+ default:
111
+ return model_1.RNode.lexeme(node) ?? '';
112
+ }
113
+ }
114
+ /**
115
+ * Collects what the top level of the analyzed code prints on its own (as {@link DependencyInfo#implicit}
116
+ * outputs), given that it is echoed at all
117
+ * (`project.assumeImplicitEcho`). A statement is only an output if its value is visible: an assignment, a loop,
118
+ * and every {@link CallProp.Invisible} call hand back their result invisibly, while a bare symbol, a constant,
119
+ * or an ordinary call reaches stdout. Calls another category already reports (a plot, a write, an assertion)
120
+ * are left to it.
121
+ */
122
+ function collectImplicitEchoes(ast, dataflow, accountedFor, result) {
123
+ for (const file of ast.ast.files) {
124
+ for (const statement of file.root.children) {
125
+ const echoed = echoedValue(statement, dataflow);
126
+ if (echoed === undefined || accountedFor.has(echoed.info.id)) {
127
+ continue;
128
+ }
129
+ result.push({ nodeId: echoed.info.id, functionName: echoName(echoed, dataflow), value: 'stdout', implicit: true });
130
+ }
131
+ }
132
+ }
133
+ //# sourceMappingURL=implicit-echo.js.map
@@ -312,7 +312,7 @@ exports.GuessDepVersionsQueryDefinition = {
312
312
  const tightestLe = versionBound(tightestBound(enforced.filter(e => versionBound(e.bound)), '<='))?.ver;
313
313
  const active = [], dominated = [];
314
314
  const nonSig = [...(0, arrays_1.arraysGroupBy)(dep.evidence.filter(e => e.source !== 'signature' && e.source !== 'available'), e => `${e.source}|${e.bound ?? ''}|${e.partial ? 'p' : ''}`)]
315
- .map(([, evs]) => ({ ev: evs[0], origins: [...new Set(evs.map(e => e.origin))] }))
315
+ .map(([, evs]) => ({ ev: evs[0], origins: (0, arrays_1.uniqueArray)(evs.map(e => e.origin)) }))
316
316
  .sort((x, y) => compareBounds(x.ev, y.ev));
317
317
  const bestRankByBound = new Map();
318
318
  for (const { ev } of nonSig) {
@@ -343,7 +343,7 @@ exports.GuessDepVersionsQueryDefinition = {
343
343
  const sigRecords = [...(0, arrays_1.arraysGroupBy)(dep.evidence.filter(e => e.source === 'signature'), e => e.function ?? e.origin)].map(([fn, evs]) => {
344
344
  const ge = tightestBound(evs, '>='), le = tightestBound(evs, '<=');
345
345
  const geVer = versionBound(ge)?.ver, leVer = versionBound(le)?.ver;
346
- const params = [...new Set(evs.map(e => e.parameter).filter((pm) => pm !== undefined))];
346
+ const params = (0, arrays_1.uniqueArray)(evs.map(e => e.parameter).filter((pm) => pm !== undefined));
347
347
  const at = evs.find(e => e.location)?.location;
348
348
  const reasons = [evs.some(e => !e.parameter) ? 'new' : undefined, params.length > 0 ? `params: [${truncatedList(params)}]` : undefined,
349
349
  at ? `at ${at}` : undefined].filter(Boolean).join(', ');
@@ -6,7 +6,6 @@ const logic_1 = require("../../../util/logic");
6
6
  const log_1 = require("../../../util/log");
7
7
  const happens_before_1 = require("../../../control-flow/happens-before");
8
8
  const parse_1 = require("../../../slicing/criterion/parse");
9
- const cfg_kind_1 = require("../../../project/cfg-kind");
10
9
  /**
11
10
  * Execute happens-before queries on the given analyzer.
12
11
  * This checks, whether for two given slicing criteria `a` and `b`, `a` happens before `b` in the control flow graph.
@@ -15,7 +14,7 @@ async function executeHappensBefore({ analyzer }, queries) {
15
14
  const start = Date.now();
16
15
  const results = {};
17
16
  const ast = await analyzer.normalize();
18
- const cfg = await analyzer.controlflow(undefined, cfg_kind_1.CfgKind.Quick);
17
+ const cfg = await analyzer.controlflow(undefined);
19
18
  for (const query of queries) {
20
19
  const { a, b } = query;
21
20
  const fingerprint = happens_before_query_format_1.HappensBeforeKey.of(a, b);
@@ -6,7 +6,7 @@ import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id'
6
6
  import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
7
7
  import type { FlowrConfig } from '../../../config';
8
8
  import { criteriaQueryCompleter } from '../../../cli/repl/parser/slice-query-parser';
9
- import type { ExceptionPoint } from '../../../dataflow/fn/exceptions-of-function';
9
+ import type { ExceptionsByFunction } from '../../../dataflow/fn/exceptions-of-function';
10
10
  import type { SlicingCriterion } from '../../../slicing/criterion/parse';
11
11
  /**
12
12
  * Either returns all function definitions alongside exception information,
@@ -22,7 +22,7 @@ export interface InspectExceptionQueryResult extends BaseQueryResult {
22
22
  * If a function throws exceptions, the Ids of the throwing functions (at least the functions flowr knows about).
23
23
  * An empty array means the function does not throw any exceptions.
24
24
  */
25
- readonly exceptions: Record<NodeId, ExceptionPoint[]>;
25
+ readonly exceptions: ExceptionsByFunction;
26
26
  }
27
27
  declare function inspectExceptionLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-exception'>;
28
28
  export declare const InspectExceptionQueryDefinition: {
@@ -22,6 +22,7 @@ const r_version_1 = require("../../../util/r-version");
22
22
  const r_base_packages_1 = require("../../../util/r-base-packages");
23
23
  const mermaid_1 = require("../../../util/mermaid/mermaid");
24
24
  const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
25
+ const arrays_1 = require("../../../util/collections/arrays");
25
26
  /** the CRAN package landing page (only meaningful for CRAN packages, not base R) */
26
27
  function cranPageUrl(pkg) {
27
28
  return `https://cran.r-project.org/package=${encodeURIComponent(pkg)}`;
@@ -565,7 +566,7 @@ function searchSources(sources, allNames, q) {
565
566
  // every source holding a package (its latest lives in `current`, its older releases in `history`)
566
567
  const owningOf = (pkg) => sources.filter(s => s.has(pkg));
567
568
  // the versions of `pkg` matching the spec, unioned across all owning sources (so a `3.*`/date filter reaches history)
568
- const matchingVersions = (owners, pkg, m) => [...new Set(owners.flatMap(s => (0, reader_1.availableVersionEntries)(s, pkg).filter(m).map(e => e.version)))];
569
+ const matchingVersions = (owners, pkg, m) => (0, arrays_1.uniqueArray)(owners.flatMap(s => (0, reader_1.availableVersionEntries)(s, pkg).filter(m).map(e => e.version)));
569
570
  const paramPred = parameterFilter(q);
570
571
  // a parameter filter (with no function name) still means "search functions", not "list packages"
571
572
  if (!q.function && paramPred === undefined) {
@@ -705,10 +706,10 @@ function signatureQueryCompleter(line, startingNewArg) {
705
706
  const stride = all.length / MaxCompletions;
706
707
  return Array.from({ length: MaxCompletions }, (_, i) => all[Math.floor(i * stride)]);
707
708
  };
708
- const packageNames = () => [...new Set(sources.flatMap(s => s.packageNames()))].sort();
709
+ const packageNames = () => (0, arrays_1.uniqueArray)(sources.flatMap(s => s.packageNames())).sort();
709
710
  const functionsOf = (pkg) => {
710
711
  const src = sources.find(s => s.has(pkg));
711
- return src ? [...new Set((src.functions(pkg) ?? []).map(f => f.name))].sort() : [];
712
+ return src ? (0, arrays_1.uniqueArray)((src.functions(pkg) ?? []).map(f => f.name)).sort() : [];
712
713
  };
713
714
  // first token: a package spec (`pkg`, `pkg::fn`, `pkg@ver`)
714
715
  if (line.length === 0 || (line.length === 1 && !startingNewArg)) {
@@ -22,7 +22,7 @@ export interface StaticSliceQuery extends BaseQueryFormat, SliceQueryOptions {
22
22
  export interface StaticSliceQueryResult extends BaseQueryResult {
23
23
  /**
24
24
  * only contains the results of the slice steps to not repeat ourselves, this does not contain the reconstruction
25
- * if you set the {@link SliceQuery#noReconstruction|noReconstruction} flag.
25
+ * if you set the {@link SliceQueryOptions#noReconstruction|noReconstruction} flag.
26
26
  *
27
27
  * The keys are serialized versions of the used queries (i.e., the result of `JSON.stringify`).
28
28
  * This implies that multiple slice queries with the same query configuration will _not_ be re-executed.
@@ -18,6 +18,7 @@ export declare const RDelimiter: {
18
18
  readonly name: "RDelimiter";
19
19
  /**
20
20
  * Type guard for {@link RDelimiter} nodes.
21
+ * @lintIgnore node-is node-is-optional
21
22
  */
22
23
  readonly is: (this: void, node: unknown) => node is RDelimiter;
23
24
  };
@@ -9,6 +9,7 @@ exports.RDelimiter = {
9
9
  name: 'RDelimiter',
10
10
  /**
11
11
  * Type guard for {@link RDelimiter} nodes.
12
+ * @lintIgnore node-is node-is-optional
12
13
  */
13
14
  is(node) {
14
15
  return typeof node === 'object' && node !== null && 'type' in node && node.type === type_1.RType.Delimiter;
@@ -33,6 +33,7 @@ export declare const RAccess: {
33
33
  readonly name: "RAccess";
34
34
  /**
35
35
  * Type guard for {@link RAccess} nodes.
36
+ * @lintIgnore node-is node-is-optional
36
37
  */
37
38
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RAccess<Info>;
38
39
  /**
@@ -11,6 +11,7 @@ exports.RAccess = {
11
11
  name: 'RAccess',
12
12
  /**
13
13
  * Type guard for {@link RAccess} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return node?.type === type_1.RType.Access;
@@ -31,6 +31,7 @@ export declare const RArgument: {
31
31
  /**
32
32
  * Type guard for {@link RArgument} nodes.
33
33
  * @see {@link RArgument.isUnnamed} - to check whether an argument is unnamed
34
+ * @lintIgnore node-is node-is-optional
34
35
  */
35
36
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RArgument<Info>;
36
37
  /**
@@ -39,8 +40,10 @@ export declare const RArgument: {
39
40
  readonly isEmpty: <Info = object>(this: void, node: RNode<Info> | typeof EmptyArgument | undefined) => node is typeof EmptyArgument;
40
41
  /**
41
42
  * Type guard for arguments that are _not_ empty, i.e. _not_ {@link EmptyArgument}.
43
+ * It only removes the marker, it does not claim the rest is an {@link RArgument}.
44
+ * @see {@link RArgument.is} - to additionally check that the node is an argument
42
45
  */
43
- readonly isNotEmpty: <Info = object>(this: void, node: RNode<Info> | typeof EmptyArgument | undefined) => node is RArgument<Info>;
46
+ readonly isNotEmpty: <T>(this: void, node: T) => node is Exclude<T, typeof EmptyArgument>;
44
47
  /**
45
48
  * Type guard for named arguments, i.e. arguments with a name.
46
49
  */
@@ -13,6 +13,7 @@ exports.RArgument = {
13
13
  /**
14
14
  * Type guard for {@link RArgument} nodes.
15
15
  * @see {@link RArgument.isUnnamed} - to check whether an argument is unnamed
16
+ * @lintIgnore node-is node-is-optional
16
17
  */
17
18
  is(node) {
18
19
  return node?.type === type_1.RType.Argument;
@@ -25,9 +26,11 @@ exports.RArgument = {
25
26
  },
26
27
  /**
27
28
  * Type guard for arguments that are _not_ empty, i.e. _not_ {@link EmptyArgument}.
29
+ * It only removes the marker, it does not claim the rest is an {@link RArgument}.
30
+ * @see {@link RArgument.is} - to additionally check that the node is an argument
28
31
  */
29
32
  isNotEmpty(node) {
30
- return node !== r_function_call_1.EmptyArgument && exports.RArgument.is(node);
33
+ return node !== r_function_call_1.EmptyArgument;
31
34
  },
32
35
  /**
33
36
  * Type guard for named arguments, i.e. arguments with a name.
@@ -52,7 +55,7 @@ exports.RArgument = {
52
55
  return undefined;
53
56
  }
54
57
  for (const arg of args) {
55
- if (arg === r_function_call_1.EmptyArgument) {
58
+ if (exports.RArgument.isEmpty(arg)) {
56
59
  continue;
57
60
  }
58
61
  if (arg.info.id === id) {
@@ -18,6 +18,7 @@ export declare const RBinaryOp: {
18
18
  readonly name: "RBinaryOp";
19
19
  /**
20
20
  * Type guard for {@link RBinaryOp} nodes.
21
+ * @lintIgnore node-is node-is-optional
21
22
  */
22
23
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RBinaryOp<Info>;
23
24
  /**
@@ -12,6 +12,7 @@ exports.RBinaryOp = {
12
12
  name: 'RBinaryOp',
13
13
  /**
14
14
  * Type guard for {@link RBinaryOp} nodes.
15
+ * @lintIgnore node-is node-is-optional
15
16
  */
16
17
  is(node) {
17
18
  return node?.type === type_1.RType.BinaryOp;
@@ -14,6 +14,7 @@ export declare const RBreak: {
14
14
  readonly name: "RBreak";
15
15
  /**
16
16
  * Type guard for {@link RBreak} nodes.
17
+ * @lintIgnore node-is node-is-optional
17
18
  */
18
19
  readonly is: <Info = object>(this: void, node: unknown) => node is RBreak<Info>;
19
20
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
@@ -11,6 +11,7 @@ exports.RBreak = {
11
11
  name: 'RBreak',
12
12
  /**
13
13
  * Type guard for {@link RBreak} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return typeof node === 'object' && node !== null && node.type === type_1.RType.Break;
@@ -16,6 +16,7 @@ export declare const RComment: {
16
16
  readonly name: "RComment";
17
17
  /**
18
18
  * Type guard for {@link RComment} nodes.
19
+ * @lintIgnore node-is node-is-optional
19
20
  */
20
21
  readonly is: <Info = object>(this: void, node: unknown) => node is RComment<Info>;
21
22
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
@@ -11,6 +11,7 @@ exports.RComment = {
11
11
  name: 'RComment',
12
12
  /**
13
13
  * Type guard for {@link RComment} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return typeof node === 'object' && node !== null && node.type === type_1.RType.Comment;
@@ -18,6 +18,7 @@ export declare const RExpressionList: {
18
18
  readonly name: "RExpressionList";
19
19
  /**
20
20
  * Type guard for {@link RExpressionList} nodes.
21
+ * @lintIgnore node-is node-is-optional
21
22
  */
22
23
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RExpressionList<Info>;
23
24
  /**
@@ -11,6 +11,7 @@ exports.RExpressionList = {
11
11
  name: 'RExpressionList',
12
12
  /**
13
13
  * Type guard for {@link RExpressionList} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return node?.type === type_1.RType.ExpressionList;
@@ -24,6 +24,7 @@ export declare const RForLoop: {
24
24
  readonly name: "RForLoop";
25
25
  /**
26
26
  * Type guard for RForLoop nodes.
27
+ * @lintIgnore node-is node-is-optional
27
28
  */
28
29
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RForLoop<Info>;
29
30
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
@@ -11,6 +11,7 @@ exports.RForLoop = {
11
11
  name: 'RForLoop',
12
12
  /**
13
13
  * Type guard for RForLoop nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return node?.type === type_1.RType.ForLoop;
@@ -37,6 +37,7 @@ export declare const RFunctionCall: {
37
37
  readonly name: "RFunctionCall";
38
38
  /**
39
39
  * Type guard for {@link RFunctionCall} nodes.
40
+ * @lintIgnore node-is node-is-optional
40
41
  */
41
42
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RFunctionCall<Info>;
42
43
  /**
@@ -48,10 +49,11 @@ export declare const RFunctionCall: {
48
49
  */
49
50
  readonly isUnnamed: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RUnnamedFunctionCall<Info>;
50
51
  /**
51
- * Bind a call's `arguments` to the formal `paramNames` with {@link matchArgumentsToParameters}, R's argument
52
- * matching. Returns a map from parameter name to the argument bound to it, so
53
- * `matchArgsToParams(call.arguments, names).get('X')` answers "which argument is mapped to parameter `X`".
54
- * An empty argument (`f(1, ,3)`) takes its formal but never appears in the map, as there is nothing to bind.
52
+ * Bind a call's `arguments` to the formal `paramNames`, R's argument matching.
53
+ *
54
+ * Kept here rather than forwarding to {@link MatchArgs.toNames}: this module is loaded before the dataflow
55
+ * layer exists, so importing the wall from here would drag it into the AST model at load time.
56
+ * @useInstead {@link MatchArgs.toNames}
55
57
  */
56
58
  readonly matchArgsToParams: <Info = object>(this: void, args: readonly PotentiallyEmptyRArgument<Info>[], paramNames: readonly string[]) => ReadonlyMap<string, RArgument<Info>>;
57
59
  /** The one argument a call was given, `undefined` unless there is exactly one and it is not empty. */
@@ -13,6 +13,7 @@ exports.RFunctionCall = {
13
13
  name: 'RFunctionCall',
14
14
  /**
15
15
  * Type guard for {@link RFunctionCall} nodes.
16
+ * @lintIgnore node-is node-is-optional
16
17
  */
17
18
  is(node) {
18
19
  return node?.type === type_1.RType.FunctionCall;
@@ -30,10 +31,11 @@ exports.RFunctionCall = {
30
31
  return exports.RFunctionCall.is(node) && !node.named;
31
32
  },
32
33
  /**
33
- * Bind a call's `arguments` to the formal `paramNames` with {@link matchArgumentsToParameters}, R's argument
34
- * matching. Returns a map from parameter name to the argument bound to it, so
35
- * `matchArgsToParams(call.arguments, names).get('X')` answers "which argument is mapped to parameter `X`".
36
- * An empty argument (`f(1, ,3)`) takes its formal but never appears in the map, as there is nothing to bind.
34
+ * Bind a call's `arguments` to the formal `paramNames`, R's argument matching.
35
+ *
36
+ * Kept here rather than forwarding to {@link MatchArgs.toNames}: this module is loaded before the dataflow
37
+ * layer exists, so importing the wall from here would drag it into the AST model at load time.
38
+ * @useInstead {@link MatchArgs.toNames}
37
39
  */
38
40
  matchArgsToParams(args, paramNames) {
39
41
  const matched = (0, arg_matching_1.matchArgumentsToParameters)(args.map(a => a === exports.EmptyArgument ? undefined : a.name?.content), paramNames);
@@ -25,6 +25,7 @@ export declare const RFunctionDefinition: {
25
25
  readonly name: "RFunctionDefinition";
26
26
  /**
27
27
  * Type guard for {@link RFunctionDefinition} nodes.
28
+ * @lintIgnore node-is node-is-optional
28
29
  */
29
30
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RFunctionDefinition<Info>;
30
31
  /**
@@ -11,6 +11,7 @@ exports.RFunctionDefinition = {
11
11
  name: 'RFunctionDefinition',
12
12
  /**
13
13
  * Type guard for {@link RFunctionDefinition} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return node?.type === type_1.RType.FunctionDefinition;
@@ -20,6 +20,7 @@ export declare const RIfThenElse: {
20
20
  readonly name: "RIfThenElse";
21
21
  /**
22
22
  * Type guard for {@link RIfThenElse} nodes.
23
+ * @lintIgnore node-is node-is-optional
23
24
  */
24
25
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RIfThenElse<Info>;
25
26
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
@@ -11,6 +11,7 @@ exports.RIfThenElse = {
11
11
  name: 'RIfThenElse',
12
12
  /**
13
13
  * Type guard for {@link RIfThenElse} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return node?.type === type_1.RType.IfThenElse;
@@ -16,6 +16,7 @@ export declare const RLineDirective: {
16
16
  readonly name: "RLineDirective";
17
17
  /**
18
18
  * Type guard for {@link RLineDirective} nodes.
19
+ * @lintIgnore node-is node-is-optional
19
20
  */
20
21
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RLineDirective<Info>;
21
22
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
@@ -11,6 +11,7 @@ exports.RLineDirective = {
11
11
  name: 'RLineDirective',
12
12
  /**
13
13
  * Type guard for {@link RLineDirective} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return node?.type === type_1.RType.LineDirective;
@@ -16,6 +16,7 @@ export declare const RLogical: {
16
16
  readonly name: "RLogical";
17
17
  /**
18
18
  * Type guard for {@link RLogical} nodes.
19
+ * @lintIgnore node-is node-is-optional
19
20
  */
20
21
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RLogical<Info>;
21
22
  /**
@@ -11,6 +11,7 @@ exports.RLogical = {
11
11
  name: 'RLogical',
12
12
  /**
13
13
  * Type guard for {@link RLogical} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return node?.type === type_1.RType.Logical;
@@ -14,6 +14,7 @@ export declare const RNext: {
14
14
  readonly name: "RNext";
15
15
  /**
16
16
  * Type guard for {@link RNext} nodes.
17
+ * @lintIgnore node-is node-is-optional
17
18
  */
18
19
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RNext<Info>;
19
20
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
@@ -11,6 +11,7 @@ exports.RNext = {
11
11
  name: 'RNext',
12
12
  /**
13
13
  * Type guard for {@link RNext} nodes.
14
+ * @lintIgnore node-is node-is-optional
14
15
  */
15
16
  is(node) {
16
17
  return node?.type === type_1.RType.Next;
@@ -18,8 +18,14 @@ export declare const RNumber: {
18
18
  readonly name: "RNumber";
19
19
  /**
20
20
  * Type guard for {@link RNumber} nodes.
21
+ * @lintIgnore node-is node-is-optional
21
22
  */
22
23
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RNumber<Info>;
24
+ /**
25
+ * The value `node` is written as, counting a leading unary minus (`-1`) as part of the literal;
26
+ * `undefined` whenever the value is not spelled out in the source.
27
+ */
28
+ readonly literalValueOf: <Info = object>(this: void, node: RNode<Info> | undefined) => number | undefined;
23
29
  readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
24
30
  readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
25
31
  readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RNumber = void 0;
4
4
  const model_1 = require("../model");
5
5
  const type_1 = require("../type");
6
+ const r_unary_op_1 = require("./r-unary-op");
6
7
  /**
7
8
  * Helper for working with {@link RNumber} AST nodes.
8
9
  */
@@ -11,9 +12,21 @@ exports.RNumber = {
11
12
  name: 'RNumber',
12
13
  /**
13
14
  * Type guard for {@link RNumber} nodes.
15
+ * @lintIgnore node-is node-is-optional
14
16
  */
15
17
  is(node) {
16
18
  return node?.type === type_1.RType.Number;
19
+ },
20
+ /**
21
+ * The value `node` is written as, counting a leading unary minus (`-1`) as part of the literal;
22
+ * `undefined` whenever the value is not spelled out in the source.
23
+ */
24
+ literalValueOf(node) {
25
+ if (exports.RNumber.is(node)) {
26
+ return node.content.num;
27
+ }
28
+ return r_unary_op_1.RUnaryOp.is(node) && node.operator === '-' && exports.RNumber.is(node.operand)
29
+ ? -node.operand.content.num : undefined;
17
30
  }
18
31
  };
19
32
  //# sourceMappingURL=r-number.js.map
@@ -21,6 +21,7 @@ export declare const RParameter: {
21
21
  /**
22
22
  * Type guard for {@link RParameter} nodes.
23
23
  * @see {@link RParameter.isDotDotDotDot} - to check whether a parameter is the special `...` parameter
24
+ * @lintIgnore node-is node-is-optional
24
25
  */
25
26
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RParameter<Info>;
26
27
  /**