@eagleoutice/flowr 2.17.5 → 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 (357) hide show
  1. package/README.md +13 -51
  2. package/abstract-interpretation/absint-inference.d.ts +4 -4
  3. package/abstract-interpretation/absint-inference.js +11 -11
  4. package/abstract-interpretation/abstract-semantics.d.ts +2 -1
  5. package/abstract-interpretation/branch-paths-interpreter.d.ts +1 -0
  6. package/abstract-interpretation/branch-paths-interpreter.js +60 -0
  7. package/abstract-interpretation/branch-paths.d.ts +60 -0
  8. package/abstract-interpretation/branch-paths.js +120 -0
  9. package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +6 -1
  10. package/abstract-interpretation/data-frame/dataframe-semantics.js +60 -1
  11. package/abstract-interpretation/data-frame/semantics.js +4 -10
  12. package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
  13. package/cli/repl/core.js +51 -0
  14. package/control-flow/cfg-dead-code.js +12 -7
  15. package/data/packed.d.ts +10 -0
  16. package/data/packed.js +33 -0
  17. package/data/r-base-guards.generated.d.ts +7 -0
  18. package/data/r-base-guards.generated.js +12 -0
  19. package/data/r-datasets.generated.d.ts +4 -0
  20. package/data/r-datasets.generated.js +10 -0
  21. package/data/r-formals.generated.d.ts +4 -0
  22. package/data/r-formals.generated.js +10 -0
  23. package/data/r-group-method-guards.generated.d.ts +3 -0
  24. package/data/r-group-method-guards.generated.js +8 -0
  25. package/dataflow/environments/ambient-effect.d.ts +1000 -0
  26. package/dataflow/environments/ambient-effect.js +234 -0
  27. package/dataflow/environments/ambient-state-name.d.ts +45 -2
  28. package/dataflow/environments/ambient-state-name.js +61 -3
  29. package/dataflow/environments/apply-kill.js +11 -4
  30. package/dataflow/environments/built-in-kinds.d.ts +4 -46
  31. package/dataflow/environments/built-in-kinds.js +6 -2
  32. package/dataflow/environments/built-in-props.d.ts +16 -4
  33. package/dataflow/environments/built-in-props.js +11 -3
  34. package/dataflow/environments/built-in.d.ts +6 -1
  35. package/dataflow/environments/built-in.js +13 -36
  36. package/dataflow/environments/default-builtin-config/base-functions.d.ts +1 -1
  37. package/dataflow/environments/default-builtin-config/base-functions.js +110 -52
  38. package/dataflow/environments/default-builtin-config/base-language.d.ts +1 -1
  39. package/dataflow/environments/default-builtin-config/base-language.js +11 -8
  40. package/dataflow/environments/default-builtin-config/dev-tooling.js +1 -1
  41. package/dataflow/environments/default-builtin-config/file-io.js +6 -4
  42. package/dataflow/environments/default-builtin-config/graphics-devices.d.ts +1 -1
  43. package/dataflow/environments/default-builtin-config/graphics-devices.js +24 -14
  44. package/dataflow/environments/default-builtin-config/guard-builders.d.ts +16 -0
  45. package/dataflow/environments/default-builtin-config/guard-builders.js +29 -0
  46. package/dataflow/environments/default-builtin-config/guards-primitive-lang.d.ts +15 -0
  47. package/dataflow/environments/default-builtin-config/guards-primitive-lang.js +228 -0
  48. package/dataflow/environments/default-builtin-config/guards-primitive-ops.d.ts +11 -0
  49. package/dataflow/environments/default-builtin-config/guards-primitive-ops.js +154 -0
  50. package/dataflow/environments/default-builtin-config/guards.d.ts +9 -0
  51. package/dataflow/environments/default-builtin-config/guards.js +211 -0
  52. package/dataflow/environments/default-builtin-config/index.d.ts +3 -3
  53. package/dataflow/environments/default-builtin-config/index.js +22 -7
  54. package/dataflow/environments/default-builtin-config/media-formats.js +4 -4
  55. package/dataflow/environments/default-builtin-config/package-spatial.js +2 -1
  56. package/dataflow/environments/default-builtin-config/package-tidyverse.js +3 -2
  57. package/dataflow/environments/default-builtin-config/package-utils.d.ts +1 -1
  58. package/dataflow/environments/default-builtin-config/package-utils.js +5 -2
  59. package/dataflow/environments/default-builtin-config/parallel-execution.d.ts +1 -1
  60. package/dataflow/environments/default-builtin-config/parallel-execution.js +3 -1
  61. package/dataflow/environments/default-builtin-config/r-formals.d.ts +13 -0
  62. package/dataflow/environments/default-builtin-config/r-formals.js +110 -0
  63. package/dataflow/environments/default-builtin-config/shared-configs.d.ts +138 -77
  64. package/dataflow/environments/default-builtin-config/shared-configs.js +52 -88
  65. package/dataflow/environments/default-builtin-config/statistics.d.ts +1 -1
  66. package/dataflow/environments/default-builtin-config/statistics.js +4 -1
  67. package/dataflow/environments/diff.js +5 -2
  68. package/dataflow/environments/environment.d.ts +20 -0
  69. package/dataflow/environments/environment.js +39 -4
  70. package/dataflow/environments/group-generics.d.ts +5 -1
  71. package/dataflow/environments/group-generics.js +13 -3
  72. package/dataflow/environments/guard-facts.d.ts +169 -0
  73. package/dataflow/environments/guard-facts.js +26 -0
  74. package/dataflow/environments/identifier.d.ts +9 -1
  75. package/dataflow/environments/identifier.js +5 -0
  76. package/dataflow/environments/pkg-name.d.ts +1 -0
  77. package/dataflow/environments/query-fn-props.d.ts +3 -5
  78. package/dataflow/environments/query-fn-props.js +44 -21
  79. package/dataflow/environments/removal-marker.d.ts +2 -0
  80. package/dataflow/environments/removal-marker.js +5 -0
  81. package/dataflow/eval/resolve/resolve-strings.d.ts +2 -5
  82. package/dataflow/eval/resolve/resolve-strings.js +2 -2
  83. package/dataflow/extractor.js +24 -15
  84. package/dataflow/fn/condition-handlers.d.ts +2 -0
  85. package/dataflow/fn/condition-handlers.js +3 -1
  86. package/dataflow/fn/frame-reflection.d.ts +4 -2
  87. package/dataflow/fn/frame-reflection.js +16 -0
  88. package/dataflow/fn/function-props.js +15 -22
  89. package/dataflow/fn/function-semantics.d.ts +31 -1
  90. package/dataflow/fn/function-semantics.js +15 -0
  91. package/dataflow/fn/guards/built-in-guards.d.ts +112 -0
  92. package/dataflow/fn/guards/built-in-guards.js +199 -0
  93. package/dataflow/fn/guards/call-contracts.d.ts +97 -0
  94. package/dataflow/fn/guards/call-contracts.js +331 -0
  95. package/dataflow/fn/guards/condition-grouping.d.ts +20 -0
  96. package/dataflow/fn/guards/condition-grouping.js +135 -0
  97. package/dataflow/fn/guards/function-guards.d.ts +112 -0
  98. package/dataflow/fn/guards/function-guards.js +1549 -0
  99. package/dataflow/fn/guards/group-method-guards.d.ts +28 -0
  100. package/dataflow/fn/guards/group-method-guards.js +56 -0
  101. package/dataflow/fn/guards/guard-claims.d.ts +125 -0
  102. package/dataflow/fn/guards/guard-claims.js +678 -0
  103. package/dataflow/fn/guards/guard-knowledge.d.ts +41 -0
  104. package/dataflow/fn/guards/guard-knowledge.js +180 -0
  105. package/dataflow/fn/guards/guard-term-syntax.d.ts +9 -0
  106. package/dataflow/fn/guards/guard-term-syntax.js +210 -0
  107. package/dataflow/fn/guards/guard-term.d.ts +136 -0
  108. package/dataflow/fn/guards/guard-term.js +550 -0
  109. package/dataflow/fn/guards/stated-guards.d.ts +13 -0
  110. package/dataflow/fn/guards/stated-guards.js +35 -0
  111. package/dataflow/fn/higher-order-function.d.ts +2 -0
  112. package/dataflow/fn/higher-order-function.js +1 -0
  113. package/dataflow/fn/strict-function.d.ts +4 -0
  114. package/dataflow/fn/strict-function.js +66 -17
  115. package/dataflow/graph/ambient-access.d.ts +4 -1
  116. package/dataflow/graph/ambient-access.js +8 -2
  117. package/dataflow/graph/closure-frames.js +1 -1
  118. package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
  119. package/dataflow/graph/dataflowgraph-builder.js +2 -2
  120. package/dataflow/graph/df-helper.d.ts +6 -0
  121. package/dataflow/graph/df-helper.js +15 -0
  122. package/dataflow/graph/graph.d.ts +12 -6
  123. package/dataflow/graph/graph.js +21 -28
  124. package/dataflow/info.d.ts +2 -1
  125. package/dataflow/info.js +3 -1
  126. package/dataflow/internal/dispatch-linking.d.ts +3 -1
  127. package/dataflow/internal/dispatch-linking.js +1 -0
  128. package/dataflow/internal/linker.d.ts +2 -0
  129. package/dataflow/internal/linker.js +115 -6
  130. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -1
  131. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.d.ts +5 -2
  132. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.js +2 -1
  133. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +19 -57
  134. package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +471 -295
  135. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +13 -1
  136. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +2 -0
  137. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +106 -19
  138. package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
  139. package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +24 -3
  140. package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.d.ts +1 -1
  141. package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.js +33 -11
  142. package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +4 -0
  143. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +4 -4
  144. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +23 -7
  145. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -4
  146. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +19 -2
  147. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +347 -46
  148. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -1
  149. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +5 -0
  150. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +110 -16
  151. package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -0
  152. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +9 -2
  153. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
  154. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -2
  155. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +5 -0
  156. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +28 -0
  157. package/dataflow/internal/process/functions/call/built-in/built-in-load.js +16 -6
  158. package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +6 -1
  159. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +37 -2
  160. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +4 -0
  161. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +19 -1
  162. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -1
  163. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +55 -11
  164. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
  165. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +11 -10
  166. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -1
  167. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +8 -0
  168. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +64 -7
  169. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +1 -1
  170. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +160 -20
  171. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -3
  172. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +6 -0
  173. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +142 -4
  174. package/dataflow/internal/process/functions/call/quoted.d.ts +2 -0
  175. package/dataflow/internal/process/functions/call/quoted.js +23 -4
  176. package/dataflow/processor.d.ts +2 -0
  177. package/documentation/data/dfg/doc-ambient.d.ts +4 -0
  178. package/documentation/data/dfg/doc-ambient.js +74 -0
  179. package/documentation/wiki-dataflow-graph.js +10 -4
  180. package/documentation/wiki-linter.js +12 -0
  181. package/documentation/wiki-query.js +112 -1
  182. package/linter/linter-rules.d.ts +41 -1
  183. package/linter/linter-rules.js +5 -1
  184. package/linter/rules/call-contracts.d.ts +40 -0
  185. package/linter/rules/call-contracts.js +56 -0
  186. package/linter/rules/cmd-check/bogus-return.js +1 -1
  187. package/linter/rules/cmd-check/call-arguments.js +5 -6
  188. package/linter/rules/cmd-check/cmd-check-util.d.ts +0 -6
  189. package/linter/rules/cmd-check/cmd-check-util.js +0 -28
  190. package/linter/rules/cmd-check/package-hooks.js +2 -1
  191. package/linter/rules/cmd-check/s-three-method-consistency.js +1 -1
  192. package/linter/rules/interactive-functions.d.ts +30 -0
  193. package/linter/rules/interactive-functions.js +87 -0
  194. package/linter/rules/process-state-in-session.js +1 -1
  195. package/linter/rules/undefined-symbol-util.d.ts +1 -1
  196. package/linter/rules/undefined-symbol-util.js +8 -2
  197. package/linter/rules/undefined-symbol.js +18 -7
  198. package/linter/rules/useless-loop.d.ts +1 -1
  199. package/package.json +1 -1
  200. package/project/context/flowr-analyzer-dependencies-context.js +2 -1
  201. package/project/flowr-analyzer.d.ts +1 -0
  202. package/project/flowr-analyzer.js +5 -5
  203. package/project/sigdb/build.js +14 -4
  204. package/project/sigdb/decode.d.ts +3 -0
  205. package/project/sigdb/decode.js +10 -1
  206. package/project/sigdb/guarded-source.d.ts +6 -0
  207. package/project/sigdb/guarded-source.js +29 -0
  208. package/project/sigdb/reader.d.ts +5 -0
  209. package/project/sigdb/reader.js +27 -1
  210. package/project/sigdb/schema.d.ts +24 -2
  211. package/queries/catalog/absint-query/absint-query-format.d.ts +6 -3
  212. package/queries/catalog/absint-query/absint-query-format.js +57 -2
  213. package/queries/catalog/ambient-access-query/ambient-access-query-format.d.ts +6 -2
  214. package/queries/catalog/ambient-access-query/ambient-access-query-format.js +48 -3
  215. package/queries/catalog/cluster-query/cluster-query-format.d.ts +5 -2
  216. package/queries/catalog/cluster-query/cluster-query-format.js +19 -2
  217. package/queries/catalog/code-clones-query/code-clones-query-format.d.ts +5 -2
  218. package/queries/catalog/code-clones-query/code-clones-query-format.js +34 -2
  219. package/queries/catalog/config-query/config-query-format.d.ts +5 -2
  220. package/queries/catalog/config-query/config-query-format.js +41 -2
  221. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +5 -2
  222. package/queries/catalog/control-flow-query/control-flow-query-format.js +19 -2
  223. package/queries/catalog/data-columns-query/data-columns-query-format.d.ts +72 -0
  224. package/queries/catalog/data-columns-query/data-columns-query-format.js +215 -0
  225. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +5 -2
  226. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +38 -2
  227. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +5 -2
  228. package/queries/catalog/dataflow-query/dataflow-query-format.js +18 -2
  229. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
  230. package/queries/catalog/dependencies-query/dependencies-query-format.js +8 -3
  231. package/queries/catalog/dependencies-query/function-info/other-path-functions.js +1 -1
  232. package/queries/catalog/dependencies-query/function-info/tagged-functions.d.ts +11 -0
  233. package/queries/catalog/dependencies-query/function-info/tagged-functions.js +18 -0
  234. package/queries/catalog/dice-query/dice-query-format.d.ts +7 -2
  235. package/queries/catalog/dice-query/dice-query-format.js +34 -2
  236. package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -4
  237. package/queries/catalog/does-call-query/does-call-query-format.js +114 -2
  238. package/queries/catalog/files-query/files-query-format.d.ts +5 -2
  239. package/queries/catalog/files-query/files-query-format.js +45 -2
  240. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +6 -3
  241. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +303 -2
  242. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +8 -4
  243. package/queries/catalog/happens-before-query/happens-before-query-format.js +37 -2
  244. package/queries/catalog/id-map-query/id-map-query-format.d.ts +5 -2
  245. package/queries/catalog/id-map-query/id-map-query-format.js +18 -2
  246. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +5 -2
  247. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +29 -2
  248. package/queries/catalog/inspect-fn-guards-query/inspect-fn-guards-query-format.d.ts +37 -0
  249. package/queries/catalog/inspect-fn-guards-query/inspect-fn-guards-query-format.js +125 -0
  250. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +3 -2
  251. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +54 -2
  252. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +6 -2
  253. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +23 -2
  254. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +6 -2
  255. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +15 -2
  256. package/queries/catalog/linter-query/linter-query-format.d.ts +8 -2
  257. package/queries/catalog/linter-query/linter-query-format.js +69 -4
  258. package/queries/catalog/location-map-query/location-map-query-format.d.ts +7 -3
  259. package/queries/catalog/location-map-query/location-map-query-format.js +70 -2
  260. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +5 -2
  261. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +18 -2
  262. package/queries/catalog/origin-query/origin-query-format.d.ts +6 -3
  263. package/queries/catalog/origin-query/origin-query-format.js +29 -2
  264. package/queries/catalog/project-query/project-query-format.d.ts +6 -3
  265. package/queries/catalog/project-query/project-query-format.js +98 -2
  266. package/queries/catalog/provenance-query/provenance-query-format.d.ts +6 -3
  267. package/queries/catalog/provenance-query/provenance-query-format.js +30 -2
  268. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +9 -2
  269. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +38 -2
  270. package/queries/catalog/search-query/search-query-format.d.ts +5 -2
  271. package/queries/catalog/search-query/search-query-format.js +23 -2
  272. package/queries/catalog/signature-query/signature-query-executor.js +3 -1
  273. package/queries/catalog/signature-query/signature-query-format.d.ts +3 -0
  274. package/queries/catalog/signature-query/signature-query-render.js +23 -0
  275. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +13 -2
  276. package/queries/catalog/static-slice-query/static-slice-query-format.js +55 -2
  277. package/queries/catalog/taint-query/taint-query-format.d.ts +6 -3
  278. package/queries/catalog/taint-query/taint-query-format.js +28 -2
  279. package/queries/query.d.ts +48 -27
  280. package/queries/query.js +6 -4
  281. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +2 -0
  282. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -0
  283. package/r-bridge/shell.js +7 -2
  284. package/reconstruct/reconstruct.js +18 -3
  285. package/slicing/static/removal-slice.js +4 -3
  286. package/slicing/static/slice-call.d.ts +11 -0
  287. package/slicing/static/slice-call.js +43 -2
  288. package/slicing/static/static-slicer.d.ts +2 -0
  289. package/slicing/static/static-slicer.js +137 -21
  290. package/slicing/static/visiting-queue.d.ts +2 -0
  291. package/slicing/static/visiting-queue.js +4 -0
  292. package/util/flowr-version.d.ts +1 -1
  293. package/util/flowr-version.js +2 -2
  294. package/util/objects.d.ts +2 -0
  295. package/util/objects.js +5 -0
  296. package/util/r-datasets.d.ts +27 -0
  297. package/util/r-datasets.js +45 -0
  298. package/util/text/playground-link.d.ts +2 -0
  299. package/util/text/playground-link.js +2 -0
  300. package/queries/catalog/absint-query/absint-query-executor.d.ts +0 -6
  301. package/queries/catalog/absint-query/absint-query-executor.js +0 -61
  302. package/queries/catalog/ambient-access-query/ambient-access-query-executor.d.ts +0 -6
  303. package/queries/catalog/ambient-access-query/ambient-access-query-executor.js +0 -50
  304. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +0 -6
  305. package/queries/catalog/cluster-query/cluster-query-executor.js +0 -21
  306. package/queries/catalog/code-clones-query/code-clones-query-executor.d.ts +0 -6
  307. package/queries/catalog/code-clones-query/code-clones-query-executor.js +0 -38
  308. package/queries/catalog/config-query/config-query-executor.d.ts +0 -6
  309. package/queries/catalog/config-query/config-query-executor.js +0 -45
  310. package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +0 -6
  311. package/queries/catalog/control-flow-query/control-flow-query-executor.js +0 -21
  312. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +0 -6
  313. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +0 -40
  314. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +0 -6
  315. package/queries/catalog/dataflow-query/dataflow-query-executor.js +0 -20
  316. package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +0 -9
  317. package/queries/catalog/dependencies-query/function-info/statistics-functions.js +0 -18
  318. package/queries/catalog/dice-query/dice-query-executor.d.ts +0 -8
  319. package/queries/catalog/dice-query/dice-query-executor.js +0 -37
  320. package/queries/catalog/does-call-query/does-call-query-executor.d.ts +0 -6
  321. package/queries/catalog/does-call-query/does-call-query-executor.js +0 -116
  322. package/queries/catalog/files-query/files-query-executor.d.ts +0 -6
  323. package/queries/catalog/files-query/files-query-executor.js +0 -47
  324. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +0 -6
  325. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +0 -307
  326. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +0 -7
  327. package/queries/catalog/happens-before-query/happens-before-query-executor.js +0 -40
  328. package/queries/catalog/id-map-query/id-map-query-executor.d.ts +0 -6
  329. package/queries/catalog/id-map-query/id-map-query-executor.js +0 -20
  330. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +0 -6
  331. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +0 -31
  332. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +0 -4
  333. package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +0 -58
  334. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +0 -7
  335. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +0 -25
  336. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.d.ts +0 -7
  337. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +0 -17
  338. package/queries/catalog/linter-query/linter-query-executor.d.ts +0 -9
  339. package/queries/catalog/linter-query/linter-query-executor.js +0 -62
  340. package/queries/catalog/location-map-query/location-map-query-executor.d.ts +0 -7
  341. package/queries/catalog/location-map-query/location-map-query-executor.js +0 -73
  342. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +0 -6
  343. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +0 -20
  344. package/queries/catalog/origin-query/origin-query-executor.d.ts +0 -6
  345. package/queries/catalog/origin-query/origin-query-executor.js +0 -31
  346. package/queries/catalog/project-query/project-query-executor.d.ts +0 -6
  347. package/queries/catalog/project-query/project-query-executor.js +0 -103
  348. package/queries/catalog/provenance-query/provenance-query-executor.d.ts +0 -6
  349. package/queries/catalog/provenance-query/provenance-query-executor.js +0 -33
  350. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +0 -10
  351. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +0 -40
  352. package/queries/catalog/search-query/search-query-executor.d.ts +0 -6
  353. package/queries/catalog/search-query/search-query-executor.js +0 -25
  354. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +0 -14
  355. package/queries/catalog/static-slice-query/static-slice-query-executor.js +0 -59
  356. package/queries/catalog/taint-query/taint-query-executor.d.ts +0 -7
  357. package/queries/catalog/taint-query/taint-query-executor.js +0 -30
@@ -6,6 +6,7 @@ exports.produceNameSharedIdMap = produceNameSharedIdMap;
6
6
  exports.linkInstanceReads = linkInstanceReads;
7
7
  exports.readsOfUncalledClosures = readsOfUncalledClosures;
8
8
  exports.linkFunctionCallWithSingleTarget = linkFunctionCallWithSingleTarget;
9
+ exports.errorEscapes = errorEscapes;
9
10
  exports.isWithinArgumentOf = isWithinArgumentOf;
10
11
  exports.linkFunctionCalls = linkFunctionCalls;
11
12
  exports.getAllFunctionCallTargets = getAllFunctionCallTargets;
@@ -46,6 +47,10 @@ const vertex_2 = require("../graph/vertex");
46
47
  const resolve_helper_1 = require("../environments/resolve-helper");
47
48
  const resolve_by_name_1 = require("../environments/resolve-by-name");
48
49
  const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
50
+ const r_expression_list_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-expression-list");
51
+ const r_if_then_else_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-if-then-else");
52
+ const r_while_loop_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-while-loop");
53
+ const r_for_loop_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-for-loop");
49
54
  const r_binary_op_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-binary-op");
50
55
  const r_symbol_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
51
56
  const df_helper_1 = require("../graph/df-helper");
@@ -53,6 +58,7 @@ const closure_frames_1 = require("../graph/closure-frames");
53
58
  const ambient_state_name_1 = require("../environments/ambient-state-name");
54
59
  const class_declaration_1 = require("../fn/class-declaration");
55
60
  const fixpoint_1 = require("../../util/fixpoint");
61
+ const built_in_library_1 = require("./process/functions/call/built-in/built-in-library");
56
62
  const ValueFlowBits = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall;
57
63
  const FCallLinkReadBits = edge_1.EdgeType.Reads | edge_1.EdgeType.Calls | edge_1.EdgeType.DefinedByOnCall;
58
64
  /** Find all reads within the graph that do not reference a local definition in the graph. */
@@ -214,6 +220,12 @@ function linkFreeReads(graph, fnSubflow, fnId, info, idMap) {
214
220
  if (ingoing.type === identifier_1.ReferenceType.S3MethodPrefix && inCallee === undefined) {
215
221
  defs = (0, arrays_1.uniqueArrayMerge)(defs, resolve_helper_1.Resolve.byNameAndType(name, environment, ingoing.type) ?? []);
216
222
  }
223
+ /* a data set nothing defines is the lazy data of a package attached by the time of the call, as for a read outside of a function */
224
+ if (defs.length === 0 && ingoing.type !== identifier_1.ReferenceType.Function && ingoing.type !== identifier_1.ReferenceType.BuiltInFunction) {
225
+ for (const load of (0, built_in_library_1.dataLoadNodesForNamespace)(environment, identifier_1.Identifier.getName(name))) {
226
+ graph.addEdge(ingoing.nodeId, load, edge_1.EdgeType.Reads);
227
+ }
228
+ }
217
229
  for (const def of defs) {
218
230
  const { nodeId, type, value, definedAt, envState } = def;
219
231
  /* the state an earlier run of the function left behind is what its next run reads */
@@ -330,6 +342,46 @@ function linkFieldWritesOnCall(graph, id, fnId, start, binding, envState, idMap)
330
342
  }
331
343
  }
332
344
  }
345
+ /** Whether an error raised by the call `from` still leaves the expression it is written in (the whole program for `undefined`): redoes what a `stop` written at that spot would have done, since we only learn a callee always throws after linking it here. */
346
+ function errorEscapes(from, expression, idMap, graph) {
347
+ for (let node = raisedAt(from, idMap, graph); node !== undefined && node.info.id !== expression;) {
348
+ const parent = model_1.RNode.directParent(node, idMap);
349
+ if (parent === undefined) {
350
+ return true;
351
+ }
352
+ if (!errorPassesThrough(parent, node.info.id, graph)) {
353
+ return false;
354
+ }
355
+ node = parent;
356
+ }
357
+ return true;
358
+ }
359
+ /** Where what the call `from` raises surfaces: an anonymous function an apply runs raises where it is written, a handler (whose call an argument makes) where the construct running it is. */
360
+ function raisedAt(from, idMap, graph) {
361
+ if (!node_id_1.NodeId.isAnonymousCall(from)) {
362
+ return idMap.get(from);
363
+ }
364
+ const handler = df_helper_1.Dataflow.sourcesOf(graph, from, edge_1.EdgeType.Calls).map(c => idMap.get(c)).find(r_argument_1.RArgument.is);
365
+ return handler === undefined ? node_id_1.NodeId.nodeOf(from, idMap) : model_1.RNode.directParent(handler, idMap);
366
+ }
367
+ /** Whether an error raised within the child `child` of `parent` is sure to be raised by `parent` as well. */
368
+ function errorPassesThrough(parent, child, graph) {
369
+ if (r_argument_1.RArgument.is(parent) || r_expression_list_1.RExpressionList.is(parent)) {
370
+ return true;
371
+ }
372
+ else if (r_function_call_1.RFunctionCall.is(parent)) {
373
+ /* a handler catches the error instead of passing it on */
374
+ return !vertex_2.DfgVertex.hasOrigin(graph.getVertex(parent.info.id), built_in_proc_name_1.BuiltInProcName.Try);
375
+ }
376
+ else if (r_if_then_else_1.RIfThenElse.is(parent) || r_while_loop_1.RWhileLoop.is(parent)) {
377
+ /* only the condition is guaranteed to be evaluated */
378
+ return parent.condition.info.id === child;
379
+ }
380
+ else if (r_for_loop_1.RForLoop.is(parent)) {
381
+ return parent.vector.info.id === child;
382
+ }
383
+ return false;
384
+ }
333
385
  /** Whether the call `info` may get its function from `target`, which it has the edge `e` to. */
334
386
  function mayBeFunctionSource(graph, info, target, e, unbound = false) {
335
387
  if (edge_1.DfEdge.includesType(e, edge_1.EdgeType.Calls | edge_1.EdgeType.DefinedByOnCall)) {
@@ -367,7 +419,13 @@ function linkFunctionCall(graph, id, info, idMap, isRoot) {
367
419
  for (const def of functionDefs) {
368
420
  /* we can skip this if we already linked it */
369
421
  if (!df_helper_1.Dataflow.hasEdge(graph, id, def.id, edge_1.EdgeType.Calls)) {
370
- propagateExitPoints.push(...linkFunctionCallWithSingleTarget(graph, def, info, idMap));
422
+ const exits = linkFunctionCallWithSingleTarget(graph, def, info, idMap);
423
+ if (exits.length > 0 && escapesAnonymousFunction(graph, id, def.id, idMap)) {
424
+ /* it is the call that raises what its callee raises, so what runs after it only runs if the call returns;
425
+ with several possible callees, an exit only some of them take is not certain */
426
+ const certain = (e) => functionDefs.size <= 1 || [...functionDefs].every(d => d.exitPoints.some(o => o.type === e.type));
427
+ propagateExitPoints.push(...exits.map(e => ({ ...e, cds: (0, info_1.withCds)(e.cds, [certain(e) ? { id } : { id, when: true }]) })));
428
+ }
371
429
  }
372
430
  }
373
431
  if (!isRoot || (functionDefs.size === 0 && builtIns.size === 0)) {
@@ -377,6 +435,15 @@ function linkFunctionCall(graph, id, info, idMap, isRoot) {
377
435
  const calledBuiltIns = builtIns.size > 0 ? [...builtIns] : undefined;
378
436
  return { functionCall: id, called: [...functionDefs], propagateExitPoints, calledBuiltIns };
379
437
  }
438
+ /** An anonymous function the call `id` runs calls the free function `fnId` it reads: whether what `fnId` raises leaves the anonymous function, which a handler around the call within it prevents. */
439
+ function escapesAnonymousFunction(graph, id, fnId, idMap) {
440
+ const anonymous = node_id_1.NodeId.isAnonymousCall(id) ? node_id_1.NodeId.nodeOf(id, idMap) : undefined;
441
+ if (!r_function_definition_1.RFunctionDefinition.is(anonymous) || anonymous.info.id === fnId) {
442
+ return true;
443
+ }
444
+ const within = df_helper_1.Dataflow.sourcesOf(graph, fnId, edge_1.EdgeType.Calls).filter(c => model_1.RNode.findEnclosing(c, idMap, r_function_definition_1.RFunctionDefinition.is) === anonymous.info.id);
445
+ return within.length === 0 || within.some(c => errorEscapes(c, anonymous.body.info.id, idMap, graph));
446
+ }
380
447
  /** Returns the called functions within `graph` (ideally a superset of `thisGraph`, the graph searched for calls), which can be used to merge the environments with the call; also links the corresponding arguments. */
381
448
  function linkFunctionCalls(graph, idMap, thisGraph,
382
449
  /** calls `graph` knows of that `thisGraph` does not, as a read that became a call */
@@ -430,6 +497,13 @@ function getAllFunctionCallTargets(call, graph, environment, resolver) {
430
497
  info.ruledOut?.forEach(e => all.delete(e));
431
498
  return [...all];
432
499
  }
500
+ /**
501
+ * The steps a walk for the function definitions reads evaluate to takes with the calls it is in before it forgets them: the
502
+ * walk keeps apart what a parameter holds in each call of a function, so a program whose functions call each other a lot
503
+ * (thousands of calls, as in a package) has it visit every vertex once per call. Without the calls, a visit covers them all,
504
+ * which reaches the same functions and maybe more, so the walk stays sound and ends after visiting each vertex about once.
505
+ */
506
+ const MaxContextSensitiveSteps = 20_000;
433
507
  /** Finds all linked function definitions starting from the given read ids; expects the caller to already have resolved the accessed objects (first layer of reads/returns/calls/...). */
434
508
  function getAllLinkedFunctionDefinitions(functionDefinitionReadIds, dataflowGraph) {
435
509
  const result = new Set();
@@ -438,12 +512,15 @@ function getAllLinkedFunctionDefinitions(functionDefinitionReadIds, dataflowGrap
438
512
  /* the calls each vertex was expanded under, by whether an access led to it */
439
513
  const expanded = [new Map(), new Map()];
440
514
  const scopes = new Map();
515
+ let steps = 0;
441
516
  const next = (id, viaAccess, call) => {
442
- if (expanded[viaAccess ? 1 : 0].get(id)?.has(call) !== true) {
443
- potential.push([id, viaAccess, call]);
517
+ /* past the budget, the walk forgets the calls it is in, which only lets it reach more (see `MaxContextSensitiveSteps`) */
518
+ const kept = steps < MaxContextSensitiveSteps ? call : undefined;
519
+ if (expanded[viaAccess ? 1 : 0].get(id)?.has(kept) !== true) {
520
+ potential.push([id, viaAccess, kept]);
444
521
  }
445
522
  };
446
- for (let item = potential.pop(); item !== undefined; item = potential.pop()) {
523
+ for (let item = potential.pop(); item !== undefined; item = potential.pop(), steps++) {
447
524
  const [cid, viaAccess, call] = item;
448
525
  const done = expanded[viaAccess ? 1 : 0];
449
526
  const calls = done.get(cid);
@@ -470,6 +547,9 @@ function getAllLinkedFunctionDefinitions(functionDefinitionReadIds, dataflowGrap
470
547
  }
471
548
  return [result, builtIns];
472
549
  }
550
+ function subsets(node) {
551
+ return r_access_1.RAccess.is(node) && node.operator === '[';
552
+ }
473
553
  /** One step of the walk for the function definitions that reads may evaluate to: hands each state the walk goes on to from `id` to `next`, or returns `id` if the walk ends at it, being a built-in or a function definition. */
474
554
  function walkLinkedDefinitions(graph, id, viaAccess, call, scopes, next) {
475
555
  if (node_id_1.NodeId.isBuiltIn(id)) {
@@ -487,7 +567,8 @@ function walkLinkedDefinitions(graph, id, viaAccess, call, scopes, next) {
487
567
  next(named, false, undefined);
488
568
  }
489
569
  }
490
- const nextViaAccess = viaAccess || vertex_2.DfgVertex.hasOrigin(vertex, built_in_proc_name_1.BuiltInProcName.Access);
570
+ /* a subset (`fs[1]`) holds entries as the list does, an element access (`fs[[1]]`, `fs$f`) the entry it names */
571
+ const nextViaAccess = viaAccess || (vertex_2.DfgVertex.hasOrigin(vertex, built_in_proc_name_1.BuiltInProcName.Access) && !subsets(graph.idMap?.get(id)));
491
572
  const isSkipType = vertex_2.DfgVertex.isFunctionCall(vertex);
492
573
  /* a replacement keeps its target what it was (`environment(f) <- e` leaves `f` the same function), unless the call is to what it put into a part of it, so the walk goes on to the binding it replaces only */
493
574
  const replaces = vertex_2.DfgVertex.isVariableDefinition(vertex) && vertex.par && !nextViaAccess;
@@ -625,6 +706,12 @@ function linkExpressionIn(graph, expr, environment, idMap) {
625
706
  /* the call vertex carries the call's id, its name symbol has no vertex of its own */
626
707
  references.push({ nodeId: inner.info.id, name: inner.functionName.content, cds: undefined, type: identifier_1.ReferenceType.Function });
627
708
  }
709
+ else if (r_expression_list_1.RExpressionList.is(inner)) {
710
+ /* the braces of a group name the group, which already calls `{` */
711
+ for (const brace of inner.grouping ?? []) {
712
+ callees.add(brace.info.id);
713
+ }
714
+ }
628
715
  else if (r_symbol_1.RSymbol.is(inner) && !callees.has(inner.info.id)) {
629
716
  references.push({ nodeId: inner.info.id, name: inner.content, cds: undefined, type: identifier_1.ReferenceType.Variable });
630
717
  }
@@ -805,6 +892,15 @@ function reapplyLoopExitPoints(exits, references, graph) {
805
892
  }
806
893
  }
807
894
  }
895
+ /** An access of an environment one of `refs` is bound to in `environment` reads its field: `function(i) e$a`, and the call reads what the environment holds, as that of a named function does (see {@link readEnvironmentContents}): `function(i) rd(e)`. */
896
+ function bindAccessedFields(refs, environment, graph, idMap, call) {
897
+ for (const ref of refs) {
898
+ for (const holder of (ref.name === undefined ? undefined : resolve_helper_1.Resolve.byNameAndType(ref.name, environment, identifier_1.ReferenceType.Variable)?.filter(identifier_1.hasEnvState)) ?? []) {
899
+ bindAccessedField(graph, ref.nodeId, holder.envState, idMap, call);
900
+ (0, built_in_envir_utils_1.readEnvironmentContents)(graph, call, holder);
901
+ }
902
+ }
903
+ }
808
904
  /**
809
905
  * The open references a function definition still carries into its closure.
810
906
  * @helper api
@@ -813,6 +909,18 @@ exports.ClosureRefs = {
813
909
  name: 'ClosureRefs',
814
910
  /** Resolves the open ingoing references of a definition called anonymously at `callId` against `environment`, links what resolves, and leaves only the references that stay open. */
815
911
  resolveOpenIngoing(graph, callId, definition, environment) {
912
+ if (graph.idMap !== undefined) {
913
+ bindAccessedFields(definition.subflow.in, environment, graph, graph.idMap, callId);
914
+ /* what the closure writes into an environment a free variable holds is written by this call, as for a named call (see linkFreeReads) */
915
+ for (const ingoing of definition.subflow.in) {
916
+ for (const def of ingoing.name === undefined ? [] : resolve_helper_1.Resolve.byNameAndType(ingoing.name, environment, ingoing.type) ?? []) {
917
+ if ((0, identifier_1.hasEnvState)(def) && !node_id_1.NodeId.isBuiltIn(def.nodeId) && !definition.subflow.graph.has(def.nodeId)) {
918
+ linkFieldWritesOnCall(graph, callId, definition.id, ingoing.nodeId, def.nodeId, def.envState, graph.idMap);
919
+ (0, built_in_envir_utils_1.readEnvironmentContents)(graph, callId, def);
920
+ }
921
+ }
922
+ }
923
+ }
816
924
  definition.subflow.in = linkInputs(definition.subflow.in, environment, [], graph, false, callId);
817
925
  }
818
926
  };
@@ -846,7 +954,8 @@ function linkFieldReads(graph, accessId, fieldDefs, returnsFunctions, call) {
846
954
  recordFound(graph, accessId, fieldDefs?.map(d => d.nodeId).filter(d => !node_id_1.NodeId.isBuiltIn(d)) ?? [], call);
847
955
  for (const fd of fieldDefs ?? []) {
848
956
  graph.addEdge(accessId, fd.nodeId, edge_1.EdgeType.Reads);
849
- if (fd.definedAt !== undefined && fd.definedAt !== fd.nodeId) {
957
+ /* a parameter is defined by its parameter node, which has no vertex */
958
+ if (fd.definedAt !== undefined && fd.definedAt !== fd.nodeId && fd.type !== identifier_1.ReferenceType.Parameter) {
850
959
  graph.addEdge(accessId, fd.definedAt, edge_1.EdgeType.Reads);
851
960
  }
852
961
  if (returnsFunctions && (fd.type & (identifier_1.ReferenceType.Function | identifier_1.ReferenceType.Unknown)) !== 0) {
@@ -67,7 +67,8 @@ function processAccess(name, args, rootId, data, config) {
67
67
  ? ((0, built_in_stack_env_1.stackEnvInheritsFields)(head.value) ? resolve_helper_1.Resolve.byNameAndType(fieldName, envState, identifier_1.ReferenceType.Unknown) : envState.current.memory.get(fieldName))
68
68
  : undefined;
69
69
  (0, linker_1.linkFieldReads)(info.graph, name.info.id, fieldDefs, stackEnvState === undefined);
70
- if (fieldName !== undefined && !fieldDefs?.length && (0, built_in_stack_env_1.stackEnvKindOf)(head.value, data) === default_builtin_config_1.StackEnvKind.CallerFrame) {
70
+ /* the frame of the caller or of a function around is linked once it is known, as a free variable is */
71
+ if (fieldName !== undefined && !fieldDefs?.length && ((0, built_in_stack_env_1.stackEnvKindOf)(head.value, data) === default_builtin_config_1.StackEnvKind.CallerFrame || (0, built_in_stack_env_1.isEnclosingFrame)(envState))) {
71
72
  info.in = [...info.in, { name: fieldName, nodeId: name.info.id, type: identifier_1.ReferenceType.Variable, cds: data.cds }];
72
73
  }
73
74
  }
@@ -1,3 +1,4 @@
1
+ import { Ternary } from '../../../../../../util/logic';
1
2
  import type { DataflowProcessorInformation } from '../../../../../processor';
2
3
  import type { ParentInformation, RNodeWithParent } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
4
  import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
@@ -20,9 +21,9 @@ export type AmbientKeys = {
20
21
  readonly from: 'unnamed';
21
22
  readonly quoted: boolean;
22
23
  } | {
23
- /** the call always sets this entry, like `Sys.setLanguage` sets `LANGUAGE` */
24
+ /** the call always names these entries, like `Sys.setLanguage` sets `LANGUAGE` */
24
25
  readonly from: 'constant';
25
- readonly key: string;
26
+ readonly keys: readonly string[];
26
27
  } | {
27
28
  /** the entries a parameter names, like `Sys.setlocale(category = "LC_ALL")` or `detach(package:dplyr)` */
28
29
  readonly from: 'parameter';
@@ -40,6 +41,8 @@ export type AmbientKeys = {
40
41
  };
41
42
  /** The strings the value at `value` may have, `undefined` if we do not know. */
42
43
  export declare function stringValuesOf<OtherInfo>(value: RNodeWithParent<OtherInfo> | undefined, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): BrandedIdentifier[] | undefined;
44
+ /** Whether the value at `node` is `TRUE`, {@link Ternary.Never} if there is no flag. */
45
+ export declare function flagValue<OtherInfo>(node: RNodeWithParent<OtherInfo> | undefined, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): Ternary;
43
46
  /** The entries the call with the arguments `args` names, see {@link AmbientKeys}. */
44
47
  export declare function keysOf<OtherInfo>(keys: AmbientKeys, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], data: DataflowProcessorInformation<OtherInfo & ParentInformation>): readonly BrandedIdentifier[];
45
48
  /** The pseudo variables a write to the given entries of `state` defines: the entries and what every write to the state adds to. No entry has an empty name. */
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.stringValuesOf = stringValuesOf;
4
+ exports.flagValue = flagValue;
4
5
  exports.keysOf = keysOf;
5
6
  exports.keyedWrites = keyedWrites;
6
7
  const logic_1 = require("../../../../../../util/logic");
@@ -65,7 +66,7 @@ function parameterKeys(keys, args, data) {
65
66
  function keysOf(keys, args, data) {
66
67
  switch (keys.from) {
67
68
  case 'constant':
68
- return [keys.key];
69
+ return keys.keys;
69
70
  case 'argument-names':
70
71
  return args.flatMap((a) => {
71
72
  if (a === r_function_call_1.EmptyArgument) {
@@ -3,19 +3,18 @@ import { type ControlDependency, DataflowInformation, type ExitPoint } from '../
3
3
  import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
4
4
  import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
5
5
  import { type DataflowGraphVertexFunctionCall } from '../../../../../graph/vertex';
6
- import { type FnSig } from '../../../../../environments/built-in-props';
7
6
  import { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
8
7
  import { type NamedInGraphIdentifierDefinition, type BrandedIdentifier, Identifier, type IdentifierDefinition, type IdentifierReference } from '../../../../../environments/identifier';
9
8
  import { type REnvironmentInformation } from '../../../../../environments/environment';
10
9
  import { RNode } from '../../../../../../r-bridge/lang-4.x/ast/model/model';
11
- import type { LinkTo } from '../../../../../../queries/catalog/call-context-query/call-context-query-format';
12
10
  import type { DataflowGraph } from '../../../../../graph/graph';
13
11
  import type { FlowrConfig } from '../../../../../../config';
14
12
  import { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
15
13
  import { AmbientStateName, KeyedState } from '../../../../../environments/ambient-state-name';
16
- import { type AmbientKeys } from './built-in-ambient-keys';
17
- import { AmbientSingleState, AmbientStateAccessType } from '../../../../../environments/built-in-kinds';
18
- export { PrintingOptions, AmbientStateAccessType } from '../../../../../environments/built-in-kinds';
14
+ import { Ternary } from '../../../../../../util/logic';
15
+ import { AmbientSingleState } from '../../../../../environments/built-in-kinds';
16
+ import { type AmbientCondition, type AmbientEffects } from '../../../../../environments/ambient-effect';
17
+ export { PrintingOptions } from '../../../../../environments/built-in-kinds';
19
18
  /** Whether calling `definition` runs a body flowR cannot see: a library function's, or whatever a parameter is bound to. */
20
19
  export declare function hidesBody(definition: IdentifierDefinition): boolean;
21
20
  /** Whether the call `call` of a function body reaches a built-in only once linked where the function is called, through a parameter or a name the body cannot resolve. */
@@ -32,63 +31,20 @@ export declare function makeAmbientWritesMaybe(after: REnvironmentInformation, b
32
31
  export declare function ambientWritesBetween(after: REnvironmentInformation, before: REnvironmentInformation): AmbientStateName[];
33
32
  /** Notes that a definition binds a promise or a text connection, which reads have to look for from now on. */
34
33
  export declare function markForcing(environment: REnvironmentInformation): void;
34
+ /** Notes that a call may lock a binding or an environment (`lockBinding`), after which binding a name may fail. */
35
+ export declare function markLocking(environment: REnvironmentInformation): void;
36
+ /** Whether a call seen so far may lock a binding, see {@link markLocking}. */
37
+ export declare function mayLock(environment: REnvironmentInformation): boolean;
35
38
  /** Whether a definition seen so far binds a promise or a text connection, see {@link markForcing}. */
36
39
  export declare function mayForce(environment: REnvironmentInformation): boolean;
37
40
  /** The state a symbol reads, plus the maybe-writes of forcing a promise bound to it. */
38
41
  export declare function ambientAccessOfSymbol<OtherInfo>(res: DataflowInformation, symbol: RSymbol<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
39
- /** An {@link AmbientStateAccessType} together with what refines it for some of the types. */
40
- export type AmbientStateAccess = {
41
- readonly type: AmbientStateAccessType.SetOptions | AmbientStateAccessType.GetOption | AmbientStateAccessType.ReadGraphics | AmbientStateAccessType.SetPalette | AmbientStateAccessType.OpenDevice | AmbientStateAccessType.SwitchDevice | AmbientStateAccessType.DrawRng | AmbientStateAccessType.SetWorkingDirectory | AmbientStateAccessType.GetWorkingDirectory | AmbientStateAccessType.OpenTextConnection | AmbientStateAccessType.RegisterFinalizer | AmbientStateAccessType.RunFinalizers;
42
- } | {
43
- readonly type: AmbientStateAccessType.ReadFiles | AmbientStateAccessType.WriteFiles;
44
- /** the signature whose {@link ArgProp.Resource} arguments name the files, absent if they do not name them exactly (like a glob) */
45
- readonly sig?: FnSig;
46
- /** a device numbers the files of its pages with a `%d` in the name (`plot%03d.png`) */
47
- readonly numbered?: boolean;
48
- } | {
49
- readonly type: AmbientStateAccessType.SetRng;
50
- /** the position from which on (unnamed) arguments, and every argument named other than `seed`, set the kind of generator */
51
- readonly kindFrom?: number;
52
- } | {
53
- readonly type: AmbientStateAccessType.ReadOptions;
54
- readonly keys: readonly string[];
55
- /** the argument `print(x)` dispatches on: a package method may read any option unless the value is plain */
56
- readonly dispatchOn?: number;
57
- } | {
58
- readonly type: AmbientStateAccessType.CloseDevice;
59
- /** `graphics.off()` closes every device */
60
- readonly all?: boolean;
61
- } | {
62
- readonly type: AmbientStateAccessType.SetKeyed;
63
- readonly state: KeyedState;
64
- readonly keys: AmbientKeys;
65
- } | {
66
- readonly type: AmbientStateAccessType.ReadState;
67
- readonly state: AmbientStateName;
68
- } | {
69
- /** reads the entries the call names, like `Sys.getenv("HOME")`, all of them if it names none */
70
- readonly type: AmbientStateAccessType.ReadKeyed;
71
- readonly state: KeyedState;
72
- readonly keys: AmbientKeys;
73
- } | {
74
- readonly type: AmbientStateAccessType.SetState;
75
- /** the pseudo variable the call sets, like {@link AmbientStateName.sink} */
76
- readonly state: AmbientStateName;
77
- /** `Sys.umask()` only queries the state */
78
- readonly queryWithoutArguments?: boolean;
79
- } | {
80
- readonly type: AmbientStateAccessType.SetGraphics;
81
- /** `par()` and `par("mar")` only query the state */
82
- readonly queryOnUnnamedStrings?: boolean;
83
- /** the parameters the call sets, which each have a pseudo variable of their own, see {@link KeyedState.Par} */
84
- readonly keys?: AmbientKeys;
85
- /** a query also reads what the last plot left behind (`par("usr")`), linked like an unknown side effect */
86
- readonly queryLinksTo?: LinkTo<RegExp | string>;
87
- };
42
+ /** Whether the `condition` holds for the arguments `args`, what values are known decided with `data`. */
43
+ export declare function holds<OtherInfo>(condition: AmbientCondition, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], data?: DataflowProcessorInformation<OtherInfo & ParentInformation>): Ternary;
88
44
  /** Whether a call drawing on a device writes its canvas, see `semantics.ambient.drawingWritesDevice`. */
89
45
  export declare function drawingWritesDevice(config: FlowrConfig): boolean;
90
- /** Wires the {@link AmbientStateAccess} of a call into its dataflow information: reads become unknown references, writes define the pseudo variable globally. */
91
- export declare function applyAmbientStateAccess<OtherInfo>(res: DataflowInformation, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[] | UnknownArguments, rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, access: AmbientStateAccess | readonly AmbientStateAccess[]): DataflowInformation;
46
+ /** Wires the {@link AmbientEffect}s of a call into its dataflow information: reads become unknown references, writes define the pseudo variable globally. */
47
+ export declare function applyAmbientEffects<OtherInfo>(res: DataflowInformation, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[] | UnknownArguments, rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, effects: AmbientEffects): DataflowInformation;
92
48
  /** The arguments of a call made on our behalf, like `do.call(par, args)`, which we cannot see. */
93
49
  declare const UnknownArguments: unique symbol;
94
50
  type UnknownArguments = typeof UnknownArguments;
@@ -123,8 +79,12 @@ export declare function processAmbientScope<OtherInfo>(name: RSymbol<OtherInfo &
123
79
  export declare function evaluatesCapturedCode<OtherInfo>(res: DataflowInformation, rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
124
80
  /** What the implicit `print` of a top-level value reads (see {@link readsOfAutoPrint}): every option if a method may print it (`dispatched`). */
125
81
  export declare function autoPrintReads(dispatched: boolean): AmbientStateName[];
126
- /** R prints every visible top-level value (see {@link autoPrints}) by an implicit `print`, which reads the options the configured `print` reads for that value. */
82
+ /** what printing writes: it is part of the diversion of the output, see {@link OutputSinks} */
83
+ export declare const PrintWrites: readonly AmbientStateName[];
84
+ /** R prints every visible top-level value (see {@link autoPrints}) by an implicit `print`, which reads the options the configured `print` reads for that value, and draws a plot object. */
127
85
  export declare function readsOfAutoPrint<OtherInfo>(processed: DataflowInformation, expression: RNode<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): DataflowInformation;
86
+ /** Whether R prints the visible values of the statements of the expression list `list`: those of the top level of the analyzed script, not of a sourced file. */
87
+ export declare function autoPrintsStatementsOf<OtherInfo>(list: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): boolean;
128
88
  /** whether the value of the top-level `expression` is visible, so that R prints it, decided on its vertex */
129
89
  export declare function autoPrints<OtherInfo>(expression: RNode<OtherInfo & ParentInformation>, processed: DataflowInformation, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): boolean;
130
90
  /** A call through a variable bound to a built-in (`p <- par; p(...)`), only revealed when linking the statement's calls. */
@@ -135,3 +95,5 @@ export declare function errorsOfWarnings<OtherInfo>(block: RNode<OtherInfo & Par
135
95
  export declare function signalSites<OtherInfo>(block: RNode<OtherInfo & ParentInformation>, name: BrandedIdentifier, graph: DataflowGraph, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, link: boolean): NodeId[];
136
96
  /** Whether running `block` may signal a condition a handler for the class `condition` catches, so whether the handler may run. */
137
97
  export declare function maySignal<OtherInfo>(block: RNode<OtherInfo & ParentInformation>, condition: BrandedIdentifier, graph: DataflowGraph, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, after: REnvironmentInformation): boolean;
98
+ /** Whether `node` branches or loops on a value R may reject: a condition that is not `TRUE` or `FALSE` (`if(NA)`, `if(logical(0))`) or a vector that is not a constant. */
99
+ export declare function testsValue(node: RNode<ParentInformation>): boolean;