@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
@@ -0,0 +1,508 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.documentAllMessages = documentAllMessages;
4
+ const doc_server_message_1 = require("../../doc-util/doc-server-message");
5
+ const message_hello_1 = require("../../../cli/repl/server/messages/message-hello");
6
+ const shell_1 = require("../../../r-bridge/shell");
7
+ const doc_docker_1 = require("../../doc-util/doc-docker");
8
+ const doc_cli_option_1 = require("../../doc-util/doc-cli-option");
9
+ const doc_code_1 = require("../../doc-util/doc-code");
10
+ const message_analysis_1 = require("../../../cli/repl/server/messages/message-analysis");
11
+ const doc_files_1 = require("../../doc-util/doc-files");
12
+ const cfg_1 = require("../../../util/mermaid/cfg");
13
+ const doc_cfg_1 = require("../../doc-util/doc-cfg");
14
+ const doc_issue_1 = require("../../doc-util/doc-issue");
15
+ const message_slice_1 = require("../../../cli/repl/server/messages/message-slice");
16
+ const message_repl_1 = require("../../../cli/repl/server/messages/message-repl");
17
+ const message_query_1 = require("../../../cli/repl/server/messages/message-query");
18
+ const example_query_code_1 = require("../query/example-query-code");
19
+ const call_context_query_format_1 = require("../../../queries/call-context-query/call-context-query-format");
20
+ const message_lineage_1 = require("../../../cli/repl/server/messages/message-lineage");
21
+ function documentAllMessages() {
22
+ (0, doc_server_message_1.documentServerMessage)({
23
+ title: 'Hello',
24
+ type: 'response',
25
+ definitionPath: '../cli/repl/server/messages/message-hello.ts',
26
+ defResponse: message_hello_1.helloMessageDefinition,
27
+ mermaidSequenceDiagram: `
28
+ Client-->Server: connects
29
+ Server->>Client: hello
30
+ `,
31
+ shortDescription: 'The server informs the client about the successful connection and provides Meta-Information.',
32
+ text: async (shell) => {
33
+ return `
34
+
35
+ After launching _flowR_, for example, with <code>docker run -it --rm ${doc_docker_1.DockerName} ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'server', false, false)}</code>&nbsp;(🐳️), simply connecting should present you with a \`${message_hello_1.helloMessageDefinition.type}\` message, that amongst others should reveal the versions of&nbsp;_flowR_ and&nbsp;R, using the [semver 2.0](https://semver.org/spec/v2.0.0.html) versioning scheme.
36
+ The message looks like this:
37
+
38
+ ${(0, doc_code_1.codeBlock)('json', await (0, doc_server_message_1.inServerContext)(shell, socket => {
39
+ const [hello] = socket.getMessages(['hello']);
40
+ return JSON.stringify(hello, null, 2);
41
+ }))}
42
+
43
+ There are currently a few messages that you can send after the hello message.
44
+ If you want to _slice_ a piece of R code you first have to send an [analysis request](#message-request-file-analysis), so that you can send one or multiple slice requests afterward.
45
+ Requests for the [REPL](#message-request-repl) are independent of that.
46
+ `;
47
+ }
48
+ });
49
+ const cfgSample = 'if(unknown > 0) { x <- 2 } else { x <- 5 }\nfor(i in 1:x) { print(x); print(i) }';
50
+ (0, doc_server_message_1.documentServerMessage)({
51
+ title: 'Analysis',
52
+ type: 'request',
53
+ definitionPath: '../cli/repl/server/messages/message-analysis.ts',
54
+ defRequest: message_analysis_1.requestAnalysisMessage,
55
+ defResponse: message_analysis_1.analysisResponseMessage,
56
+ mermaidSequenceDiagram: `
57
+ Client->>+Server: request-file-analysis
58
+ alt
59
+ Server-->>Client: response-file-analysis
60
+ else
61
+ Server-->>Client: error
62
+ end
63
+ deactivate Server
64
+ `,
65
+ shortDescription: 'The server builds the dataflow graph for a given input file (or a set of files).',
66
+ text: async (shell) => {
67
+ return `
68
+
69
+ The request allows the server to analyze a file and prepare it for slicing.
70
+ The message can contain a \`filetoken\`, which is used to identify the file in later slice or lineage requests (if you do not add one, the request will not be stored and therefore, it is not available for subsequent requests).
71
+
72
+ > [!IMPORTANT]
73
+ > If you want to send and process a lot of analysis requests, but do not want to slice them, please do not pass the \`filetoken\` field. This will save the server a lot of memory allocation.
74
+
75
+ Furthermore, the request must contain either a \`content\` field to directly pass the file's content or a \`filepath\` field which contains the path to the file (this path must be accessible for the server to be useful).
76
+ If you add the \`id\` field, the answer will use the same \`id\` so you can match requests and the corresponding answers.
77
+ See the implementation of the request-file-analysis message for more information.
78
+
79
+ ${await (0, doc_server_message_1.documentServerMessageResponse)({
80
+ shell,
81
+ messageType: 'request-file-analysis',
82
+ messages: [
83
+ {
84
+ type: 'request',
85
+ description: `Let' suppose you simply want to analyze the following script:\n ${(0, doc_code_1.codeBlock)('r', 'x <- 1\nx + 1')}\n For this, you can send the following request:`,
86
+ message: {
87
+ type: 'request-file-analysis',
88
+ id: '1',
89
+ filetoken: 'x',
90
+ content: 'x <- 1\nx + 1'
91
+ },
92
+ mark: true
93
+ },
94
+ {
95
+ type: 'response',
96
+ expectedType: 'response-file-analysis',
97
+ description: `
98
+
99
+ The \`results\` field of the response effectively contains three keys of importance:
100
+
101
+ - \`parse\`: which contains 1:1 the parse result in CSV format that we received from the \`${shell_1.RShell.name}\` (i.e., the AST produced by the parser of the R interpreter).
102
+ - \`normalize\`: which contains the normalized AST, including ids (see the \`info\` field and the [Normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized%20AST) wiki page).
103
+ - \`dataflow\`: especially important is the \`graph\` field which contains the dataflow graph as a set of root vertices (see the [Dataflow Graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow%20Graph) wiki page).
104
+ `
105
+ }
106
+ ]
107
+ })}
108
+
109
+ You receive an error if, for whatever reason, the analysis fails (e.g., the message or code you sent contained syntax errors).
110
+ It contains a human-readable description *why* the analysis failed (see the error message implementation for more details).
111
+
112
+ ${await (0, doc_server_message_1.documentServerMessageResponse)({
113
+ shell,
114
+ title: 'Example Error Message',
115
+ messages: [{
116
+ type: 'request',
117
+ message: {
118
+ type: 'request-file-analysis',
119
+ id: '1',
120
+ filename: 'sample.R',
121
+ content: 'x <-'
122
+ }
123
+ }, {
124
+ type: 'response',
125
+ expectedType: 'error',
126
+ mark: true
127
+ }]
128
+ })}
129
+
130
+ &nbsp;
131
+
132
+ <a id="analysis-include-cfg"></a>
133
+ **Including the Control Flow Graph**
134
+
135
+ While _flowR_ does (for the time being) not use an explicit control flow graph but instead relies on control-dependency edges within the dataflow graph,
136
+ the respective structure can still be exposed using the server (note that, as this feature is not needed within _flowR_, it is tested significantly less -
137
+ so please create a [new issue](${doc_issue_1.NewIssueUrl}) for any bug you may encounter).
138
+ For this, the analysis request may add \`cfg: true\` to its list of options.
139
+
140
+ ${await (0, doc_server_message_1.documentServerMessageResponse)({
141
+ shell,
142
+ title: 'Requesting a Control Flow Graph',
143
+ messages: [{
144
+ type: 'request',
145
+ message: {
146
+ type: 'request-file-analysis',
147
+ id: '1',
148
+ filetoken: 'x',
149
+ content: cfgSample,
150
+ cfg: true
151
+ },
152
+ mark: true
153
+ }, {
154
+ type: 'response',
155
+ expectedType: 'response-file-analysis',
156
+ description: `
157
+ The response looks basically the same as a response sent without the \`cfg\` flag. However, additionally it contains a \`cfg\` field.
158
+ If you are interested in a visual representation of the control flow graph, see the
159
+ [visualization with mermaid](${await (async () => {
160
+ const res = await (0, doc_cfg_1.getCfg)(shell, cfgSample);
161
+ return (0, cfg_1.cfgToMermaidUrl)(res.info, res.ast);
162
+ })()}).
163
+ `
164
+ }]
165
+ })}
166
+
167
+ &nbsp;
168
+
169
+ <a id="analysis-format-n-quads"></a>
170
+ **Retrieve the Output as RDF N-Quads**
171
+
172
+ The default response is formatted as JSON.
173
+ However, by specifying \`format: "n-quads"\`, you can retrieve the individual results (e.g., the [Normalized AST](${doc_files_1.FlowrWikiBaseRef}/Normalized%20AST)),
174
+ as [RDF N-Quads](https://www.w3.org/TR/n-quads/).
175
+ This works with and without the control flow graph as described [above](#analysis-include-cfg).
176
+
177
+ ${await (0, doc_server_message_1.documentServerMessageResponse)({
178
+ shell,
179
+ title: 'Requesting RDF N-Quads',
180
+ messages: [{
181
+ type: 'request',
182
+ message: {
183
+ type: 'request-file-analysis',
184
+ id: '1',
185
+ filetoken: 'x',
186
+ content: 'x <- 1\nx + 1',
187
+ format: 'n-quads',
188
+ cfg: true
189
+ },
190
+ mark: true
191
+ }, {
192
+ type: 'response',
193
+ expectedType: 'response-file-analysis',
194
+ description: `
195
+ Please note, that the base message format is still JSON. Only the individual results get converted.
196
+ While the context is derived from the \`filename\`, we currently offer no way to customize other parts of the quads
197
+ (please open a [new issue](${doc_issue_1.NewIssueUrl}) if you require this).
198
+ `
199
+ }]
200
+ })}
201
+ `;
202
+ }
203
+ });
204
+ (0, doc_server_message_1.documentServerMessage)({
205
+ title: 'Slice',
206
+ type: 'request',
207
+ definitionPath: '../cli/repl/server/messages/message-slice.ts',
208
+ defRequest: message_slice_1.requestSliceMessage,
209
+ defResponse: message_slice_1.responseSliceMessage,
210
+ mermaidSequenceDiagram: `
211
+ Client->>+Server: request-slice
212
+
213
+ alt
214
+ Server-->>Client: response-slice
215
+ else
216
+ Server-->>Client: error
217
+ end
218
+ deactivate Server
219
+ `,
220
+ shortDescription: 'The server slices a file based on the given criteria.',
221
+ text: async (shell) => {
222
+ return `
223
+ To slice, you have to send a file analysis request first. The \`filetoken\` you assign is of use here as you can re-use it to repeatedly slice the same file.
224
+ Besides that, you only need to add an array of slicing criteria, using one of the formats described on the [terminology wiki page](${doc_files_1.FlowrWikiBaseRef}/Terminology#slicing-criterion)
225
+ (however, instead of using \`;\`, you can simply pass separate array elements).
226
+ See the implementation of the request-slice message for more information.
227
+
228
+ Additionally, you may pass \`"noMagicComments": true\` to disable the automatic selection of elements based on magic comments (see below).
229
+
230
+ ${await (0, doc_server_message_1.documentServerMessageResponse)({
231
+ shell,
232
+ messageType: 'request-slice',
233
+ messages: [{
234
+ type: 'request',
235
+ description: `Let's assume you want to slice the following script:\n${(0, doc_code_1.codeBlock)('r', 'x <- 1\nx + 1')}\n\nFor this we first request the analysis, using a \`filetoken\` of \`x\` to slice the file in the next request.`,
236
+ message: {
237
+ type: 'request-file-analysis',
238
+ id: '1',
239
+ filetoken: 'x',
240
+ content: 'x <- 1\nx + 1'
241
+ }
242
+ }, {
243
+ type: 'response',
244
+ expectedType: 'response-file-analysis',
245
+ description: `
246
+ See [above](#message-request-file-analysis) for the general structure of the response.
247
+ `
248
+ }, {
249
+ type: 'request',
250
+ description: 'Of course, the second slice criterion `2:1` is redundant for the input, as they refer to the same variable. It is only for demonstration purposes.',
251
+ message: {
252
+ type: 'request-slice',
253
+ id: '2',
254
+ filetoken: 'x',
255
+ criterion: ['2@x', '2:1']
256
+ },
257
+ mark: true
258
+ }, {
259
+ type: 'response',
260
+ expectedType: 'response-slice',
261
+ description: `
262
+ The \`results\` field of the response contains two keys of importance:
263
+
264
+ - \`slice\`: which contains the result of the slicing (e.g., the ids included in the slice in \`result\`).
265
+ - \`reconstruct\`: contains the reconstructed code, as well as additional meta information.
266
+ The automatically selected lines correspond to additional filters (e.g., magic comments) which force the unconditiojnal inclusion of certain elements.
267
+ `
268
+ }]
269
+ })}
270
+
271
+ The semantics of the error message are similar. If, for example, the slicing criterion is invalid or the \`filetoken\` is unknown, _flowR_ will respond with an error.
272
+
273
+ &nbsp;
274
+
275
+ <a id="slice-magic-comments"></a>
276
+ **Magic Comments**
277
+
278
+
279
+ Within a document that is to be sliced, you can use magic comments to influence the slicing process:
280
+
281
+ - \`# flowr@include_next_line\` will cause the next line to be included, independent of if it is important for the slice.
282
+ - \`# flowr@include_this_line\` will cause the current line to be included, independent of if it is important for the slice.
283
+ - \`# flowr@include_start\` and \`# flowr@include_end\` will cause the lines between them to be included, independent of if they are important for the slice. These magic comments can be nested but should appear on a separate line.
284
+
285
+ `;
286
+ }
287
+ });
288
+ (0, doc_server_message_1.documentServerMessage)({
289
+ title: 'REPL',
290
+ type: 'request',
291
+ definitionPath: '../cli/repl/server/messages/message-repl.ts',
292
+ defRequest: message_repl_1.requestExecuteReplExpressionMessage,
293
+ defResponse: message_repl_1.responseExecuteReplIntermediateMessage,
294
+ additionalDefs: [message_repl_1.responseExecuteReplEndMessage],
295
+ mermaidSequenceDiagram: `
296
+ Client->>+Server: request-repl-execution
297
+
298
+ alt
299
+ Server-->>Client: error
300
+ else
301
+
302
+ loop
303
+ Server-->>Client: response-repl-execution
304
+ end
305
+ Server-->>Client: end-repl-execution
306
+
307
+ end
308
+
309
+ deactivate Server
310
+ `,
311
+ shortDescription: 'Access the read evaluate print loop of flowR.',
312
+ text: async (shell) => {
313
+ return `
314
+ > [!WARNING]
315
+ > To execute arbitrary R commands with a request, the server has to be started explicitly with ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'r-session-access')}.
316
+ > Please be aware that this introduces a security risk.
317
+
318
+
319
+ The REPL execution message allows to send a REPL command to receive its output.
320
+ For more on the REPL, see the [introduction](${doc_files_1.FlowrWikiBaseRef}/Overview#the-read-eval-print-loop-repl), or the [description below](#using-the-repl).
321
+ You only have to pass the command you want to execute in the \`expression\` field.
322
+ Furthermore, you can set the \`ansi\` field to \`true\` if you are interested in output formatted using [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
323
+ We strongly recommend you to make use of the \`id\` field to link answers with requests as you can theoretically request the execution of multiple scripts at the same time, which then happens in parallel.
324
+
325
+ > [!WARNING]
326
+ > There is currently no automatic sandboxing or safeguarding against such requests. They simply execute the respective&nbsp;R code on your machine.
327
+ > Please be very careful (and do not use ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'r-session-access')} if you are unsure).
328
+
329
+
330
+ The answer on such a request is different from the other messages as the \`response-repl-execution\` message may be sent multiple times.
331
+ This allows to better handle requests that require more time but already output intermediate results.
332
+ You can detect the end of the execution by receiving the \`end-repl-execution\` message.
333
+
334
+ The semantics of the error message are similar to that of the other messages.
335
+ ${await (0, doc_server_message_1.documentServerMessageResponse)({
336
+ shell,
337
+ messageType: 'request-slice',
338
+ messages: [{
339
+ type: 'request',
340
+ message: {
341
+ type: 'request-repl-execution',
342
+ id: '1',
343
+ expression: ':help',
344
+ },
345
+ mark: true
346
+ }, {
347
+ type: 'response',
348
+ expectedType: 'response-repl-execution',
349
+ description: msg => {
350
+ return `
351
+ The \`stream\` field (either \`stdout\` or \`stderr\`) informs you of the output's origin: either the standard output or the standard error channel. After this message follows the end marker.
352
+
353
+
354
+ <details>
355
+ <summary>Pretty-Printed Result</summary>
356
+
357
+ ${(0, doc_code_1.codeBlock)('text', msg.result)}
358
+
359
+ </details>
360
+ `;
361
+ }
362
+ }, {
363
+ type: 'response',
364
+ expectedType: 'end-repl-execution',
365
+ }]
366
+ })}
367
+ `;
368
+ }
369
+ });
370
+ (0, doc_server_message_1.documentServerMessage)({
371
+ title: 'Query',
372
+ type: 'request',
373
+ definitionPath: '../cli/repl/server/messages/message-query.ts',
374
+ defRequest: message_query_1.requestQueryMessage,
375
+ defResponse: message_query_1.responseQueryMessage,
376
+ mermaidSequenceDiagram: `
377
+ Client->>+Server: request-query
378
+
379
+ alt
380
+ Server-->>Client: response-query
381
+ else
382
+ Server-->>Client: error
383
+ end
384
+ deactivate Server
385
+ `,
386
+ shortDescription: 'Query an analysis result for specific information.',
387
+ text: async (shell) => {
388
+ return `
389
+ To send queries, you have to send an [analysis request](#message-request-file-analysis) first. The \`filetoken\` you assign is of use here as you can re-use it to repeatedly query the same file.
390
+ This message provides direct access to _flowR_'s Query API. Please consult the [Query API documentation](${doc_files_1.FlowrWikiBaseRef}/Query%20API) for more information.
391
+
392
+ ${await (0, doc_server_message_1.documentServerMessageResponse)({
393
+ shell,
394
+ messageType: 'request-query',
395
+ messages: [{
396
+ type: 'request',
397
+ description: `Let's assume you want to query the following script:\n${(0, doc_code_1.codeBlock)('r', example_query_code_1.exampleQueryCode)}.\n\nFor this we first request the analysis, using a dummy \`filetoken\` of \`x\` to slice the file in the next request.`,
398
+ message: {
399
+ type: 'request-file-analysis',
400
+ id: '1',
401
+ filetoken: 'x',
402
+ content: example_query_code_1.exampleQueryCode
403
+ }
404
+ }, {
405
+ type: 'response',
406
+ expectedType: 'response-file-analysis',
407
+ description: `
408
+ See [above](#message-request-file-analysis) for the general structure of the response.
409
+ `
410
+ }, {
411
+ type: 'request',
412
+ message: {
413
+ type: 'request-query',
414
+ id: '2',
415
+ filetoken: 'x',
416
+ query: [
417
+ {
418
+ type: 'compound',
419
+ query: 'call-context',
420
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- otherwise we would have to carry generic typing information through the test infrastrcuture
421
+ commonArguments: {
422
+ kind: 'visualize',
423
+ subkind: 'text',
424
+ callTargets: call_context_query_format_1.CallTargets.OnlyGlobal,
425
+ },
426
+ arguments: [
427
+ {
428
+ callName: '^mean$'
429
+ },
430
+ {
431
+ callName: '^print$',
432
+ callTargets: call_context_query_format_1.CallTargets.OnlyLocal
433
+ }
434
+ ]
435
+ }
436
+ ]
437
+ },
438
+ mark: true
439
+ }, {
440
+ type: 'response',
441
+ expectedType: 'response-query'
442
+ }]
443
+ })}
444
+
445
+ `;
446
+ }
447
+ });
448
+ (0, doc_server_message_1.documentServerMessage)({
449
+ title: 'Lineage',
450
+ type: 'request',
451
+ definitionPath: '../cli/repl/server/messages/message-lineage.ts',
452
+ defRequest: message_lineage_1.requestLineageMessage,
453
+ defResponse: message_lineage_1.responseLineageMessage,
454
+ mermaidSequenceDiagram: `
455
+ Client->>+Server: request-lineage
456
+
457
+ alt
458
+ Server-->>Client: response-lineage
459
+ else
460
+ Server-->>Client: error
461
+ end
462
+ deactivate Server
463
+ `,
464
+ shortDescription: 'Obtain the lineage of a given slicing criterion.',
465
+ text: async (shell) => {
466
+ return `
467
+
468
+ In order to retrieve the lineage of an object, you have to send a file analysis request first. The \`filetoken\` you assign is of use here as you can re-use it to repeatedly retrieve the lineage of the same file.
469
+ Besides that, you will need to add a [criterion](${doc_files_1.FlowrWikiBaseRef}/Terminology#slicing-criterion) that specifies the object whose lineage you're interested in.
470
+
471
+ ${await (0, doc_server_message_1.documentServerMessageResponse)({
472
+ shell,
473
+ messageType: 'request-query',
474
+ messages: [{
475
+ type: 'request',
476
+ message: {
477
+ type: 'request-file-analysis',
478
+ id: '1',
479
+ filetoken: 'x',
480
+ content: 'x <- 1\nx + 1'
481
+ }
482
+ }, {
483
+ type: 'response',
484
+ expectedType: 'response-file-analysis',
485
+ description: `
486
+ See [above](#message-request-file-analysis) for the general structure of the response.
487
+ `
488
+ }, {
489
+ type: 'request',
490
+ message: {
491
+ type: 'request-lineage',
492
+ id: '2',
493
+ filetoken: 'x',
494
+ criterion: '2@x'
495
+ },
496
+ mark: true
497
+ }, {
498
+ type: 'response',
499
+ expectedType: 'response-lineage',
500
+ description: 'The response contains the lineage of the desired object in form of an array of IDs (as the representation of a set).'
501
+ }]
502
+ })}
503
+
504
+ `;
505
+ }
506
+ });
507
+ }
508
+ //# sourceMappingURL=doc-data-server-messages.js.map
@@ -0,0 +1,7 @@
1
+ export interface AutoGenHeaderArguments {
2
+ readonly rVersion?: string;
3
+ readonly currentDateAndTime?: string;
4
+ readonly filename: string;
5
+ readonly purpose: string;
6
+ }
7
+ export declare function autoGenHeader({ rVersion, filename, purpose, currentDateAndTime }: AutoGenHeaderArguments): string;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.autoGenHeader = autoGenHeader;
4
+ const version_1 = require("../../util/version");
5
+ function autoGenHeader({ rVersion, filename, purpose, currentDateAndTime = new Date().toISOString().replace('T', ', ').replace(/\.\d+Z$/, ' UTC') }) {
6
+ const shortenFilename = filename.replace(/^.*src\//, 'src/');
7
+ return `_This document was generated from '${shortenFilename}' on ${currentDateAndTime} presenting an overview of flowR's ${purpose} (v${(0, version_1.flowrVersion)().format()}${rVersion ? ', using R v' + rVersion : ''})._`;
8
+ }
9
+ //# sourceMappingURL=doc-auto-gen.js.map
@@ -0,0 +1,7 @@
1
+ import type { ControlFlowInformation } from '../../util/cfg/cfg';
2
+ import type { RShell } from '../../r-bridge/shell';
3
+ import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
4
+ export declare function getCfg(shell: RShell, code: string): Promise<{
5
+ info: ControlFlowInformation;
6
+ ast: NormalizedAst;
7
+ }>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCfg = getCfg;
4
+ const cfg_1 = require("../../util/cfg/cfg");
5
+ const pipeline_executor_1 = require("../../core/pipeline-executor");
6
+ const default_pipelines_1 = require("../../core/steps/pipeline/default-pipelines");
7
+ const retriever_1 = require("../../r-bridge/retriever");
8
+ async function getCfg(shell, code) {
9
+ const steps = await new pipeline_executor_1.PipelineExecutor(default_pipelines_1.DEFAULT_NORMALIZE_PIPELINE, {
10
+ shell,
11
+ request: (0, retriever_1.requestFromInput)(code)
12
+ }).allRemainingSteps();
13
+ return {
14
+ info: (0, cfg_1.extractCFG)(steps.normalize),
15
+ ast: steps.normalize
16
+ };
17
+ }
18
+ //# sourceMappingURL=doc-cfg.js.map
@@ -0,0 +1,8 @@
1
+ /** Automatically provides hover over with the documentation for these! */
2
+ import { scripts } from '../../cli/common/scripts-info';
3
+ import { flowrMainOptionDefinitions } from '../../cli/flowr-main-options';
4
+ type ScriptOptions<Type extends keyof typeof scripts | 'flowr'> = Type extends keyof typeof scripts ? typeof scripts[Type]['options'][number]['name'] : Type extends 'flowr' ? typeof flowrMainOptionDefinitions[number]['name'] : never;
5
+ export declare function getCliLongOptionOf<ScriptName extends keyof typeof scripts | 'flowr', OptionName extends ScriptOptions<ScriptName>>(scriptName: ScriptName, optionName: OptionName, withAlias?: boolean, quote?: boolean): string;
6
+ export declare function multipleCliOptions<ScriptName extends keyof typeof scripts | 'flowr', OptionName extends ScriptOptions<ScriptName>>(scriptName: ScriptName, ...options: OptionName[]): string;
7
+ export declare function getReplCommand(commandName: string, quote?: boolean, showStar?: boolean): string;
8
+ export {};
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getCliLongOptionOf = getCliLongOptionOf;
4
+ exports.multipleCliOptions = multipleCliOptions;
5
+ exports.getReplCommand = getReplCommand;
6
+ /** Automatically provides hover over with the documentation for these! */
7
+ const scripts_info_1 = require("../../cli/common/scripts-info");
8
+ const assert_1 = require("../../util/assert");
9
+ const doc_hover_over_1 = require("./doc-hover-over");
10
+ const flowr_main_options_1 = require("../../cli/flowr-main-options");
11
+ const repl_commands_1 = require("../../cli/repl/commands/repl-commands");
12
+ function getCliLongOptionOf(scriptName, optionName, withAlias = false, quote = true) {
13
+ const script = scriptName === 'flowr' ? flowr_main_options_1.flowrMainOptionDefinitions : scripts_info_1.scripts[scriptName].options;
14
+ (0, assert_1.guard)(script !== undefined, () => `Unknown script ${scriptName}, pick one of ${JSON.stringify(Object.keys(scripts_info_1.scripts))}.`);
15
+ const option = script.find(({ name }) => name === optionName);
16
+ (0, assert_1.guard)(option !== undefined, () => `Unknown option ${optionName}, pick one of ${JSON.stringify(script.map(o => o.name))}.`);
17
+ const char = quote ? '`' : '';
18
+ const alias = withAlias && option.alias ? ' (alias:' + (0, doc_hover_over_1.textWithTooltip)(`${char}-${option.alias}${char}`, option.description) + ')' : '';
19
+ const ligatureBreaker = quote ? '' : '<span/>';
20
+ // span ensures split even with ligatures
21
+ return (0, doc_hover_over_1.textWithTooltip)(`${char}-${ligatureBreaker}-${optionName}${char}`, 'Description (Command Line Argument): ' + option.description) + alias;
22
+ }
23
+ function multipleCliOptions(scriptName, ...options) {
24
+ return options.map(o => getCliLongOptionOf(scriptName, o, false, true)).join(' ');
25
+ }
26
+ function getReplCommand(commandName, quote = true, showStar = false) {
27
+ const availableNames = (0, repl_commands_1.getReplCommands)();
28
+ const commands = availableNames[commandName];
29
+ (0, assert_1.guard)(commands !== undefined, () => `Unknown command ${commandName}, pick one of ${JSON.stringify(Object.keys(availableNames))}.`);
30
+ const char = quote ? '`' : '';
31
+ const aliases = commands.aliases.length > 0 ? ' (aliases: ' + commands.aliases.map(a => `:${a}`).join(', ') + ')' : '';
32
+ const starredComment = commandName.endsWith('*') ? ', starred version' : '';
33
+ const baseDescription = commandName.endsWith('*') ? '; Base Command: ' + availableNames[commandName.slice(0, -1)].description : '';
34
+ return (0, doc_hover_over_1.textWithTooltip)(`${char}:${commandName}${showStar ? '[*]' : ''}${char}`, `Description (Repl Command${starredComment}): ` + commands.description + baseDescription + aliases);
35
+ }
36
+ //# sourceMappingURL=doc-cli-option.js.map
@@ -0,0 +1 @@
1
+ export declare function codeBlock(language: string, code: string | undefined): string;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.codeBlock = codeBlock;
4
+ function codeBlock(language, code) {
5
+ return `\n\`\`\`${language}\n${code?.trim() ?? ''}\n\`\`\`\n`;
6
+ }
7
+ //# sourceMappingURL=doc-code.js.map
@@ -0,0 +1,21 @@
1
+ import type { DataflowGraph } from '../../dataflow/graph/graph';
2
+ import type { RShell } from '../../r-bridge/shell';
3
+ import type { MermaidMarkdownMark } from '../../util/mermaid/dfg';
4
+ import { DEFAULT_DATAFLOW_PIPELINE } from '../../core/steps/pipeline/default-pipelines';
5
+ import type { PipelineOutput } from '../../core/steps/pipeline/pipeline';
6
+ export declare function printDfGraph(graph: DataflowGraph, mark?: ReadonlySet<MermaidMarkdownMark>): string;
7
+ export interface PrintDataflowGraphOptions {
8
+ readonly mark?: ReadonlySet<MermaidMarkdownMark>;
9
+ readonly showCode?: boolean;
10
+ readonly codeOpen?: boolean;
11
+ readonly exposeResult?: boolean;
12
+ readonly switchCodeAndGraph?: boolean;
13
+ }
14
+ export declare function printDfGraphForCode(shell: RShell, code: string, options: PrintDataflowGraphOptions & {
15
+ exposeResult: true;
16
+ }): Promise<[string, PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>]>;
17
+ export declare function printDfGraphForCode(shell: RShell, code: string, options?: PrintDataflowGraphOptions & {
18
+ exposeResult?: false | undefined;
19
+ }): Promise<string>;
20
+ /** returns resolved expected df graph */
21
+ export declare function verifyExpectedSubgraph(shell: RShell, code: string, expectedSubgraph: DataflowGraph): Promise<DataflowGraph>;