@eagleoutice/flowr 2.6.2 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (435) hide show
  1. package/README.md +36 -34
  2. package/abstract-interpretation/data-frame/absint-visitor.d.ts +1 -1
  3. package/abstract-interpretation/data-frame/absint-visitor.js +6 -6
  4. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +4 -7
  5. package/abstract-interpretation/data-frame/dataframe-domain.js +5 -11
  6. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +3 -1
  7. package/abstract-interpretation/data-frame/mappers/access-mapper.js +3 -2
  8. package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
  9. package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +3 -1
  10. package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +3 -2
  11. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +7 -7
  12. package/abstract-interpretation/data-frame/mappers/function-mapper.js +28 -24
  13. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +3 -1
  14. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +3 -2
  15. package/abstract-interpretation/data-frame/semantics.js +54 -41
  16. package/abstract-interpretation/data-frame/shape-inference.d.ts +3 -3
  17. package/abstract-interpretation/data-frame/shape-inference.js +3 -3
  18. package/abstract-interpretation/domains/abstract-domain.d.ts +1 -0
  19. package/abstract-interpretation/domains/abstract-domain.js +3 -2
  20. package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
  21. package/abstract-interpretation/domains/interval-domain.d.ts +2 -2
  22. package/abstract-interpretation/domains/interval-domain.js +3 -6
  23. package/abstract-interpretation/domains/lattice.d.ts +2 -0
  24. package/abstract-interpretation/domains/lattice.js +3 -1
  25. package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -1
  26. package/abstract-interpretation/domains/positive-interval-domain.js +1 -1
  27. package/abstract-interpretation/domains/satisfiable-domain.d.ts +2 -2
  28. package/abstract-interpretation/domains/satisfiable-domain.js +2 -2
  29. package/abstract-interpretation/domains/set-range-domain.d.ts +98 -0
  30. package/abstract-interpretation/domains/set-range-domain.js +400 -0
  31. package/abstract-interpretation/domains/set-upper-bound-domain.js +2 -2
  32. package/abstract-interpretation/domains/singleton-domain.js +2 -2
  33. package/abstract-interpretation/normalized-ast-fold.d.ts +1 -1
  34. package/benchmark/slicer.d.ts +3 -1
  35. package/benchmark/slicer.js +50 -27
  36. package/benchmark/stats/print.js +8 -5
  37. package/benchmark/stats/stats.d.ts +3 -2
  38. package/benchmark/summarizer/data.d.ts +11 -8
  39. package/benchmark/summarizer/first-phase/process.js +12 -9
  40. package/benchmark/summarizer/second-phase/graph.d.ts +3 -1
  41. package/benchmark/summarizer/second-phase/graph.js +3 -1
  42. package/benchmark/summarizer/second-phase/process.js +24 -18
  43. package/cli/export-quads-app.js +1 -1
  44. package/cli/repl/commands/repl-dataflow.js +2 -1
  45. package/cli/repl/commands/repl-parse.js +16 -4
  46. package/cli/repl/commands/repl-query.js +1 -1
  47. package/cli/repl/core.js +16 -13
  48. package/cli/repl/server/connection.js +2 -1
  49. package/cli/script-core/statistics-helper-core.js +2 -1
  50. package/cli/slicer-app.js +3 -4
  51. package/cli/wiki.d.ts +4 -0
  52. package/cli/wiki.js +165 -0
  53. package/config.d.ts +4 -0
  54. package/config.js +6 -0
  55. package/control-flow/cfg-dead-code.js +14 -3
  56. package/control-flow/cfg-simplification.d.ts +5 -2
  57. package/control-flow/cfg-simplification.js +3 -0
  58. package/control-flow/extract-cfg.d.ts +9 -3
  59. package/control-flow/extract-cfg.js +44 -4
  60. package/control-flow/semantic-cfg-guided-visitor.d.ts +2 -2
  61. package/control-flow/simple-visitor.js +2 -2
  62. package/control-flow/useless-loop.d.ts +3 -3
  63. package/control-flow/useless-loop.js +16 -5
  64. package/core/pipeline-executor.d.ts +3 -6
  65. package/core/pipeline-executor.js +4 -7
  66. package/core/print/normalize-printer.d.ts +1 -1
  67. package/core/print/normalize-printer.js +2 -2
  68. package/core/steps/all/core/00-parse.d.ts +1 -1
  69. package/core/steps/all/core/00-parse.js +1 -1
  70. package/core/steps/all/core/10-normalize.d.ts +3 -9
  71. package/core/steps/all/core/10-normalize.js +1 -16
  72. package/core/steps/all/core/11-normalize-tree-sitter.d.ts +2 -3
  73. package/core/steps/all/core/11-normalize-tree-sitter.js +2 -3
  74. package/core/steps/all/core/20-dataflow.d.ts +3 -4
  75. package/core/steps/all/core/20-dataflow.js +2 -2
  76. package/core/steps/all/static-slicing/00-slice.d.ts +4 -2
  77. package/core/steps/all/static-slicing/00-slice.js +3 -2
  78. package/core/steps/all/static-slicing/10-reconstruct.d.ts +8 -0
  79. package/core/steps/all/static-slicing/10-reconstruct.js +4 -1
  80. package/core/steps/pipeline/default-pipelines.d.ts +94 -95
  81. package/core/steps/pipeline/default-pipelines.js +8 -8
  82. package/dataflow/cluster.js +2 -2
  83. package/dataflow/environments/append.d.ts +5 -0
  84. package/dataflow/environments/append.js +6 -20
  85. package/dataflow/environments/built-in.d.ts +2 -1
  86. package/dataflow/environments/clone.d.ts +1 -2
  87. package/dataflow/environments/clone.js +3 -17
  88. package/dataflow/environments/define.d.ts +7 -3
  89. package/dataflow/environments/define.js +9 -56
  90. package/dataflow/environments/diff.js +3 -3
  91. package/dataflow/environments/environment.d.ts +48 -28
  92. package/dataflow/environments/environment.js +187 -62
  93. package/dataflow/environments/overwrite.d.ts +1 -5
  94. package/dataflow/environments/overwrite.js +2 -61
  95. package/dataflow/environments/reference-to-maybe.d.ts +13 -0
  96. package/dataflow/environments/reference-to-maybe.js +54 -0
  97. package/dataflow/environments/resolve-by-name.d.ts +6 -1
  98. package/dataflow/environments/resolve-by-name.js +56 -4
  99. package/dataflow/environments/scoping.d.ts +8 -4
  100. package/dataflow/environments/scoping.js +13 -9
  101. package/dataflow/eval/resolve/alias-tracking.d.ts +10 -4
  102. package/dataflow/eval/resolve/alias-tracking.js +15 -13
  103. package/dataflow/eval/resolve/resolve-argument.d.ts +2 -1
  104. package/dataflow/eval/resolve/resolve-argument.js +10 -10
  105. package/dataflow/eval/resolve/resolve.d.ts +13 -11
  106. package/dataflow/eval/resolve/resolve.js +16 -15
  107. package/dataflow/eval/values/string/string-constants.d.ts +9 -3
  108. package/dataflow/eval/values/string/string-constants.js +9 -3
  109. package/dataflow/extractor.d.ts +2 -3
  110. package/dataflow/extractor.js +25 -28
  111. package/dataflow/fn/higher-order-function.d.ts +2 -1
  112. package/dataflow/fn/higher-order-function.js +4 -4
  113. package/dataflow/graph/dataflowgraph-builder.d.ts +9 -5
  114. package/dataflow/graph/dataflowgraph-builder.js +21 -11
  115. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  116. package/dataflow/graph/graph.d.ts +13 -11
  117. package/dataflow/graph/graph.js +40 -24
  118. package/dataflow/graph/invert-dfg.d.ts +3 -2
  119. package/dataflow/graph/invert-dfg.js +3 -3
  120. package/dataflow/graph/resolve-graph.d.ts +2 -1
  121. package/dataflow/graph/resolve-graph.js +2 -2
  122. package/dataflow/graph/unknown-replacement.d.ts +4 -2
  123. package/dataflow/graph/unknown-replacement.js +4 -2
  124. package/dataflow/graph/vertex.d.ts +3 -3
  125. package/dataflow/graph/vertex.js +3 -3
  126. package/dataflow/info.d.ts +8 -1
  127. package/dataflow/info.js +21 -0
  128. package/dataflow/internal/linker.js +10 -11
  129. package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +2 -2
  130. package/dataflow/internal/process/functions/call/argument/make-argument.js +2 -3
  131. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +7 -1
  132. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +12 -3
  133. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -1
  134. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -7
  135. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +2 -2
  136. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -1
  137. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -6
  138. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -14
  139. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +10 -8
  140. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +4 -4
  141. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
  142. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +10 -14
  143. package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +1 -1
  144. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -2
  145. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +3 -1
  146. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +8 -6
  147. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +1 -1
  148. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  149. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +4 -4
  150. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +6 -1
  151. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +7 -2
  152. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -5
  153. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +6 -4
  154. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +15 -10
  155. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +78 -75
  156. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +3 -1
  157. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -1
  158. package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
  159. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -5
  160. package/dataflow/internal/process/functions/call/common.d.ts +1 -1
  161. package/dataflow/internal/process/functions/call/common.js +6 -7
  162. package/dataflow/internal/process/functions/call/default-call-handling.d.ts +3 -1
  163. package/dataflow/internal/process/functions/call/default-call-handling.js +3 -1
  164. package/dataflow/internal/process/functions/call/known-call-handling.js +4 -4
  165. package/dataflow/internal/process/functions/call/named-call-handling.js +4 -4
  166. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
  167. package/dataflow/internal/process/functions/process-argument.js +1 -1
  168. package/dataflow/internal/process/functions/process-parameter.js +4 -4
  169. package/dataflow/internal/process/process-symbol.js +1 -1
  170. package/dataflow/internal/process/process-value.d.ts +1 -1
  171. package/dataflow/internal/process/process-value.js +7 -7
  172. package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -1
  173. package/dataflow/origin/dfg-get-symbol-refs.js +1 -1
  174. package/dataflow/processor.d.ts +7 -16
  175. package/documentation/data/dfg/doc-data-dfg-util.d.ts +0 -2
  176. package/documentation/data/faq/faqs.js +27 -18
  177. package/documentation/data/faq/recommended-configs.d.ts +36 -0
  178. package/documentation/data/faq/recommended-configs.js +40 -0
  179. package/documentation/data/faq/wiki-faq-store.d.ts +1 -0
  180. package/documentation/data/faq/wiki-faq-store.js +10 -2
  181. package/documentation/data/server/doc-data-server-messages.js +1 -1
  182. package/documentation/doc-capabilities.d.ts +9 -0
  183. package/documentation/{print-capabilities-markdown.js → doc-capabilities.js} +18 -21
  184. package/documentation/doc-readme.d.ts +9 -0
  185. package/documentation/{print-readme.js → doc-readme.js} +31 -35
  186. package/documentation/doc-util/doc-benchmarks.d.ts +6 -4
  187. package/documentation/doc-util/doc-benchmarks.js +6 -4
  188. package/documentation/doc-util/doc-cfg.js +5 -8
  189. package/documentation/doc-util/doc-dfg.d.ts +7 -7
  190. package/documentation/doc-util/doc-dfg.js +15 -14
  191. package/documentation/doc-util/doc-escape.d.ts +6 -0
  192. package/documentation/doc-util/doc-escape.js +11 -0
  193. package/documentation/doc-util/doc-general.d.ts +22 -2
  194. package/documentation/doc-util/doc-general.js +22 -2
  195. package/documentation/doc-util/doc-normalized-ast.d.ts +10 -5
  196. package/documentation/doc-util/doc-normalized-ast.js +14 -10
  197. package/documentation/doc-util/doc-query.d.ts +12 -4
  198. package/documentation/doc-util/doc-query.js +18 -11
  199. package/documentation/doc-util/doc-search.d.ts +0 -30
  200. package/documentation/doc-util/doc-search.js +2 -73
  201. package/documentation/doc-util/doc-server-message.d.ts +5 -5
  202. package/documentation/doc-util/doc-server-message.js +4 -4
  203. package/documentation/doc-util/doc-types.d.ts +69 -32
  204. package/documentation/doc-util/doc-types.js +109 -62
  205. package/documentation/index.d.ts +9 -9
  206. package/documentation/index.js +9 -9
  207. package/documentation/issue-linting-rule.d.ts +9 -0
  208. package/documentation/{print-linter-issue.js → issue-linting-rule.js} +20 -23
  209. package/documentation/wiki-analyzer.d.ts +9 -0
  210. package/documentation/wiki-analyzer.js +425 -0
  211. package/documentation/wiki-cfg.d.ts +9 -0
  212. package/documentation/{print-cfg-wiki.js → wiki-cfg.js} +144 -160
  213. package/documentation/wiki-core.d.ts +14 -0
  214. package/documentation/{print-core-wiki.js → wiki-core.js} +164 -175
  215. package/documentation/wiki-dataflow-graph.d.ts +9 -0
  216. package/documentation/{print-dataflow-graph-wiki.js → wiki-dataflow-graph.js} +146 -177
  217. package/documentation/wiki-engine.d.ts +9 -0
  218. package/documentation/{print-engines-wiki.js → wiki-engine.js} +27 -42
  219. package/documentation/wiki-faq.d.ts +8 -0
  220. package/documentation/wiki-faq.js +21 -0
  221. package/documentation/wiki-interface.d.ts +9 -0
  222. package/documentation/{print-interface-wiki.js → wiki-interface.js} +59 -56
  223. package/documentation/wiki-linter.d.ts +9 -0
  224. package/documentation/{print-linter-wiki.js → wiki-linter.js} +52 -48
  225. package/documentation/wiki-linting-and-testing.d.ts +9 -0
  226. package/documentation/{print-linting-and-testing-wiki.js → wiki-linting-and-testing.js} +25 -32
  227. package/documentation/wiki-mk/doc-context.d.ts +186 -0
  228. package/documentation/wiki-mk/doc-context.js +84 -0
  229. package/documentation/wiki-mk/doc-maker.d.ts +95 -0
  230. package/documentation/wiki-mk/doc-maker.js +134 -0
  231. package/documentation/wiki-normalized-ast.d.ts +9 -0
  232. package/documentation/{print-normalized-ast-wiki.js → wiki-normalized-ast.js} +64 -47
  233. package/documentation/wiki-onboarding.d.ts +8 -0
  234. package/documentation/{print-onboarding-wiki.js → wiki-onboarding.js} +18 -15
  235. package/documentation/wiki-query.d.ts +9 -0
  236. package/documentation/{print-query-wiki.js → wiki-query.js} +62 -47
  237. package/documentation/wiki-search.d.ts +9 -0
  238. package/documentation/wiki-search.js +61 -0
  239. package/linter/linter-executor.js +3 -2
  240. package/linter/linter-format.d.ts +2 -2
  241. package/linter/linter-rules.d.ts +15 -19
  242. package/linter/rules/absolute-path.d.ts +1 -2
  243. package/linter/rules/absolute-path.js +5 -5
  244. package/linter/rules/dataframe-access-validation.d.ts +2 -2
  245. package/linter/rules/dataframe-access-validation.js +13 -9
  246. package/linter/rules/dead-code.d.ts +1 -1
  247. package/linter/rules/deprecated-functions.d.ts +1 -5
  248. package/linter/rules/file-path-validity.d.ts +1 -1
  249. package/linter/rules/file-path-validity.js +4 -4
  250. package/linter/rules/function-finder-util.d.ts +3 -7
  251. package/linter/rules/function-finder-util.js +1 -1
  252. package/linter/rules/naming-convention.d.ts +2 -2
  253. package/linter/rules/naming-convention.js +1 -1
  254. package/linter/rules/network-functions.d.ts +1 -1
  255. package/linter/rules/network-functions.js +1 -1
  256. package/linter/rules/seeded-randomness.d.ts +4 -3
  257. package/linter/rules/seeded-randomness.js +38 -18
  258. package/linter/rules/unused-definition.d.ts +1 -1
  259. package/linter/rules/useless-loop.d.ts +2 -2
  260. package/linter/rules/useless-loop.js +2 -2
  261. package/package.json +5 -17
  262. package/project/cache/flowr-analyzer-cache.d.ts +7 -10
  263. package/project/cache/flowr-analyzer-cache.js +17 -38
  264. package/project/cache/flowr-analyzer-controlflow-cache.d.ts +34 -0
  265. package/project/cache/flowr-analyzer-controlflow-cache.js +79 -0
  266. package/project/context/flowr-analyzer-context.d.ts +37 -5
  267. package/project/context/flowr-analyzer-context.js +51 -4
  268. package/project/context/flowr-analyzer-environment-context.d.ts +47 -0
  269. package/project/context/flowr-analyzer-environment-context.js +50 -0
  270. package/project/context/flowr-analyzer-files-context.d.ts +63 -13
  271. package/project/context/flowr-analyzer-files-context.js +110 -39
  272. package/project/context/flowr-file.d.ts +32 -10
  273. package/project/context/flowr-file.js +30 -9
  274. package/project/flowr-analyzer-builder.d.ts +22 -28
  275. package/project/flowr-analyzer-builder.js +32 -70
  276. package/project/flowr-analyzer.d.ts +55 -14
  277. package/project/flowr-analyzer.js +53 -8
  278. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +7 -1
  279. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +13 -5
  280. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +3 -3
  281. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +11 -5
  282. package/project/plugins/file-plugins/flowr-description-file.d.ts +3 -3
  283. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +22 -0
  284. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +33 -0
  285. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +22 -0
  286. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +33 -0
  287. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +22 -0
  288. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +33 -0
  289. package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.d.ts +20 -0
  290. package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.js +42 -0
  291. package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.d.ts +59 -0
  292. package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.js +132 -0
  293. package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
  294. package/project/plugins/file-plugins/notebooks/notebook.js +2 -0
  295. package/project/plugins/flowr-analyzer-plugin-defaults.d.ts +5 -0
  296. package/project/plugins/flowr-analyzer-plugin-defaults.js +23 -0
  297. package/project/plugins/flowr-analyzer-plugin.d.ts +2 -0
  298. package/project/plugins/flowr-analyzer-plugin.js +2 -0
  299. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
  300. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  301. package/project/plugins/plugin-registry.d.ts +34 -0
  302. package/project/plugins/plugin-registry.js +62 -0
  303. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
  304. package/queries/catalog/call-context-query/call-context-query-executor.js +5 -6
  305. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +5 -2
  306. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +25 -18
  307. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
  308. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
  309. package/queries/catalog/control-flow-query/control-flow-query-format.js +3 -2
  310. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
  311. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
  312. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
  313. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
  314. package/queries/catalog/dependencies-query/dependencies-query-executor.js +5 -5
  315. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
  316. package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
  317. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
  318. package/queries/catalog/df-shape-query/df-shape-query-executor.js +2 -2
  319. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +6 -6
  320. package/queries/catalog/df-shape-query/df-shape-query-format.js +8 -7
  321. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +2 -1
  322. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
  323. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
  324. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
  325. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +1 -1
  326. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +4 -4
  327. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +1 -1
  328. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
  329. package/queries/catalog/linter-query/linter-query-format.js +13 -2
  330. package/queries/catalog/location-map-query/location-map-query-executor.js +2 -1
  331. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  332. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  333. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
  334. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  335. package/queries/catalog/project-query/project-query-executor.js +3 -1
  336. package/queries/catalog/project-query/project-query-format.d.ts +1 -1
  337. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +2 -2
  338. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +3 -3
  339. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  340. package/queries/catalog/search-query/search-query-format.d.ts +1 -1
  341. package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -2
  342. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
  343. package/queries/catalog/static-slice-query/static-slice-query-format.js +13 -1
  344. package/queries/query.d.ts +26 -18
  345. package/queries/query.js +21 -1
  346. package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -1
  347. package/r-bridge/lang-4.x/ast/model/collect.js +4 -0
  348. package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +29 -0
  349. package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +15 -0
  350. package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +5 -7
  351. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +24 -11
  352. package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -0
  353. package/r-bridge/lang-4.x/ast/model/type.js +2 -0
  354. package/r-bridge/lang-4.x/ast/parser/json/format.js +1 -1
  355. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +9 -8
  356. package/r-bridge/lang-4.x/ast/parser/json/parser.js +11 -10
  357. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.d.ts +4 -3
  358. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +20 -11
  359. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +3 -3
  360. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +5 -4
  361. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +3 -2
  362. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +14 -5
  363. package/r-bridge/parser.d.ts +15 -5
  364. package/r-bridge/parser.js +27 -13
  365. package/r-bridge/retriever.d.ts +9 -15
  366. package/r-bridge/retriever.js +14 -5
  367. package/r-bridge/shell.d.ts +1 -1
  368. package/r-bridge/shell.js +1 -1
  369. package/reconstruct/auto-select/auto-select-defaults.d.ts +0 -1
  370. package/reconstruct/auto-select/magic-comments.js +1 -1
  371. package/reconstruct/reconstruct.d.ts +17 -9
  372. package/reconstruct/reconstruct.js +19 -8
  373. package/search/flowr-search.d.ts +12 -0
  374. package/search/search-executor/search-enrichers.d.ts +9 -2
  375. package/search/search-executor/search-enrichers.js +1 -3
  376. package/search/search-executor/search-generators.d.ts +1 -1
  377. package/search/search-executor/search-generators.js +9 -4
  378. package/slicing/criterion/collect-all.d.ts +3 -2
  379. package/slicing/criterion/collect-all.js +1 -1
  380. package/slicing/criterion/parse.js +4 -4
  381. package/slicing/static/slice-call.d.ts +3 -2
  382. package/slicing/static/slice-call.js +4 -4
  383. package/slicing/static/static-slicer.d.ts +3 -1
  384. package/slicing/static/static-slicer.js +6 -7
  385. package/statistics/features/supported/assignments/assignments.js +1 -1
  386. package/statistics/features/supported/control-flow/control-flow.js +2 -2
  387. package/statistics/features/supported/data-access/data-access.js +1 -1
  388. package/statistics/features/supported/defined-functions/defined-functions.js +1 -1
  389. package/statistics/features/supported/expression-list/statistics-expression-list.js +1 -1
  390. package/statistics/features/supported/loops/loops.js +1 -1
  391. package/statistics/features/supported/used-functions/used-functions.js +2 -2
  392. package/statistics/features/supported/variables/variables.js +3 -2
  393. package/statistics/statistics.js +3 -2
  394. package/util/assert.d.ts +4 -0
  395. package/util/assert.js +4 -0
  396. package/util/containers.js +1 -1
  397. package/util/files.d.ts +1 -1
  398. package/util/files.js +1 -1
  399. package/util/mermaid/ast.d.ts +4 -3
  400. package/util/mermaid/ast.js +36 -8
  401. package/util/mermaid/cfg.js +1 -1
  402. package/util/mermaid/dfg.d.ts +1 -0
  403. package/util/mermaid/dfg.js +3 -3
  404. package/util/simple-df/dfg-view.d.ts +2 -1
  405. package/util/simple-df/dfg-view.js +2 -2
  406. package/util/version.js +1 -1
  407. package/dataflow/environments/remove.d.ts +0 -12
  408. package/dataflow/environments/remove.js +0 -52
  409. package/documentation/print-analyzer-wiki.d.ts +0 -1
  410. package/documentation/print-analyzer-wiki.js +0 -141
  411. package/documentation/print-capabilities-markdown.d.ts +0 -1
  412. package/documentation/print-cfg-wiki.d.ts +0 -1
  413. package/documentation/print-core-wiki.d.ts +0 -5
  414. package/documentation/print-dataflow-graph-wiki.d.ts +0 -1
  415. package/documentation/print-engines-wiki.d.ts +0 -1
  416. package/documentation/print-faq-wiki.d.ts +0 -1
  417. package/documentation/print-faq-wiki.js +0 -18
  418. package/documentation/print-interface-wiki.d.ts +0 -1
  419. package/documentation/print-linter-issue.d.ts +0 -1
  420. package/documentation/print-linter-wiki.d.ts +0 -1
  421. package/documentation/print-linting-and-testing-wiki.d.ts +0 -1
  422. package/documentation/print-normalized-ast-wiki.d.ts +0 -1
  423. package/documentation/print-onboarding-wiki.d.ts +0 -1
  424. package/documentation/print-query-wiki.d.ts +0 -1
  425. package/documentation/print-readme.d.ts +0 -1
  426. package/documentation/print-search-wiki.d.ts +0 -1
  427. package/documentation/print-search-wiki.js +0 -74
  428. package/util/formats/adapter-format.d.ts +0 -6
  429. package/util/formats/adapter-format.js +0 -3
  430. package/util/formats/adapter.d.ts +0 -27
  431. package/util/formats/adapter.js +0 -58
  432. package/util/formats/adapters/r-adapter.d.ts +0 -4
  433. package/util/formats/adapters/r-adapter.js +0 -7
  434. package/util/formats/adapters/rmd-adapter.d.ts +0 -35
  435. package/util/formats/adapters/rmd-adapter.js +0 -100
@@ -2,24 +2,21 @@ import { type RShell } from './shell';
2
2
  import type { AsyncOrSync } from 'ts-essentials';
3
3
  import { RShellExecutor } from './shell-executor';
4
4
  import { type NormalizedAst } from './lang-4.x/ast/model/processing/decorate';
5
- import type { SupportedFormats } from '../util/formats/adapter-format';
6
5
  export declare const fileProtocol = "file://";
7
- export interface ParseRequestAdditionalInfoBase {
8
- type: SupportedFormats;
9
- }
10
- export interface RParseRequestFromFile<AdditionalInfo extends ParseRequestAdditionalInfoBase = ParseRequestAdditionalInfoBase> {
6
+ export interface RParseRequestFromFile {
11
7
  readonly request: 'file';
12
8
  /**
13
- * The path to the file (an absolute path is probably best here).
9
+ * The path to the file represented in the {@link FlowrAnalyzerFilesContext}.
14
10
  * See {@link RParseRequests} for multiple files.
15
11
  */
16
12
  readonly content: string;
17
- /**
18
- * Additional info from different file formates like .Rmd
19
- */
20
- readonly info?: AdditionalInfo;
21
13
  }
22
- export interface RParseRequestFromText<AdditionalInfo extends ParseRequestAdditionalInfoBase = ParseRequestAdditionalInfoBase> {
14
+ /**
15
+ * A request to parse R code given as text.
16
+ * This option is mostly useful for quick tests or injects, as usually files are controlled by the {@link RParseRequestFromFile} request
17
+ * referring to a file in the {@link FlowrAnalyzerFilesContext}.
18
+ */
19
+ export interface RParseRequestFromText {
23
20
  readonly request: 'text';
24
21
  /**
25
22
  * Source code to parse (not a file path).
@@ -28,10 +25,6 @@ export interface RParseRequestFromText<AdditionalInfo extends ParseRequestAdditi
28
25
  * or concatenate their contents to pass them with this request.
29
26
  */
30
27
  readonly content: string;
31
- /**
32
- * Additional info from different file formates like .Rmd
33
- */
34
- readonly info?: AdditionalInfo;
35
28
  }
36
29
  /**
37
30
  * A provider for an {@link RParseRequests} that can be used, for example, to override source file parsing behavior in tests
@@ -77,6 +70,7 @@ export declare function retrieveParseDataFromRCode(request: RParseRequest, shell
77
70
  /**
78
71
  * Uses {@link retrieveParseDataFromRCode} and returns the nicely formatted object-AST.
79
72
  * If successful, allows further querying the last result with {@link retrieveNumberOfRTokensOfLastParse}.
73
+ * This function is outdated and should only be used for legacy reasons. Please use the {@link FlowrAnalyzer} instead.
80
74
  */
81
75
  export declare function retrieveNormalizedAstFromRCode(request: RParseRequest, shell: RShell): Promise<NormalizedAst>;
82
76
  /**
@@ -23,7 +23,6 @@ const decorate_1 = require("./lang-4.x/ast/model/processing/decorate");
23
23
  const type_1 = require("./lang-4.x/ast/model/type");
24
24
  const fs_1 = __importDefault(require("fs"));
25
25
  const path_1 = __importDefault(require("path"));
26
- const adapter_1 = require("../util/formats/adapter");
27
26
  exports.fileProtocol = 'file://';
28
27
  /**
29
28
  * Type guard for {@link RParseRequest}
@@ -39,18 +38,25 @@ function isParseRequest(request) {
39
38
  * If your input starts with {@link fileProtocol}, it is assumed to be a file path and will be processed as such.
40
39
  * Giving an array, you can mix file paths and text content (again using the {@link fileProtocol}).
41
40
  *
41
+ * To obtain a {@link FlowrAnalyzerContext} from such an input, use {@link contextFromInput}.
42
42
  */
43
- function requestFromInput(input, fileTypeHint) {
43
+ function requestFromInput(input) {
44
44
  if (Array.isArray(input)) {
45
45
  return input.flatMap(requestFromInput);
46
46
  }
47
47
  const content = input;
48
48
  const file = content.startsWith(exports.fileProtocol);
49
49
  if (file) {
50
- return (0, adapter_1.requestFromFile)(content.slice(7));
50
+ return {
51
+ request: 'file',
52
+ content: content.substring(exports.fileProtocol.length),
53
+ };
51
54
  }
52
55
  else {
53
- return (0, adapter_1.requestFromText)(content, fileTypeHint);
56
+ return {
57
+ request: 'text',
58
+ content
59
+ };
54
60
  }
55
61
  }
56
62
  /**
@@ -134,10 +140,13 @@ function retrieveParseDataFromRCode(request, shell) {
134
140
  /**
135
141
  * Uses {@link retrieveParseDataFromRCode} and returns the nicely formatted object-AST.
136
142
  * If successful, allows further querying the last result with {@link retrieveNumberOfRTokensOfLastParse}.
143
+ * This function is outdated and should only be used for legacy reasons. Please use the {@link FlowrAnalyzer} instead.
137
144
  */
138
145
  async function retrieveNormalizedAstFromRCode(request, shell) {
139
146
  const data = await retrieveParseDataFromRCode(request, shell);
140
- return (0, parser_1.normalize)({ parsed: data }, (0, decorate_1.deterministicCountingIdGenerator)(0), request.request === 'file' ? request.content : undefined);
147
+ return (0, parser_1.normalize)({
148
+ files: [{ parsed: data, filePath: request.request === 'file' ? request.content : undefined }]
149
+ }, (0, decorate_1.deterministicCountingIdGenerator)(0));
141
150
  }
142
151
  /**
143
152
  * If the string has (R-)quotes around it, they will be removed; otherwise the string is returned unchanged.
@@ -70,7 +70,7 @@ export interface RShellOptions extends RShellSessionOptions {
70
70
  }
71
71
  export declare const DEFAULT_R_PATH: string;
72
72
  /**
73
- *
73
+ * Get the default RShell options, possibly using the given config to override some values
74
74
  */
75
75
  export declare function getDefaultRShellOptions(config?: RShellEngineConfig): RShellOptions;
76
76
  /**
package/r-bridge/shell.js CHANGED
@@ -62,7 +62,7 @@ exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = {
62
62
  exports.DEFAULT_R_PATH = (0, os_1.getPlatform)() === 'windows' ? 'R.exe' : 'R';
63
63
  let DEFAULT_R_SHELL_OPTIONS = undefined;
64
64
  /**
65
- *
65
+ * Get the default RShell options, possibly using the given config to override some values
66
66
  */
67
67
  function getDefaultRShellOptions(config) {
68
68
  if (!DEFAULT_R_SHELL_OPTIONS) {
@@ -6,7 +6,6 @@ import type { ParentInformation, NormalizedAst } from '../../r-bridge/lang-4.x/a
6
6
  * independent of if it is selected by the slice or not.
7
7
  * @see reconstructToCode
8
8
  * @see doNotAutoSelect
9
- * @see autoSelectLibrary
10
9
  */
11
10
  export type AutoSelectPredicate = (node: RNode<ParentInformation>, fullAst: NormalizedAst) => boolean;
12
11
  /**
@@ -52,7 +52,7 @@ function makeMagicCommentHandler(and) {
52
52
  if (!lines) {
53
53
  lines = new Set();
54
54
  const startLineStack = [];
55
- (0, visitor_1.visitAst)(normalizedAst.ast, n => {
55
+ (0, visitor_1.visitAst)(normalizedAst.ast.files.map(f => f.root), n => {
56
56
  const comments = n.info.additionalTokens;
57
57
  if (!comments) {
58
58
  return;
@@ -6,19 +6,27 @@
6
6
  import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
7
7
  import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
8
8
  import { type AutoSelectPredicate } from './auto-select/auto-select-defaults';
9
- type Selection = ReadonlySet<NodeId>;
9
+ interface Selection {
10
+ /**
11
+ * The set of node ids to be reconstructed.
12
+ */
13
+ nodes: ReadonlySet<NodeId>;
14
+ /**
15
+ * @see {@link ReconstructRequiredInput#reconstructFiles}
16
+ */
17
+ reconstructFiles?: 'all' | number[];
18
+ }
10
19
  export declare const reconstructLogger: import("tslog").Logger<import("tslog").ILogObj>;
11
20
  export interface ReconstructionResult {
12
- code: string;
21
+ /** Returns the reconstructed code as string or array of code reconstructions (corresponding to the desired file indices in the {@link Selection}) */
22
+ code: string | string[];
13
23
  /** number of lines that contain nodes that triggered the `autoSelectIf` predicate {@link reconstructToCode} */
14
24
  linesWithAutoSelected: number;
15
25
  }
16
- /**
17
- * Reconstructs parts of a normalized R ast into R code on an expression basis.
18
- * @param ast - The {@link NormalizedAst|normalized ast} to be used as a basis for reconstruction
19
- * @param selection - The selection of nodes to be reconstructed (probably the {@link NodeId|NodeIds} identified by the slicer)
20
- * @param autoSelectIf - A predicate that can be used to force the reconstruction of a node (for example to reconstruct library call statements, see {@link autoSelectLibrary}, {@link doNotAutoSelect})
21
- * @returns The number of lines for which `autoSelectIf` triggered, as well as the reconstructed code itself.
22
- */
26
+ export declare function reconstructToCode(ast: NormalizedAst, selection: Selection & {
27
+ reconstructFiles?: [number] | undefined;
28
+ }, autoSelectIf?: AutoSelectPredicate): ReconstructionResult & {
29
+ code: string;
30
+ };
23
31
  export declare function reconstructToCode(ast: NormalizedAst, selection: Selection, autoSelectIf?: AutoSelectPredicate): ReconstructionResult;
24
32
  export {};
@@ -408,25 +408,25 @@ function getIndentString(indent) {
408
408
  function prettyPrintCodeToString(code, lf = '\n') {
409
409
  return code.map(({ line, indent }) => `${getIndentString(indent)}${line}`).join(lf);
410
410
  }
411
- function removeOuterExpressionListIfApplicable(result, linesWithAutoSelected) {
411
+ function removeOuterExpressionListIfApplicable(result) {
412
412
  if (result.length > 1 && result[0].line === '{' && result[result.length - 1].line === '}') {
413
413
  // remove outer block
414
- return { code: prettyPrintCodeToString(indentBy(result.slice(1, result.length - 1), -1)), linesWithAutoSelected };
414
+ return prettyPrintCodeToString(indentBy(result.slice(1, result.length - 1), -1));
415
415
  }
416
416
  else {
417
- return { code: prettyPrintCodeToString(result), linesWithAutoSelected };
417
+ return prettyPrintCodeToString(result);
418
418
  }
419
419
  }
420
420
  /**
421
421
  * Reconstructs parts of a normalized R ast into R code on an expression basis.
422
422
  * @param ast - The {@link NormalizedAst|normalized ast} to be used as a basis for reconstruction
423
423
  * @param selection - The selection of nodes to be reconstructed (probably the {@link NodeId|NodeIds} identified by the slicer)
424
- * @param autoSelectIf - A predicate that can be used to force the reconstruction of a node (for example to reconstruct library call statements, see {@link autoSelectLibrary}, {@link doNotAutoSelect})
424
+ * @param autoSelectIf - A predicate that can be used to force the reconstruction of a node
425
425
  * @returns The number of lines for which `autoSelectIf` triggered, as well as the reconstructed code itself.
426
426
  */
427
427
  function reconstructToCode(ast, selection, autoSelectIf = auto_select_defaults_1.doNotAutoSelect) {
428
428
  if (exports.reconstructLogger.settings.minLevel <= 1 /* LogLevel.Trace */) {
429
- exports.reconstructLogger.trace(`reconstruct ast with ids: ${JSON.stringify([...selection])}`);
429
+ exports.reconstructLogger.trace(`reconstruct ast with ids: ${JSON.stringify([...selection.nodes])} for files: ${JSON.stringify(selection.reconstructFiles)}`);
430
430
  }
431
431
  // we use a wrapper to count the number of lines for which the autoSelectIf predicate triggered
432
432
  const linesWithAutoSelected = new Set();
@@ -439,9 +439,20 @@ function reconstructToCode(ast, selection, autoSelectIf = auto_select_defaults_1
439
439
  }
440
440
  return result;
441
441
  };
442
+ const indices = selection.reconstructFiles === 'all' ? ast.ast.files.map((_, i) => i) : (selection.reconstructFiles ?? [0]);
443
+ (0, assert_1.guard)(indices.every(i => i >= 0 && i < ast.ast.files.length), `reconstructToCode: reconstructFiles contains invalid file indices: ${JSON.stringify(indices)} for ast with ${ast.ast.files.length} files`);
444
+ const results = [];
442
445
  // fold of the normalized ast
443
- const result = (0, stateful_fold_1.foldAstStateful)(ast.ast, { selection, autoSelectIf: autoSelectIfWrapper, fullAst: ast }, reconstructAstFolds);
444
- (0, log_1.expensiveTrace)(exports.reconstructLogger, () => `reconstructed ast before string conversion: ${JSON.stringify(result)}`);
445
- return removeOuterExpressionListIfApplicable(result, linesWithAutoSelected.size);
446
+ for (const i of indices) {
447
+ if (exports.reconstructLogger.settings.minLevel <= 1 /* LogLevel.Trace */) {
448
+ exports.reconstructLogger.trace(`reconstructing file index ${i} with root id ${ast.ast.files[i].root.info.id}`);
449
+ }
450
+ results.push(removeOuterExpressionListIfApplicable((0, stateful_fold_1.foldAstStateful)(ast.ast.files[i].root, { selection: selection.nodes, autoSelectIf: autoSelectIfWrapper, fullAst: ast }, reconstructAstFolds)));
451
+ }
452
+ (0, log_1.expensiveTrace)(exports.reconstructLogger, () => `reconstructed ast before string conversion: ${JSON.stringify(results)}`);
453
+ return {
454
+ code: indices.length === 1 ? results[0] : results,
455
+ linesWithAutoSelected: linesWithAutoSelected.size
456
+ };
446
457
  }
447
458
  //# sourceMappingURL=reconstruct.js.map
@@ -41,6 +41,18 @@ export interface FlowrSearchGetFilter extends Record<string, unknown> {
41
41
  * The node must have the given id.
42
42
  */
43
43
  readonly id?: NodeId;
44
+ /**
45
+ * The node must stem form a file with the given path matching the regex
46
+ * Please note that you can address the full path!
47
+ * @example
48
+ * ```ts
49
+ * // matches all files in any 'tests' folder
50
+ * filePath: '.*\\tests\\.*'
51
+ * // matches all files named 'myfile.R' in any folder
52
+ * filePath: '.*\\/myfile\\.R$'
53
+ * ```
54
+ */
55
+ readonly filePathRegex?: string;
44
56
  }
45
57
  /** Intentionally, we abstract away from an array to avoid the use of conventional typescript operations */
46
58
  export declare class FlowrSearchElements<Info = NoInfo, Elements extends FlowrSearchElement<Info>[] = FlowrSearchElement<Info>[]> {
@@ -10,6 +10,7 @@ import { type CfgSimplificationPassName } from '../../control-flow/cfg-simplific
10
10
  import type { AsyncOrSync } from 'ts-essentials';
11
11
  import type { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer';
12
12
  import type { DataflowInformation } from '../../dataflow/info';
13
+ import type { FlowrConfigOptions } from '../../config';
13
14
  export interface EnrichmentData<ElementContent extends MergeableRecord, ElementArguments = undefined, SearchContent extends MergeableRecord = never, SearchArguments = ElementArguments> {
14
15
  /**
15
16
  * A function that is applied to each element of the search to enrich it with additional data.
@@ -18,6 +19,7 @@ export interface EnrichmentData<ElementContent extends MergeableRecord, ElementA
18
19
  dataflow: DataflowInformation;
19
20
  normalize: NormalizedAst;
20
21
  cfg: ControlFlowInformation;
22
+ config: FlowrConfigOptions;
21
23
  }, args: ElementArguments | undefined, previousValue: ElementContent | undefined) => AsyncOrSync<ElementContent>;
22
24
  readonly enrichSearch?: (search: FlowrSearchElements<ParentInformation>, data: ReadonlyFlowrAnalysisProvider, args: SearchArguments | undefined, previousValue: SearchContent | undefined) => AsyncOrSync<SearchContent>;
23
25
  /**
@@ -98,6 +100,7 @@ export declare const Enrichments: {
98
100
  dataflow: DataflowInformation;
99
101
  normalize: NormalizedAst;
100
102
  cfg: ControlFlowInformation;
103
+ config: FlowrConfigOptions;
101
104
  }, args: {
102
105
  onlyBuiltin?: boolean;
103
106
  } | undefined, prev: CallTargetsContent | undefined) => CallTargetsContent;
@@ -108,6 +111,7 @@ export declare const Enrichments: {
108
111
  dataflow: DataflowInformation;
109
112
  normalize: NormalizedAst;
110
113
  cfg: ControlFlowInformation;
114
+ config: FlowrConfigOptions;
111
115
  }, args: Omit<LinkToLastCall<import("../../queries/catalog/call-context-query/call-context-query-format").CallNameTypes>, "type">[] | undefined, prev: LastCallContent | undefined) => LastCallContent;
112
116
  mapper: ({ linkedIds }: LastCallContent) => FlowrSearchElement<ParentInformation>[];
113
117
  };
@@ -116,19 +120,21 @@ export declare const Enrichments: {
116
120
  dataflow: DataflowInformation;
117
121
  normalize: NormalizedAst;
118
122
  cfg: ControlFlowInformation;
123
+ config: FlowrConfigOptions;
119
124
  }, _args: CfgInformationArguments | undefined, prev: CfgInformationElementContent | undefined) => {
120
125
  isRoot: boolean;
121
126
  isReachable: boolean | undefined;
122
127
  };
123
- enrichSearch: (_search: FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, data: ReadonlyFlowrAnalysisProvider, args: CfgInformationArguments | undefined, prev: CfgInformationSearchContent | undefined) => Promise<CfgInformationSearchContent>;
128
+ enrichSearch: (_search: FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, data: ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>, args: CfgInformationArguments | undefined, prev: CfgInformationSearchContent | undefined) => Promise<CfgInformationSearchContent>;
124
129
  };
125
130
  readonly "query-data": {
126
131
  enrichElement: (_e: FlowrSearchElement<ParentInformation>, _search: FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, _data: {
127
132
  dataflow: DataflowInformation;
128
133
  normalize: NormalizedAst;
129
134
  cfg: ControlFlowInformation;
135
+ config: FlowrConfigOptions;
130
136
  }, args: QueryDataElementContent | undefined, prev: QueryDataElementContent | undefined) => QueryDataElementContent;
131
- enrichSearch: (_search: FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, _data: ReadonlyFlowrAnalysisProvider, args: QueryDataSearchContent | undefined, prev: QueryDataSearchContent | undefined) => Required<QueryDataSearchContent>;
137
+ enrichSearch: (_search: FlowrSearchElements<ParentInformation, FlowrSearchElement<ParentInformation>[]>, _data: ReadonlyFlowrAnalysisProvider<import("../../r-bridge/parser").KnownParser>, args: QueryDataSearchContent | undefined, prev: QueryDataSearchContent | undefined) => Required<QueryDataSearchContent>;
132
138
  };
133
139
  };
134
140
  /**
@@ -145,4 +151,5 @@ export declare function enrichElement<Element extends FlowrSearchElement<ParentI
145
151
  dataflow: DataflowInformation;
146
152
  normalize: NormalizedAst;
147
153
  cfg: ControlFlowInformation;
154
+ config: FlowrConfigOptions;
148
155
  }, enrichment: E, args?: EnrichmentElementArguments<E>): Promise<Element>;
@@ -7,7 +7,6 @@ const objects_1 = require("../../util/objects");
7
7
  const vertex_1 = require("../../dataflow/graph/vertex");
8
8
  const identify_link_to_last_call_relation_1 = require("../../queries/catalog/call-context-query/identify-link-to-last-call-relation");
9
9
  const assert_1 = require("../../util/assert");
10
- const extract_cfg_1 = require("../../control-flow/extract-cfg");
11
10
  const dfg_get_origin_1 = require("../../dataflow/origin/dfg-get-origin");
12
11
  const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
13
12
  const cfg_simplification_1 = require("../../control-flow/cfg-simplification");
@@ -76,9 +75,8 @@ exports.Enrichments = {
76
75
  const content = prev ?? { linkedIds: [] };
77
76
  const vertex = data.dataflow.graph.get(e.node.info.id);
78
77
  if (vertex !== undefined && vertex[0].tag === vertex_1.VertexType.FunctionCall) {
79
- const cfg = (0, extract_cfg_1.extractCfgQuick)(data.normalize);
80
78
  for (const arg of args) {
81
- const lastCalls = (0, identify_link_to_last_call_relation_1.identifyLinkToLastCallRelation)(vertex[0].id, cfg.graph, data.dataflow.graph, {
79
+ const lastCalls = (0, identify_link_to_last_call_relation_1.identifyLinkToLastCallRelation)(vertex[0].id, data.cfg.graph, data.dataflow.graph, {
82
80
  ...arg,
83
81
  callName: (0, call_context_query_executor_1.promoteCallName)(arg.callName),
84
82
  type: 'link-to-last-call',
@@ -28,7 +28,7 @@ export declare const generators: {
28
28
  readonly syntax: typeof generateSyntax;
29
29
  };
30
30
  declare function generateAll(data: ReadonlyFlowrAnalysisProvider): Promise<FlowrSearchElements<ParentInformation>>;
31
- declare function generateGet(input: ReadonlyFlowrAnalysisProvider, { filter: { line, column, id, name, nameIsRegex } }: {
31
+ declare function generateGet(input: ReadonlyFlowrAnalysisProvider, { filter: { line, column, id, name, nameIsRegex, filePathRegex } }: {
32
32
  filter: FlowrSearchGetFilter;
33
33
  }): Promise<FlowrSearchElements<ParentInformation>>;
34
34
  declare function generateFrom(_input: ReadonlyFlowrAnalysisProvider, args: {
@@ -30,13 +30,18 @@ async function getAllNodes(data) {
30
30
  return [...new Map([...normalize.idMap.values()].map(n => [n.info.id, n]))
31
31
  .values()];
32
32
  }
33
- async function generateGet(input, { filter: { line, column, id, name, nameIsRegex } }) {
33
+ async function generateGet(input, { filter: { line, column, id, name, nameIsRegex, filePathRegex } }) {
34
34
  const normalize = await input.normalize();
35
35
  let potentials = (id ?
36
36
  [normalize.idMap.get(id)].filter(assert_1.isNotUndefined) :
37
37
  await getAllNodes(input));
38
+ if (filePathRegex) {
39
+ const filePathFilter = new RegExp(filePathRegex);
40
+ potentials = potentials.filter(({ info }) => info.file && filePathFilter.test(info.file));
41
+ }
38
42
  if (line && line < 0) {
39
- const maxLines = normalize.ast.info.fullRange?.[2] ??
43
+ (0, assert_1.guard)(normalize.ast.files.length === 1, 'Currently, negative line numbers are only supported for single-file inputs');
44
+ const maxLines = normalize.ast.files[0].root.info.fullRange?.[2] ??
40
45
  (id ? (await getAllNodes(input)) : potentials).reduce((maxLine, { location }) => location && location[2] > maxLine ? location[2] : maxLine, 0);
41
46
  line = maxLines + line + 1;
42
47
  }
@@ -85,7 +90,7 @@ async function generateFromQuery(input, args) {
85
90
  .enrich(input, search_enrichers_1.Enrichment.QueryData, { queries: result });
86
91
  return elements.mutate(s => Promise.all(s.map(async (e) => {
87
92
  const [query, _] = [...nodesByQuery].find(([_, nodes]) => nodes.has(e));
88
- return await (0, search_enrichers_1.enrichElement)(e, elements, { normalize, dataflow, cfg }, search_enrichers_1.Enrichment.QueryData, { query });
93
+ return await (0, search_enrichers_1.enrichElement)(e, elements, { normalize, dataflow, cfg, config: input.flowrConfig }, search_enrichers_1.Enrichment.QueryData, { query });
89
94
  })));
90
95
  }
91
96
  async function generateSyntax(input, args) {
@@ -107,7 +112,7 @@ async function generateSyntax(input, args) {
107
112
  return new flowr_search_1.FlowrSearchElements([]);
108
113
  }
109
114
  const nodesByTreeSitterId = new Map();
110
- (0, visitor_1.visitAst)((await input.normalize()).ast, node => {
115
+ (0, visitor_1.visitAst)((await input.normalize()).ast.files.map(f => f.root), node => {
111
116
  const treeSitterInfo = node.info;
112
117
  if (treeSitterInfo.treeSitterId) {
113
118
  nodesByTreeSitterId.set(treeSitterInfo.treeSitterId, node);
@@ -5,8 +5,9 @@
5
5
  */
6
6
  import type { MergeableRecord } from '../../util/objects';
7
7
  import type { SlicingCriteria } from './parse';
8
- import type { RNodeWithParent } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
8
+ import type { ParentInformation, RNodeWithParent } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
9
9
  import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
10
+ import type { RProject } from '../../r-bridge/lang-4.x/ast/model/nodes/r-project';
10
11
  /**
11
12
  * Defines the filter for collecting all possible slicing criteria.
12
13
  * @see DefaultAllVariablesFilter
@@ -34,4 +35,4 @@ export interface SlicingCriteriaFilter extends MergeableRecord {
34
35
  * The slicing criteria will be *ordered* (i.e., it will not return `[1:2,3:4]` and `[3:4,1:2]` if `maximumSize` \> 1).
35
36
  * If there are not enough matching nodes within the ast, this will return *no* slicing criteria!
36
37
  */
37
- export declare function collectAllSlicingCriteria<OtherInfo>(ast: RNodeWithParent<OtherInfo>, filter: Readonly<SlicingCriteriaFilter>): Generator<SlicingCriteria, void, void>;
38
+ export declare function collectAllSlicingCriteria<OtherInfo>(ast: RProject<OtherInfo & ParentInformation>, filter: Readonly<SlicingCriteriaFilter>): Generator<SlicingCriteria, void, void>;
@@ -12,7 +12,7 @@ const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-fun
12
12
  function* collectAllSlicingCriteria(ast, filter) {
13
13
  (0, assert_1.guard)(filter.minimumSize >= 1, `Minimum size must be at least 1, but was ${filter.minimumSize}`);
14
14
  (0, assert_1.guard)(filter.maximumSize >= filter.minimumSize, `Maximum size must be at least minimum size, but was ${filter.maximumSize} < ${filter.minimumSize}`);
15
- const potentialSlicingNodes = filter.collectAll(ast);
15
+ const potentialSlicingNodes = ast.files.flatMap(f => filter.collectAll(f.root));
16
16
  if (potentialSlicingNodes.length < filter.minimumSize) {
17
17
  return;
18
18
  }
@@ -27,14 +27,14 @@ function slicingCriterionToId(criterion, idMap) {
27
27
  if (criterion.startsWith('$')) {
28
28
  resolved = (0, node_id_1.normalizeIdToNumberIfPossible)(criterion.substring(1));
29
29
  }
30
- else if (criterion.includes(':')) {
31
- const [line, column] = criterion.split(':').map(c => parseInt(c));
32
- resolved = locationToId([line, column], idMap);
33
- }
34
30
  else if (criterion.includes('@')) {
35
31
  const [line, name] = criterion.split(/@(.*)/s); // only split at first occurrence
36
32
  resolved = conventionalCriteriaToId(parseInt(line), name, idMap);
37
33
  }
34
+ else if (criterion.includes(':')) {
35
+ const [line, column] = criterion.split(':').map(c => parseInt(c));
36
+ resolved = locationToId([line, column], idMap);
37
+ }
38
38
  if (resolved === undefined) {
39
39
  throw new CriteriaParseError(`invalid slicing criterion ${criterion}`);
40
40
  }
@@ -6,11 +6,12 @@ import type { REnvironmentInformation } from '../../dataflow/environments/enviro
6
6
  import { type DataflowGraph, type OutgoingEdges } from '../../dataflow/graph/graph';
7
7
  import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
8
8
  import type { DataflowInformation } from '../../dataflow/info';
9
+ import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
9
10
  /**
10
11
  * Returns the function call targets (definitions) by the given caller
11
12
  */
12
- export declare function getAllFunctionCallTargets(dataflowGraph: DataflowGraph, callerInfo: DataflowGraphVertexFunctionCall, baseEnvironment: REnvironmentInformation, queue: VisitingQueue): [Set<DataflowGraphVertexInfo>, REnvironmentInformation];
13
+ export declare function getAllFunctionCallTargets(dataflowGraph: DataflowGraph, callerInfo: DataflowGraphVertexFunctionCall, baseEnvironment: REnvironmentInformation, queue: VisitingQueue, ctx: ReadOnlyFlowrAnalyzerContext): [Set<DataflowGraphVertexInfo>, REnvironmentInformation];
13
14
  /** returns the new threshold hit count */
14
- export declare function sliceForCall(current: NodeToSlice, callerInfo: DataflowGraphVertexFunctionCall, dataflowInformation: DataflowInformation, queue: VisitingQueue): void;
15
+ export declare function sliceForCall(current: NodeToSlice, callerInfo: DataflowGraphVertexFunctionCall, dataflowInformation: DataflowInformation, queue: VisitingQueue, ctx: ReadOnlyFlowrAnalyzerContext): void;
15
16
  /** Returns true if we found at least one return edge */
16
17
  export declare function handleReturns(from: NodeId, queue: VisitingQueue, currentEdges: OutgoingEdges, baseEnvFingerprint: Fingerprint, baseEnvironment: REnvironmentInformation): boolean;
@@ -16,12 +16,12 @@ const static_slicer_1 = require("./static-slicer");
16
16
  /**
17
17
  * Returns the function call targets (definitions) by the given caller
18
18
  */
19
- function getAllFunctionCallTargets(dataflowGraph, callerInfo, baseEnvironment, queue) {
19
+ function getAllFunctionCallTargets(dataflowGraph, callerInfo, baseEnvironment, queue, ctx) {
20
20
  // bind with call-local environments during slicing
21
21
  const outgoingEdges = dataflowGraph.get(callerInfo.id, true);
22
22
  (0, assert_1.guard)(outgoingEdges !== undefined, () => `outgoing edges of id: ${callerInfo.id} must be in graph but can not be found, keep in slice to be sure`);
23
23
  // lift baseEnv on the same level
24
- const activeEnvironment = (0, built_in_function_definition_1.retrieveActiveEnvironment)(callerInfo.environment, baseEnvironment);
24
+ const activeEnvironment = (0, built_in_function_definition_1.retrieveActiveEnvironment)(callerInfo.environment, baseEnvironment, ctx);
25
25
  const name = callerInfo.name;
26
26
  (0, assert_1.guard)(name !== undefined, () => `name of id: ${callerInfo.id} can not be found in id map`);
27
27
  const functionCallDefs = (0, resolve_by_name_1.resolveByName)(name, activeEnvironment, identifier_1.ReferenceType.Unknown)?.filter(d => !(0, built_in_1.isBuiltIn)(d.definedAt))?.map(d => d.nodeId) ?? [];
@@ -59,9 +59,9 @@ function linkCallTargets(onlyForSideEffects, functionCallTargets, activeEnvironm
59
59
  }
60
60
  }
61
61
  /** returns the new threshold hit count */
62
- function sliceForCall(current, callerInfo, dataflowInformation, queue) {
62
+ function sliceForCall(current, callerInfo, dataflowInformation, queue, ctx) {
63
63
  const baseEnvironment = current.baseEnvironment;
64
- const [functionCallTargets, activeEnvironment] = getAllFunctionCallTargets(dataflowInformation.graph, callerInfo, current.baseEnvironment, queue);
64
+ const [functionCallTargets, activeEnvironment] = getAllFunctionCallTargets(dataflowInformation.graph, callerInfo, current.baseEnvironment, queue, ctx);
65
65
  const activeEnvironmentFingerprint = (0, fingerprint_1.envFingerprint)(activeEnvironment);
66
66
  if (functionCallTargets.size === 0) {
67
67
  /*
@@ -7,11 +7,13 @@ import { type REnvironmentInformation } from '../../dataflow/environments/enviro
7
7
  import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
8
8
  import { SliceDirection } from '../../core/steps/all/static-slicing/00-slice';
9
9
  import type { DataflowInformation } from '../../dataflow/info';
10
+ import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
10
11
  export declare const slicerLogger: import("tslog").Logger<import("tslog").ILogObj>;
11
12
  /**
12
13
  * This returns the ids to include in the static slice of the given type, when slicing with the given seed id's (must be at least one).
13
14
  * <p>
14
15
  * The returned ids can be used to {@link reconstructToCode|reconstruct the slice to R code}.
16
+ * @param ctx - The analyzer context used for slicing.
15
17
  * @param info - The dataflow information used for slicing.
16
18
  * @param idMap - The mapping from node ids to their information in the AST.
17
19
  * @param criteria - The criteria to slice on.
@@ -19,7 +21,7 @@ export declare const slicerLogger: import("tslog").Logger<import("tslog").ILogOb
19
21
  * @param threshold - The maximum number of nodes to visit in the graph. If the threshold is reached, the slice will side with inclusion and drop its minimal guarantee. The limit ensures that the algorithm halts.
20
22
  * @param cache - A cache to store the results of the slice. If provided, the slice may use this cache to speed up the slicing process.
21
23
  */
22
- export declare function staticSlice(info: DataflowInformation, { idMap }: NormalizedAst, criteria: SlicingCriteria, direction: SliceDirection, threshold?: number, cache?: Map<Fingerprint, Set<NodeId>>): Readonly<SliceResult>;
24
+ export declare function staticSlice(ctx: ReadOnlyFlowrAnalyzerContext, info: DataflowInformation, { idMap }: NormalizedAst, criteria: SlicingCriteria, direction: SliceDirection, threshold?: number, cache?: Map<Fingerprint, Set<NodeId>>): Readonly<SliceResult>;
23
25
  /**
24
26
  * Updates the potential addition for the given target node in the visiting queue.
25
27
  * This describes vertices that might be added *if* another path reaches them.
@@ -5,11 +5,9 @@ exports.staticSlice = staticSlice;
5
5
  exports.updatePotentialAddition = updatePotentialAddition;
6
6
  const assert_1 = require("../../util/assert");
7
7
  const log_1 = require("../../util/log");
8
- const fingerprint_1 = require("./fingerprint");
9
8
  const visiting_queue_1 = require("./visiting-queue");
10
9
  const slice_call_1 = require("./slice-call");
11
10
  const parse_1 = require("../criterion/parse");
12
- const environment_1 = require("../../dataflow/environments/environment");
13
11
  const vertex_1 = require("../../dataflow/graph/vertex");
14
12
  const edge_1 = require("../../dataflow/graph/edge");
15
13
  const _00_slice_1 = require("../../core/steps/all/static-slicing/00-slice");
@@ -19,6 +17,7 @@ exports.slicerLogger = log_1.log.getSubLogger({ name: 'slicer' });
19
17
  * This returns the ids to include in the static slice of the given type, when slicing with the given seed id's (must be at least one).
20
18
  * <p>
21
19
  * The returned ids can be used to {@link reconstructToCode|reconstruct the slice to R code}.
20
+ * @param ctx - The analyzer context used for slicing.
22
21
  * @param info - The dataflow information used for slicing.
23
22
  * @param idMap - The mapping from node ids to their information in the AST.
24
23
  * @param criteria - The criteria to slice on.
@@ -26,21 +25,21 @@ exports.slicerLogger = log_1.log.getSubLogger({ name: 'slicer' });
26
25
  * @param threshold - The maximum number of nodes to visit in the graph. If the threshold is reached, the slice will side with inclusion and drop its minimal guarantee. The limit ensures that the algorithm halts.
27
26
  * @param cache - A cache to store the results of the slice. If provided, the slice may use this cache to speed up the slicing process.
28
27
  */
29
- function staticSlice(info, { idMap }, criteria, direction, threshold = 75, cache) {
28
+ function staticSlice(ctx, info, { idMap }, criteria, direction, threshold = 75, cache) {
30
29
  (0, assert_1.guard)(criteria.length > 0, 'must have at least one seed id to calculate slice');
31
30
  const decodedCriteria = (0, parse_1.convertAllSlicingCriteriaToIds)(criteria, idMap);
32
31
  (0, log_1.expensiveTrace)(exports.slicerLogger, () => `calculating ${direction} slice for ${decodedCriteria.length} seed criteria: ${decodedCriteria.map(s => JSON.stringify(s)).join(', ')}`);
33
32
  let { graph } = info;
34
33
  if (direction === _00_slice_1.SliceDirection.Forward) {
35
- graph = (0, invert_dfg_1.invertDfg)(graph);
34
+ graph = (0, invert_dfg_1.invertDfg)(graph, ctx.env.makeCleanEnv());
36
35
  }
37
36
  const queue = new visiting_queue_1.VisitingQueue(threshold, cache);
38
37
  let minNesting = Number.MAX_SAFE_INTEGER;
39
38
  const sliceSeedIds = new Set();
40
39
  // every node ships the call environment which registers the calling environment
41
40
  {
42
- const emptyEnv = (0, environment_1.initializeCleanEnvironments)();
43
- const basePrint = (0, fingerprint_1.envFingerprint)(emptyEnv);
41
+ const emptyEnv = ctx.env.makeCleanEnv();
42
+ const basePrint = ctx.env.getCleanEnvFingerprint();
44
43
  for (const { id: startId } of decodedCriteria) {
45
44
  queue.add(startId, emptyEnv, basePrint, false);
46
45
  // retrieve the minimum nesting of all nodes to only add control dependencies if they are "part" of the current execution
@@ -77,7 +76,7 @@ function staticSlice(info, { idMap }, criteria, direction, threshold = 75, cache
77
76
  }
78
77
  if (!onlyForSideEffects) {
79
78
  if (currentVertex.tag === vertex_1.VertexType.FunctionCall && !currentVertex.onlyBuiltin) {
80
- (0, slice_call_1.sliceForCall)(current, currentVertex, info, queue);
79
+ (0, slice_call_1.sliceForCall)(current, currentVertex, info, queue, ctx);
81
80
  }
82
81
  const ret = (0, slice_call_1.handleReturns)(id, queue, currentEdges, baseEnvFingerprint, baseEnvironment);
83
82
  if (ret) {
@@ -17,7 +17,7 @@ const initialAssignmentInfo = {
17
17
  exports.AssignmentOperators = new Set(operators_1.Operators.filter(op => operators_1.OperatorDatabase[op].usedAs === 'assignment'));
18
18
  function visitAssignment(info, input) {
19
19
  const assignmentStack = [];
20
- (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
20
+ (0, visitor_1.visitAst)(input.normalizedRAst.ast.files.map(r => r.root), node => {
21
21
  if (node.type !== type_1.RType.BinaryOp || !exports.AssignmentOperators.has(node.operator)) {
22
22
  return;
23
23
  }
@@ -20,10 +20,10 @@ const initialControlflowInfo = {
20
20
  };
21
21
  function visitIfThenElse(info, input) {
22
22
  const ifThenElseStack = [];
23
- (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
23
+ (0, visitor_1.visitAst)(input.normalizedRAst.ast.files.map(f => f.root), node => {
24
24
  if (node.type !== type_1.RType.IfThenElse) {
25
25
  if (node.type === type_1.RType.FunctionCall && node.named && node.functionName.content === 'switch') {
26
- const initialArg = (0, unpack_argument_1.unpackArgument)(node.arguments[0]);
26
+ const initialArg = (0, unpack_argument_1.unpackNonameArg)(node.arguments[0]);
27
27
  if (initialArg) {
28
28
  info.switchCase = (0, common_syntax_probability_1.updateCommonSyntaxTypeCounts)(info.switchCase, initialArg);
29
29
  }
@@ -46,7 +46,7 @@ function visitAccess(info, input) {
46
46
  const accessNest = [];
47
47
  const accessChain = [];
48
48
  const parentRoleCache = new Map();
49
- (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
49
+ (0, visitor_1.visitAst)(input.normalizedRAst.ast.files.map(f => f.root), node => {
50
50
  if (node.type !== type_1.RType.Access) {
51
51
  return;
52
52
  }
@@ -45,7 +45,7 @@ function retrieveAllCallsites(input, node, recursiveCalls) {
45
45
  function visitDefinitions(info, input) {
46
46
  const definitionStack = [];
47
47
  const allDefinitions = [];
48
- (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
48
+ (0, visitor_1.visitAst)(input.normalizedRAst.ast.files.map(f => f.root), node => {
49
49
  if (node.type !== type_1.RType.FunctionDefinition) {
50
50
  return;
51
51
  }
@@ -11,7 +11,7 @@ const initialExpressionListInfo = {
11
11
  function visitLists(info, input) {
12
12
  let nest = -1; // we start with nesting 0
13
13
  let total = 0;
14
- (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
14
+ (0, visitor_1.visitAst)(input.normalizedRAst.ast.files.map(f => f.root), node => {
15
15
  if (node.type === type_1.RType.ExpressionList) {
16
16
  nest++;
17
17
  total++;