@eagleoutice/flowr 2.0.25 → 2.1.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 (381) hide show
  1. package/benchmark/slicer.js +2 -1
  2. package/benchmark/stats/print.js +3 -4
  3. package/benchmark/stats/size-of.js +9 -7
  4. package/benchmark/summarizer/first-phase/input.d.ts +0 -1
  5. package/benchmark/summarizer/first-phase/input.js +2 -3
  6. package/benchmark/summarizer/first-phase/process.js +7 -7
  7. package/benchmark/summarizer/second-phase/graph.js +1 -2
  8. package/benchmark/summarizer/second-phase/process.d.ts +0 -1
  9. package/benchmark/summarizer/second-phase/process.js +4 -5
  10. package/benchmark/summarizer/summarizer.js +7 -1
  11. package/cli/benchmark-app.js +6 -1
  12. package/cli/common/features.js +2 -3
  13. package/cli/common/script.js +2 -3
  14. package/cli/common/scripts-info.d.ts +69 -1
  15. package/cli/common/scripts-info.js +6 -6
  16. package/cli/flowr-main-options.d.ts +4 -0
  17. package/cli/flowr-main-options.js +88 -0
  18. package/cli/flowr.d.ts +3 -3
  19. package/cli/flowr.js +22 -31
  20. package/cli/repl/commands/{cfg.d.ts → repl-cfg.d.ts} +1 -1
  21. package/cli/repl/commands/{cfg.js → repl-cfg.js} +3 -3
  22. package/cli/repl/commands/{commands.d.ts → repl-commands.d.ts} +3 -1
  23. package/cli/repl/commands/{commands.js → repl-commands.js} +56 -35
  24. package/cli/repl/commands/{dataflow.d.ts → repl-dataflow.d.ts} +1 -1
  25. package/cli/repl/commands/{dataflow.js → repl-dataflow.js} +2 -2
  26. package/cli/repl/commands/{execute.d.ts → repl-execute.d.ts} +1 -1
  27. package/cli/repl/commands/{execute.js → repl-execute.js} +3 -3
  28. package/cli/repl/commands/repl-lineage.d.ts +15 -0
  29. package/cli/repl/commands/{lineage.js → repl-lineage.js} +14 -12
  30. package/cli/repl/commands/{main.js → repl-main.js} +1 -1
  31. package/cli/repl/commands/{normalize.d.ts → repl-normalize.d.ts} +1 -1
  32. package/cli/repl/commands/{normalize.js → repl-normalize.js} +3 -3
  33. package/cli/repl/commands/{parse.d.ts → repl-parse.d.ts} +1 -1
  34. package/cli/repl/commands/{parse.js → repl-parse.js} +3 -2
  35. package/cli/repl/commands/repl-query.d.ts +8 -0
  36. package/cli/repl/commands/repl-query.js +155 -0
  37. package/cli/repl/commands/repl-quit.d.ts +2 -0
  38. package/cli/repl/commands/{quit.js → repl-quit.js} +1 -1
  39. package/cli/repl/commands/{version.d.ts → repl-version.d.ts} +1 -1
  40. package/cli/repl/commands/{version.js → repl-version.js} +4 -4
  41. package/cli/repl/core.d.ts +1 -2
  42. package/cli/repl/core.js +13 -13
  43. package/cli/repl/execute.d.ts +1 -2
  44. package/cli/repl/execute.js +2 -3
  45. package/cli/repl/print-version.js +3 -4
  46. package/cli/repl/server/connection.d.ts +1 -0
  47. package/cli/repl/server/connection.js +45 -12
  48. package/cli/repl/server/messages/{messages.d.ts → all-messages.d.ts} +8 -7
  49. package/cli/repl/server/messages/{messages.js → all-messages.js} +1 -1
  50. package/cli/repl/server/messages/{analysis.d.ts → message-analysis.d.ts} +2 -1
  51. package/cli/repl/server/messages/message-analysis.js +39 -0
  52. package/cli/repl/server/messages/{error.d.ts → message-error.d.ts} +1 -1
  53. package/cli/repl/server/messages/{error.js → message-error.js} +1 -1
  54. package/cli/repl/server/messages/{hello.d.ts → message-hello.d.ts} +4 -3
  55. package/cli/repl/server/messages/message-hello.js +20 -0
  56. package/cli/repl/server/messages/{lineage.d.ts → message-lineage.d.ts} +2 -1
  57. package/cli/repl/server/messages/message-lineage.js +25 -0
  58. package/cli/repl/server/messages/message-query.d.ts +16 -0
  59. package/cli/repl/server/messages/message-query.js +26 -0
  60. package/cli/repl/server/messages/{repl.d.ts → message-repl.d.ts} +3 -1
  61. package/cli/repl/server/messages/message-repl.js +53 -0
  62. package/cli/repl/server/messages/{slice.d.ts → message-slice.d.ts} +2 -1
  63. package/cli/repl/server/messages/{slice.js → message-slice.js} +14 -6
  64. package/cli/repl/server/net.d.ts +0 -1
  65. package/cli/repl/server/send.d.ts +1 -1
  66. package/cli/repl/server/send.js +2 -3
  67. package/cli/repl/server/server.js +2 -2
  68. package/cli/repl/server/validate.d.ts +1 -1
  69. package/cli/repl/server/validate.js +5 -6
  70. package/cli/run-script.d.ts +8 -0
  71. package/cli/run-script.js +18 -0
  72. package/cli/script-core/statistics-core.d.ts +2 -0
  73. package/cli/script-core/statistics-core.js +100 -0
  74. package/cli/script-core/statistics-helper-core.d.ts +2 -0
  75. package/cli/script-core/statistics-helper-core.js +81 -0
  76. package/cli/script-core/summarizer-core.d.ts +2 -0
  77. package/cli/script-core/summarizer-core.js +51 -0
  78. package/cli/statistics-app.js +3 -87
  79. package/cli/statistics-helper-app.js +3 -77
  80. package/cli/summarizer-app.js +2 -48
  81. package/config.d.ts +20 -4
  82. package/config.js +62 -36
  83. package/core/pipeline-executor.js +11 -1
  84. package/core/print/dataflow-printer.js +4 -5
  85. package/core/print/normalize-printer.js +4 -5
  86. package/core/print/parse-printer.js +1 -2
  87. package/core/print/print.js +2 -3
  88. package/core/print/slice-diff-ansi.js +1 -2
  89. package/core/steps/pipeline/create-pipeline.js +1 -2
  90. package/core/steps/pipeline/default-pipelines.d.ts +18 -18
  91. package/core/steps/pipeline/pipeline.js +1 -2
  92. package/dataflow/environments/append.js +1 -2
  93. package/dataflow/environments/built-in-config.d.ts +47 -0
  94. package/dataflow/environments/built-in-config.js +83 -0
  95. package/dataflow/environments/built-in.d.ts +49 -6
  96. package/dataflow/environments/built-in.js +29 -97
  97. package/dataflow/environments/clone.js +2 -2
  98. package/dataflow/environments/default-builtin-config.d.ts +5 -0
  99. package/dataflow/environments/default-builtin-config.js +83 -0
  100. package/dataflow/environments/define.js +1 -2
  101. package/dataflow/environments/diff.js +5 -6
  102. package/dataflow/environments/environment.js +8 -7
  103. package/dataflow/environments/identifier.d.ts +39 -8
  104. package/dataflow/environments/identifier.js +33 -0
  105. package/dataflow/environments/overwrite.d.ts +6 -5
  106. package/dataflow/environments/overwrite.js +16 -9
  107. package/dataflow/environments/resolve-by-name.d.ts +3 -1
  108. package/dataflow/environments/resolve-by-name.js +40 -8
  109. package/dataflow/environments/scoping.js +2 -3
  110. package/dataflow/extractor.js +25 -24
  111. package/dataflow/graph/dataflowgraph-builder.d.ts +139 -0
  112. package/dataflow/graph/dataflowgraph-builder.js +247 -0
  113. package/dataflow/graph/diff.js +12 -11
  114. package/dataflow/graph/edge.d.ts +2 -2
  115. package/dataflow/graph/edge.js +46 -20
  116. package/dataflow/graph/graph.d.ts +14 -6
  117. package/dataflow/graph/graph.js +25 -21
  118. package/dataflow/graph/quads.js +1 -2
  119. package/dataflow/graph/resolve-graph.d.ts +7 -0
  120. package/dataflow/graph/resolve-graph.js +51 -0
  121. package/dataflow/graph/vertex.d.ts +12 -4
  122. package/dataflow/graph/vertex.js +19 -11
  123. package/dataflow/info.d.ts +3 -7
  124. package/dataflow/info.js +7 -8
  125. package/dataflow/internal/linker.d.ts +3 -1
  126. package/dataflow/internal/linker.js +77 -32
  127. package/dataflow/internal/process/functions/call/argument/make-argument.js +5 -5
  128. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -2
  129. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +10 -8
  130. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +5 -1
  131. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +27 -10
  132. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +40 -26
  133. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +30 -20
  134. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +10 -9
  135. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +12 -11
  136. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +6 -5
  137. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +7 -6
  138. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -4
  139. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +10 -6
  140. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +7 -3
  141. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -3
  142. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
  143. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +6 -6
  144. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
  145. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +6 -5
  146. package/dataflow/internal/process/functions/call/common.js +30 -19
  147. package/dataflow/internal/process/functions/call/default-call-handling.js +1 -2
  148. package/dataflow/internal/process/functions/call/known-call-handling.js +8 -6
  149. package/dataflow/internal/process/functions/call/named-call-handling.js +7 -6
  150. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +11 -7
  151. package/dataflow/internal/process/functions/process-argument.js +10 -8
  152. package/dataflow/internal/process/functions/process-parameter.js +8 -6
  153. package/dataflow/internal/process/process-named-call.js +3 -3
  154. package/dataflow/internal/process/process-symbol.js +5 -4
  155. package/dataflow/internal/process/process-uninteresting-leaf.js +1 -2
  156. package/dataflow/internal/process/process-value.js +5 -4
  157. package/dataflow/processor.js +1 -2
  158. package/documentation/data/dfg/doc-data-dfg-util.d.ts +20 -0
  159. package/documentation/data/dfg/doc-data-dfg-util.js +13 -0
  160. package/documentation/data/query/example-query-code.d.ts +1 -0
  161. package/documentation/data/query/example-query-code.js +25 -0
  162. package/documentation/data/server/doc-data-server-messages.d.ts +1 -0
  163. package/documentation/data/server/doc-data-server-messages.js +508 -0
  164. package/documentation/doc-util/doc-auto-gen.d.ts +7 -0
  165. package/documentation/doc-util/doc-auto-gen.js +9 -0
  166. package/documentation/doc-util/doc-cfg.d.ts +7 -0
  167. package/documentation/doc-util/doc-cfg.js +18 -0
  168. package/documentation/doc-util/doc-cli-option.d.ts +8 -0
  169. package/documentation/doc-util/doc-cli-option.js +36 -0
  170. package/documentation/doc-util/doc-code.d.ts +1 -0
  171. package/documentation/doc-util/doc-code.js +7 -0
  172. package/documentation/doc-util/doc-dfg.d.ts +21 -0
  173. package/documentation/doc-util/doc-dfg.js +93 -0
  174. package/documentation/doc-util/doc-docker.d.ts +1 -0
  175. package/documentation/doc-util/doc-docker.js +5 -0
  176. package/documentation/doc-util/doc-env.d.ts +2 -0
  177. package/documentation/doc-util/doc-env.js +20 -0
  178. package/documentation/doc-util/doc-files.d.ts +6 -0
  179. package/documentation/doc-util/doc-files.js +25 -0
  180. package/documentation/doc-util/doc-general.d.ts +2 -0
  181. package/documentation/doc-util/doc-general.js +16 -0
  182. package/documentation/doc-util/doc-hover-over.d.ts +1 -0
  183. package/documentation/doc-util/doc-hover-over.js +7 -0
  184. package/documentation/doc-util/doc-issue.d.ts +1 -0
  185. package/documentation/doc-util/doc-issue.js +6 -0
  186. package/documentation/doc-util/doc-ms.d.ts +1 -0
  187. package/documentation/doc-util/doc-ms.js +8 -0
  188. package/documentation/doc-util/doc-normalized-ast.d.ts +11 -0
  189. package/documentation/doc-util/doc-normalized-ast.js +71 -0
  190. package/documentation/doc-util/doc-query.d.ts +24 -0
  191. package/documentation/doc-util/doc-query.js +113 -0
  192. package/documentation/doc-util/doc-repl.d.ts +13 -0
  193. package/documentation/doc-util/doc-repl.js +79 -0
  194. package/documentation/doc-util/doc-server-message.d.ts +37 -0
  195. package/documentation/doc-util/doc-server-message.js +153 -0
  196. package/documentation/doc-util/doc-structure.d.ts +12 -0
  197. package/documentation/doc-util/doc-structure.js +21 -0
  198. package/documentation/doc-util/doc-types.d.ts +38 -0
  199. package/documentation/doc-util/doc-types.js +276 -0
  200. package/{r-bridge/data/print.js → documentation/print-capabilities-markdown.js} +8 -4
  201. package/documentation/print-dataflow-graph-wiki.d.ts +1 -0
  202. package/documentation/print-dataflow-graph-wiki.js +849 -0
  203. package/documentation/print-interface-wiki.d.ts +1 -0
  204. package/documentation/print-interface-wiki.js +401 -0
  205. package/documentation/print-normalized-ast-wiki.d.ts +1 -0
  206. package/documentation/print-normalized-ast-wiki.js +98 -0
  207. package/documentation/print-query-wiki.d.ts +1 -0
  208. package/documentation/print-query-wiki.js +215 -0
  209. package/package.json +29 -33
  210. package/queries/base-query-format.d.ts +11 -0
  211. package/{cli/repl/server/messages/hello.js → queries/base-query-format.js} +1 -1
  212. package/queries/call-context-query/call-context-query-executor.d.ts +11 -0
  213. package/queries/call-context-query/call-context-query-executor.js +255 -0
  214. package/queries/call-context-query/call-context-query-format.d.ts +72 -0
  215. package/queries/call-context-query/call-context-query-format.js +17 -0
  216. package/queries/query-schema.d.ts +7 -0
  217. package/queries/query-schema.js +31 -0
  218. package/queries/query.d.ts +35 -0
  219. package/queries/query.js +57 -0
  220. package/queries/two-layer-collector.d.ts +8 -0
  221. package/queries/two-layer-collector.js +31 -0
  222. package/queries/virtual-query/compound-query.d.ts +24 -0
  223. package/queries/virtual-query/compound-query.js +18 -0
  224. package/queries/virtual-query/virtual-queries.d.ts +15 -0
  225. package/queries/virtual-query/virtual-queries.js +8 -0
  226. package/r-bridge/data/data.d.ts +5 -0
  227. package/r-bridge/data/data.js +6 -0
  228. package/r-bridge/data/get.js +2 -3
  229. package/r-bridge/init.js +2 -2
  230. package/r-bridge/lang-4.x/ast/model/collect.js +1 -2
  231. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -2
  232. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -0
  233. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -0
  234. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +3 -0
  235. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +5 -0
  236. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +4 -0
  237. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -1
  238. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +10 -1
  239. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +5 -0
  240. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +3 -0
  241. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +3 -0
  242. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +3 -0
  243. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +3 -0
  244. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -1
  245. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -0
  246. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +3 -0
  247. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -2
  248. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -0
  249. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -2
  250. package/r-bridge/lang-4.x/ast/model/operators.js +27 -26
  251. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +9 -9
  252. package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -2
  253. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -0
  254. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +26 -3
  255. package/r-bridge/lang-4.x/ast/model/processing/role.js +1 -2
  256. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +23 -23
  257. package/r-bridge/lang-4.x/ast/model/processing/visitor.js +23 -23
  258. package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -2
  259. package/r-bridge/lang-4.x/ast/model/type.js +221 -12
  260. package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
  261. package/r-bridge/lang-4.x/ast/parser/json/parser.js +6 -5
  262. package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +3 -3
  263. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then-else.js +4 -4
  264. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then.js +7 -7
  265. package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/normalize-expression.js +4 -4
  266. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-argument.js +10 -10
  267. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-call.js +18 -18
  268. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-definition.js +8 -8
  269. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-parameter.js +9 -9
  270. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-break.js +3 -3
  271. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-for.js +10 -10
  272. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-next.js +3 -3
  273. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-repeat.js +5 -5
  274. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-while.js +7 -7
  275. package/r-bridge/lang-4.x/ast/parser/xml/internal/normalize-access.js +12 -12
  276. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-binary.js +14 -14
  277. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-unary.js +4 -4
  278. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-comment.js +3 -3
  279. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-line-directive.js +4 -4
  280. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-delimiter.js +3 -3
  281. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-expressions.js +13 -13
  282. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-root.js +6 -6
  283. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-single-node.js +19 -19
  284. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-number.js +5 -5
  285. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-string.js +3 -3
  286. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-symbol.js +2 -3
  287. package/r-bridge/lang-4.x/ast/parser/xml/normalize-meta.js +12 -12
  288. package/r-bridge/lang-4.x/convert-values.js +7 -7
  289. package/r-bridge/retriever.js +12 -11
  290. package/r-bridge/shell.d.ts +0 -1
  291. package/r-bridge/shell.js +6 -1
  292. package/reconstruct/auto-select/auto-select-defaults.js +1 -2
  293. package/reconstruct/auto-select/magic-comments.js +3 -3
  294. package/reconstruct/reconstruct.js +4 -3
  295. package/slicing/criterion/collect-all.js +1 -2
  296. package/slicing/criterion/parse.d.ts +1 -1
  297. package/slicing/criterion/parse.js +6 -5
  298. package/slicing/static/fingerprint.js +2 -3
  299. package/slicing/static/slice-call.js +9 -9
  300. package/slicing/static/static-slicer.js +5 -4
  301. package/statistics/features/common-syntax-probability.js +13 -13
  302. package/statistics/features/feature.d.ts +5 -9
  303. package/statistics/features/feature.js +2 -2
  304. package/statistics/features/post-processing.js +2 -3
  305. package/statistics/features/supported/assignments/assignments.js +3 -2
  306. package/statistics/features/supported/assignments/post-process.js +1 -2
  307. package/statistics/features/supported/comments/post-process.js +1 -2
  308. package/statistics/features/supported/control-flow/control-flow.js +4 -3
  309. package/statistics/features/supported/control-flow/post-process.js +1 -2
  310. package/statistics/features/supported/data-access/data-access.d.ts +2 -2
  311. package/statistics/features/supported/data-access/data-access.js +3 -2
  312. package/statistics/features/supported/data-access/post-process.js +1 -2
  313. package/statistics/features/supported/defined-functions/defined-functions.js +9 -7
  314. package/statistics/features/supported/defined-functions/post-process.d.ts +1 -1
  315. package/statistics/features/supported/defined-functions/post-process.js +2 -3
  316. package/statistics/features/supported/expression-list/post-process.js +1 -2
  317. package/statistics/features/supported/expression-list/{expression-list.js → statistics-expression-list.js} +4 -3
  318. package/statistics/features/supported/loops/loops.js +8 -7
  319. package/statistics/features/supported/loops/post-process.js +1 -2
  320. package/statistics/features/supported/used-functions/post-process.js +2 -3
  321. package/statistics/features/supported/used-functions/used-functions.d.ts +1 -1
  322. package/statistics/features/supported/used-functions/used-functions.js +4 -3
  323. package/statistics/features/supported/used-packages/post-process.js +1 -2
  324. package/statistics/features/supported/values/post-process.js +1 -2
  325. package/statistics/features/supported/variables/post-process.js +2 -3
  326. package/statistics/features/supported/variables/variables.js +2 -1
  327. package/statistics/meta-statistics.js +1 -2
  328. package/statistics/output/print-stats.js +4 -5
  329. package/statistics/output/statistics-file.js +5 -5
  330. package/statistics/statistics.js +2 -3
  331. package/statistics/summarizer/auto-detect.js +1 -2
  332. package/statistics/summarizer/post-process/clusterer.js +1 -2
  333. package/statistics/summarizer/post-process/file-based-count.js +2 -3
  334. package/statistics/summarizer/post-process/histogram.js +3 -4
  335. package/statistics/summarizer/post-process/post-process-output.js +2 -3
  336. package/statistics/summarizer/second-phase/process.d.ts +2 -0
  337. package/statistics/summarizer/second-phase/process.js +2 -2
  338. package/statistics/summarizer/summarizer.js +8 -1
  339. package/util/ansi.d.ts +1 -0
  340. package/util/ansi.js +27 -4
  341. package/util/args.js +2 -3
  342. package/util/arrays.js +8 -9
  343. package/util/assert.js +5 -6
  344. package/util/bimap.d.ts +4 -4
  345. package/util/cfg/cfg.d.ts +1 -0
  346. package/util/cfg/cfg.js +8 -5
  347. package/util/cfg/visitor.d.ts +8 -13
  348. package/util/cfg/visitor.js +22 -56
  349. package/util/diff.js +1 -2
  350. package/util/files.d.ts +0 -1
  351. package/util/files.js +11 -8
  352. package/util/json.js +2 -3
  353. package/util/mermaid/ast.js +7 -7
  354. package/util/mermaid/cfg.js +2 -3
  355. package/util/mermaid/dfg.d.ts +12 -4
  356. package/util/mermaid/dfg.js +28 -16
  357. package/util/mermaid/mermaid.js +5 -4
  358. package/util/numbers.js +1 -2
  359. package/util/objects.d.ts +7 -0
  360. package/util/objects.js +13 -3
  361. package/util/os.js +1 -2
  362. package/util/quads.js +5 -5
  363. package/util/random.js +2 -2
  364. package/util/range.js +8 -9
  365. package/util/schema.d.ts +11 -0
  366. package/util/schema.js +75 -0
  367. package/util/set.js +2 -3
  368. package/util/strings.js +3 -4
  369. package/util/summarizer.js +4 -4
  370. package/util/text.d.ts +1 -0
  371. package/util/text.js +20 -0
  372. package/util/time.js +1 -2
  373. package/util/version.js +2 -3
  374. package/cli/repl/commands/lineage.d.ts +0 -15
  375. package/cli/repl/commands/quit.d.ts +0 -2
  376. package/cli/repl/server/messages/analysis.js +0 -21
  377. package/cli/repl/server/messages/lineage.js +0 -17
  378. package/cli/repl/server/messages/repl.js +0 -37
  379. /package/cli/repl/commands/{main.d.ts → repl-main.d.ts} +0 -0
  380. /package/{r-bridge/data/print.d.ts → documentation/print-capabilities-markdown.d.ts} +0 -0
  381. /package/statistics/features/supported/expression-list/{expression-list.d.ts → statistics-expression-list.d.ts} +0 -0
package/util/arrays.js CHANGED
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.arrayEqual = exports.array2bag = exports.sum = exports.getUniqueCombinationsOfSize = exports.partition = exports.allPermutations = exports.partitionArray = exports.splitArrayOn = void 0;
3
+ exports.splitArrayOn = splitArrayOn;
4
+ exports.partitionArray = partitionArray;
5
+ exports.allPermutations = allPermutations;
6
+ exports.partition = partition;
7
+ exports.getUniqueCombinationsOfSize = getUniqueCombinationsOfSize;
8
+ exports.sum = sum;
9
+ exports.array2bag = array2bag;
10
+ exports.arrayEqual = arrayEqual;
4
11
  const assert_1 = require("./assert");
5
12
  /**
6
13
  * Splits the array every time the given predicate fires.
@@ -36,7 +43,6 @@ function splitArrayOn(arr, predicate) {
36
43
  }
37
44
  return result;
38
45
  }
39
- exports.splitArrayOn = splitArrayOn;
40
46
  /**
41
47
  * Returns a tuple of two arrays, where the first one contains all elements for which the predicate returned true,
42
48
  * and the second one contains all elements for which the predicate returned false.
@@ -54,7 +60,6 @@ function partitionArray(arr, predicate) {
54
60
  }
55
61
  return [left, right];
56
62
  }
57
- exports.partitionArray = partitionArray;
58
63
  /**
59
64
  * Generate all permutations of the given array using Heap's algorithm (with its non-recursive variant).
60
65
  *
@@ -82,7 +87,6 @@ function* allPermutations(arr) {
82
87
  }
83
88
  }
84
89
  }
85
- exports.allPermutations = allPermutations;
86
90
  function partition(arr, predicate) {
87
91
  const left = [];
88
92
  const right = [];
@@ -96,7 +100,6 @@ function partition(arr, predicate) {
96
100
  }
97
101
  return [left, right];
98
102
  }
99
- exports.partition = partition;
100
103
  /**
101
104
  * Generate all unique combinations of the array with the given size.
102
105
  * In other words, given `[a,b,c]`, as well as `minSize=2` and `maxSize=2`, this will generate `[a,b]`, `[a,c]` and `[b,c]`,
@@ -137,7 +140,6 @@ function* getUniqueCombinationsOfSize(array, minSize = 0, maxSize = array.length
137
140
  }
138
141
  yield* p([], 0, true);
139
142
  }
140
- exports.getUniqueCombinationsOfSize = getUniqueCombinationsOfSize;
141
143
  /**
142
144
  * Returns the sum of all elements in the given array
143
145
  */
@@ -148,7 +150,6 @@ function sum(arr) {
148
150
  }
149
151
  return sum;
150
152
  }
151
- exports.sum = sum;
152
153
  /**
153
154
  * Converts an array into a bag data-structure (in the form of a map mapping the entries/keys to their counts)
154
155
  */
@@ -159,7 +160,6 @@ function array2bag(arr) {
159
160
  }
160
161
  return result;
161
162
  }
162
- exports.array2bag = array2bag;
163
163
  function arrayEqual(a, b) {
164
164
  if (a === undefined || b === undefined) {
165
165
  return a === b;
@@ -174,5 +174,4 @@ function arrayEqual(a, b) {
174
174
  }
175
175
  return true;
176
176
  }
177
- exports.arrayEqual = arrayEqual;
178
177
  //# sourceMappingURL=arrays.js.map
package/util/assert.js CHANGED
@@ -1,24 +1,24 @@
1
1
  "use strict";
2
2
  /** use this to ensure that all cases are covered in case of a selection */
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.guard = exports.isNotNull = exports.isUndefined = exports.isNotUndefined = exports.assertUnreachable = void 0;
4
+ exports.assertUnreachable = assertUnreachable;
5
+ exports.isNotUndefined = isNotUndefined;
6
+ exports.isUndefined = isUndefined;
7
+ exports.isNotNull = isNotNull;
8
+ exports.guard = guard;
5
9
  /* istanbul ignore next */
6
10
  function assertUnreachable(x) {
7
11
  throw new Error(`Unexpected object: ${JSON.stringify(x)}`);
8
12
  }
9
- exports.assertUnreachable = assertUnreachable;
10
13
  function isNotUndefined(x) {
11
14
  return x !== undefined;
12
15
  }
13
- exports.isNotUndefined = isNotUndefined;
14
16
  function isUndefined(x) {
15
17
  return x === undefined;
16
18
  }
17
- exports.isUndefined = isUndefined;
18
19
  function isNotNull(x) {
19
20
  return x !== null;
20
21
  }
21
- exports.isNotNull = isNotNull;
22
22
  class GuardError extends Error {
23
23
  constructor(message) {
24
24
  super(message);
@@ -35,5 +35,4 @@ function guard(assertion, message = 'Assertion failed') {
35
35
  throw new GuardError(typeof message === 'string' ? message : message());
36
36
  }
37
37
  }
38
- exports.guard = guard;
39
38
  //# sourceMappingURL=assert.js.map
package/util/bimap.d.ts CHANGED
@@ -9,16 +9,16 @@ export declare class BiMap<K, V extends object> implements Map<K, V> {
9
9
  private readonly k2v;
10
10
  private v2k;
11
11
  constructor(base?: Iterable<[K, V]>);
12
- [Symbol.iterator](): IterableIterator<[K, V]>;
12
+ [Symbol.iterator](): MapIterator<[K, V]>;
13
13
  clear(): void;
14
14
  delete(key: K): boolean;
15
- entries(): IterableIterator<[K, V]>;
15
+ entries(): MapIterator<[K, V]>;
16
16
  forEach(callbackFunction: (value: V, key: K, map: Map<K, V>) => void): void;
17
17
  get(key: K): V | undefined;
18
18
  getKey(value: V): K | undefined;
19
19
  has(key: K): boolean;
20
20
  hasValue(value: V): boolean;
21
- keys(): IterableIterator<K>;
21
+ keys(): MapIterator<K>;
22
22
  set(key: K, value: V): this;
23
- values(): IterableIterator<V>;
23
+ values(): MapIterator<V>;
24
24
  }
package/util/cfg/cfg.d.ts CHANGED
@@ -38,6 +38,7 @@ export declare class ControlFlowGraph {
38
38
  private edgeInformation;
39
39
  addVertex(vertex: CfgVertex, rootVertex?: boolean): this;
40
40
  addEdge(from: NodeId, to: NodeId, edge: CfgEdge): this;
41
+ outgoing(node: NodeId): ReadonlyMap<NodeId, CfgEdge> | undefined;
41
42
  rootVertexIds(): ReadonlySet<NodeId>;
42
43
  vertices(): ReadonlyMap<NodeId, CfgVertex>;
43
44
  edges(): ReadonlyMap<NodeId, ReadonlyMap<NodeId, CfgEdge>>;
package/util/cfg/cfg.js CHANGED
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cfg2quads = exports.equalCfg = exports.extractCFG = exports.emptyControlFlowInformation = exports.ControlFlowGraph = void 0;
3
+ exports.ControlFlowGraph = void 0;
4
+ exports.emptyControlFlowInformation = emptyControlFlowInformation;
5
+ exports.extractCFG = extractCFG;
6
+ exports.equalCfg = equalCfg;
7
+ exports.cfg2quads = cfg2quads;
4
8
  const set_1 = require("../set");
5
9
  const quads_1 = require("../quads");
6
10
  const log_1 = require("../log");
@@ -33,6 +37,9 @@ class ControlFlowGraph {
33
37
  this.edgeInformation.get(from)?.set(to, edge);
34
38
  return this;
35
39
  }
40
+ outgoing(node) {
41
+ return this.edgeInformation.get(node);
42
+ }
36
43
  rootVertexIds() {
37
44
  return this.rootVertices;
38
45
  }
@@ -65,7 +72,6 @@ function emptyControlFlowInformation() {
65
72
  graph: new ControlFlowGraph()
66
73
  };
67
74
  }
68
- exports.emptyControlFlowInformation = emptyControlFlowInformation;
69
75
  const cfgFolds = {
70
76
  foldNumber: cfgLeaf("expression" /* CfgVertexType.Expression */),
71
77
  foldString: cfgLeaf("expression" /* CfgVertexType.Expression */),
@@ -98,7 +104,6 @@ const cfgFolds = {
98
104
  function extractCFG(ast) {
99
105
  return (0, fold_1.foldAst)(ast.ast, cfgFolds);
100
106
  }
101
- exports.extractCFG = extractCFG;
102
107
  function cfgLeaf(type) {
103
108
  return (leaf) => {
104
109
  const graph = new ControlFlowGraph();
@@ -460,7 +465,6 @@ function equalCfg(a, b) {
460
465
  }
461
466
  return true;
462
467
  }
463
- exports.equalCfg = equalCfg;
464
468
  /**
465
469
  * @see df2quads
466
470
  * @see serialize2quads
@@ -488,5 +492,4 @@ function cfg2quads(cfg, config) {
488
492
  returns: cfg.returns
489
493
  }, config);
490
494
  }
491
- exports.cfg2quads = cfg2quads;
492
495
  //# sourceMappingURL=cfg.js.map
@@ -1,14 +1,9 @@
1
- import type { CfgEdge, CfgVertex, ControlFlowInformation } from './cfg';
1
+ import type { ControlFlowGraph } from './cfg';
2
2
  import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
3
- export interface NodeVisitingContext {
4
- parent: {
5
- vertex: NodeId;
6
- edge: CfgEdge;
7
- } | 'root';
8
- cfg: ControlFlowInformation;
9
- visited: Set<NodeId>;
10
- /** contains the current vertex as well */
11
- siblings: NodeId[];
12
- }
13
- export type OnEnterVisitNode = (node: CfgVertex, context: NodeVisitingContext) => void;
14
- export declare function visitCfg(cfg: ControlFlowInformation, onVisit: OnEnterVisitNode): void;
3
+ /**
4
+ * Visit all nodes reachable from the start node in the control flow graph, traversing the dependencies but ignoring cycles.
5
+ * @param graph - The control flow graph.
6
+ * @param startNode - The node to start the traversal from.
7
+ * @param visitor - The visitor function to call for each node, if you return true the traversal from this node will be stopped.
8
+ */
9
+ export declare function visitInReverseOrder(graph: ControlFlowGraph, startNode: NodeId, visitor: (node: NodeId) => boolean | void): void;
@@ -1,64 +1,30 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.visitCfg = void 0;
4
- const assert_1 = require("../assert");
5
- class ControlFlowGraphExecutionTraceVisitor {
6
- onEnter;
7
- constructor(onEnter) {
8
- this.onEnter = onEnter;
9
- }
10
- visitSingle(node, context) {
11
- if (context.visited.has(node.id)) {
12
- return;
13
- }
14
- // only visit a node if we have visited all of its successors
15
- const successorEdges = context.cfg.graph.edges().get(node.id);
16
- if (successorEdges) {
17
- for (const [target,] of successorEdges) {
18
- if (!context.visited.has(target)) {
19
- return;
20
- }
21
- }
22
- }
23
- context.visited.add(node.id);
24
- this.onEnter(node, context);
25
- // find all ingoing edges
26
- const predecessors = this.retrieveAllPredecessors(context, node);
27
- const siblings = predecessors.map(p => p.source);
28
- for (const predecessor of predecessors) {
29
- const { source, edge } = predecessor;
30
- const sourceVertex = context.cfg.graph.vertices().get(source);
31
- (0, assert_1.guard)(sourceVertex !== undefined, () => `Source vertex with id ${source} not found`);
32
- this.visitSingle(sourceVertex, {
33
- parent: { vertex: node.id, edge },
34
- cfg: context.cfg,
35
- visited: context.visited,
36
- siblings
37
- });
3
+ exports.visitInReverseOrder = visitInReverseOrder;
4
+ /**
5
+ * Visit all nodes reachable from the start node in the control flow graph, traversing the dependencies but ignoring cycles.
6
+ * @param graph - The control flow graph.
7
+ * @param startNode - The node to start the traversal from.
8
+ * @param visitor - The visitor function to call for each node, if you return true the traversal from this node will be stopped.
9
+ */
10
+ function visitInReverseOrder(graph, startNode,
11
+ // eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- void is used to indicate that the return value is ignored/we never stop
12
+ visitor) {
13
+ const visited = new Set();
14
+ const queue = [startNode];
15
+ while (queue.length > 0) {
16
+ const current = queue.pop();
17
+ if (visited.has(current)) {
18
+ continue;
38
19
  }
39
- }
40
- retrieveAllPredecessors(context, node) {
41
- const predecessors = [];
42
- for (const entry of context.cfg.graph.edges().entries()) {
43
- const [source, targets] = entry;
44
- const target = targets.get(node.id);
45
- if (target) {
46
- predecessors.push({ source, edge: target });
47
- }
20
+ visited.add(current);
21
+ if (visitor(current)) {
22
+ continue;
48
23
  }
49
- return predecessors;
50
- }
51
- visit(cfg) {
52
- const visited = new Set();
53
- for (const id of cfg.entryPoints) {
54
- const node = cfg.graph.vertices().get(id);
55
- (0, assert_1.guard)(node !== undefined, `Node with id ${id} not present`);
56
- this.visitSingle(node, { parent: 'root', cfg, siblings: [...cfg.entryPoints], visited });
24
+ const incoming = graph.outgoing(current) ?? [];
25
+ for (const [from] of incoming) {
26
+ queue.push(from);
57
27
  }
58
28
  }
59
29
  }
60
- function visitCfg(cfg, onVisit) {
61
- return new ControlFlowGraphExecutionTraceVisitor(onVisit).visit(cfg);
62
- }
63
- exports.visitCfg = visitCfg;
64
30
  //# sourceMappingURL=visitor.js.map
package/util/diff.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * @module
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.setDifference = void 0;
9
+ exports.setDifference = setDifference;
10
10
  const set_1 = require("./set");
11
11
  function setDifference(left, right, info) {
12
12
  const lWithoutR = (0, set_1.setMinus)(left, right);
@@ -27,5 +27,4 @@ function setDifference(left, right, info) {
27
27
  info.report.addComment(message);
28
28
  }
29
29
  }
30
- exports.setDifference = setDifference;
31
30
  //# sourceMappingURL=diff.js.map
package/util/files.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import type { RParseRequestFromFile } from '../r-bridge/retriever';
3
2
  /**
4
3
  * Represents a table, identified by a header and a list of rows.
package/util/files.js CHANGED
@@ -26,7 +26,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
26
26
  return (mod && mod.__esModule) ? mod : { "default": mod };
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.getParentDirectory = exports.readLineByLineSync = exports.readLineByLine = exports.writeTableAsCsv = exports.allRFilesFrom = exports.allRFiles = exports.getAllFiles = void 0;
29
+ exports.getAllFiles = getAllFiles;
30
+ exports.allRFiles = allRFiles;
31
+ exports.allRFilesFrom = allRFilesFrom;
32
+ exports.writeTableAsCsv = writeTableAsCsv;
33
+ exports.readLineByLine = readLineByLine;
34
+ exports.readLineByLineSync = readLineByLineSync;
35
+ exports.getParentDirectory = getParentDirectory;
30
36
  const fs_1 = __importStar(require("fs"));
31
37
  const path_1 = __importDefault(require("path"));
32
38
  const log_1 = require("./log");
@@ -49,7 +55,6 @@ async function* getAllFiles(dir, suffix = /.*/) {
49
55
  }
50
56
  }
51
57
  }
52
- exports.getAllFiles = getAllFiles;
53
58
  const rFileRegex = /\.[rR]$/;
54
59
  /**
55
60
  * Retrieves all R files in a given directory (asynchronously)
@@ -81,7 +86,6 @@ async function* allRFiles(input, limit = Number.MAX_VALUE) {
81
86
  }
82
87
  return count;
83
88
  }
84
- exports.allRFiles = allRFiles;
85
89
  /**
86
90
  * Retrieves all R files in a given set of directories and files (asynchronously)
87
91
  *
@@ -103,12 +107,10 @@ async function* allRFilesFrom(inputs, limit) {
103
107
  }
104
108
  return count;
105
109
  }
106
- exports.allRFilesFrom = allRFilesFrom;
107
110
  function writeTableAsCsv(table, file, sep = ',', newline = '\n') {
108
111
  const csv = [table.header.join(sep), ...table.rows.map(row => row.join(sep))].join(newline);
109
112
  fs_1.default.writeFileSync(file, csv);
110
113
  }
111
- exports.writeTableAsCsv = writeTableAsCsv;
112
114
  /**
113
115
  * Reads a file line by line and calls the given function for each line.
114
116
  * The `lineNumber` starts at `0`.
@@ -124,7 +126,6 @@ async function readLineByLine(filePath, onLine) {
124
126
  await onLine(line, counter++);
125
127
  }
126
128
  }
127
- exports.readLineByLine = readLineByLine;
128
129
  /**
129
130
  * Reads a file line by line and calls the given function for each line.
130
131
  * The `lineNumber` starts at `0`.
@@ -132,6 +133,10 @@ exports.readLineByLine = readLineByLine;
132
133
  * See {@link readLineByLine} for an asynchronous version.
133
134
  */
134
135
  function readLineByLineSync(filePath, onLine) {
136
+ if (!fs_1.default.existsSync(filePath)) {
137
+ log_1.log.warn(`File ${filePath} does not exist`);
138
+ return;
139
+ }
135
140
  const reader = new n_readlines_1.default(filePath);
136
141
  let line;
137
142
  let counter = 0;
@@ -140,7 +145,6 @@ function readLineByLineSync(filePath, onLine) {
140
145
  onLine(line, counter++);
141
146
  }
142
147
  }
143
- exports.readLineByLineSync = readLineByLineSync;
144
148
  /**
145
149
  * Chops off the last part of the given directory path after a path separator, essentially returning the path's parent directory.
146
150
  * If an absolute path is passed, the returned path is also absolute.
@@ -150,5 +154,4 @@ function getParentDirectory(directory) {
150
154
  // apparently this is somehow the best way to do it in node, what
151
155
  return directory.split(path_1.default.sep).slice(0, -1).join(path_1.default.sep);
152
156
  }
153
- exports.getParentDirectory = getParentDirectory;
154
157
  //# sourceMappingURL=files.js.map
package/util/json.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsonBigIntRetriever = exports.jsonReplacer = void 0;
3
+ exports.jsonReplacer = jsonReplacer;
4
+ exports.jsonBigIntRetriever = jsonBigIntRetriever;
4
5
  // to get the types within JSON.stringify
5
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
7
  function jsonReplacer(key, value) {
@@ -15,7 +16,6 @@ function jsonReplacer(key, value) {
15
16
  return value;
16
17
  }
17
18
  }
18
- exports.jsonReplacer = jsonReplacer;
19
19
  function jsonBigIntRetriever(key, value) {
20
20
  if (typeof value === 'string' && value.endsWith('n')) {
21
21
  return BigInt(value.slice(0, -1));
@@ -24,5 +24,4 @@ function jsonBigIntRetriever(key, value) {
24
24
  return value;
25
25
  }
26
26
  }
27
- exports.jsonBigIntRetriever = jsonBigIntRetriever;
28
27
  //# sourceMappingURL=json.js.map
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizedAstToMermaidUrl = exports.normalizedAstToMermaid = void 0;
3
+ exports.normalizedAstToMermaid = normalizedAstToMermaid;
4
+ exports.normalizedAstToMermaidUrl = normalizedAstToMermaidUrl;
4
5
  const mermaid_1 = require("./mermaid");
5
6
  const visitor_1 = require("../../r-bridge/lang-4.x/ast/model/processing/visitor");
6
- function normalizedAstToMermaid(ast, prefix = '') {
7
- let output = prefix + 'flowchart TD\n';
7
+ const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
8
+ function normalizedAstToMermaid(ast, prefix = 'flowchart TD\n') {
9
+ let output = prefix;
8
10
  (0, visitor_1.visitAst)(ast, n => {
9
11
  const name = `${n.type} (${n.info.id})\\n${n.lexeme ?? ' '}`;
10
12
  output += ` n${n.info.id}(["${(0, mermaid_1.escapeMarkdown)(name)}"])\n`;
@@ -13,7 +15,7 @@ function normalizedAstToMermaid(ast, prefix = '') {
13
15
  const roleSuffix = context.role === "expr-list-child" /* RoleInParent.ExpressionListChild */ || context.role === "call-argument" /* RoleInParent.FunctionCallArgument */ || context.role === "function-def-param" /* RoleInParent.FunctionDefinitionParameter */ ? `-${context.index}` : '';
14
16
  output += ` n${n.info.parent} -->|"${context.role}${roleSuffix}"| n${n.info.id}\n`;
15
17
  }
16
- if (n.type === "RExpressionList" /* RType.ExpressionList */ && n.grouping !== undefined) {
18
+ if (n.type === type_1.RType.ExpressionList && n.grouping !== undefined) {
17
19
  output += ` n${n.info.id} -.-|"group-open"| n${n.grouping[0].info.id}\n`;
18
20
  output += ` n${n.info.id} -.-|"group-close"| n${n.grouping[1].info.id}\n`;
19
21
  }
@@ -21,12 +23,10 @@ function normalizedAstToMermaid(ast, prefix = '') {
21
23
  });
22
24
  return output;
23
25
  }
24
- exports.normalizedAstToMermaid = normalizedAstToMermaid;
25
26
  /**
26
27
  * Use mermaid to visualize the normalized AST.
27
28
  */
28
- function normalizedAstToMermaidUrl(ast, prefix = '') {
29
+ function normalizedAstToMermaidUrl(ast, prefix = 'flowchart TD\n') {
29
30
  return (0, mermaid_1.mermaidCodeToUrl)(normalizedAstToMermaid(ast, prefix));
30
31
  }
31
- exports.normalizedAstToMermaidUrl = normalizedAstToMermaidUrl;
32
32
  //# sourceMappingURL=ast.js.map
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cfgToMermaidUrl = exports.cfgToMermaid = void 0;
3
+ exports.cfgToMermaid = cfgToMermaid;
4
+ exports.cfgToMermaidUrl = cfgToMermaidUrl;
4
5
  const mermaid_1 = require("./mermaid");
5
6
  function getLexeme(n) {
6
7
  return n ? n.info.fullLexeme ?? n.lexeme ?? '<unknown>' : '';
@@ -33,12 +34,10 @@ function cfgToMermaid(cfg, normalizedAst, prefix = '') {
33
34
  }
34
35
  return output;
35
36
  }
36
- exports.cfgToMermaid = cfgToMermaid;
37
37
  /**
38
38
  * Use mermaid to visualize the normalized AST.
39
39
  */
40
40
  function cfgToMermaidUrl(cfg, normalizedAst, prefix = '') {
41
41
  return (0, mermaid_1.mermaidCodeToUrl)(cfgToMermaid(cfg, normalizedAst, prefix));
42
42
  }
43
- exports.cfgToMermaidUrl = cfgToMermaidUrl;
44
43
  //# sourceMappingURL=cfg.js.map
@@ -1,14 +1,20 @@
1
1
  import type { SourceRange } from '../range';
2
2
  import type { DataflowGraph } from '../../dataflow/graph/graph';
3
3
  import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
4
+ import type { IdentifierDefinition } from '../../dataflow/environments/identifier';
4
5
  type MarkVertex = NodeId;
5
6
  type MarkEdge = `${string}->${string}`;
6
- type Mark = MarkVertex | MarkEdge;
7
+ export type MermaidMarkdownMark = MarkVertex | MarkEdge;
8
+ export interface MermaidMarkStyle {
9
+ readonly vertex: string;
10
+ readonly edge: string;
11
+ }
7
12
  interface MermaidGraph {
8
13
  nodeLines: string[];
9
14
  edgeLines: string[];
10
15
  includeEnvironments: boolean;
11
- mark: ReadonlySet<Mark> | undefined;
16
+ mark: ReadonlySet<MermaidMarkdownMark> | undefined;
17
+ markStyle: MermaidMarkStyle;
12
18
  /** in the form of from-\>to because I am lazy, see {@link encodeEdge} */
13
19
  presentEdges: Set<string>;
14
20
  rootGraph: DataflowGraph;
@@ -17,12 +23,14 @@ interface MermaidGraph {
17
23
  * Prints a {@link SourceRange|range} as a human readable string.
18
24
  */
19
25
  export declare function formatRange(range: SourceRange | undefined): string;
26
+ export declare function printIdentifier(id: IdentifierDefinition): string;
20
27
  interface MermaidGraphConfiguration {
21
28
  graph: DataflowGraph;
22
29
  prefix?: string | null;
23
30
  idPrefix?: string;
24
31
  includeEnvironments?: boolean;
25
- mark?: ReadonlySet<Mark>;
32
+ mark?: ReadonlySet<MermaidMarkdownMark>;
33
+ markStyle?: MermaidMarkStyle;
26
34
  rootGraph?: DataflowGraph;
27
35
  presentEdges?: Set<string>;
28
36
  }
@@ -41,7 +49,7 @@ export declare function graphToMermaidUrl(graph: DataflowGraph, includeEnvironme
41
49
  export interface LabeledDiffGraph {
42
50
  label: string;
43
51
  graph: DataflowGraph;
44
- mark?: Set<Mark>;
52
+ mark?: Set<MermaidMarkdownMark>;
45
53
  }
46
54
  /** uses same id map but ensures, it is different from the rhs so that mermaid can work with that */
47
55
  export declare function diffGraphsToMermaid(left: LabeledDiffGraph, right: LabeledDiffGraph, prefix: string): string;