@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
@@ -10,6 +10,7 @@ const info_1 = require("../../../../../info");
10
10
  const known_call_handling_1 = require("../known-call-handling");
11
11
  const control_flow_1 = require("../../../../control-flow");
12
12
  const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
13
+ const r_parameter_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-parameter");
13
14
  const r_symbol_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
14
15
  const node_id_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id");
15
16
  const logger_1 = require("../../../../../logger");
@@ -37,6 +38,22 @@ const df_helper_1 = require("../../../../../graph/df-helper");
37
38
  const environment_1 = require("../../../../../environments/environment");
38
39
  const ambient_state_name_1 = require("../../../../../environments/ambient-state-name");
39
40
  const range_1 = require("../../../../../../util/range");
41
+ const r_binary_op_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-binary-op");
42
+ const r_string_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
43
+ const base_operators_1 = require("../../../../../environments/default-builtin-config/base-operators");
44
+ /** the calls that only jump, group, or bind, which signal nothing of their own (what they evaluate is a site of its own) */
45
+ const Silent = [built_in_proc_name_1.BuiltInProcName.Return, built_in_proc_name_1.BuiltInProcName.Break, built_in_proc_name_1.BuiltInProcName.ExpressionList, built_in_proc_name_1.BuiltInProcName.Assignment];
46
+ /** Whether the block may signal anything at all: it calls something that is not just a jump, or reads a name nothing binds. */
47
+ function hasSignalSite(block, graph) {
48
+ for (const id of model_1.RNode.collectAllIds(block)) {
49
+ const vertex = graph.getVertex(id);
50
+ if (vertex_1.DfgVertex.isFunctionCall(vertex) ? !Silent.some(s => vertex_1.DfgVertex.hasOrigin(vertex, s)) && identifier_1.Identifier.getName(vertex.name) !== 'next'
51
+ : vertex_1.DfgVertex.isUse(vertex) && df_helper_1.Dataflow.targetsOf(graph, id, edge_1.EdgeType.Reads).length === 0) {
52
+ return true;
53
+ }
54
+ }
55
+ return false;
56
+ }
40
57
  /** Process a built-in try-catch or similar handler. */
41
58
  function processTryCatch(name, args, rootId, data, config) {
42
59
  const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args: args.map(r_argument_1.RArgument.unnamedValueOrArg), rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Try, sig: function_semantics_1.FunctionSemantics.call.signature.every });
@@ -49,17 +66,24 @@ function processTryCatch(name, args, rootId, data, config) {
49
66
  const info = res.information;
50
67
  /* handlers are matched by the class of the condition, so a call naming none for an error lets it out: `tryCatch(stop("x"), warning = ...)` throws, and so does one with nothing but a `finally`. */
51
68
  const aborts = config.aborts ?? true;
52
- const catchesError = aborts && (error === undefined || (0, condition_handlers_1.namesAnErrorHandler)(args));
53
- /* a handler of another class runs once something in the block signals such a condition, an exiting one leaves the block there */
54
69
  const blockInfo = res.processedArguments.find(a => a !== undefined && blockArg.has(a.entryPoint));
55
70
  const blockAst = blockInfo && data.completeAst.idMap.get(blockInfo.entryPoint);
71
+ /* a handler runs only if something the block runs may signal what it handles, one for the session may run anywhere after */
72
+ const runs = (condition) => blockAst === undefined || (0, built_in_ambient_state_1.maySignal)(blockAst, condition, info.graph, data, info.environment);
73
+ /* an error may carry any class (`errorCondition(class = "my")`), so a handler of a class the block may signal catches it */
74
+ const catchesError = aborts && (error === undefined || (0, condition_handlers_1.namesAnErrorHandler)(args) || otherHandlers.some(h => !condition_handlers_1.SessionConditionClasses.has(identifier_1.Identifier.getName(h.name)) && runs(identifier_1.Identifier.getName(h.name))));
75
+ /* a handler of another class runs once something in the block signals such a condition, an exiting one leaves the block there */
56
76
  const sitesOf = (condition, link) => blockAst === undefined ? [] : (0, built_in_ambient_state_1.signalSites)(blockAst, identifier_1.Identifier.getName(condition), info.graph, data, link);
57
77
  const signaled = new Set(aborts ? otherHandlers.flatMap(({ name: condition }) => sitesOf(condition, true)) : []);
78
+ /* a calling handler decides what a signal does as well (`invokeRestart("muffleWarning")`), so what signals stays with the construct */
79
+ for (const site of aborts ? [] : otherHandlers.flatMap(({ name: condition }) => sitesOf(condition, false))) {
80
+ info.graph.addEdge(site, rootId, edge_1.EdgeType.Reads);
81
+ }
58
82
  const raising = [];
59
83
  if (blockInfo !== undefined && blockAst !== undefined && (catchesError || signaled.size > 0)) {
60
84
  const targetsOf = (n) => [data.environment, info.environment]
61
85
  .flatMap(env => resolve_helper_1.Resolve.byNameAndType(n, env, identifier_1.ReferenceType.Function) ?? []);
62
- const order = raisingOrder(info.graph, (0, query_fn_props_1.builtInLookup)(data.ctx), { rootId, targetsOf });
86
+ const order = raisingOrder(info.graph, (0, query_fn_props_1.builtInLookup)(data.ctx), { rootId, targetsOf, locked: (0, built_in_ambient_state_1.mayLock)(data.environment) });
63
87
  const raised = catchesError ? (0, built_in_ambient_state_1.errorsOfWarnings)(blockAst, info.environment, info.graph, data) : [];
64
88
  for (const site of [...raised.map(r => r.nodeId), ...signaled]) {
65
89
  info.graph.addEdge(site, rootId, edge_1.EdgeType.Reads);
@@ -68,9 +92,15 @@ function processTryCatch(name, args, rootId, data, config) {
68
92
  blockInfo.exitPoints = blockInfo.exitPoints.concat(raised);
69
93
  raising.push(...order(blockAst, []));
70
94
  }
71
- /* a handler runs only if something the block runs may signal what it handles, one for the session may run anywhere after */
72
- const runs = (condition) => blockAst === undefined || (0, built_in_ambient_state_1.maySignal)(blockAst, condition, info.graph, data, info.environment);
73
95
  const errorRuns = error !== undefined && errorArg.size > 0 && runs(error);
96
+ /*
97
+ * an exiting handler that may run leaves the block where the block signals, so a `return` (or `break`, or a raise the
98
+ * construct lets out) later in the block only happens if nothing was signaled before: `tryCatch({ log(-1); return(1) }, warning = ...)`
99
+ */
100
+ const preempted = aborts && (errorRuns || otherHandlers.some(h => runs(identifier_1.Identifier.getName(h.name)))) && blockAst !== undefined && hasSignalSite(blockAst, info.graph);
101
+ const unlessSignaled = (exits) => preempted
102
+ ? exits.map(e => e.type === 0 /* ExitPointType.Default */ ? e : { ...e, cds: (0, info_1.withCds)(e.cds ?? data.cds, [{ id: rootId, when: false }]) })
103
+ : exits;
74
104
  /* if the block raises an error in every case, the error handler is not constrained by it */
75
105
  const blockErrorExitPoints = [];
76
106
  const errorExitPoints = [];
@@ -86,11 +116,14 @@ function processTryCatch(name, args, rootId, data, config) {
86
116
  const handlerExits = exitPointsOfHandler(arg.entryPoint, info.graph) ?? [];
87
117
  errorExitPoints.push(...handlerExits.map(e => e.type === 1 /* ExitPointType.Return */ ? { ...e, type: 0 /* ExitPointType.Default */ } : e));
88
118
  }
89
- if (!blockArg.has(arg.entryPoint) || !catchesError) {
119
+ if (!blockArg.has(arg.entryPoint)) {
90
120
  return arg.exitPoints;
91
121
  }
122
+ else if (!catchesError) {
123
+ return unlessSignaled(arg.exitPoints);
124
+ }
92
125
  blockErrorExitPoints.push(...arg.exitPoints.filter(ep => ep.type === 4 /* ExitPointType.Error */).flatMap(a => a.cds));
93
- return arg.exitPoints.filter(ep => ep.type !== 4 /* ExitPointType.Error */);
126
+ return unlessSignaled(arg.exitPoints.filter(ep => ep.type !== 4 /* ExitPointType.Error */));
94
127
  });
95
128
  if (errorExitPoints.length > 0) {
96
129
  if ((0, info_1.happensInEveryBranch)(blockErrorExitPoints.some(assert_1.isUndefined) ? undefined : blockErrorExitPoints)) {
@@ -175,7 +208,10 @@ function processTryCatch(name, args, rootId, data, config) {
175
208
  /* whether the block raises decides what the construct yields, its value or that of a handler */
176
209
  info.graph.addEdge(rootId, id, edge_1.EdgeType.Reads);
177
210
  }
178
- const environment = mayAbort ? environment_1.REnvironment.append(data.environment, info.environment) : info.environment;
211
+ let environment = mayAbort ? environment_1.REnvironment.append(data.environment, info.environment) : info.environment;
212
+ if (mayAbort) {
213
+ environment = keepOverwrittenBeforeRaise(escaping, raising, environment, data.completeAst.idMap, rootId);
214
+ }
179
215
  return {
180
216
  ...info,
181
217
  out: info.out.concat(mayAbort ? (0, reference_to_maybe_1.makeAllMaybe)(escaping, info.graph, environment, true) : escaping),
@@ -183,6 +219,23 @@ function processTryCatch(name, args, rootId, data, config) {
183
219
  kill: escapingKills
184
220
  };
185
221
  }
222
+ /** A write of the block that a later one of it overwrites survives if a raising site in between leaves the block: `{ x <- 1; warning("m"); x <- 2 }`. */
223
+ function keepOverwrittenBeforeRaise(writes, raising, environment, idMap, rootId) {
224
+ const lastRaise = raising.map(id => idMap.get(id)?.location).filter(assert_1.isNotUndefined).sort(range_1.SourceRange.compare).at(-1);
225
+ if (lastRaise === undefined) {
226
+ return environment;
227
+ }
228
+ for (const write of writes) {
229
+ const at = idMap.get(write.nodeId)?.location;
230
+ const { name } = write;
231
+ if (name === undefined || !('definedAt' in write) || at === undefined || range_1.SourceRange.compare(at, lastRaise) >= 0
232
+ || resolve_helper_1.Resolve.byName(name, environment)?.some(d => d.nodeId === write.nodeId)) {
233
+ continue;
234
+ }
235
+ environment = environment_1.REnvironment.define({ ...write, name, cds: [...write.cds ?? [], { id: rootId, when: true }] }, false, environment);
236
+ }
237
+ return environment;
238
+ }
186
239
  /** Links what a block catching errors may raise because a warning turns into one, where the `warn` option that does so is only known after linking: `g(options, warn = 2)` sets it through the function `g` is handed. */
187
240
  function linkLateWarningsAsErrors(graph, environment, idMap) {
188
241
  const writes = (resolve_helper_1.Resolve.byName(ambient_state_name_1.AmbientStateName.warnsAsErrors, environment) ?? []).filter(d => vertex_1.DfgVertex.isFunctionCall(graph.getVertex(d.nodeId)));
@@ -286,18 +339,45 @@ function matchHandlers(given, config, graph) {
286
339
  };
287
340
  }
288
341
  /** Orders the raising calls in every body a block catching errors may run, once per definition and after linking bound all calls. */
289
- function orderRaisingBodies(graph, idMap, ctx) {
290
- const ordered = new Set();
342
+ function orderRaisingBodies(graph, idMap, ctx, environment) {
343
+ const ordered = new Map();
344
+ /* a warning raises where `warn` may be 2, which a body may set itself: `f <- function() { options(warn = 2); as.integer("a") }` */
345
+ const warn = ambient_state_name_1.AmbientStateName.option('warn');
346
+ /* through the earlier settings a later one of `warn` (an `on.exit` restoring it) still reads */
347
+ const warnsAsErrors = (site) => {
348
+ const seen = new Set();
349
+ const todo = [site];
350
+ for (let current = todo.pop(); current !== undefined; current = todo.pop()) {
351
+ for (const t of df_helper_1.Dataflow.targetsOf(graph, current, edge_1.EdgeType.Reads)) {
352
+ const writes = graph.ambientAccessOf(t)?.writes;
353
+ if (writes?.has(ambient_state_name_1.AmbientStateName.warnsAsErrors)) {
354
+ return true;
355
+ }
356
+ else if (writes?.has(warn) && !seen.has(t)) {
357
+ seen.add(t);
358
+ todo.push(t);
359
+ }
360
+ }
361
+ }
362
+ return false;
363
+ };
291
364
  const reach = (node) => {
292
- for (const id of r_function_definition_1.RFunctionDefinition.is(node) ? [node.info.id] : df_helper_1.Dataflow.calleeIdsOf(graph, node.info.id)) {
365
+ const isDefinition = r_function_definition_1.RFunctionDefinition.is(node);
366
+ for (const id of isDefinition ? [node.info.id] : df_helper_1.Dataflow.calleeIdsOf(graph, node.info.id)) {
293
367
  const definition = idMap.get(id);
294
368
  if (!ordered.has(id) && r_function_definition_1.RFunctionDefinition.is(definition)) {
295
- ordered.add(id);
296
- order(definition.body, []);
369
+ ordered.set(id, []);
370
+ const raising = order(definition.body, []);
371
+ ordered.set(id, raising.filter(warnsAsErrors));
372
+ keepEscapingWritesBeforeRaise(id, raising, graph, idMap);
373
+ }
374
+ /* whether such a warning raises decides what the call yields, its value or that of a handler */
375
+ for (const site of isDefinition ? [] : ordered.get(id) ?? []) {
376
+ graph.addEdge(node.info.id, site, edge_1.EdgeType.Reads);
297
377
  }
298
378
  }
299
379
  };
300
- const order = raisingOrder(graph, (0, query_fn_props_1.builtInLookup)(ctx), { reach });
380
+ const order = raisingOrder(graph, (0, query_fn_props_1.builtInLookup)(ctx), { reach, locked: (0, built_in_ambient_state_1.mayLock)(environment) });
301
381
  for (const [id, vertex] of graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
302
382
  const call = vertex_1.DfgVertex.hasOrigin(vertex, built_in_proc_name_1.BuiltInProcName.Try) ? idMap.get(id) : undefined;
303
383
  for (const arg of r_function_call_1.RFunctionCall.is(call) ? call.arguments : []) {
@@ -310,20 +390,66 @@ function orderRaisingBodies(graph, idMap, ctx) {
310
390
  }
311
391
  }
312
392
  }
393
+ /** What the body of `fn` writes outside its frame stays visible past a later write of the same name if a raising site in between may leave the body: `x <<- 1; log(-1); x <<- 2`. */
394
+ function keepEscapingWritesBeforeRaise(fn, raising, graph, idMap) {
395
+ const at = (id) => idMap.get(id)?.location;
396
+ const raises = raising.map(at).filter(assert_1.isNotUndefined);
397
+ const subflow = raising.length === 0 ? undefined : graph.getVertex(fn);
398
+ if (!vertex_1.DfgVertex.isFunctionDefinition(subflow)) {
399
+ return;
400
+ }
401
+ const superAssigns = (id) => {
402
+ const node = idMap.get(id);
403
+ const parent = node && model_1.RNode.directParent(node, idMap);
404
+ return r_binary_op_1.RBinaryOp.is(parent) && (parent.operator === '<<-' || parent.operator === '->>');
405
+ };
406
+ const escaping = [...subflow.subflow.graph].filter(id => vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(id)) && model_1.RNode.findEnclosing(id, idMap, r_function_definition_1.RFunctionDefinition.is) === fn
407
+ && (superAssigns(id) || df_helper_1.Dataflow.targetsOf(graph, id, edge_1.EdgeType.SideEffectOnCall).length > 0));
408
+ for (const later of escaping) {
409
+ const end = at(later);
410
+ if (end === undefined) {
411
+ continue;
412
+ }
413
+ const name = node_id_1.NodeId.recoverBareName(later, idMap);
414
+ for (const earlier of escaping) {
415
+ const start = at(earlier);
416
+ if (start !== undefined && node_id_1.NodeId.recoverBareName(earlier, idMap) === name && range_1.SourceRange.compare(start, end) < 0
417
+ && raises.some(r => range_1.SourceRange.compare(start, r) < 0 && range_1.SourceRange.compare(r, end) < 0)) {
418
+ graph.addEdge(later, earlier, edge_1.EdgeType.Reads);
419
+ }
420
+ }
421
+ }
422
+ }
313
423
  /** Makes every later call read the earlier ones that may raise, and those read the construct `rootId`; returns the raising ones. */
314
- function raisingOrder(graph, lookup, { rootId, targetsOf, reach }) {
424
+ function raisingOrder(graph, lookup, { rootId, targetsOf, reach, locked }) {
315
425
  const raises = (node) => {
316
426
  const vertex = graph.getVertex(node.info.id);
317
427
  const name = vertex_1.DfgVertex.isFunctionCall(vertex) ? vertex.name : r_function_call_1.RFunctionCall.is(node) ? r_function_call_1.RFunctionCall.calledName(node) : r_access_1.RAccess.is(node) ? node.operator : node.lexeme;
318
- if (name === undefined || built_in_props_1.CallProps.hasAny(lookup(name), built_in_props_1.CallProp.Throws) || (rootId !== undefined && df_helper_1.Dataflow.hasEdge(graph, node.info.id, rootId, edge_1.EdgeType.Reads))) {
428
+ if (name === undefined || built_in_props_1.CallProps.hasAny(lookup(name), built_in_props_1.CallProp.Throws) || (0, built_in_ambient_state_1.testsValue)(node) || (rootId !== undefined && df_helper_1.Dataflow.hasEdge(graph, node.info.id, rootId, edge_1.EdgeType.Reads))) {
319
429
  return true;
320
430
  }
321
431
  else if (vertex_1.DfgVertex.isFunctionCall(vertex)) {
322
- return !vertex.onlyBuiltin;
432
+ /* a built-in may raise on its own for what it is handed (`log("a")`, a locked binding), binding a name raises only for what its value does, unless it may be locked */
433
+ return !vertex.onlyBuiltin || vertex.origin === 'unnamed' || !(vertex.origin.every(o => NeverRaises.has(o)) || (!locked && bindsName(node)));
323
434
  }
324
435
  const targets = targetsOf?.(name) ?? [];
325
436
  return targets.length === 0 || targets.some(t => !node_id_1.NodeId.isBuiltIn(t.nodeId));
326
437
  };
438
+ /* reading a name bound to a promise (`delayedAssign("p", stop("e")); p`) or a lazy parameter forces it, and so raises what the promise does */
439
+ const forcesRaising = (node) => {
440
+ if (!r_symbol_1.RSymbol.is(node) || !vertex_1.DfgVertex.isUse(graph.getVertex(node.info.id))) {
441
+ return false;
442
+ }
443
+ const read = df_helper_1.Dataflow.targetsOf(graph, node.info.id, edge_1.EdgeType.Reads);
444
+ /* a parameter holds the argument handed to it, or its default if there is none */
445
+ const defaults = read.filter(t => r_parameter_1.RParameter.is(graph.idMap?.get(graph.idMap?.get(t)?.info.parent ?? '')));
446
+ const promises = [...read, ...read.flatMap(t => df_helper_1.Dataflow.sourcesOf(graph, t, edge_1.EdgeType.DefinesOnCall)), ...defaults.flatMap(t => df_helper_1.Dataflow.targetsOf(graph, t, edge_1.EdgeType.DefinedBy))];
447
+ return promises.some(t => {
448
+ const promised = graph.idMap?.get(t);
449
+ return promised !== undefined && vertex_1.DfgVertex.isFunctionCall(graph.getVertex(t)) && raises(promised);
450
+ });
451
+ };
452
+ const isHook = (node) => r_function_call_1.RFunctionCall.is(node) && vertex_1.DfgVertex.hasOrigin(graph.getVertex(node.info.id), built_in_proc_name_1.BuiltInProcName.RegisterHook);
327
453
  const order = (node, before) => {
328
454
  reach?.(node);
329
455
  if (r_function_definition_1.RFunctionDefinition.is(node)) {
@@ -332,7 +458,9 @@ function raisingOrder(graph, lookup, { rootId, targetsOf, reach }) {
332
458
  else if (r_expression_list_1.RExpressionList.is(node)) {
333
459
  const sites = [];
334
460
  let current = before;
335
- for (const child of node.children) {
461
+ /* what `on.exit` registers runs when the function exits, after everything else in the list (`on.exit(stop("x")); cat("a")` prints before it raises) */
462
+ const hooks = node.children.filter(isHook);
463
+ for (const child of [...node.children.filter(c => !hooks.includes(c)), ...hooks]) {
336
464
  const raised = order(child, current);
337
465
  current = raised.length > 0 ? raised : current;
338
466
  sites.push(...raised);
@@ -342,10 +470,12 @@ function raisingOrder(graph, lookup, { rootId, targetsOf, reach }) {
342
470
  /* what a later iteration runs follows what an earlier one may raise, which the loop carries */
343
471
  const loop = model_1.RLoopConstructs.is(node);
344
472
  const sites = model_1.RNode.directChildren(node).flatMap(child => child === r_function_call_1.EmptyArgument ? [] : order(child, loop ? [...before, node.info.id] : before));
345
- if (!CallTypes.has(node.type)) {
473
+ /* code after an unconditional exit is never analyzed, so it has no vertex and neither runs nor raises */
474
+ const forcing = forcesRaising(node);
475
+ if ((!CallTypes.has(node.type) && !forcing) || !graph.hasVertex(node.info.id)) {
346
476
  return sites;
347
477
  }
348
- const raising = raises(node);
478
+ const raising = forcing || raises(node);
349
479
  for (const site of [...before, ...rootId !== undefined && raising ? [rootId] : [], ...loop ? sites : []]) {
350
480
  graph.addEdge(node.info.id, site, edge_1.EdgeType.Reads);
351
481
  }
@@ -353,6 +483,16 @@ function raisingOrder(graph, lookup, { rootId, targetsOf, reach }) {
353
483
  };
354
484
  return order;
355
485
  }
486
+ /** the built-in constructs that raise nothing beyond what their parts do */
487
+ const NeverRaises = new Set([built_in_proc_name_1.BuiltInProcName.ExpressionList, built_in_proc_name_1.BuiltInProcName.IfThenElse, built_in_proc_name_1.BuiltInProcName.ForLoop, built_in_proc_name_1.BuiltInProcName.WhileLoop, built_in_proc_name_1.BuiltInProcName.RepeatLoop,
488
+ built_in_proc_name_1.BuiltInProcName.Break, built_in_proc_name_1.BuiltInProcName.Return, built_in_proc_name_1.BuiltInProcName.Function, built_in_proc_name_1.BuiltInProcName.FunctionDefinition, built_in_proc_name_1.BuiltInProcName.Quote]);
489
+ function bindsName(node) {
490
+ if (!r_binary_op_1.RBinaryOp.is(node) || r_binary_op_1.RBinaryOp.getOperatorInfo(node)?.usedAs !== base_operators_1.OperatorUsedAs.Assignment) {
491
+ return false;
492
+ }
493
+ const target = node.operator.startsWith('->') ? node.rhs : node.lhs;
494
+ return r_symbol_1.RSymbol.is(target) || r_string_1.RString.is(target);
495
+ }
356
496
  const CallTypes = new Set([type_1.RType.FunctionCall, type_1.RType.BinaryOp, type_1.RType.UnaryOp, type_1.RType.Access, type_1.RType.Pipe, type_1.RType.IfThenElse, type_1.RType.ForLoop, type_1.RType.WhileLoop, type_1.RType.RepeatLoop, type_1.RType.Break, type_1.RType.Next]);
357
497
  /** the exits that leave the construct for a destination of their own, which `finally` still runs before */
358
498
  const JumpExitPoints = [2 /* ExitPointType.Break */, 3 /* ExitPointType.Next */, 1 /* ExitPointType.Return */];
@@ -69,7 +69,8 @@ function processWhileLoop(name, args, rootId, data) {
69
69
  if (control_flow_1.ControlFlow.alwaysExits(condition, data.cds)) {
70
70
  logger_1.dataflowLogger.warn(`While-Loop ${rootId} forces exit in condition, skipping rest`);
71
71
  graph.addEdge(nameId, condition.entryPoint, edge_1.EdgeType.Reads);
72
- return condition;
72
+ /* the condition's graph went into `graph` already, which a second merge refuses */
73
+ return { ...condition, graph };
73
74
  }
74
75
  const whenTrue = { id: nameId, when: true };
75
76
  const cdTrue = [whenTrue];
@@ -77,7 +78,7 @@ function processWhileLoop(name, args, rootId, data) {
77
78
  (0, reference_to_maybe_1.applyCdsToAllInGraphButConstants)(body.graph, bodyRead, cdTrue);
78
79
  const remainingInputs = (0, linker_1.linkInputs)(bodyRead, information.environment, condition.in.concat(condition.unknownReferences), graph, true);
79
80
  (0, reference_to_maybe_1.applyCdToReferences)(body.out, cdTrue);
80
- const nonLocalReads = (0, linker_1.findNonLocalReads)(graph, new Set(condition.in.map(i => i.nodeId)));
81
+ const nonLocalReads = (0, linker_1.findNonLocalReads)(graph);
81
82
  (0, linker_1.linkCircularRedefinitionsWithinALoop)(graph, (0, linker_1.produceNameSharedIdMap)(nonLocalReads), body.out, body.environment);
82
83
  (0, built_in_ambient_state_1.linkAmbientStateWithinLoop)(graph, bodyRead.concat(condition.in, condition.unknownReferences), body);
83
84
  (0, linker_1.reapplyLoopExitPoints)(body.exitPoints, body.in.concat(body.out, body.unknownReferences), graph);
@@ -102,7 +103,8 @@ function processWhileLoop(name, args, rootId, data) {
102
103
  entryPoint: nameId,
103
104
  cfgEntry: conditionEntry,
104
105
  cfgExit: rootId,
105
- exitPoints: (0, info_1.filterOutLoopExitPoints)(body.exitPoints),
106
+ /* unless the body certainly runs, it only jumps away when it runs */
107
+ exitPoints: (0, info_1.filterOutLoopExitPoints)(conditionIsAlwaysTrue ? body.exitPoints : body.exitPoints.map(e => ({ ...e, cds: [...e.cds ?? data.cds ?? [], whenTrue] }))),
106
108
  graph,
107
109
  environment: loopKill ? (0, apply_kill_1.applyKills)(loopEnvironment, loopKill) : loopEnvironment,
108
110
  hooks: condition.hooks.concat(conditionIsAlwaysTrue ? body.hooks : (0, hooks_1.hooksUnder)(body.hooks, cdTrue)),
@@ -23,6 +23,12 @@ export declare function computeCallGraphSummaries<T>(this: void, graph: Dataflow
23
23
  export declare function foldCallGraph<M>(this: void, graph: DataflowGraph, monoid: Monoid<M>, own: (id: NodeId, fdef: DataflowGraphVertexFunctionDefinition) => M): Map<NodeId, M>;
24
24
  /** A promise reads the state at the point it is forced, which is wherever the callee first needs it: after the call wrote what the promise reads (`g <- function(b) { x <<- 1; b }; g(x)`), after another argument did (`f(n, n <- 4)`), or, once a closure captured its parameter, after the call returned (`mk <- function(a) function() a`). */
25
25
  export declare function linkPromisesToWritesOfCall(this: void, graph: DataflowGraph, ctx: FlowrAnalyzerContext): void;
26
+ /** A promise (`delayedAssign`) forced where its name is not read at the top level, by a call running a closure that reads it or by an access of an environment holding it, changes the state at that point, which later code reading the state sees. */
27
+ export declare function linkStateWritesOfForcedPromises(this: void, graph: DataflowGraph): void;
28
+ /** A scope opening an instance for its code (`capture.output`, `with_png`) ends it afterward, so it reads every use of it within its arguments, in the functions they call as well (`capture.output(f())` reads what `f` prints). */
29
+ export declare function linkUsesOfScopedInstances(this: void, graph: DataflowGraph): void;
30
+ /** What a body runs after a call of a closure within it sees the global state that closure changes, which the body, processed before it learned of the callee, does not know of: `f <- function() { g(); print(pi) }` with `g` setting the `digits` option. */
31
+ export declare function linkStatementsAfterCallsOfClosures(this: void, graph: DataflowGraph): void;
26
32
  /** Settles what a function writes beyond its frame (`<<-`) under branches of its own, once the calls passing the write on are linked: bound to what a call hands it, a parameter may make a branch constant (`f <- function(go) if(go) n <<- 5; f(FALSE)`). */
27
33
  export declare function settleConditionalWritesOfCalls(this: void, graph: DataflowGraph, ctx: FlowrAnalyzerContext): void;
28
34
  /** Links every materialized package-export vertex back to the `library()`/`use()` call that loaded it, reading the loading call from the export binding's `definedAt` in the (final, authoritative) environment. */
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.computeCallGraphSummaries = computeCallGraphSummaries;
4
4
  exports.foldCallGraph = foldCallGraph;
5
5
  exports.linkPromisesToWritesOfCall = linkPromisesToWritesOfCall;
6
+ exports.linkStateWritesOfForcedPromises = linkStateWritesOfForcedPromises;
7
+ exports.linkUsesOfScopedInstances = linkUsesOfScopedInstances;
8
+ exports.linkStatementsAfterCallsOfClosures = linkStatementsAfterCallsOfClosures;
6
9
  exports.settleConditionalWritesOfCalls = settleConditionalWritesOfCalls;
7
10
  exports.linkMaterializedExportsToLoaders = linkMaterializedExportsToLoaders;
8
11
  exports.reResolveOpenReferences = reResolveOpenReferences;
@@ -44,6 +47,7 @@ const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model
44
47
  const node_value_1 = require("../../../../../eval/resolve/node-value");
45
48
  const r_value_1 = require("../../../../../eval/values/r-value");
46
49
  const r_function_definition_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
50
+ const removal_marker_1 = require("../../../../../environments/removal-marker");
47
51
  const r_base_packages_1 = require("../../../../../../util/r-base-packages");
48
52
  /**
49
53
  * Computes, for every function-definition vertex `F`, `summary(F) = own(F)` unioned with `summary(G)` over every transitive callee `G`.
@@ -84,6 +88,12 @@ function linkPromisesToWritesOfCall(graph, ctx) {
84
88
  let later;
85
89
  let forcing;
86
90
  let order;
91
+ let functions;
92
+ /* the global state a closure changes while it runs, which a promise it forces may see */
93
+ const changedBy = (fns) => {
94
+ functions ??= ambientAccessOfFunctions(graph);
95
+ return monoid_1.Monoid.fold(ambient_access_1.AmbientAccess.monoid, fns.map(fn => functions?.get(fn) ?? ambient_access_1.AmbientAccess.empty));
96
+ };
87
97
  for (const [id, vertex] of graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
88
98
  /* a function of a package flowR has no body for forces its arguments as its signature states, see `keptPromisesOfPackageCall` */
89
99
  const kept = df_helper_1.Dataflow.targetsOf(graph, id, edge_1.EdgeType.Calls).some(t => !node_id_1.NodeId.isBuiltIn(t) && vertex_1.DfgVertex.isFunctionDefinition(graph.getVertex(t)))
@@ -107,6 +117,10 @@ function linkPromisesToWritesOfCall(graph, ctx) {
107
117
  write(vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(node)) ? nameOf(node) : undefined, node, ids);
108
118
  }
109
119
  }
120
+ const closures = kept === undefined ? df_helper_1.Dataflow.calleeIdsOf(graph, id).filter(t => !node_id_1.NodeId.isBuiltIn(t)) : [];
121
+ for (const { ids } of closures.length > 0 ? args : []) {
122
+ linkAmbientReadsToWrites(graph, ids, () => changedBy(closures));
123
+ }
110
124
  for (const { ids, at } of args) {
111
125
  /* whether the promise may be forced after the call, asked only once a read has a later definition to see */
112
126
  let late;
@@ -141,6 +155,9 @@ function linkPromisesToWritesOfCall(graph, ctx) {
141
155
  for (const [fn] of graph.verticesOfType(vertex_1.VertexType.FunctionDefinition)) {
142
156
  const definition = idMap.get(fn);
143
157
  for (const parameter of r_function_definition_1.RFunctionDefinition.is(definition) ? definition.parameters : []) {
158
+ if (parameter.defaultValue !== undefined) {
159
+ linkAmbientReadsToWrites(graph, model_1.RNode.collectAllIds(parameter.defaultValue), () => changedBy([fn]));
160
+ }
144
161
  for (const read of parameter.defaultValue === undefined ? [] : model_1.RNode.collectAllIds(parameter.defaultValue)) {
145
162
  const name = vertex_1.DfgVertex.isUse(graph.getVertex(read)) ? nameOf(read) : undefined;
146
163
  if (name !== undefined) {
@@ -150,6 +167,124 @@ function linkPromisesToWritesOfCall(graph, ctx) {
150
167
  }
151
168
  }
152
169
  }
170
+ /** A promise (`delayedAssign`) forced where its name is not read at the top level, by a call running a closure that reads it or by an access of an environment holding it, changes the state at that point, which later code reading the state sees. */
171
+ function linkStateWritesOfForcedPromises(graph) {
172
+ let readers;
173
+ for (const [id] of graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
174
+ const binding = function_semantics_1.FunctionSemantics.call.quoted.promisedBinding(graph, id);
175
+ const promise = binding === undefined ? [] : df_helper_1.Dataflow.targetsOf(graph, id, edge_1.EdgeType.NonStandardEvaluation);
176
+ const calls = promise.flatMap(p => [...model_1.RNode.collectAllIds(graph.idMap?.get(p))]).filter(c => vertex_1.DfgVertex.isFunctionCall(graph.getVertex(c)));
177
+ /* the calls of the promise changing the state, which run where it is forced even if its value goes unused */
178
+ const writers = calls.filter(c => ambientAccessOf(graph, [c])[ambient_access_1.AmbientAccessKind.Write].size > 0);
179
+ const written = writers.length === 0 ? [] : [...ambientAccessOf(graph, writers)[ambient_access_1.AmbientAccessKind.Write].keys()];
180
+ if (binding === undefined || written.length === 0) {
181
+ continue;
182
+ }
183
+ readers ??= new Map([...graph.ambientAccessIds()].map(r => [r, new Set(graph.ambientAccessOf(r)?.[ambient_access_1.AmbientAccessKind.Read].keys())]));
184
+ for (const site of function_semantics_1.FunctionSemantics.promiseForcingPoints(binding, graph)) {
185
+ for (const writer of writers) {
186
+ graph.addEdge(site, writer, edge_1.EdgeType.Reads);
187
+ }
188
+ const statement = program_order_1.ProgramOrder.runsOnceAt(site, graph);
189
+ if (statement === undefined || written.every(name => graph.ambientAccessOf(site)?.[ambient_access_1.AmbientAccessKind.Write].has(name))) {
190
+ continue;
191
+ }
192
+ for (const expr of promise) {
193
+ graph.addEdge(site, expr, edge_1.EdgeType.Reads);
194
+ }
195
+ for (const [reader, reads] of readers) {
196
+ if (written.some(name => reads.has(name)) && program_order_1.ProgramOrder.offset(reader, statement, graph) > 0) {
197
+ graph.addEdge(reader, site, edge_1.EdgeType.Reads);
198
+ }
199
+ }
200
+ }
201
+ }
202
+ }
203
+ /** The families of instances a scope may open one of for its code, see {@link linkUsesOfScopedInstances}. */
204
+ const ScopedInstances = [ambient_state_name_1.OutputSinks, ambient_state_name_1.GraphicsDevices];
205
+ /** A scope opening an instance for its code (`capture.output`, `with_png`) ends it afterward, so it reads every use of it within its arguments, in the functions they call as well (`capture.output(f())` reads what `f` prints). */
206
+ function linkUsesOfScopedInstances(graph) {
207
+ const idMap = graph.idMap;
208
+ if (idMap === undefined) {
209
+ return;
210
+ }
211
+ let functions;
212
+ for (const id of graph.ambientAccessIds()) {
213
+ /* a scope changes the states of the instance it opens in its own frame only */
214
+ const local = graph.ambientAccessOf(id)?.[ambient_access_1.AmbientAccessKind.Local];
215
+ const scoped = ScopedInstances.filter(family => local?.has(family.used) && local.has(family.opened));
216
+ const vertex = graph.getVertex(id);
217
+ if (scoped.length === 0 || !vertex_1.DfgVertex.isFunctionCall(vertex)) {
218
+ continue;
219
+ }
220
+ const code = vertex.args.filter(graph_1.FunctionArgument.isNotEmpty).flatMap(a => [...model_1.RNode.collectAllIds(idMap.get(a.nodeId))]);
221
+ functions ??= ambientAccessOfFunctions(graph);
222
+ const writes = ambientAccessOf(graph, code, { functions })[ambient_access_1.AmbientAccessKind.Write];
223
+ for (const writer of scoped.flatMap(family => [...writes.get(family.used) ?? []])) {
224
+ if (writer !== id) {
225
+ graph.addEdge(id, writer, edge_1.EdgeType.Reads);
226
+ }
227
+ }
228
+ }
229
+ }
230
+ /** What a body runs after a call of a closure within it sees the global state that closure changes, which the body, processed before it learned of the callee, does not know of: `f <- function() { g(); print(pi) }` with `g` setting the `digits` option. */
231
+ function linkStatementsAfterCallsOfClosures(graph) {
232
+ const idMap = graph.idMap;
233
+ if (idMap === undefined) {
234
+ return;
235
+ }
236
+ let functions;
237
+ for (const [id] of graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
238
+ const closures = graph.isRoot(id) ? [] : df_helper_1.Dataflow.calleeIdsOf(graph, id).filter(t => !node_id_1.NodeId.isBuiltIn(t) && vertex_1.DfgVertex.isFunctionDefinition(graph.getVertex(t)));
239
+ const after = closures.length === 0 ? undefined : runsAfterWithinFunction(id, idMap);
240
+ if (after === undefined || after.size === 0) {
241
+ continue;
242
+ }
243
+ const changed = () => {
244
+ functions ??= ambientAccessOfFunctions(graph);
245
+ return monoid_1.Monoid.fold(ambient_access_1.AmbientAccess.monoid, closures.map(fn => functions?.get(fn) ?? ambient_access_1.AmbientAccess.empty));
246
+ };
247
+ for (const reader of linkAmbientReadsToWrites(graph, after, changed)) {
248
+ /* the reader sees the write only as the call runs it */
249
+ graph.addEdge(reader, id, edge_1.EdgeType.Reads);
250
+ }
251
+ }
252
+ }
253
+ /** The nodes the function holding `id` may run after it: the later statements of each block around it, and all of a loop around it. */
254
+ function runsAfterWithinFunction(id, idMap) {
255
+ const after = new Set();
256
+ const add = (nodes) => nodes.forEach(n => model_1.RNode.collectAllIdsWithStop(n, r_function_definition_1.RFunctionDefinition.is).forEach(i => after.add(i)));
257
+ let node = idMap.get(id);
258
+ for (let parent = node && model_1.RNode.directParent(node, idMap); parent !== undefined && node !== undefined && !r_function_definition_1.RFunctionDefinition.is(parent); parent = model_1.RNode.directParent(parent, idMap)) {
259
+ if (r_expression_list_1.RExpressionList.is(parent)) {
260
+ add(parent.children.slice(parent.children.indexOf(node) + 1));
261
+ }
262
+ else if (model_1.RLoopConstructs.is(parent)) {
263
+ add([parent]);
264
+ }
265
+ node = parent;
266
+ }
267
+ return after;
268
+ }
269
+ /** The calls among `ids` of a promise read the global state where it is forced, after what the function forcing it may have `changed` (`function(code) { set.seed(1); code }`); returns the readers so linked. */
270
+ function linkAmbientReadsToWrites(graph, ids, changed) {
271
+ let access;
272
+ const readers = [];
273
+ for (const node of ids) {
274
+ for (const name of graph.ambientAccessOf(node)?.[ambient_access_1.AmbientAccessKind.Read].keys() ?? []) {
275
+ access ??= changed();
276
+ for (const kind of [ambient_access_1.AmbientAccessKind.Write, ambient_access_1.AmbientAccessKind.Local, ambient_access_1.AmbientAccessKind.Assumed]) {
277
+ for (const writer of access[kind].get(name) ?? []) {
278
+ if (!ids.has(writer)) {
279
+ graph.addEdge(node, writer, edge_1.EdgeType.Reads);
280
+ readers.push(node);
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }
286
+ return readers;
287
+ }
153
288
  /** Whether the branches of `fn` a node stands under are taken in the frame `call` makes: a parameter holds what that call hands it, so a condition on it may be constant there. */
154
289
  function branchesTakenIn(conditions, fn, call, graph, ctx) {
155
290
  let result = logic_1.Ternary.Always;
@@ -684,7 +819,7 @@ function propagateTransitiveEscapedDefinitions(graph, environment, defined, hidd
684
819
  continue;
685
820
  }
686
821
  environment = environment_1.REnvironment.define(def, false, environment);
687
- linkReadsAfter(graph, id, def, open, definitionsNamed);
822
+ linkReadsAfter(graph, id, def, open, definitionsNamed, defs);
688
823
  grew = true;
689
824
  }
690
825
  }
@@ -692,10 +827,12 @@ function propagateTransitiveEscapedDefinitions(graph, environment, defined, hidd
692
827
  return { environment, grew, names };
693
828
  }
694
829
  /** A read that may run after `call` and sees a definition the call may replace (or nothing, as with the `open` reads) may see `def` instead, as with a callee only the call binds: `g <- function(f) f(); x <- 1; g(function() x <<- 2); print(x)`, or `g(runif)`. */
695
- function linkReadsAfter(graph, call, def, open, definitionsNamed) {
830
+ function linkReadsAfter(graph, call, def, open, definitionsNamed, escaped) {
696
831
  const before = graph.getVertex(call)?.environment;
697
832
  const visible = before === undefined ? definitionsNamed(def.name) : resolve_helper_1.Resolve.byName(def.name, before)?.map(d => d.nodeId) ?? [];
698
- const replaced = new Set([...visible, ...df_helper_1.Dataflow.sourcesOf(graph, call, edge_1.EdgeType.SideEffectOnCall)]);
833
+ /* a write of the call that escapes under another name (`par` beside `plot` in the body) replaces nothing of this one */
834
+ const sameName = (id) => escaped.get(id)?.some(d => d.name === def.name) ?? true;
835
+ const replaced = new Set([...visible, ...df_helper_1.Dataflow.sourcesOf(graph, call, edge_1.EdgeType.SideEffectOnCall).filter(sameName)]);
699
836
  const readers = new Set(open.filter(r => r.name === def.name).map(r => r.nodeId));
700
837
  for (const [id] of graph.vertices(true)) {
701
838
  /* an argument reads the value of a call, not a name the call may define (an ambient state is defined at its call) */
@@ -748,7 +885,8 @@ function ambientAccessOfFunctions(from) {
748
885
  ...df_helper_1.Dataflow.callsIn(fdef, graph).map(([call]) => accessOfCall(graph, call, environment)),
749
886
  {
750
887
  ...ambient_access_1.AmbientAccess.empty,
751
- variables: relation_1.Relation.fromPairs(escaped(id, fdef).flatMap(def => names.get(def) ?? []).filter(({ name }) => !ambient_state_name_1.AmbientStateName.is(name)).map(({ name, nodeId }) => [name, nodeId]))
888
+ /* removing a global is a write of it, as far as what a function binds goes */
889
+ variables: relation_1.Relation.fromPairs(escaped(id, fdef).flatMap(def => names.get(def) ?? []).filter(({ name }) => !ambient_state_name_1.AmbientStateName.is(name)).map(({ name, nodeId }) => [(0, removal_marker_1.removedNameOf)(name), nodeId]))
752
890
  }
753
891
  ]));
754
892
  }
@@ -15,6 +15,8 @@ export declare const Quoted: {
15
15
  readonly sourcesOf: (this: void, graph: DataflowGraph, id: NodeId) => readonly CapturedExpression[];
16
16
  /** What `id` within captured code needs to run at all: the capturing call and every call evaluating it (`eval`, `body(f) <- quote(...)`). */
17
17
  readonly evaluationDependencies: (this: void, graph: DataflowGraph, id: NodeId) => NodeId[];
18
+ /** The variable a delaying call (`delayedAssign`) binds its promise to. */
19
+ readonly promisedBinding: (this: void, graph: DataflowGraph, id: NodeId) => NodeId | undefined;
18
20
  /** Links every name in `expr` against `environment` and hands back what stays unresolved. */
19
21
  readonly evaluateIn: typeof linkExpressionIn;
20
22
  /** The finishing pass over a complete graph: it settles what a call really evaluates, which the call itself could not know. */