@eagleoutice/flowr 2.17.4 → 2.17.6

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 (717) hide show
  1. package/README.md +12 -89
  2. package/abstract-interpretation/absint-inference.d.ts +4 -4
  3. package/abstract-interpretation/absint-inference.js +12 -13
  4. package/abstract-interpretation/abstract-semantics.d.ts +2 -1
  5. package/abstract-interpretation/branch-paths-interpreter.js +60 -0
  6. package/abstract-interpretation/branch-paths.d.ts +60 -0
  7. package/abstract-interpretation/branch-paths.js +120 -0
  8. package/abstract-interpretation/data-frame/arguments.d.ts +14 -3
  9. package/abstract-interpretation/data-frame/arguments.js +34 -0
  10. package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +6 -1
  11. package/abstract-interpretation/data-frame/dataframe-semantics.js +67 -16
  12. package/abstract-interpretation/data-frame/resolve-args.d.ts +2 -2
  13. package/abstract-interpretation/data-frame/semantics.d.ts +8 -1
  14. package/abstract-interpretation/data-frame/semantics.js +18 -16
  15. package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
  16. package/abstract-interpretation/domains/state-abstract-domain.js +28 -18
  17. package/abstract-interpretation/domains/state-map.d.ts +43 -0
  18. package/abstract-interpretation/domains/state-map.js +147 -0
  19. package/benchmark/slicer.d.ts +1 -1
  20. package/benchmark/slicer.js +8 -7
  21. package/cli/repl/commands/repl-dataflow.js +5 -5
  22. package/cli/repl/commands/repl-execute.js +3 -2
  23. package/cli/repl/commands/repl-parse.js +2 -1
  24. package/cli/repl/core.js +51 -0
  25. package/cli/repl/print-version.d.ts +1 -1
  26. package/cli/repl/print-version.js +2 -1
  27. package/cli/repl/server/connection.d.ts +1 -1
  28. package/cli/repl/server/connection.js +7 -9
  29. package/cli/slicer-app.js +2 -1
  30. package/clones/algorithms/baxter-ast.d.ts +33 -0
  31. package/clones/algorithms/baxter-ast.js +70 -0
  32. package/clones/algorithms/greedy-string-tiling.d.ts +17 -0
  33. package/clones/algorithms/greedy-string-tiling.js +56 -0
  34. package/clones/algorithms/winnowing.d.ts +27 -0
  35. package/clones/algorithms/winnowing.js +66 -0
  36. package/clones/clone-ast.d.ts +75 -0
  37. package/clones/clone-ast.js +174 -0
  38. package/clones/clone-dataflow.d.ts +11 -0
  39. package/clones/clone-dataflow.js +83 -0
  40. package/clones/clone-detector.d.ts +116 -0
  41. package/clones/clone-detector.js +200 -0
  42. package/clones/clone-index.d.ts +54 -0
  43. package/clones/clone-index.js +56 -0
  44. package/config.d.ts +21 -2
  45. package/config.js +7 -1
  46. package/control-flow/basic-cfg-guided-visitor.js +1 -2
  47. package/control-flow/cfg-dead-code.js +12 -7
  48. package/control-flow/happens-before.d.ts +2 -0
  49. package/control-flow/happens-before.js +15 -9
  50. package/control-flow/simple-visitor.js +2 -4
  51. package/core/steps/all/core/00-parse.js +2 -1
  52. package/core/steps/all/core/01-parse-tree-sitter.js +2 -1
  53. package/core/steps/all/core/10-normalize.js +2 -1
  54. package/core/steps/all/core/11-normalize-tree-sitter.js +2 -1
  55. package/core/steps/all/static-slicing/00-slice.js +2 -1
  56. package/core/steps/all/static-slicing/10-reconstruct.js +2 -1
  57. package/core/steps/pipeline/create-pipeline.js +1 -2
  58. package/core/steps/pipeline/default-pipelines.d.ts +1 -1
  59. package/core/steps/pipeline/default-pipelines.js +5 -4
  60. package/core/steps/pipeline-step.d.ts +3 -1
  61. package/core/steps/pipeline-step.js +5 -0
  62. package/data/packed.d.ts +10 -0
  63. package/data/packed.js +33 -0
  64. package/data/r-base-guards.generated.d.ts +7 -0
  65. package/data/r-base-guards.generated.js +12 -0
  66. package/data/r-base-primitives.generated.d.ts +2 -1
  67. package/data/r-datasets.generated.d.ts +4 -0
  68. package/data/r-datasets.generated.js +10 -0
  69. package/data/r-formals.generated.d.ts +4 -0
  70. package/data/r-formals.generated.js +10 -0
  71. package/data/r-group-method-guards.generated.d.ts +3 -0
  72. package/data/r-group-method-guards.generated.js +8 -0
  73. package/dataflow/cluster.js +1 -2
  74. package/dataflow/environments/ambient-effect.d.ts +1000 -0
  75. package/dataflow/environments/ambient-effect.js +234 -0
  76. package/dataflow/environments/ambient-state-name.d.ts +59 -24
  77. package/dataflow/environments/ambient-state-name.js +65 -21
  78. package/dataflow/environments/apply-kill.d.ts +9 -20
  79. package/dataflow/environments/apply-kill.js +62 -29
  80. package/dataflow/environments/built-in-config.d.ts +7 -15
  81. package/dataflow/environments/built-in-config.js +15 -16
  82. package/dataflow/environments/built-in-eval-name.d.ts +5 -6
  83. package/dataflow/environments/built-in-eval-name.js +4 -5
  84. package/dataflow/environments/built-in-kinds.d.ts +69 -0
  85. package/dataflow/environments/built-in-kinds.js +39 -0
  86. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  87. package/dataflow/environments/built-in-proc-name.js +11 -0
  88. package/dataflow/environments/built-in-props.d.ts +75 -176
  89. package/dataflow/environments/built-in-props.js +53 -157
  90. package/dataflow/environments/built-in.d.ts +42 -73
  91. package/dataflow/environments/built-in.js +49 -93
  92. package/dataflow/environments/data-masking-functions.d.ts +2 -2
  93. package/dataflow/environments/default-builtin-config/base-functions.d.ts +7 -0
  94. package/dataflow/environments/default-builtin-config/base-functions.js +397 -0
  95. package/dataflow/environments/default-builtin-config/base-language.d.ts +3 -0
  96. package/dataflow/environments/default-builtin-config/base-language.js +69 -0
  97. package/dataflow/environments/default-builtin-config/base-operators.d.ts +58 -0
  98. package/dataflow/environments/default-builtin-config/base-operators.js +169 -0
  99. package/dataflow/environments/default-builtin-config/database-access.d.ts +3 -0
  100. package/dataflow/environments/default-builtin-config/database-access.js +16 -0
  101. package/dataflow/environments/default-builtin-config/define-helpers.d.ts +45 -0
  102. package/dataflow/environments/default-builtin-config/define-helpers.js +50 -0
  103. package/dataflow/environments/default-builtin-config/dev-tooling.d.ts +3 -0
  104. package/dataflow/environments/default-builtin-config/dev-tooling.js +63 -0
  105. package/dataflow/environments/default-builtin-config/file-io.d.ts +3 -0
  106. package/dataflow/environments/default-builtin-config/file-io.js +83 -0
  107. package/dataflow/environments/default-builtin-config/graphics-devices.d.ts +3 -0
  108. package/dataflow/environments/default-builtin-config/graphics-devices.js +67 -0
  109. package/dataflow/environments/default-builtin-config/guard-builders.d.ts +16 -0
  110. package/dataflow/environments/default-builtin-config/guard-builders.js +29 -0
  111. package/dataflow/environments/default-builtin-config/guards-primitive-lang.d.ts +15 -0
  112. package/dataflow/environments/default-builtin-config/guards-primitive-lang.js +228 -0
  113. package/dataflow/environments/default-builtin-config/guards-primitive-ops.d.ts +11 -0
  114. package/dataflow/environments/default-builtin-config/guards-primitive-ops.js +154 -0
  115. package/dataflow/environments/default-builtin-config/guards.d.ts +9 -0
  116. package/dataflow/environments/default-builtin-config/guards.js +211 -0
  117. package/dataflow/environments/default-builtin-config/index.d.ts +18 -0
  118. package/dataflow/environments/default-builtin-config/index.js +129 -0
  119. package/dataflow/environments/default-builtin-config/media-formats.d.ts +3 -0
  120. package/dataflow/environments/default-builtin-config/media-formats.js +41 -0
  121. package/dataflow/environments/default-builtin-config/misc-packages.d.ts +3 -0
  122. package/dataflow/environments/default-builtin-config/misc-packages.js +18 -0
  123. package/dataflow/environments/default-builtin-config/network-access.d.ts +3 -0
  124. package/dataflow/environments/default-builtin-config/network-access.js +47 -0
  125. package/dataflow/environments/default-builtin-config/object-systems.d.ts +3 -0
  126. package/dataflow/environments/default-builtin-config/object-systems.js +39 -0
  127. package/dataflow/environments/default-builtin-config/package-data-table.d.ts +3 -0
  128. package/dataflow/environments/default-builtin-config/package-data-table.js +18 -0
  129. package/dataflow/environments/default-builtin-config/package-spatial.d.ts +3 -0
  130. package/dataflow/environments/default-builtin-config/package-spatial.js +33 -0
  131. package/dataflow/environments/default-builtin-config/package-tidyverse.d.ts +3 -0
  132. package/dataflow/environments/default-builtin-config/package-tidyverse.js +97 -0
  133. package/dataflow/environments/default-builtin-config/package-utils.d.ts +3 -0
  134. package/dataflow/environments/default-builtin-config/package-utils.js +38 -0
  135. package/dataflow/environments/default-builtin-config/package-withr.d.ts +3 -0
  136. package/dataflow/environments/default-builtin-config/package-withr.js +41 -0
  137. package/dataflow/environments/default-builtin-config/parallel-execution.d.ts +3 -0
  138. package/dataflow/environments/default-builtin-config/parallel-execution.js +33 -0
  139. package/dataflow/environments/default-builtin-config/r-formals.d.ts +13 -0
  140. package/dataflow/environments/default-builtin-config/r-formals.js +110 -0
  141. package/dataflow/environments/default-builtin-config/session-interactive.d.ts +3 -0
  142. package/dataflow/environments/default-builtin-config/session-interactive.js +31 -0
  143. package/dataflow/environments/default-builtin-config/shared-configs.d.ts +328 -0
  144. package/dataflow/environments/default-builtin-config/shared-configs.js +447 -0
  145. package/dataflow/environments/default-builtin-config/shared-signatures.d.ts +21 -0
  146. package/dataflow/environments/default-builtin-config/shared-signatures.js +32 -0
  147. package/dataflow/environments/default-builtin-config/statistics.d.ts +3 -0
  148. package/dataflow/environments/default-builtin-config/statistics.js +35 -0
  149. package/dataflow/environments/default-builtin-config/unit-testing.d.ts +3 -0
  150. package/dataflow/environments/default-builtin-config/unit-testing.js +13 -0
  151. package/dataflow/environments/diff.js +5 -2
  152. package/dataflow/environments/environment.d.ts +48 -52
  153. package/dataflow/environments/environment.js +62 -74
  154. package/dataflow/environments/group-generics.d.ts +16 -19
  155. package/dataflow/environments/group-generics.js +28 -15
  156. package/dataflow/environments/guard-facts.d.ts +169 -0
  157. package/dataflow/environments/guard-facts.js +26 -0
  158. package/dataflow/environments/identifier.d.ts +81 -428
  159. package/dataflow/environments/identifier.js +39 -145
  160. package/dataflow/environments/pkg-name.d.ts +198 -0
  161. package/dataflow/environments/pkg-name.js +3 -0
  162. package/dataflow/environments/query-fn-props.d.ts +28 -79
  163. package/dataflow/environments/query-fn-props.js +77 -115
  164. package/dataflow/environments/removal-marker.d.ts +2 -0
  165. package/dataflow/environments/removal-marker.js +5 -0
  166. package/dataflow/environments/resolve-by-name.d.ts +6 -16
  167. package/dataflow/environments/resolve-by-name.js +23 -35
  168. package/dataflow/environments/scoping.d.ts +5 -5
  169. package/dataflow/environments/scoping.js +13 -5
  170. package/dataflow/eval/resolve/alias-tracking.d.ts +31 -68
  171. package/dataflow/eval/resolve/alias-tracking.js +611 -126
  172. package/dataflow/eval/resolve/match-arguments.d.ts +5 -3
  173. package/dataflow/eval/resolve/resolve-argument.d.ts +11 -11
  174. package/dataflow/eval/resolve/resolve-argument.js +25 -30
  175. package/dataflow/eval/resolve/resolve-field.d.ts +10 -0
  176. package/dataflow/eval/resolve/resolve-field.js +127 -0
  177. package/dataflow/eval/resolve/resolve-replacement.d.ts +10 -0
  178. package/dataflow/eval/resolve/resolve-replacement.js +80 -0
  179. package/dataflow/eval/resolve/resolve-strings.d.ts +4 -7
  180. package/dataflow/eval/resolve/resolve-strings.js +2 -2
  181. package/dataflow/eval/resolve/resolve.d.ts +13 -10
  182. package/dataflow/eval/resolve/resolve.js +81 -32
  183. package/dataflow/eval/values/general.d.ts +6 -24
  184. package/dataflow/eval/values/general.js +12 -29
  185. package/dataflow/eval/values/lists/list-constants.d.ts +11 -0
  186. package/dataflow/eval/values/lists/list-constants.js +65 -0
  187. package/dataflow/eval/values/r-value.d.ts +20 -23
  188. package/dataflow/eval/values/r-value.js +22 -17
  189. package/dataflow/extractor.d.ts +2 -10
  190. package/dataflow/extractor.js +111 -48
  191. package/dataflow/fn/argument-roles.d.ts +2 -4
  192. package/dataflow/fn/argument-roles.js +49 -23
  193. package/dataflow/fn/class-declaration.d.ts +36 -52
  194. package/dataflow/fn/class-declaration.js +22 -56
  195. package/dataflow/fn/condition-handlers.d.ts +4 -1
  196. package/dataflow/fn/condition-handlers.js +3 -1
  197. package/dataflow/fn/dispatch.d.ts +70 -0
  198. package/dataflow/fn/dispatch.js +434 -0
  199. package/dataflow/fn/exceptions-of-function.d.ts +1 -2
  200. package/dataflow/fn/exceptions-of-function.js +36 -106
  201. package/dataflow/fn/frame-reflection.d.ts +5 -5
  202. package/dataflow/fn/frame-reflection.js +24 -16
  203. package/dataflow/fn/function-props.d.ts +2 -5
  204. package/dataflow/fn/function-props.js +30 -46
  205. package/dataflow/fn/function-semantics.d.ts +44 -26
  206. package/dataflow/fn/function-semantics.js +19 -18
  207. package/dataflow/fn/guards/built-in-guards.d.ts +112 -0
  208. package/dataflow/fn/guards/built-in-guards.js +199 -0
  209. package/dataflow/fn/guards/call-contracts.d.ts +97 -0
  210. package/dataflow/fn/guards/call-contracts.js +331 -0
  211. package/dataflow/fn/guards/condition-grouping.d.ts +20 -0
  212. package/dataflow/fn/guards/condition-grouping.js +135 -0
  213. package/dataflow/fn/guards/function-guards.d.ts +112 -0
  214. package/dataflow/fn/guards/function-guards.js +1549 -0
  215. package/dataflow/fn/guards/group-method-guards.d.ts +28 -0
  216. package/dataflow/fn/guards/group-method-guards.js +56 -0
  217. package/dataflow/fn/guards/guard-claims.d.ts +125 -0
  218. package/dataflow/fn/guards/guard-claims.js +678 -0
  219. package/dataflow/fn/guards/guard-knowledge.d.ts +41 -0
  220. package/dataflow/fn/guards/guard-knowledge.js +180 -0
  221. package/dataflow/fn/guards/guard-term-syntax.d.ts +9 -0
  222. package/dataflow/fn/guards/guard-term-syntax.js +210 -0
  223. package/dataflow/fn/guards/guard-term.d.ts +136 -0
  224. package/dataflow/fn/guards/guard-term.js +550 -0
  225. package/dataflow/fn/guards/stated-guards.d.ts +13 -0
  226. package/dataflow/fn/guards/stated-guards.js +35 -0
  227. package/dataflow/fn/higher-order-function.d.ts +2 -0
  228. package/dataflow/fn/higher-order-function.js +3 -4
  229. package/dataflow/fn/strict-function.d.ts +14 -35
  230. package/dataflow/fn/strict-function.js +183 -146
  231. package/dataflow/graph/ambient-access.d.ts +54 -0
  232. package/dataflow/graph/ambient-access.js +86 -0
  233. package/dataflow/graph/call-graph.d.ts +9 -29
  234. package/dataflow/graph/call-graph.js +17 -41
  235. package/dataflow/graph/closure-frames.d.ts +46 -0
  236. package/dataflow/graph/closure-frames.js +225 -0
  237. package/dataflow/graph/dataflowgraph-builder.d.ts +25 -96
  238. package/dataflow/graph/dataflowgraph-builder.js +29 -97
  239. package/dataflow/graph/df-helper.d.ts +54 -188
  240. package/dataflow/graph/df-helper.js +122 -208
  241. package/dataflow/graph/diff-dataflow-graph.d.ts +5 -15
  242. package/dataflow/graph/diff-dataflow-graph.js +25 -25
  243. package/dataflow/graph/edge.js +1 -1
  244. package/dataflow/graph/graph-helper.d.ts +10 -46
  245. package/dataflow/graph/graph-helper.js +16 -50
  246. package/dataflow/graph/graph.d.ts +50 -97
  247. package/dataflow/graph/graph.js +72 -75
  248. package/dataflow/graph/match-args.d.ts +21 -88
  249. package/dataflow/graph/match-args.js +284 -97
  250. package/dataflow/graph/vertex.d.ts +101 -128
  251. package/dataflow/graph/vertex.js +23 -20
  252. package/dataflow/hooks.d.ts +7 -14
  253. package/dataflow/hooks.js +15 -13
  254. package/dataflow/info.d.ts +4 -18
  255. package/dataflow/info.js +3 -1
  256. package/dataflow/internal/dispatch-linking.d.ts +73 -0
  257. package/dataflow/internal/dispatch-linking.js +333 -0
  258. package/dataflow/internal/linker.d.ts +50 -50
  259. package/dataflow/internal/linker.js +566 -155
  260. package/dataflow/internal/process/functions/call/argument/make-argument.js +2 -1
  261. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +2 -14
  262. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +18 -47
  263. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.d.ts +12 -8
  264. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.js +12 -10
  265. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +38 -128
  266. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +681 -339
  267. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +10 -7
  268. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +78 -45
  269. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +17 -19
  270. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +185 -78
  271. package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +5 -5
  272. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +26 -5
  273. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +2 -2
  274. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +3 -2
  275. package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.d.ts +15 -0
  276. package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.js +438 -0
  277. package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +4 -0
  278. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +40 -57
  279. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +214 -117
  280. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +4 -3
  281. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +74 -17
  282. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +20 -5
  283. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +420 -115
  284. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +1 -7
  285. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -14
  286. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +8 -7
  287. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +530 -140
  288. package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +20 -10
  289. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +98 -13
  290. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +2 -6
  291. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +9 -16
  292. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +14 -8
  293. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +40 -7
  294. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +18 -8
  295. package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +8 -5
  296. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +39 -8
  297. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +9 -24
  298. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +10 -6
  299. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +4 -0
  300. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +5 -6
  301. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -4
  302. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -4
  303. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +27 -12
  304. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -6
  305. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +74 -38
  306. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +17 -4
  307. package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +117 -4
  308. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +5 -3
  309. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
  310. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +8 -4
  311. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +18 -29
  312. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +9 -27
  313. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +42 -45
  314. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -1
  315. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +12 -18
  316. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +72 -21
  317. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +19 -17
  318. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +286 -81
  319. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +7 -4
  320. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +44 -30
  321. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +723 -115
  322. package/dataflow/internal/process/functions/call/common.d.ts +8 -24
  323. package/dataflow/internal/process/functions/call/common.js +24 -24
  324. package/dataflow/internal/process/functions/call/deferred.d.ts +7 -27
  325. package/dataflow/internal/process/functions/call/deferred.js +6 -27
  326. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +6 -26
  327. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -16
  328. package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -4
  329. package/dataflow/internal/process/functions/call/named-call-handling.js +14 -35
  330. package/dataflow/internal/process/functions/call/nse.d.ts +2 -9
  331. package/dataflow/internal/process/functions/call/nse.js +6 -13
  332. package/dataflow/internal/process/functions/call/quoted.d.ts +6 -15
  333. package/dataflow/internal/process/functions/call/quoted.js +48 -65
  334. package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +3 -6
  335. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +29 -11
  336. package/dataflow/internal/process/functions/process-parameter.js +1 -1
  337. package/dataflow/internal/program-order.d.ts +3 -10
  338. package/dataflow/internal/program-order.js +19 -10
  339. package/dataflow/origin/dfg-get-origin.js +2 -1
  340. package/dataflow/processor.d.ts +2 -0
  341. package/documentation/data/dfg/doc-ambient.d.ts +4 -0
  342. package/documentation/data/dfg/doc-ambient.js +74 -0
  343. package/documentation/data/faq/faqs.js +16 -1
  344. package/documentation/data/interface/doc-writing-code.js +5 -7
  345. package/documentation/doc-capabilities.js +3 -3
  346. package/documentation/doc-readme.js +1 -1
  347. package/documentation/doc-util/doc-code.d.ts +0 -5
  348. package/documentation/doc-util/doc-code.js +2 -22
  349. package/documentation/doc-util/doc-query.d.ts +1 -2
  350. package/documentation/doc-util/doc-query.js +4 -5
  351. package/documentation/doc-util/doc-search.js +1 -1
  352. package/documentation/wiki-analyzer.js +4 -3
  353. package/documentation/wiki-core.js +5 -5
  354. package/documentation/wiki-dataflow-graph.js +15 -3
  355. package/documentation/wiki-interface.js +2 -1
  356. package/documentation/wiki-linter.js +27 -3
  357. package/documentation/wiki-linting-and-testing.js +15 -2
  358. package/documentation/wiki-query.js +223 -30
  359. package/index.d.ts +3 -1
  360. package/index.js +6 -3
  361. package/linter/linter-executor.js +1 -1
  362. package/linter/linter-rules.d.ts +78 -9
  363. package/linter/linter-rules.js +12 -1
  364. package/linter/linter-util.d.ts +3 -3
  365. package/linter/linter-util.js +1 -1
  366. package/linter/rules/call-contracts.d.ts +40 -0
  367. package/linter/rules/call-contracts.js +56 -0
  368. package/linter/rules/cmd-check/bogus-return.d.ts +2 -1
  369. package/linter/rules/cmd-check/bogus-return.js +1 -1
  370. package/linter/rules/cmd-check/call-arguments.d.ts +3 -2
  371. package/linter/rules/cmd-check/call-arguments.js +10 -11
  372. package/linter/rules/cmd-check/cmd-check-util.d.ts +8 -13
  373. package/linter/rules/cmd-check/cmd-check-util.js +0 -28
  374. package/linter/rules/cmd-check/dependency-declaration.d.ts +2 -1
  375. package/linter/rules/cmd-check/dependency-declaration.js +1 -1
  376. package/linter/rules/cmd-check/documentation-mismatch.d.ts +3 -2
  377. package/linter/rules/cmd-check/documentation-mismatch.js +2 -1
  378. package/linter/rules/cmd-check/file-checks.d.ts +2 -2
  379. package/linter/rules/cmd-check/foreign-function-calls.d.ts +2 -1
  380. package/linter/rules/cmd-check/global-environment-modification.d.ts +6 -5
  381. package/linter/rules/cmd-check/namespace-tampering.d.ts +2 -1
  382. package/linter/rules/cmd-check/non-ascii-code.js +1 -1
  383. package/linter/rules/cmd-check/package-files.d.ts +2 -2
  384. package/linter/rules/cmd-check/package-hooks.d.ts +5 -4
  385. package/linter/rules/cmd-check/package-hooks.js +2 -1
  386. package/linter/rules/cmd-check/package-runtime.js +2 -2
  387. package/linter/rules/cmd-check/rd-files.js +2 -1
  388. package/linter/rules/cmd-check/s-three-method-consistency.d.ts +3 -2
  389. package/linter/rules/cmd-check/s-three-method-consistency.js +3 -2
  390. package/linter/rules/code-clones.d.ts +57 -0
  391. package/linter/rules/code-clones.js +53 -0
  392. package/linter/rules/deprecated-functions.js +3 -6
  393. package/linter/rules/file-path-validity.js +6 -4
  394. package/linter/rules/function-finder-util.d.ts +4 -2
  395. package/linter/rules/interactive-functions.d.ts +30 -0
  396. package/linter/rules/interactive-functions.js +87 -0
  397. package/linter/rules/naming-convention.d.ts +6 -5
  398. package/linter/rules/naming-convention.js +2 -3
  399. package/linter/rules/no-leaked-credentials.d.ts +2 -1
  400. package/linter/rules/no-leaked-credentials.js +1 -1
  401. package/linter/rules/overwritten-file.d.ts +2 -1
  402. package/linter/rules/problematic-inputs.d.ts +2 -1
  403. package/linter/rules/problematic-inputs.js +3 -3
  404. package/linter/rules/process-state-in-session.d.ts +7 -6
  405. package/linter/rules/process-state-in-session.js +2 -2
  406. package/linter/rules/roxygen-arguments.d.ts +1 -1
  407. package/linter/rules/secret-exfiltration.js +1 -1
  408. package/linter/rules/seeded-randomness.d.ts +3 -3
  409. package/linter/rules/unclosed-connection.js +1 -2
  410. package/linter/rules/undefined-symbol-util.d.ts +4 -3
  411. package/linter/rules/undefined-symbol-util.js +8 -2
  412. package/linter/rules/undefined-symbol.d.ts +3 -2
  413. package/linter/rules/undefined-symbol.js +18 -7
  414. package/linter/rules/unescaped-arguments.d.ts +1 -1
  415. package/linter/rules/unescaped-arguments.js +6 -8
  416. package/linter/rules/unused-definition.d.ts +4 -3
  417. package/linter/rules/unused-definition.js +10 -12
  418. package/linter/rules/unused-import.d.ts +6 -5
  419. package/linter/rules/useless-loop.d.ts +1 -1
  420. package/package.json +1 -1
  421. package/project/attached-packages.d.ts +5 -4
  422. package/project/cache/flowr-analyzer-cache.d.ts +14 -1
  423. package/project/cache/flowr-analyzer-cache.js +40 -3
  424. package/project/context/flowr-analyzer-dependencies-context.d.ts +12 -12
  425. package/project/context/flowr-analyzer-dependencies-context.js +2 -1
  426. package/project/context/flowr-analyzer-environment-context.d.ts +3 -3
  427. package/project/context/flowr-analyzer-environment-context.js +3 -3
  428. package/project/context/flowr-analyzer-functions-context.d.ts +9 -7
  429. package/project/context/flowr-analyzer-gas-context.d.ts +25 -0
  430. package/project/context/flowr-analyzer-gas-context.js +34 -4
  431. package/project/dependency-version-space.d.ts +30 -29
  432. package/project/dependency-version-space.js +1 -2
  433. package/project/flowr-analyzer-builder.d.ts +2 -3
  434. package/project/flowr-analyzer.d.ts +36 -3
  435. package/project/flowr-analyzer.js +8 -2
  436. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +15 -14
  437. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-on-demand-plugin.d.ts +5 -4
  438. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-on-demand-plugin.js +1 -1
  439. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +2 -1
  440. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -3
  441. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +2 -1
  442. package/project/plugins/package-version-plugins/package.d.ts +6 -5
  443. package/project/sigdb/build.js +15 -5
  444. package/project/sigdb/decode.d.ts +11 -7
  445. package/project/sigdb/decode.js +11 -3
  446. package/project/sigdb/dict.d.ts +2 -1
  447. package/project/sigdb/dict.js +2 -2
  448. package/project/sigdb/guarded-source.d.ts +6 -0
  449. package/project/sigdb/guarded-source.js +29 -0
  450. package/project/sigdb/index-format.d.ts +2 -1
  451. package/project/sigdb/manifest.d.ts +1 -1
  452. package/project/sigdb/memory-source.d.ts +18 -17
  453. package/project/sigdb/on-demand/package-sources.d.ts +4 -3
  454. package/project/sigdb/on-demand/recoverer.d.ts +2 -1
  455. package/project/sigdb/on-demand/remote-sources.d.ts +2 -1
  456. package/project/sigdb/reader.d.ts +90 -80
  457. package/project/sigdb/reader.js +27 -5
  458. package/project/sigdb/schema.d.ts +33 -10
  459. package/project/sigdb/signature-db.d.ts +6 -6
  460. package/queries/catalog/absint-query/absint-query-format.d.ts +6 -3
  461. package/queries/catalog/absint-query/absint-query-format.js +57 -2
  462. package/queries/catalog/ambient-access-query/ambient-access-query-format.d.ts +58 -0
  463. package/queries/catalog/ambient-access-query/ambient-access-query-format.js +90 -0
  464. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +2 -1
  465. package/queries/catalog/call-context-query/call-context-query-executor.js +2 -2
  466. package/queries/catalog/call-graph-query/expand-library-internals.d.ts +3 -2
  467. package/queries/catalog/cluster-query/cluster-query-format.d.ts +5 -2
  468. package/queries/catalog/cluster-query/cluster-query-format.js +19 -2
  469. package/queries/catalog/code-clones-query/code-clones-query-format.d.ts +57 -0
  470. package/queries/catalog/code-clones-query/code-clones-query-format.js +105 -0
  471. package/queries/catalog/config-query/config-query-format.d.ts +5 -2
  472. package/queries/catalog/config-query/config-query-format.js +41 -2
  473. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +5 -2
  474. package/queries/catalog/control-flow-query/control-flow-query-format.js +19 -2
  475. package/queries/catalog/data-columns-query/data-columns-query-format.d.ts +72 -0
  476. package/queries/catalog/data-columns-query/data-columns-query-format.js +215 -0
  477. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +5 -2
  478. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +38 -2
  479. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +5 -2
  480. package/queries/catalog/dataflow-query/dataflow-query-format.js +18 -2
  481. package/queries/catalog/dependencies-query/data-flow.d.ts +5 -4
  482. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +5 -2
  483. package/queries/catalog/dependencies-query/dependencies-query-executor.js +5 -5
  484. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +4 -3
  485. package/queries/catalog/dependencies-query/dependencies-query-format.js +9 -4
  486. package/queries/catalog/dependencies-query/function-info/function-info.d.ts +6 -4
  487. package/queries/catalog/dependencies-query/function-info/other-path-functions.js +1 -1
  488. package/queries/catalog/dependencies-query/function-info/tagged-functions.d.ts +11 -0
  489. package/queries/catalog/dependencies-query/function-info/tagged-functions.js +18 -0
  490. package/queries/catalog/dependencies-query/implicit-echo.js +2 -1
  491. package/queries/catalog/dice-query/dice-query-format.d.ts +8 -2
  492. package/queries/catalog/dice-query/dice-query-format.js +35 -2
  493. package/queries/catalog/does-call-query/does-call-query-format.d.ts +8 -4
  494. package/queries/catalog/does-call-query/does-call-query-format.js +115 -2
  495. package/queries/catalog/files-query/files-query-format.d.ts +5 -2
  496. package/queries/catalog/files-query/files-query-format.js +45 -2
  497. package/queries/catalog/function-info-query/function-info-query-format.d.ts +2 -1
  498. package/queries/catalog/function-info-query/function-origin.d.ts +3 -2
  499. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +11 -7
  500. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +303 -2
  501. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +9 -4
  502. package/queries/catalog/happens-before-query/happens-before-query-format.js +38 -2
  503. package/queries/catalog/id-map-query/id-map-query-format.d.ts +5 -2
  504. package/queries/catalog/id-map-query/id-map-query-format.js +18 -2
  505. package/queries/catalog/input-sources-query/input-sources-query-executor.js +7 -3
  506. package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +9 -9
  507. package/queries/catalog/input-sources-query/simple-input-classifier.js +1 -1
  508. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +5 -2
  509. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +29 -2
  510. package/queries/catalog/inspect-fn-guards-query/inspect-fn-guards-query-format.d.ts +37 -0
  511. package/queries/catalog/inspect-fn-guards-query/inspect-fn-guards-query-format.js +125 -0
  512. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +3 -2
  513. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +54 -2
  514. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +6 -2
  515. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +23 -2
  516. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +6 -2
  517. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +15 -2
  518. package/queries/catalog/linter-query/linter-query-format.d.ts +8 -2
  519. package/queries/catalog/linter-query/linter-query-format.js +72 -6
  520. package/queries/catalog/location-map-query/location-map-query-format.d.ts +7 -3
  521. package/queries/catalog/location-map-query/location-map-query-format.js +70 -2
  522. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +5 -2
  523. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +18 -2
  524. package/queries/catalog/origin-query/origin-query-format.d.ts +7 -3
  525. package/queries/catalog/origin-query/origin-query-format.js +30 -2
  526. package/queries/catalog/project-query/project-query-format.d.ts +8 -4
  527. package/queries/catalog/project-query/project-query-format.js +98 -2
  528. package/queries/catalog/provenance-query/provenance-query-format.d.ts +7 -3
  529. package/queries/catalog/provenance-query/provenance-query-format.js +31 -2
  530. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +10 -2
  531. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +39 -2
  532. package/queries/catalog/search-query/search-query-format.d.ts +5 -2
  533. package/queries/catalog/search-query/search-query-format.js +23 -2
  534. package/queries/catalog/signature-query/signature-query-executor.d.ts +9 -6
  535. package/queries/catalog/signature-query/signature-query-executor.js +17 -16
  536. package/queries/catalog/signature-query/signature-query-format.d.ts +24 -20
  537. package/queries/catalog/signature-query/signature-query-render.js +24 -1
  538. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +22 -7
  539. package/queries/catalog/static-slice-query/static-slice-query-format.js +56 -2
  540. package/queries/catalog/taint-query/taint-query-format.d.ts +6 -3
  541. package/queries/catalog/taint-query/taint-query-format.js +28 -2
  542. package/queries/query-function-filter.d.ts +1 -1
  543. package/queries/query.d.ts +104 -32
  544. package/queries/query.js +61 -37
  545. package/r-bridge/data/data.d.ts +39 -28
  546. package/r-bridge/data/data.js +37 -28
  547. package/r-bridge/lang-4.x/ast/model/model.d.ts +10 -1
  548. package/r-bridge/lang-4.x/ast/model/model.js +30 -0
  549. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +21 -0
  550. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +25 -2
  551. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +2 -1
  552. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -2
  553. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +2 -2
  554. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
  555. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
  556. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
  557. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
  558. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +4 -3
  559. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
  560. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
  561. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
  562. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
  563. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
  564. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
  565. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
  566. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
  567. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
  568. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +5 -6
  569. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -7
  570. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
  571. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -2
  572. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +2 -2
  573. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
  574. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +4 -5
  575. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +9 -2
  576. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +18 -6
  577. package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +1 -1
  578. package/r-bridge/lang-4.x/ast/model/processing/visitor.js +2 -2
  579. package/r-bridge/lang-4.x/ast/model/type.d.ts +1 -1
  580. package/r-bridge/lang-4.x/ast/model/type.js +1 -1
  581. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -2
  582. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -2
  583. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +2 -2
  584. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +3 -2
  585. package/r-bridge/parser.d.ts +8 -2
  586. package/r-bridge/parser.js +6 -0
  587. package/r-bridge/shell-executor.d.ts +2 -2
  588. package/r-bridge/shell-executor.js +3 -2
  589. package/r-bridge/shell.d.ts +2 -2
  590. package/r-bridge/shell.js +10 -4
  591. package/reconstruct/auto-select/magic-comments.js +1 -1
  592. package/reconstruct/reconstruct.d.ts +0 -5
  593. package/reconstruct/reconstruct.js +24 -8
  594. package/search/flowr-search-builder.d.ts +14 -0
  595. package/search/flowr-search-builder.js +7 -0
  596. package/search/flowr-search-executor.js +2 -2
  597. package/search/flowr-search-filters.js +8 -9
  598. package/search/flowr-search.js +1 -1
  599. package/search/search-executor/search-enrichers.d.ts +2 -0
  600. package/search/search-executor/search-enrichers.js +6 -1
  601. package/search/search-executor/search-generators.d.ts +2 -2
  602. package/search/search-executor/search-generators.js +13 -8
  603. package/search/search-executor/search-mappers.js +1 -1
  604. package/search/search-executor/search-transformer.d.ts +2 -2
  605. package/search/search-executor/search-transformer.js +6 -6
  606. package/slicing/criterion/parse.d.ts +2 -1
  607. package/slicing/criterion/parse.js +2 -1
  608. package/slicing/static/removal-slice.js +6 -4
  609. package/slicing/static/slice-call.d.ts +41 -4
  610. package/slicing/static/slice-call.js +117 -11
  611. package/slicing/static/slicer-types.d.ts +2 -1
  612. package/slicing/static/static-slicer.d.ts +2 -0
  613. package/slicing/static/static-slicer.js +199 -28
  614. package/slicing/static/visiting-queue.d.ts +4 -0
  615. package/slicing/static/visiting-queue.js +8 -0
  616. package/taint-analysis/builder/report-template.d.ts +3 -3
  617. package/util/arg-matching.d.ts +1 -1
  618. package/util/collections/relation.d.ts +23 -0
  619. package/util/collections/relation.js +63 -0
  620. package/util/fixpoint.d.ts +65 -0
  621. package/util/fixpoint.js +216 -0
  622. package/util/flowr-version.d.ts +1 -1
  623. package/util/flowr-version.js +2 -2
  624. package/util/json.d.ts +4 -0
  625. package/util/json.js +12 -3
  626. package/util/mermaid/cfg.js +1 -2
  627. package/util/mermaid/dfg.d.ts +1 -1
  628. package/util/mermaid/dfg.js +1 -1
  629. package/util/mermaid/mermaid.d.ts +2 -1
  630. package/util/monoid.d.ts +26 -0
  631. package/util/monoid.js +31 -0
  632. package/util/objects.d.ts +2 -0
  633. package/util/objects.js +5 -0
  634. package/util/prefix.d.ts +1 -1
  635. package/util/r-base-packages.d.ts +10 -7
  636. package/util/r-base-packages.js +11 -6
  637. package/util/r-datasets.d.ts +27 -0
  638. package/util/r-datasets.js +45 -0
  639. package/util/r-package-urls.d.ts +10 -9
  640. package/util/r-value.js +2 -1
  641. package/util/r-version-order.d.ts +2 -0
  642. package/util/r-version-order.js +19 -0
  643. package/util/r-version.d.ts +2 -1
  644. package/util/r-version.js +2 -14
  645. package/util/range.d.ts +38 -29
  646. package/util/range.js +10 -5
  647. package/util/simple-df/dfg-ascii.js +2 -2
  648. package/util/text/ansi.d.ts +13 -9
  649. package/util/text/ansi.js +4 -6
  650. package/util/text/playground-link.d.ts +2 -0
  651. package/util/text/playground-link.js +2 -0
  652. package/util/text/strings.d.ts +10 -3
  653. package/util/text/strings.js +10 -1
  654. package/util/version.d.ts +1 -1
  655. package/util/version.js +2 -1
  656. package/dataflow/environments/default-builtin-config.d.ts +0 -8874
  657. package/dataflow/environments/default-builtin-config.js +0 -1737
  658. package/queries/catalog/absint-query/absint-query-executor.d.ts +0 -6
  659. package/queries/catalog/absint-query/absint-query-executor.js +0 -61
  660. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +0 -6
  661. package/queries/catalog/cluster-query/cluster-query-executor.js +0 -21
  662. package/queries/catalog/config-query/config-query-executor.d.ts +0 -6
  663. package/queries/catalog/config-query/config-query-executor.js +0 -45
  664. package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +0 -6
  665. package/queries/catalog/control-flow-query/control-flow-query-executor.js +0 -21
  666. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +0 -6
  667. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +0 -40
  668. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +0 -6
  669. package/queries/catalog/dataflow-query/dataflow-query-executor.js +0 -20
  670. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +0 -9
  671. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +0 -18
  672. package/queries/catalog/dice-query/dice-query-executor.d.ts +0 -8
  673. package/queries/catalog/dice-query/dice-query-executor.js +0 -37
  674. package/queries/catalog/does-call-query/does-call-query-executor.d.ts +0 -6
  675. package/queries/catalog/does-call-query/does-call-query-executor.js +0 -117
  676. package/queries/catalog/files-query/files-query-executor.d.ts +0 -6
  677. package/queries/catalog/files-query/files-query-executor.js +0 -47
  678. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +0 -6
  679. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +0 -307
  680. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +0 -7
  681. package/queries/catalog/happens-before-query/happens-before-query-executor.js +0 -40
  682. package/queries/catalog/id-map-query/id-map-query-executor.d.ts +0 -6
  683. package/queries/catalog/id-map-query/id-map-query-executor.js +0 -20
  684. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +0 -6
  685. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +0 -31
  686. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +0 -4
  687. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +0 -58
  688. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +0 -7
  689. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +0 -25
  690. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.d.ts +0 -7
  691. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +0 -17
  692. package/queries/catalog/linter-query/linter-query-executor.d.ts +0 -9
  693. package/queries/catalog/linter-query/linter-query-executor.js +0 -59
  694. package/queries/catalog/location-map-query/location-map-query-executor.d.ts +0 -7
  695. package/queries/catalog/location-map-query/location-map-query-executor.js +0 -73
  696. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +0 -6
  697. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +0 -20
  698. package/queries/catalog/origin-query/origin-query-executor.d.ts +0 -6
  699. package/queries/catalog/origin-query/origin-query-executor.js +0 -31
  700. package/queries/catalog/project-query/project-query-executor.d.ts +0 -6
  701. package/queries/catalog/project-query/project-query-executor.js +0 -103
  702. package/queries/catalog/provenance-query/provenance-query-executor.d.ts +0 -6
  703. package/queries/catalog/provenance-query/provenance-query-executor.js +0 -33
  704. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +0 -10
  705. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +0 -40
  706. package/queries/catalog/search-query/search-query-executor.d.ts +0 -6
  707. package/queries/catalog/search-query/search-query-executor.js +0 -25
  708. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +0 -14
  709. package/queries/catalog/static-slice-query/static-slice-query-executor.js +0 -59
  710. package/queries/catalog/taint-query/taint-query-executor.d.ts +0 -7
  711. package/queries/catalog/taint-query/taint-query-executor.js +0 -30
  712. package/r-bridge/lang-4.x/ast/model/operators.d.ts +0 -33
  713. package/r-bridge/lang-4.x/ast/model/operators.js +0 -54
  714. package/taint-analysis/eval/eval.js +0 -124
  715. package/taint-analysis/eval/instrumentation.d.ts +0 -59
  716. package/taint-analysis/eval/instrumentation.js +0 -124
  717. /package/{taint-analysis/eval/eval.d.ts → abstract-interpretation/branch-paths-interpreter.d.ts} +0 -0
@@ -0,0 +1,234 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AmbientVerbInfo = exports.AmbientFamilyInfo = exports.Ambient = exports.AmbientVerb = exports.AmbientPart = void 0;
4
+ exports.withImpliedAmbient = withImpliedAmbient;
5
+ exports.declaresAmbient = declaresAmbient;
6
+ exports.ambientSummaryOf = ambientSummaryOf;
7
+ const built_in_props_1 = require("./built-in-props");
8
+ const ambient_state_name_1 = require("./ambient-state-name");
9
+ const arrays_1 = require("../../util/collections/arrays");
10
+ /** The parts of the global state other than the {@link KeyedState|keyed} ones a built-in may access, see {@link AmbientEffect}. */
11
+ var AmbientPart;
12
+ (function (AmbientPart) {
13
+ /** the graphics devices, one of which is active */
14
+ AmbientPart["Device"] = "device";
15
+ /** the plot on the active device */
16
+ AmbientPart["Plot"] = "plot";
17
+ /** the color palette all devices share */
18
+ AmbientPart["Palette"] = "palette";
19
+ /** the ggplot `last_plot()` returns, which every ggplot that is built or added to becomes */
20
+ AmbientPart["LastPlot"] = "last-plot";
21
+ /** the diversions of the console output, the last of which is active */
22
+ AmbientPart["Sink"] = "sink";
23
+ /** the diversion of messages and warnings */
24
+ AmbientPart["MessageSink"] = "message-sink";
25
+ /** the state of the random number generator */
26
+ AmbientPart["Rng"] = "rng";
27
+ /** the kind of the random number generator */
28
+ AmbientPart["RngKind"] = "rng-kind";
29
+ AmbientPart["WorkingDirectory"] = "wd";
30
+ /** the directories on disk, which every path to a file leads through */
31
+ AmbientPart["Directories"] = "directories";
32
+ /** the files on disk, which the arguments of the {@link AmbientEffect#sig|signature} name */
33
+ AmbientPart["Files"] = "files";
34
+ /** the root `here::here()` builds paths from */
35
+ AmbientPart["ProjectRoot"] = "project-root";
36
+ AmbientPart["LibPaths"] = "lib-paths";
37
+ AmbientPart["Umask"] = "umask";
38
+ /** the finalizers registered, which `gc()` runs */
39
+ AmbientPart["Finalizers"] = "finalizers";
40
+ /** the variable a text connection opened for writing binds */
41
+ AmbientPart["TextConnection"] = "text-connection";
42
+ /** the message of the last error, which `geterrmessage()` returns */
43
+ AmbientPart["ErrorMessage"] = "error-message";
44
+ })(AmbientPart || (exports.AmbientPart = AmbientPart = {}));
45
+ /** What a built-in does to a part of the global state, see {@link AmbientEffect}. */
46
+ var AmbientVerb;
47
+ (function (AmbientVerb) {
48
+ AmbientVerb["Reads"] = "reads";
49
+ /** replaces it */
50
+ AmbientVerb["Writes"] = "writes";
51
+ /** changes it on top of what it was, so it reads it as well: drawing on the plot, drawing a random number */
52
+ AmbientVerb["Adds"] = "adds";
53
+ /** starts it afresh: a new plot */
54
+ AmbientVerb["Resets"] = "resets";
55
+ /** removes the named entries */
56
+ AmbientVerb["Kills"] = "kills";
57
+ /** opens an instance, which becomes the active one */
58
+ AmbientVerb["Opens"] = "opens";
59
+ /** closes the active instance, the one named, or every one */
60
+ AmbientVerb["Closes"] = "closes";
61
+ /** makes another instance the active one */
62
+ AmbientVerb["Switches"] = "switches";
63
+ /** builds an object that does the drawing once printed */
64
+ AmbientVerb["Builds"] = "builds";
65
+ })(AmbientVerb || (exports.AmbientVerb = AmbientVerb = {}));
66
+ /** Shorthands for the {@link AmbientEffect}s, one per part, so a configuration reads `Ambient.plot.adds`. */
67
+ function effectsOf(family) {
68
+ return Object.fromEntries(Object.values(AmbientVerb).map(access => [access, { family, access }]));
69
+ }
70
+ /**
71
+ * The {@link AmbientEffect}s by part and verb, see {@link AmbientEffect}.
72
+ * @helper dataflow
73
+ */
74
+ exports.Ambient = {
75
+ device: effectsOf(AmbientPart.Device),
76
+ plot: effectsOf(AmbientPart.Plot),
77
+ par: effectsOf(ambient_state_name_1.KeyedState.Par),
78
+ palette: effectsOf(AmbientPart.Palette),
79
+ lastPlot: effectsOf(AmbientPart.LastPlot),
80
+ sink: effectsOf(AmbientPart.Sink),
81
+ messageSink: effectsOf(AmbientPart.MessageSink),
82
+ option: effectsOf(ambient_state_name_1.KeyedState.Option),
83
+ env: effectsOf(ambient_state_name_1.KeyedState.Env),
84
+ locale: effectsOf(ambient_state_name_1.KeyedState.Locale),
85
+ searchPath: effectsOf(ambient_state_name_1.KeyedState.SearchPath),
86
+ rng: effectsOf(AmbientPart.Rng),
87
+ rngKind: effectsOf(AmbientPart.RngKind),
88
+ wd: effectsOf(AmbientPart.WorkingDirectory),
89
+ directories: effectsOf(AmbientPart.Directories),
90
+ files: effectsOf(AmbientPart.Files),
91
+ projectRoot: effectsOf(AmbientPart.ProjectRoot),
92
+ libPaths: effectsOf(AmbientPart.LibPaths),
93
+ umask: effectsOf(AmbientPart.Umask),
94
+ finalizers: effectsOf(AmbientPart.Finalizers),
95
+ textConnection: effectsOf(AmbientPart.TextConnection),
96
+ errorMessage: effectsOf(AmbientPart.ErrorMessage),
97
+ /** The effects of `effects` in a flat list. */
98
+ list(effects) {
99
+ return effects === undefined ? [] : 'family' in effects ? [effects] : effects;
100
+ }
101
+ };
102
+ /** A call that reads or writes the files its arguments name accesses the {@link AmbientPart.Files|files on disk} as well. */
103
+ function withFileAccess(config) {
104
+ const { tags, ambient, sig } = config;
105
+ if (!tags?.includes(built_in_props_1.SemanticCallTag.File)) {
106
+ return config;
107
+ }
108
+ const writes = tags.includes(built_in_props_1.SemanticCallTag.Writes);
109
+ const split = writes && tags.includes(built_in_props_1.SemanticCallTag.Reads) && sig !== undefined && built_in_props_1.FnSig.resources(sig, true) !== sig;
110
+ /* reading first, so the files read are the ones written before, not the call's own */
111
+ const verbs = [...split || !writes && tags.includes(built_in_props_1.SemanticCallTag.Reads) ? [AmbientVerb.Reads] : [], ...writes ? [AmbientVerb.Writes] : []];
112
+ const stated = exports.Ambient.list(ambient);
113
+ const isDevice = (verb) => stated.some(a => a.family === AmbientPart.Device && a.access === verb);
114
+ if (verbs.length === 0 || stated.some(a => a.family === AmbientPart.Files && verbs.includes(a.access)) || isDevice(AmbientVerb.Closes)) {
115
+ return config;
116
+ }
117
+ const glob = tags.includes(built_in_props_1.SemanticCallTag.Glob);
118
+ /* appending to a file (`cat(x, file = f, append = TRUE)`) keeps what was written to it before */
119
+ const appends = writes && !verbs.includes(AmbientVerb.Reads) && sig?.some(([name]) => name === 'append') ? [AmbientVerb.Reads] : [];
120
+ return { ...config, ambient: [...stated, ...appends.map(access => ({ family: AmbientPart.Files, access, when: { flag: 'append' }, sig: glob ? undefined : sig })), ...verbs.map(access => ({
121
+ family: AmbientPart.Files, access, numbered: isDevice(AmbientVerb.Opens),
122
+ sig: glob || sig === undefined ? undefined : split ? built_in_props_1.FnSig.resources(sig, access === AmbientVerb.Writes) : sig
123
+ }))] };
124
+ }
125
+ /** A call starting a process hands it every environment variable, a call loading a package looks for it in the library paths, a call printing adds to the diverted output. */
126
+ function withImplicitAccess(config) {
127
+ const { tags, ambient } = config;
128
+ /* what always goes to the message sink, like `message`, does not print to the output sink */
129
+ const printsToMessages = exports.Ambient.list(ambient).some(e => e.family === exports.Ambient.messageSink.adds.family && e.when === undefined && e.unless === undefined);
130
+ const implied = [
131
+ ...tags?.includes(built_in_props_1.SemanticCallTag.Process) ? [exports.Ambient.env.reads] : [],
132
+ ...tags?.includes(built_in_props_1.SemanticCallTag.LoadsPackage) ? [exports.Ambient.libPaths.reads] : [],
133
+ ...tags?.includes(built_in_props_1.SemanticCallTag.Prints) && !printsToMessages ? [exports.Ambient.sink.adds] : []
134
+ ];
135
+ return implied.length === 0 ? config : { ...config, ambient: [...exports.Ambient.list(ambient), ...implied] };
136
+ }
137
+ /** The configuration with the {@link AmbientEffect}s its tags imply added to the ones it states. */
138
+ function withImpliedAmbient(config) {
139
+ return config === undefined ? config : withImplicitAccess(withFileAccess(config));
140
+ }
141
+ /** Whether the configuration declares an {@link AmbientEffect} or a scoped change of the state, which makes the function one touching {@link CallProp.Ambient|ambient state} on a page. */
142
+ function declaresAmbient(config) {
143
+ return config !== undefined && (exports.Ambient.list(config.ambient).length > 0 || config.scope !== undefined);
144
+ }
145
+ /** The words for every part of the global state, the one source the wiki, the signature browser, and these docs share. */
146
+ exports.AmbientFamilyInfo = {
147
+ [AmbientPart.Device]: { label: 'graphics device', noun: 'device', description: 'The graphics devices R draws on, one of which is active: opening one makes it the active one, closing it returns to another, and closing a device writes its file.' },
148
+ [AmbientPart.Plot]: { label: 'plot', noun: 'plot', of: AmbientPart.Device, description: 'What is drawn on the active device: a new plot replaces it, an addon like points draws on top of it, and drawing opens a device if none is open.' },
149
+ [ambient_state_name_1.KeyedState.Par]: { label: 'graphics parameters', noun: 'graphics parameters', of: AmbientPart.Device, description: 'The parameters par sets for the active device, each by its name, which every later base graphics plot on that device picks up.' },
150
+ [AmbientPart.Palette]: { label: 'palette', noun: 'palette', description: 'The color palette all devices share, which a numeric color indexes into.' },
151
+ [AmbientPart.LastPlot]: { label: 'last ggplot', noun: 'last ggplot', description: 'The ggplot last built or added to, which last_plot() returns and ggsave saves by default.' },
152
+ [AmbientPart.Sink]: { label: 'output sink', noun: 'sink', verbs: { [AmbientVerb.Adds]: 'prints to the active' }, description: 'Where the console output goes: sink(file) diverts it on top of a stack, sink() ends the last diversion, which finishes what it wrote.' },
153
+ [AmbientPart.MessageSink]: { label: 'message sink', noun: 'message sink', verbs: { [AmbientVerb.Adds]: 'signals to the active' }, description: 'Where messages and warnings go: sink(con, type = "message") diverts them, sink(type = "message") returns them to the console.' },
154
+ [ambient_state_name_1.KeyedState.Option]: { label: 'options', noun: 'options', description: 'The options options() sets by name, like digits or scipen, which printing and many functions read.' },
155
+ [ambient_state_name_1.KeyedState.Env]: { label: 'environment variables', noun: 'environment variables', description: 'The environment variables of the R process by name, like TZ or LANG, which R and every child process read.' },
156
+ [ambient_state_name_1.KeyedState.Locale]: { label: 'locale', noun: 'locale', description: 'The locale categories like LC_COLLATE, which sorting, formatting, and messages follow.' },
157
+ [ambient_state_name_1.KeyedState.SearchPath]: { label: 'search path', noun: 'search path', description: 'The packages and environments attached, in which R looks up a name the code does not define.' },
158
+ [AmbientPart.Rng]: { label: 'random numbers', noun: 'random number generator', verbs: { [AmbientVerb.Adds]: 'draws from', [AmbientVerb.Writes]: 'seeds' }, description: 'The state of the random number generator, which set.seed sets and every draw advances.' },
159
+ [AmbientPart.RngKind]: { label: 'random number kind', noun: 'generator kind', of: AmbientPart.Rng, description: 'Which random number generator R uses, which RNGkind sets and set.seed keeps unless it is given one.' },
160
+ [AmbientPart.WorkingDirectory]: { label: 'working directory', noun: 'working directory', description: 'The directory relative paths start from, which setwd changes.' },
161
+ [AmbientPart.Directories]: { label: 'directories', noun: 'directories', description: 'The directories on disk, which dir.create, unlink, and file.rename change and every path to a file leads through.' },
162
+ [AmbientPart.Files]: { label: 'files', noun: 'files', description: 'The files on disk, which a call reads or writes by the paths its arguments name.' },
163
+ [AmbientPart.ProjectRoot]: { label: 'project root', noun: 'project root', description: 'The root here::here() builds its paths from, which here::i_am names.' },
164
+ [AmbientPart.LibPaths]: { label: 'library paths', noun: 'library paths', description: 'Where packages are installed and loaded from, which .libPaths(new) changes.' },
165
+ [AmbientPart.Umask]: { label: 'file creation mask', noun: 'file creation mask', description: 'The permissions every new file lacks, which Sys.umask sets.' },
166
+ [AmbientPart.Finalizers]: { label: 'finalizers', noun: 'finalizers', description: 'The functions reg.finalizer registers to run once their object is released, which gc() may run.' },
167
+ [AmbientPart.TextConnection]: { label: 'text connection', noun: 'text connection', description: 'The variable a text connection opened for writing binds, which every write to the connection changes.' },
168
+ [AmbientPart.ErrorMessage]: { label: 'last error message', noun: 'last error message', description: 'The message of the last error, which an error sets and geterrmessage() returns, so code going on after try or tryCatch caught one may read it.' }
169
+ };
170
+ /** The words for every access verb, see {@link AmbientFamilyInfo}. */
171
+ exports.AmbientVerbInfo = {
172
+ [AmbientVerb.Reads]: { label: 'reads', description: 'The call depends on the state, so it links to the calls that set it before.' },
173
+ [AmbientVerb.Writes]: { label: 'writes', description: 'The call replaces the state, so later reads link to it instead of what came before.' },
174
+ [AmbientVerb.Adds]: { label: 'adds to', description: 'The call changes the state on top of what it was, so it reads it and later reads see both.' },
175
+ [AmbientVerb.Resets]: { label: 'starts a new', description: 'The call starts the state anew, so later reads no longer see what came before.' },
176
+ [AmbientVerb.Kills]: { label: 'removes', description: 'The call removes entries, so later reads of them see nothing set.' },
177
+ [AmbientVerb.Opens]: { label: 'opens', description: 'The call opens an instance that becomes the active one, the others keep their state until they are active again.' },
178
+ [AmbientVerb.Closes]: { label: 'closes', description: 'The call ends an instance, which links it to the call that opened it and to everything done with it in between.' },
179
+ [AmbientVerb.Switches]: { label: 'switches', description: 'The call makes another open instance the active one.' },
180
+ [AmbientVerb.Builds]: { label: 'builds an object drawing', description: 'The call builds an object that only draws once it is printed, like a ggplot.' }
181
+ };
182
+ function memberWords(effect) {
183
+ const member = effect.member;
184
+ if (member === undefined) {
185
+ return effect.family === AmbientPart.Files && effect.sig !== undefined ? effect.sig.filter(([, p]) => (p & built_in_props_1.ArgProp.Resource) !== 0).map(([n]) => `named by ${n}`) : [];
186
+ }
187
+ else if (member === 'every') {
188
+ return ['every open one'];
189
+ }
190
+ switch (member.from) {
191
+ case 'constant': return member.keys;
192
+ case 'argument-names': return ['the names of the arguments'];
193
+ case 'unnamed': return ['the unnamed arguments'];
194
+ case 'parameter': return [`named by ${member.names.join(' or ')}${member.fallback === undefined ? '' : `, else ${member.fallback}`}`];
195
+ }
196
+ }
197
+ function conditionWords(condition) {
198
+ if (condition === 'no-arguments') {
199
+ return 'it has no arguments';
200
+ }
201
+ else if (condition === 'query') {
202
+ return 'it only queries';
203
+ }
204
+ else if ('flag' in condition) {
205
+ return `${condition.flag} is TRUE`;
206
+ }
207
+ else if ('calls' in condition) {
208
+ return `${condition.arg} is a call of ${condition.calls.join(' or ')}`;
209
+ }
210
+ else if ('arg' in condition) {
211
+ return `${condition.arg} is ${condition.is.map(v => v === null ? 'missing' : `"${v}"`).join(' or ')}`;
212
+ }
213
+ return `it has arguments besides ${condition.besides.join(', ') || 'none'}`;
214
+ }
215
+ /**
216
+ * The {@link AmbientEffect}s of a built-in, including those its tags imply, grouped by the part they access (a part of the active device under the device)
217
+ * and by verb, with the entries each access names: `graphics device: opens device, reads plot, adds to plot`.
218
+ */
219
+ function ambientSummaryOf(config) {
220
+ const families = new Map();
221
+ for (const effect of exports.Ambient.list(withImpliedAmbient(config)?.ambient)) {
222
+ const words = exports.AmbientFamilyInfo[effect.family];
223
+ const family = words.of ?? effect.family;
224
+ const accesses = families.get(family) ?? new Map();
225
+ families.set(family, accesses);
226
+ const when = [...effect.when === undefined ? [] : [`if ${conditionWords(effect.when)}`], ...effect.unless === undefined ? [] : [`unless ${conditionWords(effect.unless)}`]];
227
+ const key = `${effect.family} ${effect.access} ${when.join()}`;
228
+ const known = accesses.get(key) ?? { part: effect.family, access: effect.access, label: `${words.verbs?.[effect.access] ?? exports.AmbientVerbInfo[effect.access].label} ${words.noun}`, members: [], when };
229
+ accesses.set(key, known);
230
+ known.members = (0, arrays_1.uniqueArrayMerge)(known.members, memberWords(effect));
231
+ }
232
+ return [...families].map(([family, accesses]) => ({ family, label: exports.AmbientFamilyInfo[family].label, accesses: [...accesses.values()] }));
233
+ }
234
+ //# sourceMappingURL=ambient-effect.js.map
@@ -1,8 +1,5 @@
1
- import type { Identifier } from './identifier';
2
- /**
3
- * The states made of named entries: setting one entry replaces its pseudo variable `#<state>:<key>`, adds to the accumulating
4
- * `all` of the state, and an entry we cannot name adds to `#<state>:*` instead (`options(op)`, `Sys.setenv(...)`).
5
- */
1
+ import type { Identifier, BrandedIdentifier } from './identifier';
2
+ /** The states made of named entries: setting one entry replaces its pseudo variable `#<state>:<key>`, adds to the accumulating `all` of the state, and an entry we cannot name adds to `#<state>:*` instead (`options(op)`, `Sys.setenv(...)`). */
6
3
  export declare enum KeyedState {
7
4
  /** the options `options(digits = 3)` sets */
8
5
  Option = "option",
@@ -17,21 +14,29 @@ export declare enum KeyedState {
17
14
  }
18
15
  /** The key standing for any entry of a {@link KeyedState} we cannot name. */
19
16
  export declare const UnknownKey = "*";
20
- /**
21
- * Graphics parameters, options and other global state, tracked as global pseudo variables (`#...`) so readers link to the calls that set them.
22
- * Accumulating states only grow: `par(mar = ...)` keeps an earlier `par(mfrow = ...)`.
23
- * The pseudo variables a function may leave changed are what `Dataflow.sideEffects.ambientWrites` reports.
24
- */
17
+ /** The name of a global pseudo variable tracking a part of the global state, see the helper of the same name. */
18
+ export type AmbientStateName = `#${string}` & BrandedIdentifier;
19
+ /** Graphics parameters, options and other global state, tracked as global pseudo variables (`#...`) so readers link to the calls that set them. */
25
20
  export declare const AmbientStateName: {
26
21
  /** the graphics state (`par`, `layout`, ...) of the active device, which a new device starts afresh */
27
22
  readonly graphics: "#graphics";
28
23
  /** the graphics states of the other open devices, the active one returns to one of them once it closes */
29
24
  readonly otherDevices: "#graphics:other";
30
- /** the call that opened the active device, and those of the other open devices */
25
+ /** the calls that opened the active device, set it up, and drew on it (a plot or `par` opens a device if none is open), and those of the other open devices, which closing a device links to */
31
26
  readonly device: "#device";
32
27
  readonly otherDevicesOpenedBy: "#device:other";
28
+ /** the call that explicitly opened the active device (`png("a.png")`), and those of the other open devices, which names the file its close writes */
29
+ readonly deviceOpener: "#device:opener";
30
+ readonly otherDeviceOpeners: "#device:opener:other";
33
31
  /** within a function, the call of its body that opened the active device, which only that body knows */
34
32
  readonly deviceOpenedHere: "#device:here";
33
+ /** the calls drawing the plot on the active device: a new plot (`plot`) replaces it, an addon (`points`) reads and adds to it */
34
+ readonly plot: "#plot";
35
+ readonly otherPlots: "#plot:other";
36
+ /** the plot ggplot2's `last_plot()` returns, which building a ggplot (`ggplot`, `+`) replaces and `ggsave` reads; it belongs to no device */
37
+ readonly lastPlot: "#last-plot";
38
+ /** what is drawn on the active device, which every plot adds to; only written if `semantics.ambient.drawingWritesDevice` is set */
39
+ readonly canvas: "#canvas";
35
40
  /** the color palette, which, other than the graphics parameters, all devices share */
36
41
  readonly palette: "#palette";
37
42
  /** the files on disk, which every call writing a file adds to and every call reading a file we cannot name reads */
@@ -40,8 +45,19 @@ export declare const AmbientStateName: {
40
45
  readonly anyFile: "#file:*";
41
46
  /** the working directory `setwd` changes, which every call accessing a file reads to resolve a relative path */
42
47
  readonly workingDirectory: "#wd";
43
- /** whether console output is diverted into a file or connection, as `sink(file)` does and `sink()` undoes */
48
+ /** the directories on disk, which creating, moving, or removing one changes and every call accessing a file reads, as the path may lead through them */
49
+ readonly directories: "#dirs";
50
+ /** where console output goes, the call diverting it into a file or connection (`sink(file)`), and the diversions below it, which `sink()` returns to */
44
51
  readonly sink: "#sink";
52
+ readonly otherSinks: "#sink:other";
53
+ /** the explicit diversion of the console output, and those below it */
54
+ readonly sinkOpener: "#sink:opener";
55
+ readonly otherSinkOpeners: "#sink:opener:other";
56
+ /** the diversion of the output and every call printing into it, and those of the diversions below, which ending it links to */
57
+ readonly sinkOutput: "#sink:output";
58
+ readonly otherSinkOutputs: "#sink:output:other";
59
+ /** within a function, the call of its body that diverted the output */
60
+ readonly sinkOpenedHere: "#sink:here";
45
61
  /** the project root `here::here()` builds its paths from, found from the working directory unless `here::i_am` names it */
46
62
  readonly projectRoot: "#project-root";
47
63
  /** where packages are installed and loaded from, which `.libPaths(new)` changes and every package load reads */
@@ -50,6 +66,8 @@ export declare const AmbientStateName: {
50
66
  readonly umask: "#umask";
51
67
  /** the state of the random number generator, which `set.seed` sets and every draw advances */
52
68
  readonly rng: "#rng";
69
+ /** the message of the last error, which `try` and `tryCatch` may have caught */
70
+ readonly errorMessage: "#error-message";
53
71
  /** the kind of generator, which `set.seed` keeps unless it is given one */
54
72
  readonly rngKind: "#rng:kind";
55
73
  /** the global variable R keeps that state in, so assigning it sets {@link AmbientStateName.rng} as well */
@@ -63,22 +81,39 @@ export declare const AmbientStateName: {
63
81
  /** the finalizers registered (`reg.finalizer`) and the removals that may release their objects, which `gc()` may run */
64
82
  readonly finalizers: "#finalizers";
65
83
  /** marks `name` as bound to a text connection opened for writing, whose writes change it */
66
- readonly textConnection: (this: void, name: string) => string;
84
+ readonly textConnection: (this: void, name: BrandedIdentifier) => AmbientStateName;
67
85
  /** the file named `stem` (`data` for `out/data.csv`), so a read of a named file only sees writes that may hit it */
68
- readonly file: (this: void, stem: string) => string;
86
+ readonly file: (this: void, stem: string) => AmbientStateName;
69
87
  /** the pseudo variable holding the option `key`; setting the option replaces it */
70
- readonly option: (this: void, key: string) => string;
88
+ readonly option: (this: void, key: BrandedIdentifier) => AmbientStateName;
71
89
  /** the pseudo variable of the entry `key` of a state, like `#env:PATH`; setting the entry replaces it */
72
- readonly keyed: (this: void, state: KeyedState, key: string) => string;
90
+ readonly keyed: (this: void, state: KeyedState, key: BrandedIdentifier) => AmbientStateName;
73
91
  /** the pseudo variable every write to the state adds to, like `#env` */
74
- readonly allOf: (this: void, state: KeyedState) => string;
75
- /** the entry of a state a pseudo variable stands for (`#env:PATH` is `PATH` of `env`), `undefined` for any other */
76
- readonly entryOf: (this: void, name: string) => {
77
- readonly state: KeyedState;
78
- readonly key: string;
79
- } | undefined;
92
+ readonly allOf: (this: void, state: KeyedState) => AmbientStateName;
80
93
  /** whether `name` is one of these pseudo variables */
81
- readonly is: (this: void, name: Identifier | undefined) => name is string;
94
+ readonly is: (this: void, name: Identifier | undefined) => name is AmbientStateName;
82
95
  };
96
+ /**
97
+ * A state of which several instances exist at once, one of them active, like the graphics devices:
98
+ * opening an instance makes it the active one, switching makes another one active, closing it returns to another.
99
+ */
100
+ export interface AmbientFamily {
101
+ /** each state an instance has of its own, with the pseudo variable holding it for the other open instances */
102
+ readonly states: readonly (readonly [active: AmbientStateName, others: AmbientStateName])[];
103
+ /** the state of {@link AmbientFamily#states} holding the calls that opened the active instance and used it */
104
+ readonly used: AmbientStateName;
105
+ /** the state of {@link AmbientFamily#states} only an explicit opening writes, which tells it apart from a use that opened the instance on the fly */
106
+ readonly opened: AmbientStateName;
107
+ /** the state of {@link AmbientFamily#states} a switch to another instance reads */
108
+ readonly switched: AmbientStateName;
109
+ /** within a function, the call of its body that opened the active instance */
110
+ readonly openedHere: AmbientStateName;
111
+ }
112
+ /** The graphics devices, each with its graphics parameters, the calls opening and using it, its current plot, and its explicit opening. */
113
+ export declare const GraphicsDevices: AmbientFamily;
114
+ /** The diversions of the console output, a stack: `sink(file)` pushes one, `sink()` pops it and returns to the one below. */
115
+ export declare const OutputSinks: AmbientFamily;
116
+ /** The diversion of messages, warnings, and errors (`sink(con, type = "message")`), which, other than that of the output, is no stack: `sink(type = "message")` returns to the console. */
117
+ export declare const MessageSinks: AmbientFamily;
83
118
  /** The pseudo variables that only grow, because every write to their state adds to them. */
84
- export declare const KeyedAccumulators: readonly string[];
119
+ export declare const KeyedAccumulators: readonly AmbientStateName[];
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.KeyedAccumulators = exports.AmbientStateName = exports.UnknownKey = exports.KeyedState = void 0;
4
- /**
5
- * The states made of named entries: setting one entry replaces its pseudo variable `#<state>:<key>`, adds to the accumulating
6
- * `all` of the state, and an entry we cannot name adds to `#<state>:*` instead (`options(op)`, `Sys.setenv(...)`).
7
- */
3
+ exports.KeyedAccumulators = exports.MessageSinks = exports.OutputSinks = exports.GraphicsDevices = exports.AmbientStateName = exports.UnknownKey = exports.KeyedState = void 0;
4
+ /** The states made of named entries: setting one entry replaces its pseudo variable `#<state>:<key>`, adds to the accumulating `all` of the state, and an entry we cannot name adds to `#<state>:*` instead (`options(op)`, `Sys.setenv(...)`). */
8
5
  var KeyedState;
9
6
  (function (KeyedState) {
10
7
  /** the options `options(digits = 3)` sets */
@@ -32,21 +29,27 @@ const EntryPrefix = {
32
29
  };
33
30
  /** The key standing for any entry of a {@link KeyedState} we cannot name. */
34
31
  exports.UnknownKey = '*';
35
- /**
36
- * Graphics parameters, options and other global state, tracked as global pseudo variables (`#...`) so readers link to the calls that set them.
37
- * Accumulating states only grow: `par(mar = ...)` keeps an earlier `par(mfrow = ...)`.
38
- * The pseudo variables a function may leave changed are what `Dataflow.sideEffects.ambientWrites` reports.
39
- */
32
+ /** Graphics parameters, options and other global state, tracked as global pseudo variables (`#...`) so readers link to the calls that set them. */
40
33
  exports.AmbientStateName = {
41
34
  /** the graphics state (`par`, `layout`, ...) of the active device, which a new device starts afresh */
42
35
  graphics: '#graphics',
43
36
  /** the graphics states of the other open devices, the active one returns to one of them once it closes */
44
37
  otherDevices: '#graphics:other',
45
- /** the call that opened the active device, and those of the other open devices */
38
+ /** the calls that opened the active device, set it up, and drew on it (a plot or `par` opens a device if none is open), and those of the other open devices, which closing a device links to */
46
39
  device: '#device',
47
40
  otherDevicesOpenedBy: '#device:other',
41
+ /** the call that explicitly opened the active device (`png("a.png")`), and those of the other open devices, which names the file its close writes */
42
+ deviceOpener: '#device:opener',
43
+ otherDeviceOpeners: '#device:opener:other',
48
44
  /** within a function, the call of its body that opened the active device, which only that body knows */
49
45
  deviceOpenedHere: '#device:here',
46
+ /** the calls drawing the plot on the active device: a new plot (`plot`) replaces it, an addon (`points`) reads and adds to it */
47
+ plot: '#plot',
48
+ otherPlots: '#plot:other',
49
+ /** the plot ggplot2's `last_plot()` returns, which building a ggplot (`ggplot`, `+`) replaces and `ggsave` reads; it belongs to no device */
50
+ lastPlot: '#last-plot',
51
+ /** what is drawn on the active device, which every plot adds to; only written if `semantics.ambient.drawingWritesDevice` is set */
52
+ canvas: '#canvas',
50
53
  /** the color palette, which, other than the graphics parameters, all devices share */
51
54
  palette: '#palette',
52
55
  /** the files on disk, which every call writing a file adds to and every call reading a file we cannot name reads */
@@ -55,8 +58,19 @@ exports.AmbientStateName = {
55
58
  anyFile: '#file:*',
56
59
  /** the working directory `setwd` changes, which every call accessing a file reads to resolve a relative path */
57
60
  workingDirectory: '#wd',
58
- /** whether console output is diverted into a file or connection, as `sink(file)` does and `sink()` undoes */
61
+ /** the directories on disk, which creating, moving, or removing one changes and every call accessing a file reads, as the path may lead through them */
62
+ directories: '#dirs',
63
+ /** where console output goes, the call diverting it into a file or connection (`sink(file)`), and the diversions below it, which `sink()` returns to */
59
64
  sink: '#sink',
65
+ otherSinks: '#sink:other',
66
+ /** the explicit diversion of the console output, and those below it */
67
+ sinkOpener: '#sink:opener',
68
+ otherSinkOpeners: '#sink:opener:other',
69
+ /** the diversion of the output and every call printing into it, and those of the diversions below, which ending it links to */
70
+ sinkOutput: '#sink:output',
71
+ otherSinkOutputs: '#sink:output:other',
72
+ /** within a function, the call of its body that diverted the output */
73
+ sinkOpenedHere: '#sink:here',
60
74
  /** the project root `here::here()` builds its paths from, found from the working directory unless `here::i_am` names it */
61
75
  projectRoot: '#project-root',
62
76
  /** where packages are installed and loaded from, which `.libPaths(new)` changes and every package load reads */
@@ -65,6 +79,8 @@ exports.AmbientStateName = {
65
79
  umask: '#umask',
66
80
  /** the state of the random number generator, which `set.seed` sets and every draw advances */
67
81
  rng: '#rng',
82
+ /** the message of the last error, which `try` and `tryCatch` may have caught */
83
+ errorMessage: '#error-message',
68
84
  /** the kind of generator, which `set.seed` keeps unless it is given one */
69
85
  rngKind: '#rng:kind',
70
86
  /** the global variable R keeps that state in, so assigning it sets {@link AmbientStateName.rng} as well */
@@ -98,20 +114,48 @@ exports.AmbientStateName = {
98
114
  allOf(state) {
99
115
  return AllOfKeyedState[state];
100
116
  },
101
- /** the entry of a state a pseudo variable stands for (`#env:PATH` is `PATH` of `env`), `undefined` for any other */
102
- entryOf(name) {
103
- for (const state of Object.values(KeyedState)) {
104
- if (name.startsWith(`#${state}:`)) {
105
- return { state, key: name.slice(state.length + 2) };
106
- }
107
- }
108
- return undefined;
109
- },
110
117
  /** whether `name` is one of these pseudo variables */
111
118
  is(name) {
112
119
  return typeof name === 'string' && name.startsWith('#');
113
120
  }
114
121
  };
122
+ /** The graphics devices, each with its graphics parameters, the calls opening and using it, its current plot, and its explicit opening. */
123
+ exports.GraphicsDevices = {
124
+ states: [
125
+ [exports.AmbientStateName.graphics, exports.AmbientStateName.otherDevices],
126
+ [exports.AmbientStateName.device, exports.AmbientStateName.otherDevicesOpenedBy],
127
+ [exports.AmbientStateName.plot, exports.AmbientStateName.otherPlots],
128
+ [exports.AmbientStateName.deviceOpener, exports.AmbientStateName.otherDeviceOpeners]
129
+ ],
130
+ used: exports.AmbientStateName.device,
131
+ opened: exports.AmbientStateName.deviceOpener,
132
+ switched: exports.AmbientStateName.graphics,
133
+ openedHere: exports.AmbientStateName.deviceOpenedHere
134
+ };
135
+ /** The diversions of the console output, a stack: `sink(file)` pushes one, `sink()` pops it and returns to the one below. */
136
+ exports.OutputSinks = {
137
+ states: [
138
+ [exports.AmbientStateName.sink, exports.AmbientStateName.otherSinks],
139
+ [exports.AmbientStateName.sinkOpener, exports.AmbientStateName.otherSinkOpeners],
140
+ [exports.AmbientStateName.sinkOutput, exports.AmbientStateName.otherSinkOutputs]
141
+ ],
142
+ used: exports.AmbientStateName.sinkOutput,
143
+ opened: exports.AmbientStateName.sinkOpener,
144
+ switched: exports.AmbientStateName.sink,
145
+ openedHere: exports.AmbientStateName.sinkOpenedHere
146
+ };
147
+ /** The diversion of messages, warnings, and errors (`sink(con, type = "message")`), which, other than that of the output, is no stack: `sink(type = "message")` returns to the console. */
148
+ exports.MessageSinks = {
149
+ states: [
150
+ ['#message-sink', '#message-sink:other'],
151
+ ['#message-sink:opener', '#message-sink:opener:other'],
152
+ ['#message-sink:output', '#message-sink:output:other']
153
+ ],
154
+ used: '#message-sink:output',
155
+ opened: '#message-sink:opener',
156
+ switched: '#message-sink',
157
+ openedHere: '#message-sink:here'
158
+ };
115
159
  /** The pseudo variables that only grow, because every write to their state adds to them. */
116
160
  exports.KeyedAccumulators = Object.values(KeyedState).flatMap(state => [exports.AmbientStateName.allOf(state), exports.AmbientStateName.keyed(state, exports.UnknownKey)]);
117
161
  //# sourceMappingURL=ambient-state-name.js.map
@@ -1,31 +1,20 @@
1
- /**
2
- * Applying {@link KillReference|kills} (e.g., produced by `rm`) to an {@link REnvironmentInformation}.
3
- * @module
4
- */
5
1
  import type { ControlDependency, KillReference } from '../info';
6
2
  import type { REnvironmentInformation } from './environment';
7
3
  import type { IdentifierReference } from './identifier';
8
4
  import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
9
5
  import { Identifier } from './identifier';
10
- /**
11
- * Accounts for the writes after a kill: a re-definition revives a `named` removal (dropping it), a conditional
12
- * one only revives it in its branch, and a wholesale (`all`/`unknown`) removal stays but spares the names written
13
- * after it.
14
- */
6
+ import type { DataflowGraph } from '../graph/graph';
7
+ /** Accounts for the writes after a kill: a re-definition revives a `named` removal (dropping it), a conditional one only revives it in its branch, and a wholesale (`all`/`unknown`) removal stays but spares the names written after it. */
15
8
  export declare function cancelRevivedKills(kills: readonly KillReference[], writes: readonly IdentifierReference[]): KillReference[];
16
9
  /** The calls that removed `name` from the scope it would otherwise still be bound in. */
17
10
  export declare function removalsOf(name: Identifier, env: REnvironmentInformation): readonly NodeId[];
18
- /**
19
- * Applies the given {@link KillReference|kills} to a copy of `env`. `named` kills remove (or, when conditional,
20
- * weaken to maybe) a single definition; `all` kills clear the current frame; `unknown` kills weaken every
21
- * in-scope definition to maybe. Returns `env` unchanged when there is nothing to apply.
22
- */
23
- export declare function applyKills(env: REnvironmentInformation, kills: readonly KillReference[] | undefined): REnvironmentInformation;
11
+ /** A read of `name` that still sees a definition depends on the calls that may have removed it, so a slice of the read keeps the `rm(name)` that might have run. */
12
+ export declare function readRemovals(graph: DataflowGraph, read: NodeId, name: Identifier | undefined, env: REnvironmentInformation): void;
13
+ /** Applies the given {@link KillReference|kills} to a copy of `env`. */
14
+ export declare function applyKills(env: REnvironmentInformation, kills: readonly KillReference[] | undefined, mark?: boolean): REnvironmentInformation;
15
+ /** {@link applyKills} on the global frame, as a removal with `envir = .GlobalEnv` within a function does. */
16
+ export declare function applyGlobalKills(env: REnvironmentInformation, kills: readonly KillReference[]): REnvironmentInformation;
24
17
  /** Attaches `cds` to a list of kills, turning them into conditional (maybe) kills. */
25
18
  export declare function makeKillsMaybe(kills: readonly KillReference[] | undefined, cds: readonly ControlDependency[]): KillReference[];
26
- /**
27
- * Drops the writes that a still-effective removal undid: a definite `named` kill takes out its own name and a
28
- * definite wholesale kill takes out every name it did not spare. Conditional and `unknown` kills leave the (now
29
- * maybe) definition in place, as it may still be visible afterwards.
30
- */
19
+ /** Drops the writes that a still-effective removal undid: a definite `named` kill takes out its own name and a definite wholesale kill takes out every name it did not spare. */
31
20
  export declare function dropKilledWrites(out: readonly IdentifierReference[], kills: readonly KillReference[] | undefined): readonly IdentifierReference[];