@eagleoutice/flowr 2.6.2 → 2.6.3

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 (349) hide show
  1. package/README.md +36 -34
  2. package/abstract-interpretation/data-frame/absint-visitor.js +3 -3
  3. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +7 -7
  4. package/abstract-interpretation/data-frame/mappers/function-mapper.js +20 -16
  5. package/abstract-interpretation/data-frame/semantics.js +8 -0
  6. package/abstract-interpretation/data-frame/shape-inference.d.ts +3 -3
  7. package/abstract-interpretation/data-frame/shape-inference.js +3 -3
  8. package/abstract-interpretation/normalized-ast-fold.d.ts +1 -1
  9. package/benchmark/slicer.d.ts +1 -0
  10. package/benchmark/slicer.js +13 -12
  11. package/benchmark/summarizer/first-phase/process.js +1 -1
  12. package/benchmark/summarizer/second-phase/graph.d.ts +3 -1
  13. package/benchmark/summarizer/second-phase/graph.js +3 -1
  14. package/cli/export-quads-app.js +1 -1
  15. package/cli/repl/commands/repl-dataflow.js +2 -1
  16. package/cli/repl/commands/repl-parse.js +16 -4
  17. package/cli/repl/commands/repl-query.js +1 -1
  18. package/cli/repl/core.js +16 -13
  19. package/cli/repl/server/connection.js +2 -1
  20. package/cli/script-core/statistics-helper-core.js +2 -1
  21. package/cli/slicer-app.js +3 -4
  22. package/cli/wiki.d.ts +4 -0
  23. package/cli/wiki.js +165 -0
  24. package/config.d.ts +4 -0
  25. package/config.js +6 -0
  26. package/control-flow/cfg-dead-code.js +13 -3
  27. package/control-flow/cfg-simplification.d.ts +5 -2
  28. package/control-flow/cfg-simplification.js +3 -0
  29. package/control-flow/extract-cfg.d.ts +9 -3
  30. package/control-flow/extract-cfg.js +44 -4
  31. package/control-flow/semantic-cfg-guided-visitor.d.ts +2 -2
  32. package/control-flow/simple-visitor.js +2 -2
  33. package/control-flow/useless-loop.d.ts +3 -3
  34. package/control-flow/useless-loop.js +14 -5
  35. package/core/pipeline-executor.d.ts +3 -6
  36. package/core/pipeline-executor.js +4 -7
  37. package/core/print/normalize-printer.d.ts +1 -1
  38. package/core/print/normalize-printer.js +2 -2
  39. package/core/steps/all/core/00-parse.d.ts +1 -1
  40. package/core/steps/all/core/00-parse.js +1 -1
  41. package/core/steps/all/core/10-normalize.d.ts +3 -9
  42. package/core/steps/all/core/10-normalize.js +1 -16
  43. package/core/steps/all/core/11-normalize-tree-sitter.d.ts +2 -3
  44. package/core/steps/all/core/11-normalize-tree-sitter.js +2 -3
  45. package/core/steps/all/core/20-dataflow.d.ts +3 -4
  46. package/core/steps/all/core/20-dataflow.js +2 -2
  47. package/core/steps/all/static-slicing/00-slice.d.ts +1 -2
  48. package/core/steps/all/static-slicing/00-slice.js +1 -1
  49. package/core/steps/all/static-slicing/10-reconstruct.d.ts +8 -0
  50. package/core/steps/all/static-slicing/10-reconstruct.js +4 -1
  51. package/core/steps/pipeline/default-pipelines.d.ts +55 -56
  52. package/core/steps/pipeline/default-pipelines.js +8 -8
  53. package/dataflow/environments/clone.d.ts +0 -1
  54. package/dataflow/environments/clone.js +12 -2
  55. package/dataflow/environments/diff.js +2 -2
  56. package/dataflow/environments/overwrite.d.ts +1 -5
  57. package/dataflow/environments/overwrite.js +3 -19
  58. package/dataflow/environments/scoping.d.ts +6 -2
  59. package/dataflow/environments/scoping.js +6 -2
  60. package/dataflow/eval/resolve/resolve-argument.js +2 -2
  61. package/dataflow/eval/values/string/string-constants.d.ts +9 -3
  62. package/dataflow/eval/values/string/string-constants.js +9 -3
  63. package/dataflow/extractor.d.ts +2 -3
  64. package/dataflow/extractor.js +25 -22
  65. package/dataflow/graph/graph.d.ts +3 -9
  66. package/dataflow/graph/graph.js +0 -13
  67. package/dataflow/graph/unknown-replacement.d.ts +4 -2
  68. package/dataflow/graph/unknown-replacement.js +4 -2
  69. package/dataflow/info.d.ts +7 -0
  70. package/dataflow/info.js +21 -0
  71. package/dataflow/internal/linker.js +7 -4
  72. package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +2 -2
  73. package/dataflow/internal/process/functions/call/argument/make-argument.js +2 -3
  74. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -1
  75. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +4 -4
  76. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
  77. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +4 -4
  78. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +6 -6
  79. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +1 -1
  80. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
  81. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +1 -1
  82. package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +1 -1
  83. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +1 -1
  84. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +1 -1
  85. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  86. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +3 -3
  87. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +6 -1
  88. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +6 -1
  89. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -2
  90. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +15 -10
  91. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +78 -75
  92. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +3 -1
  93. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -1
  94. package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
  95. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +1 -1
  96. package/dataflow/internal/process/functions/call/common.d.ts +1 -1
  97. package/dataflow/internal/process/functions/call/common.js +4 -4
  98. package/dataflow/internal/process/functions/call/default-call-handling.d.ts +3 -1
  99. package/dataflow/internal/process/functions/call/default-call-handling.js +3 -1
  100. package/dataflow/internal/process/functions/call/known-call-handling.js +3 -3
  101. package/dataflow/internal/process/functions/call/named-call-handling.js +4 -4
  102. package/dataflow/internal/process/functions/process-parameter.js +4 -4
  103. package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -1
  104. package/dataflow/origin/dfg-get-symbol-refs.js +1 -1
  105. package/dataflow/processor.d.ts +6 -11
  106. package/documentation/data/dfg/doc-data-dfg-util.d.ts +0 -2
  107. package/documentation/data/faq/faqs.js +27 -18
  108. package/documentation/data/faq/recommended-configs.d.ts +36 -0
  109. package/documentation/data/faq/recommended-configs.js +40 -0
  110. package/documentation/data/faq/wiki-faq-store.d.ts +1 -0
  111. package/documentation/data/faq/wiki-faq-store.js +10 -2
  112. package/documentation/data/server/doc-data-server-messages.js +1 -1
  113. package/documentation/doc-capabilities.d.ts +9 -0
  114. package/documentation/{print-capabilities-markdown.js → doc-capabilities.js} +18 -21
  115. package/documentation/doc-readme.d.ts +9 -0
  116. package/documentation/{print-readme.js → doc-readme.js} +31 -35
  117. package/documentation/doc-util/doc-benchmarks.d.ts +6 -4
  118. package/documentation/doc-util/doc-benchmarks.js +6 -4
  119. package/documentation/doc-util/doc-cfg.js +5 -8
  120. package/documentation/doc-util/doc-dfg.d.ts +7 -7
  121. package/documentation/doc-util/doc-dfg.js +13 -13
  122. package/documentation/doc-util/doc-escape.d.ts +6 -0
  123. package/documentation/doc-util/doc-escape.js +11 -0
  124. package/documentation/doc-util/doc-general.d.ts +22 -2
  125. package/documentation/doc-util/doc-general.js +22 -2
  126. package/documentation/doc-util/doc-normalized-ast.d.ts +10 -5
  127. package/documentation/doc-util/doc-normalized-ast.js +12 -9
  128. package/documentation/doc-util/doc-query.d.ts +12 -4
  129. package/documentation/doc-util/doc-query.js +18 -11
  130. package/documentation/doc-util/doc-search.d.ts +0 -30
  131. package/documentation/doc-util/doc-search.js +2 -73
  132. package/documentation/doc-util/doc-server-message.d.ts +5 -5
  133. package/documentation/doc-util/doc-server-message.js +4 -4
  134. package/documentation/doc-util/doc-types.d.ts +69 -32
  135. package/documentation/doc-util/doc-types.js +108 -61
  136. package/documentation/index.d.ts +9 -9
  137. package/documentation/index.js +9 -9
  138. package/documentation/issue-linting-rule.d.ts +9 -0
  139. package/documentation/{print-linter-issue.js → issue-linting-rule.js} +20 -23
  140. package/documentation/wiki-analyzer.d.ts +9 -0
  141. package/documentation/wiki-analyzer.js +412 -0
  142. package/documentation/wiki-cfg.d.ts +9 -0
  143. package/documentation/{print-cfg-wiki.js → wiki-cfg.js} +144 -160
  144. package/documentation/wiki-core.d.ts +14 -0
  145. package/documentation/{print-core-wiki.js → wiki-core.js} +164 -175
  146. package/documentation/wiki-dataflow-graph.d.ts +9 -0
  147. package/documentation/{print-dataflow-graph-wiki.js → wiki-dataflow-graph.js} +142 -172
  148. package/documentation/wiki-engine.d.ts +9 -0
  149. package/documentation/{print-engines-wiki.js → wiki-engine.js} +27 -42
  150. package/documentation/wiki-faq.d.ts +8 -0
  151. package/documentation/wiki-faq.js +22 -0
  152. package/documentation/wiki-interface.d.ts +9 -0
  153. package/documentation/{print-interface-wiki.js → wiki-interface.js} +59 -56
  154. package/documentation/wiki-linter.d.ts +9 -0
  155. package/documentation/{print-linter-wiki.js → wiki-linter.js} +52 -48
  156. package/documentation/wiki-linting-and-testing.d.ts +9 -0
  157. package/documentation/{print-linting-and-testing-wiki.js → wiki-linting-and-testing.js} +25 -32
  158. package/documentation/wiki-mk/doc-context.d.ts +186 -0
  159. package/documentation/wiki-mk/doc-context.js +84 -0
  160. package/documentation/wiki-mk/doc-maker.d.ts +95 -0
  161. package/documentation/wiki-mk/doc-maker.js +133 -0
  162. package/documentation/wiki-normalized-ast.d.ts +9 -0
  163. package/documentation/{print-normalized-ast-wiki.js → wiki-normalized-ast.js} +64 -47
  164. package/documentation/wiki-onboarding.d.ts +8 -0
  165. package/documentation/{print-onboarding-wiki.js → wiki-onboarding.js} +18 -15
  166. package/documentation/wiki-query.d.ts +9 -0
  167. package/documentation/{print-query-wiki.js → wiki-query.js} +62 -47
  168. package/documentation/wiki-search.d.ts +9 -0
  169. package/documentation/wiki-search.js +61 -0
  170. package/linter/linter-executor.js +3 -2
  171. package/linter/linter-format.d.ts +2 -2
  172. package/linter/linter-rules.d.ts +13 -17
  173. package/linter/rules/absolute-path.d.ts +1 -2
  174. package/linter/rules/absolute-path.js +2 -2
  175. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  176. package/linter/rules/dataframe-access-validation.js +12 -8
  177. package/linter/rules/dead-code.d.ts +1 -1
  178. package/linter/rules/deprecated-functions.d.ts +1 -5
  179. package/linter/rules/file-path-validity.d.ts +1 -1
  180. package/linter/rules/file-path-validity.js +4 -4
  181. package/linter/rules/function-finder-util.d.ts +1 -5
  182. package/linter/rules/naming-convention.d.ts +2 -2
  183. package/linter/rules/naming-convention.js +1 -1
  184. package/linter/rules/network-functions.d.ts +1 -1
  185. package/linter/rules/network-functions.js +1 -1
  186. package/linter/rules/seeded-randomness.d.ts +3 -2
  187. package/linter/rules/seeded-randomness.js +33 -13
  188. package/linter/rules/unused-definition.d.ts +1 -1
  189. package/linter/rules/useless-loop.d.ts +2 -2
  190. package/linter/rules/useless-loop.js +2 -2
  191. package/package.json +6 -17
  192. package/project/cache/flowr-analyzer-cache.d.ts +7 -10
  193. package/project/cache/flowr-analyzer-cache.js +17 -38
  194. package/project/cache/flowr-analyzer-controlflow-cache.d.ts +34 -0
  195. package/project/cache/flowr-analyzer-controlflow-cache.js +79 -0
  196. package/project/context/flowr-analyzer-context.d.ts +30 -5
  197. package/project/context/flowr-analyzer-context.js +48 -4
  198. package/project/context/flowr-analyzer-files-context.d.ts +63 -13
  199. package/project/context/flowr-analyzer-files-context.js +110 -39
  200. package/project/context/flowr-file.d.ts +32 -10
  201. package/project/context/flowr-file.js +30 -9
  202. package/project/flowr-analyzer-builder.d.ts +22 -28
  203. package/project/flowr-analyzer-builder.js +32 -70
  204. package/project/flowr-analyzer.d.ts +55 -14
  205. package/project/flowr-analyzer.js +53 -8
  206. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +7 -1
  207. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +13 -5
  208. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +3 -3
  209. package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +11 -5
  210. package/project/plugins/file-plugins/flowr-description-file.d.ts +3 -3
  211. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +22 -0
  212. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +33 -0
  213. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +22 -0
  214. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +33 -0
  215. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +22 -0
  216. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +33 -0
  217. package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.d.ts +20 -0
  218. package/project/plugins/file-plugins/notebooks/flowr-jupyter-file.js +42 -0
  219. package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.d.ts +59 -0
  220. package/project/plugins/file-plugins/notebooks/flowr-rmarkdown-file.js +132 -0
  221. package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
  222. package/project/plugins/file-plugins/notebooks/notebook.js +2 -0
  223. package/project/plugins/flowr-analyzer-plugin-defaults.d.ts +5 -0
  224. package/project/plugins/flowr-analyzer-plugin-defaults.js +23 -0
  225. package/project/plugins/flowr-analyzer-plugin.d.ts +2 -0
  226. package/project/plugins/flowr-analyzer-plugin.js +2 -0
  227. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
  228. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  229. package/project/plugins/plugin-registry.d.ts +34 -0
  230. package/project/plugins/plugin-registry.js +62 -0
  231. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
  232. package/queries/catalog/call-context-query/call-context-query-executor.js +4 -2
  233. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +5 -2
  234. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +25 -18
  235. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
  236. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
  237. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
  238. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
  239. package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
  240. package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
  241. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
  242. package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
  243. package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -1
  244. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +2 -2
  245. package/queries/catalog/df-shape-query/df-shape-query-format.js +6 -5
  246. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +2 -1
  247. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
  248. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
  249. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
  250. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +1 -1
  251. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -1
  252. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +1 -1
  253. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
  254. package/queries/catalog/linter-query/linter-query-format.js +13 -2
  255. package/queries/catalog/location-map-query/location-map-query-executor.js +2 -1
  256. package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
  257. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  258. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
  259. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  260. package/queries/catalog/project-query/project-query-executor.js +3 -1
  261. package/queries/catalog/project-query/project-query-format.d.ts +1 -1
  262. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +2 -2
  263. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
  264. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  265. package/queries/catalog/search-query/search-query-format.d.ts +1 -1
  266. package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
  267. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
  268. package/queries/catalog/static-slice-query/static-slice-query-format.js +13 -1
  269. package/queries/query.d.ts +26 -18
  270. package/queries/query.js +21 -1
  271. package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -1
  272. package/r-bridge/lang-4.x/ast/model/collect.js +4 -0
  273. package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +29 -0
  274. package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +15 -0
  275. package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +5 -7
  276. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +24 -11
  277. package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -0
  278. package/r-bridge/lang-4.x/ast/model/type.js +2 -0
  279. package/r-bridge/lang-4.x/ast/parser/json/format.js +1 -1
  280. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +9 -8
  281. package/r-bridge/lang-4.x/ast/parser/json/parser.js +11 -10
  282. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.d.ts +4 -3
  283. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +20 -11
  284. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +3 -3
  285. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +5 -4
  286. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +3 -2
  287. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +14 -5
  288. package/r-bridge/parser.d.ts +15 -5
  289. package/r-bridge/parser.js +27 -13
  290. package/r-bridge/retriever.d.ts +9 -15
  291. package/r-bridge/retriever.js +14 -5
  292. package/r-bridge/shell.d.ts +1 -1
  293. package/r-bridge/shell.js +1 -1
  294. package/reconstruct/auto-select/auto-select-defaults.d.ts +0 -1
  295. package/reconstruct/auto-select/magic-comments.js +1 -1
  296. package/reconstruct/reconstruct.d.ts +17 -9
  297. package/reconstruct/reconstruct.js +19 -8
  298. package/search/flowr-search.d.ts +12 -0
  299. package/search/search-executor/search-enrichers.d.ts +9 -2
  300. package/search/search-executor/search-enrichers.js +1 -3
  301. package/search/search-executor/search-generators.d.ts +1 -1
  302. package/search/search-executor/search-generators.js +9 -4
  303. package/slicing/criterion/collect-all.d.ts +3 -2
  304. package/slicing/criterion/collect-all.js +1 -1
  305. package/slicing/criterion/parse.js +4 -4
  306. package/statistics/features/supported/assignments/assignments.js +1 -1
  307. package/statistics/features/supported/control-flow/control-flow.js +1 -1
  308. package/statistics/features/supported/data-access/data-access.js +1 -1
  309. package/statistics/features/supported/defined-functions/defined-functions.js +1 -1
  310. package/statistics/features/supported/expression-list/statistics-expression-list.js +1 -1
  311. package/statistics/features/supported/loops/loops.js +1 -1
  312. package/statistics/features/supported/used-functions/used-functions.js +1 -1
  313. package/statistics/features/supported/variables/variables.js +1 -1
  314. package/statistics/statistics.js +3 -2
  315. package/util/assert.d.ts +4 -0
  316. package/util/assert.js +4 -0
  317. package/util/files.d.ts +1 -1
  318. package/util/files.js +1 -1
  319. package/util/mermaid/ast.d.ts +4 -3
  320. package/util/mermaid/ast.js +36 -8
  321. package/util/mermaid/cfg.js +1 -1
  322. package/util/version.js +1 -1
  323. package/documentation/print-analyzer-wiki.d.ts +0 -1
  324. package/documentation/print-analyzer-wiki.js +0 -141
  325. package/documentation/print-capabilities-markdown.d.ts +0 -1
  326. package/documentation/print-cfg-wiki.d.ts +0 -1
  327. package/documentation/print-core-wiki.d.ts +0 -5
  328. package/documentation/print-dataflow-graph-wiki.d.ts +0 -1
  329. package/documentation/print-engines-wiki.d.ts +0 -1
  330. package/documentation/print-faq-wiki.d.ts +0 -1
  331. package/documentation/print-faq-wiki.js +0 -18
  332. package/documentation/print-interface-wiki.d.ts +0 -1
  333. package/documentation/print-linter-issue.d.ts +0 -1
  334. package/documentation/print-linter-wiki.d.ts +0 -1
  335. package/documentation/print-linting-and-testing-wiki.d.ts +0 -1
  336. package/documentation/print-normalized-ast-wiki.d.ts +0 -1
  337. package/documentation/print-onboarding-wiki.d.ts +0 -1
  338. package/documentation/print-query-wiki.d.ts +0 -1
  339. package/documentation/print-readme.d.ts +0 -1
  340. package/documentation/print-search-wiki.d.ts +0 -1
  341. package/documentation/print-search-wiki.js +0 -74
  342. package/util/formats/adapter-format.d.ts +0 -6
  343. package/util/formats/adapter-format.js +0 -3
  344. package/util/formats/adapter.d.ts +0 -27
  345. package/util/formats/adapter.js +0 -58
  346. package/util/formats/adapters/r-adapter.d.ts +0 -4
  347. package/util/formats/adapters/r-adapter.js +0 -7
  348. package/util/formats/adapters/rmd-adapter.d.ts +0 -35
  349. package/util/formats/adapters/rmd-adapter.js +0 -100
@@ -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
  }
@@ -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,7 +20,7 @@ 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
26
  const initialArg = (0, unpack_argument_1.unpackArgument)(node.arguments[0]);
@@ -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++;
@@ -25,7 +25,7 @@ const isImplicitLoop = /[lsvmt]?apply/;
25
25
  function visitLoops(info, input) {
26
26
  // holds number of loops and their nesting depths
27
27
  const loopStack = [];
28
- (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
28
+ (0, visitor_1.visitAst)(input.normalizedRAst.ast.files.map(f => f.root), node => {
29
29
  switch (node.type) {
30
30
  case type_1.RType.Next:
31
31
  info.nextStatements++;
@@ -50,7 +50,7 @@ function classifyArguments(args, existing) {
50
50
  function visitCalls(info, input) {
51
51
  const calls = [];
52
52
  const allCalls = [];
53
- (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
53
+ (0, visitor_1.visitAst)(input.normalizedRAst.ast.files.map(f => f.root), node => {
54
54
  if (node.type !== type_1.RType.FunctionCall) {
55
55
  return;
56
56
  }
@@ -15,7 +15,7 @@ const initialVariableInfo = {
15
15
  unknownVariables: 0
16
16
  };
17
17
  function visitVariables(info, input) {
18
- (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
18
+ (0, visitor_1.visitAst)(input.normalizedRAst.ast.files.map(f => f.root), node => {
19
19
  if (node.type !== type_1.RType.Symbol || (0, r_symbol_1.isSpecialSymbol)(node)) {
20
20
  return;
21
21
  }
@@ -14,6 +14,7 @@ const pipeline_executor_1 = require("../core/pipeline-executor");
14
14
  const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
15
15
  const feature_1 = require("./features/feature");
16
16
  const convert_values_1 = require("../r-bridge/lang-4.x/convert-values");
17
+ const flowr_analyzer_context_1 = require("../project/context/flowr-analyzer-context");
17
18
  /**
18
19
  * By default, {@link extractUsageStatistics} requires a generator, but sometimes you already know all the files
19
20
  * that you want to process. This function simply reps your requests as a generator.
@@ -82,8 +83,8 @@ function processMetaOnSuccessful(meta, request) {
82
83
  const parser = new xmldom_1.DOMParser();
83
84
  async function extractSingle(result, shell, request, features, suffixFilePath, config) {
84
85
  const slicerOutput = await new pipeline_executor_1.PipelineExecutor(default_pipelines_1.DEFAULT_DATAFLOW_PIPELINE, {
85
- request, parser: shell
86
- }, config).allRemainingSteps();
86
+ context: (0, flowr_analyzer_context_1.contextFromInput)(request, config), parser: shell
87
+ }).allRemainingSteps();
87
88
  // retrieve parsed xml through (legacy) xmlparsedata
88
89
  const suffix = request.request === 'file' ? ', encoding="utf-8"' : '';
89
90
  shell.sendCommands(`try(flowr_parsed<-parse(${request.request}=${JSON.stringify(request.content)},keep.source=TRUE${suffix}),silent=FALSE)`, 'try(flowr_output<-xmlparsedata::xml_parse_data(flowr_parsed,includeText=TRUE,pretty=FALSE),silent=FALSE)');
package/util/assert.d.ts CHANGED
@@ -53,6 +53,10 @@ export declare function isUndefined<T>(x: T | undefined): x is undefined;
53
53
  * @see {@link isNotUndefined}
54
54
  */
55
55
  export declare function isNotNull<T>(x: T | null): x is T;
56
+ /**
57
+ * Generates a GitHub issue URL for reporting guard errors
58
+ */
59
+ export declare function getGuardIssueUrl(message: string): string;
56
60
  export type GuardMessage = string | (() => string);
57
61
  /**
58
62
  * @param assertion - will be asserted
package/util/assert.js CHANGED
@@ -5,6 +5,7 @@ exports.assertUnreachable = assertUnreachable;
5
5
  exports.isNotUndefined = isNotUndefined;
6
6
  exports.isUndefined = isUndefined;
7
7
  exports.isNotNull = isNotNull;
8
+ exports.getGuardIssueUrl = getGuardIssueUrl;
8
9
  exports.guard = guard;
9
10
  /* v8 ignore next */
10
11
  const version_1 = require("./version");
@@ -86,6 +87,9 @@ function prepareStack(stack) {
86
87
  }
87
88
  return lines.map(l => l.replaceAll(/\(\/.*(src|test)/g, '(<>/$1')).join('\n');
88
89
  }
90
+ /**
91
+ * Generates a GitHub issue URL for reporting guard errors
92
+ */
89
93
  function getGuardIssueUrl(message) {
90
94
  const body = encodeURIComponent(`<!-- Please describe your issue in more detail below! -->
91
95
 
package/util/files.d.ts CHANGED
@@ -75,7 +75,7 @@ export declare function getParentDirectory(directory: string): string;
75
75
  * @param file - The file to parse
76
76
  * @returns Map containing the keys and values of the provided file.
77
77
  */
78
- export declare function parseDCF(file: FlowrFileProvider<string>): Map<string, string[]>;
78
+ export declare function parseDCF(file: FlowrFileProvider): Map<string, string[]>;
79
79
  /**
80
80
  * Checks whether the given path-like object is a file that exists on the local filesystem.
81
81
  */
package/util/files.js CHANGED
@@ -212,7 +212,7 @@ function parseDCF(file) {
212
212
  let currentValue = '';
213
213
  const indentRegex = new RegExp(/^\s/);
214
214
  const firstColonRegex = new RegExp(/:(.*)/s);
215
- const fileContent = file.content().split(/\r?\n/);
215
+ const fileContent = file.content().toString().split(/\r?\n/);
216
216
  for (const line of fileContent) {
217
217
  if (indentRegex.test(line)) {
218
218
  currentValue += '\n' + line.trim();
@@ -1,9 +1,10 @@
1
- import type { RNodeWithParent } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
1
+ import type { ParentInformation, RNodeWithParent } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
2
+ import type { RProject } from '../../r-bridge/lang-4.x/ast/model/nodes/r-project';
2
3
  /**
3
4
  * Serialize the normalized AST to mermaid format
4
5
  */
5
- export declare function normalizedAstToMermaid(ast: RNodeWithParent, prefix?: string): string;
6
+ export declare function normalizedAstToMermaid(ast: RProject<ParentInformation> | RNodeWithParent, prefix?: string): string;
6
7
  /**
7
8
  * Use mermaid to visualize the normalized AST.
8
9
  */
9
- export declare function normalizedAstToMermaidUrl(ast: RNodeWithParent, prefix?: string): string;
10
+ export declare function normalizedAstToMermaidUrl(ast: RProject<ParentInformation> | RNodeWithParent, prefix?: string): string;
@@ -6,6 +6,14 @@ const mermaid_1 = require("./mermaid");
6
6
  const visitor_1 = require("../../r-bridge/lang-4.x/ast/model/processing/visitor");
7
7
  const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
8
8
  const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
9
+ const flowr_file_1 = require("../../project/context/flowr-file");
10
+ function identifyMermaidDirection(prefix) {
11
+ const directionMatch = prefix.match(/flowchart (TD|LR|RL|BT)/);
12
+ if (directionMatch) {
13
+ return directionMatch[1];
14
+ }
15
+ return 'TD';
16
+ }
9
17
  /**
10
18
  * Serialize the normalized AST to mermaid format
11
19
  */
@@ -24,17 +32,37 @@ function normalizedAstToMermaid(ast, prefix = 'flowchart TD\n') {
24
32
  output += ` n${n.info.id} -.-|"group-close"| n${n.grouping[1].info.id}\n`;
25
33
  }
26
34
  }
27
- (0, visitor_1.visitAst)(ast, n => {
28
- showNode(n);
29
- if (n.type === 'RAccess' && (n.operator !== '[' && n.operator !== '[[')) {
30
- for (const k of n.access) {
31
- if (k !== r_function_call_1.EmptyArgument) {
32
- showNode(k);
35
+ function showAst(ast) {
36
+ (0, visitor_1.visitAst)(ast, n => {
37
+ showNode(n);
38
+ if (n.type === 'RAccess' && (n.operator !== '[' && n.operator !== '[[')) {
39
+ for (const k of n.access) {
40
+ if (k !== r_function_call_1.EmptyArgument) {
41
+ showNode(k);
42
+ }
33
43
  }
34
44
  }
45
+ return false;
46
+ });
47
+ }
48
+ if (ast.type === type_1.RType.Project) {
49
+ for (const f of ast.files) {
50
+ // add a subgraph for each file
51
+ if (ast.files.length !== 1 || (f.filePath && f.filePath !== flowr_file_1.FlowrFile.INLINE_PATH)) {
52
+ output += ` subgraph "File: ${(0, mermaid_1.escapeMarkdown)(f.filePath ?? flowr_file_1.FlowrFile.INLINE_PATH)}"\n`;
53
+ const direction = identifyMermaidDirection(prefix);
54
+ output += ` direction ${direction}\n`;
55
+ showAst(f.root);
56
+ output += ' end\n';
57
+ }
58
+ else {
59
+ showAst(f.root);
60
+ }
35
61
  }
36
- return false;
37
- });
62
+ }
63
+ else {
64
+ showAst(ast);
65
+ }
38
66
  return output;
39
67
  }
40
68
  /**
@@ -43,7 +43,7 @@ function cfgToMermaid(cfg, normalizedAst, prefix = 'flowchart BT\n', simplify =
43
43
  if (vertex.type === control_flow_graph_1.CfgVertexType.Block) {
44
44
  if (simplify) {
45
45
  const ids = vertex.elems?.map(e => e.id) ?? [];
46
- const reconstruct = (0, reconstruct_1.reconstructToCode)(normalizedAst, new Set(ids), auto_select_defaults_1.doNotAutoSelect).code;
46
+ const reconstruct = (0, reconstruct_1.reconstructToCode)(normalizedAst, { nodes: new Set(ids) }, auto_select_defaults_1.doNotAutoSelect).code;
47
47
  const name = `"\`Basic Block (${id})\n${(0, mermaid_1.escapeMarkdown)(reconstruct)}\`"`;
48
48
  output += ` n${id}[[${name}]]\n`;
49
49
  }
package/util/version.js CHANGED
@@ -6,7 +6,7 @@ exports.printVersionInformation = printVersionInformation;
6
6
  const semver_1 = require("semver");
7
7
  const assert_1 = require("./assert");
8
8
  // this is automatically replaced with the current version by release-it
9
- const version = '2.6.2';
9
+ const version = '2.6.3';
10
10
  /**
11
11
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
12
  */
@@ -1 +0,0 @@
1
- export {};
@@ -1,141 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const shell_1 = require("../r-bridge/shell");
7
- const log_1 = require("../../test/functionality/_helper/log");
8
- const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
9
- const doc_types_1 = require("./doc-util/doc-types");
10
- const path_1 = __importDefault(require("path"));
11
- const flowr_analyzer_1 = require("../project/flowr-analyzer");
12
- const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
13
- const doc_structure_1 = require("./doc-util/doc-structure");
14
- const doc_files_1 = require("./doc-util/doc-files");
15
- async function analyzerQuickExample() {
16
- const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
17
- .addRequestFromInput('x <- 1; print(x)')
18
- .setEngine('tree-sitter')
19
- .build();
20
- // get the dataflow
21
- const df = await analyzer.dataflow();
22
- // obtain the identified loading order
23
- console.log(analyzer.inspectContext().files.loadingOrder.getLoadingOrder());
24
- // run a dependency query
25
- const results = await analyzer.query([{ type: 'dependencies' }]);
26
- return { analyzer, df, results };
27
- }
28
- async function getText(shell) {
29
- const rversion = (await shell.usedRVersion())?.format() ?? 'unknown';
30
- const types = (0, doc_types_1.getTypesFromFolder)({
31
- rootFolder: path_1.default.resolve('src/'),
32
- inlineTypes: doc_types_1.mermaidHide
33
- });
34
- return `${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'analyzer', rVersion: rversion })}
35
-
36
- We are currently working on documenting the capabilities of the analyzer (with the plugins, their loading order, etc.). In general, the code documentation
37
- starting with the ${(0, doc_types_1.shortLink)(flowr_analyzer_1.FlowrAnalyzer.name, types.info)} and the ${(0, doc_types_1.shortLink)(flowr_analyzer_builder_1.FlowrAnalyzerBuilder.name, types.info)}
38
- should be the best starting point.
39
-
40
- ${(0, doc_structure_1.collapsibleToc)({
41
- 'Overview': undefined,
42
- 'Builder Configuration': undefined,
43
- 'Plugins': {
44
- 'Plugin Types': {
45
- 'Dependency Identification': undefined,
46
- 'Project Discovery': undefined,
47
- 'File Loading': undefined,
48
- 'Loading Order': undefined
49
- },
50
- 'How to add a new plugin': undefined,
51
- 'How to add a new plugin type': undefined
52
- },
53
- 'Context Information': {
54
- 'Files Context': undefined,
55
- 'Loading Order Context': undefined,
56
- 'Dependencies Context': undefined
57
- },
58
- 'Analyzer Internals': undefined
59
- })}
60
-
61
-
62
- ${(0, doc_structure_1.section)('Overview', 2)}
63
-
64
- No matter whether you want to analyze a single R script, a couple of R notebooks, or a complete project,
65
- your journey starts with the ${(0, doc_types_1.shortLink)(flowr_analyzer_builder_1.FlowrAnalyzerBuilder.name, types.info)} (further described in [Builder Configuration](#builder-configuration) below).
66
- This builder allows you to configure the analysis in many different ways, for example, by specifying which files to analyze, which plugins to use, or
67
- what [Engine](${doc_files_1.FlowrWikiBaseRef}/Engines) to use for the analysis.
68
-
69
- ${(0, doc_structure_1.block)({
70
- type: 'NOTE',
71
- content: `If you want to quickly try out the analyzer, you can use the following code snippet that analyzes a simple R expression:
72
-
73
- ${(0, doc_types_1.printCodeOfElement)({ program: types.program, info: types.info, dropLinesStart: 1, dropLinesEnd: 2, hideDefinedAt: true }, analyzerQuickExample.name)}
74
- `
75
- })}
76
-
77
- In general, we work on providing a set of example repositories that demonstrate how to use the analyzer in different scenarios:
78
-
79
- * [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-project-query](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-project-query) for an example project that runs queries on an R project
80
-
81
- **TODO**: mention [Context](#Context_Information)
82
-
83
- ${(0, doc_structure_1.section)('Builder Configuration', 2)}
84
-
85
- **TODO** also explain buildSync and that TreeSitter has to be initialized for this
86
-
87
- ${(0, doc_structure_1.section)('Plugins', 2)}
88
-
89
- ${(0, doc_structure_1.section)('Plugin Types', 3)}
90
-
91
- During the construction of a new ${(0, doc_types_1.shortLink)(flowr_analyzer_1.FlowrAnalyzer.name, types.info)}, plugins of different types are applied at different stages of the analysis.
92
- These plugins are grouped by their ${(0, doc_types_1.shortLink)('PluginType', types.info)} and are applied in the following order (as shown in the documentation of the ${(0, doc_types_1.shortLink)('PluginType', types.info)}):
93
-
94
- ${(() => {
95
- const doc = (0, doc_types_1.getDocumentationForType)('PluginType', types.info);
96
- // skip until the first ```text
97
- const lines = doc.split('\n');
98
- const start = lines.findIndex(l => l.trim().startsWith('```text'));
99
- const end = lines.findIndex((l, i) => i > start && l.trim().startsWith('```'));
100
- // github rendering pls fix xD
101
- return start >= 0 && end > start ? '```text\n' + lines.slice(start + 1, end).join('\n').replaceAll('▶', '>') + '\n```' : doc;
102
- })()}
103
-
104
- We describe the different plugin types in more detail below.
105
-
106
-
107
- ${(0, doc_structure_1.section)('Project Discovery', 4)}
108
-
109
- ${(0, doc_structure_1.section)('File Loading', 4)}
110
-
111
- ${(0, doc_structure_1.section)('Dependency Identification', 4)}
112
-
113
- ${(0, doc_structure_1.section)('Loading Order', 4)}
114
-
115
- ${(0, doc_structure_1.section)('How to add a new plugin', 3)}
116
-
117
- ${(0, doc_structure_1.section)('How to add a new plugin type', 3)}
118
-
119
- ${(0, doc_structure_1.section)('Context Information', 2)}
120
-
121
- ${(0, doc_structure_1.section)('Files Context', 3)}
122
-
123
- ${(0, doc_structure_1.section)('Loading Order Context', 3)}
124
-
125
- ${(0, doc_structure_1.section)('Dependencies Context', 3)}
126
-
127
- ${(0, doc_structure_1.section)('Analyzer Internals', 2)}
128
-
129
- `;
130
- }
131
- /** if we run this script, we want a Markdown representation of the capabilities */
132
- if (require.main === module) {
133
- (0, log_1.setMinLevelOfAllLogs)(6 /* LogLevel.Fatal */);
134
- const shell = new shell_1.RShell();
135
- void getText(shell).then(str => {
136
- console.log(str);
137
- }).finally(() => {
138
- shell.close();
139
- });
140
- }
141
- //# sourceMappingURL=print-analyzer-wiki.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { FlowrAnalyzer } from '../project/flowr-analyzer';
2
- /**
3
- *
4
- */
5
- export declare function inspectContextExample(analyzer: FlowrAnalyzer): void;
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const log_1 = require("../../test/functionality/_helper/log");
4
- const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
5
- const faqs_1 = require("./data/faq/faqs");
6
- function print() {
7
- const faqs = (0, faqs_1.registerFaqs)();
8
- return `${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'frequently asked questions' })}
9
-
10
- ${faqs.toMarkdown()}
11
-
12
- `.trim();
13
- }
14
- if (require.main === module) {
15
- (0, log_1.setMinLevelOfAllLogs)(6 /* LogLevel.Fatal */);
16
- console.log(print());
17
- }
18
- //# sourceMappingURL=print-faq-wiki.js.map
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,74 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const shell_1 = require("../r-bridge/shell");
7
- const log_1 = require("../../test/functionality/_helper/log");
8
- const doc_files_1 = require("./doc-util/doc-files");
9
- const doc_auto_gen_1 = require("./doc-util/doc-auto-gen");
10
- const doc_search_1 = require("./doc-util/doc-search");
11
- const flowr_search_builder_1 = require("../search/flowr-search-builder");
12
- const vertex_1 = require("../dataflow/graph/vertex");
13
- const doc_types_1 = require("./doc-util/doc-types");
14
- const path_1 = __importDefault(require("path"));
15
- const flowr_search_executor_1 = require("../search/flowr-search-executor");
16
- async function getText(shell) {
17
- const rversion = (await shell.usedRVersion())?.format() ?? 'unknown';
18
- const types = (0, doc_types_1.getTypesFromFolder)({
19
- rootFolder: path_1.default.resolve('./src/search/'),
20
- inlineTypes: doc_types_1.mermaidHide
21
- });
22
- return `${(0, doc_auto_gen_1.autoGenHeader)({ filename: module.filename, purpose: 'search API', rVersion: rversion })}
23
-
24
- This page briefly summarizes flowR's search API which provides a set of functions to search for nodes in the [Dataflow Graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph) and the
25
- [Normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized%20AST) of a given R code (the search will always consider both, with respect to your search query).
26
- Please see the [Interface](${doc_files_1.FlowrWikiBaseRef}/Interface) wiki page for more information on how to access this API.
27
- Within code, you can execute a search using the ${(0, doc_types_1.shortLink)(flowr_search_executor_1.runSearch.name, types.info)} function.
28
-
29
- For an initial motivation, let's have a look at the following example:
30
-
31
- ${await (0, doc_search_1.showSearch)(shell, 'x <- x * x', flowr_search_builder_1.Q.var('x'))}
32
-
33
- This returns all references to the variable \`x\` in the code.
34
- However, the search API is not limited to simple variable references and can do much more.
35
-
36
- For example, let's have every definition of \`x\` in the code but the first one:
37
-
38
- ${await (0, doc_search_1.showSearch)(shell, 'x <- x * x\nprint(x)\nx <- y <- 3\nprint(x)\nx <- 2', flowr_search_builder_1.Q.var('x').filter(vertex_1.VertexType.VariableDefinition).skip(1))}
39
-
40
- In summary, every search has two parts. It is initialized with a _generator_ (such as \`Q.var('x')\`)
41
- and can be further refined with _transformers_ or _modifiers_.
42
- Such queries can be constructed starting from the ${(0, doc_types_1.shortLink)('Q', types.info)} object (backed by ${(0, doc_types_1.shortLink)('FlowrSearchGenerator', types.info)}) and
43
- are fully serializable so you can use them when communicating with the [Query API](${doc_files_1.FlowrWikiBaseRef}/Query%20API).
44
-
45
- We offer the following generators:
46
-
47
- ${Object.keys(flowr_search_builder_1.Q).sort().map(key => `- ${(0, doc_types_1.shortLink)(`FlowrSearchGenerator::${key}`, types.info)}\\\n${(0, doc_types_1.getDocumentationForType)(`FlowrSearchGenerator::${key}`, types.info)}`).join('\n')}
48
-
49
- Likewise, we have a palette of _transformers_ and _modifiers_:
50
-
51
- ${
52
- /* let's iterate over all methods of FlowrSearchBuilder */
53
- Object.getOwnPropertyNames(Object.getPrototypeOf(new flowr_search_builder_1.FlowrSearchBuilder(undefined)))
54
- .filter(n => n !== 'constructor').sort().map(key => `- ${(0, doc_types_1.shortLink)(`FlowrSearchBuilder::${key}`, types.info)}\\\n${(0, doc_types_1.getDocumentationForType)(`FlowrSearchBuilder::${key}`, types.info)}`).join('\n')}
55
-
56
- Every search (and consequently the search pipeline) works with an array of ${(0, doc_types_1.shortLink)('FlowrSearchElement', types.info)} (neatly wrapped in ${(0, doc_types_1.shortLink)('FlowrSearchElements', types.info)}).
57
- Hence, even operations such as \`.first\` or \`.last\` return an array of elements (albeit with a single or no element).
58
- The search API does its best to stay typesafe wrt. to the return type and the transformers in use.
59
- In addition, it offers optimizer passes to optimize the search pipeline before execution.
60
- They are executed with \`.build\` which may happen automatically, whenever you want to run a search using ${(0, doc_types_1.shortLink)('runSearch', types.info)}.
61
-
62
- `;
63
- }
64
- /** if we run this script, we want a Markdown representation of the capabilities */
65
- if (require.main === module) {
66
- (0, log_1.setMinLevelOfAllLogs)(6 /* LogLevel.Fatal */);
67
- const shell = new shell_1.RShell();
68
- void getText(shell).then(str => {
69
- console.log(str);
70
- }).finally(() => {
71
- shell.close();
72
- });
73
- }
74
- //# sourceMappingURL=print-search-wiki.js.map
@@ -1,6 +0,0 @@
1
- import type { RParseRequest } from '../../r-bridge/retriever';
2
- export interface FileAdapter {
3
- convertRequest(request: RParseRequest): RParseRequest;
4
- }
5
- export type SupportedFormats = 'R' | 'Rmd';
6
- export type SupportedDocumentTypes = '.r' | '.rmd';
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=adapter-format.js.map
@@ -1,27 +0,0 @@
1
- import type { RParseRequest, RParseRequestFromText } from '../../r-bridge/retriever';
2
- import type { SupportedFormats } from './adapter-format';
3
- export declare const FileAdapters: {
4
- readonly R: {
5
- convertRequest: (request: RParseRequest) => RParseRequest;
6
- };
7
- readonly Rmd: {
8
- convertRequest: (request: RParseRequest) => RParseRequestFromText<import("./adapters/rmd-adapter").RmdInfo>;
9
- };
10
- };
11
- export declare const DocumentTypeToFormat: {
12
- readonly '.r': "R";
13
- readonly '.rmd': "Rmd";
14
- };
15
- export type AdapterReturnTypes = ReturnType<typeof FileAdapters[keyof typeof FileAdapters]['convertRequest']>;
16
- /**
17
- * Produce a parse request from a file path
18
- */
19
- export declare function requestFromFile(path: string): AdapterReturnTypes;
20
- /**
21
- * Produce a parse request from a text input
22
- */
23
- export declare function requestFromText(text: string, typeHint?: SupportedFormats): AdapterReturnTypes;
24
- /**
25
- * Infer the file type from a parse request, using file extension or info hints
26
- */
27
- export declare function inferFileType(request: RParseRequest): keyof typeof FileAdapters;