@eagleoutice/flowr 1.3.14 → 1.4.2

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 (309) hide show
  1. package/README.md +3 -3
  2. package/abstract-interpretation/domain.d.ts +27 -0
  3. package/abstract-interpretation/domain.js +146 -0
  4. package/abstract-interpretation/handler/binop/binop.d.ts +16 -0
  5. package/abstract-interpretation/handler/binop/binop.js +40 -0
  6. package/abstract-interpretation/handler/binop/operators.d.ts +2 -0
  7. package/abstract-interpretation/handler/binop/operators.js +42 -0
  8. package/abstract-interpretation/handler/handler.d.ts +6 -0
  9. package/abstract-interpretation/handler/handler.js +3 -0
  10. package/abstract-interpretation/processor.d.ts +10 -0
  11. package/abstract-interpretation/processor.js +84 -0
  12. package/benchmark/slicer.d.ts +6 -8
  13. package/benchmark/slicer.js +5 -15
  14. package/benchmark/stats/print.d.ts +1 -1
  15. package/benchmark/stats/print.js +0 -2
  16. package/benchmark/stats/stats.d.ts +3 -4
  17. package/benchmark/stats/stats.js +1 -1
  18. package/cli/benchmark-app.d.ts +1 -0
  19. package/cli/benchmark-app.js +21 -6
  20. package/cli/benchmark-helper-app.d.ts +2 -0
  21. package/cli/benchmark-helper-app.js +15 -6
  22. package/cli/common/features.d.ts +1 -1
  23. package/cli/common/options.d.ts +1 -1
  24. package/cli/common/options.js +4 -1
  25. package/cli/common/script.d.ts +1 -1
  26. package/cli/common/scripts-info.d.ts +3 -2
  27. package/cli/common/scripts-info.js +15 -1
  28. package/cli/export-quads-app.js +1 -5
  29. package/cli/repl/commands/cfg.d.ts +1 -1
  30. package/cli/repl/commands/cfg.js +3 -3
  31. package/cli/repl/commands/commands.d.ts +4 -2
  32. package/cli/repl/commands/commands.js +67 -28
  33. package/cli/repl/commands/dataflow.d.ts +1 -1
  34. package/cli/repl/commands/dataflow.js +2 -2
  35. package/cli/repl/commands/execute.d.ts +2 -2
  36. package/cli/repl/commands/main.d.ts +2 -2
  37. package/cli/repl/commands/normalize.d.ts +1 -1
  38. package/cli/repl/commands/normalize.js +2 -2
  39. package/cli/repl/commands/parse.d.ts +1 -1
  40. package/cli/repl/commands/parse.js +12 -12
  41. package/cli/repl/commands/quit.d.ts +1 -1
  42. package/cli/repl/commands/quit.js +4 -1
  43. package/cli/repl/commands/version.d.ts +1 -1
  44. package/cli/repl/core.d.ts +5 -3
  45. package/cli/repl/core.js +63 -7
  46. package/cli/repl/execute.d.ts +1 -1
  47. package/cli/repl/execute.js +3 -3
  48. package/cli/repl/server/connection.d.ts +2 -2
  49. package/cli/repl/server/connection.js +4 -8
  50. package/cli/repl/server/messages/analysis.d.ts +3 -3
  51. package/cli/repl/server/messages/analysis.js +12 -32
  52. package/cli/repl/server/messages/error.d.ts +1 -1
  53. package/cli/repl/server/messages/hello.d.ts +2 -2
  54. package/cli/repl/server/messages/messages.d.ts +5 -5
  55. package/cli/repl/server/messages/repl.d.ts +1 -1
  56. package/cli/repl/server/messages/slice.d.ts +3 -3
  57. package/cli/repl/server/net.d.ts +16 -0
  58. package/cli/repl/server/net.js +42 -3
  59. package/cli/repl/server/send.d.ts +2 -2
  60. package/cli/repl/server/server.d.ts +2 -2
  61. package/cli/repl/server/validate.d.ts +3 -3
  62. package/cli/statistics-helper-app.js +2 -3
  63. package/cli/summarizer-app.js +1 -2
  64. package/config.d.ts +16 -0
  65. package/config.js +75 -0
  66. package/core/input.d.ts +5 -5
  67. package/core/output.d.ts +1 -1
  68. package/core/print/dataflow-printer.d.ts +3 -3
  69. package/core/print/normalize-printer.d.ts +2 -2
  70. package/core/print/parse-printer.d.ts +2 -3
  71. package/core/print/parse-printer.js +6 -4
  72. package/core/print/print.d.ts +1 -1
  73. package/core/print/slice-diff-ansi.d.ts +1 -1
  74. package/core/slicer.d.ts +5 -4
  75. package/core/slicer.js +2 -2
  76. package/core/steps.d.ts +10 -9
  77. package/core/steps.js +5 -4
  78. package/dataflow/environments/append.d.ts +1 -1
  79. package/dataflow/environments/environment.d.ts +4 -4
  80. package/dataflow/environments/environment.js +8 -0
  81. package/dataflow/environments/overwrite.d.ts +1 -1
  82. package/dataflow/environments/register.d.ts +2 -2
  83. package/dataflow/environments/register.js +1 -0
  84. package/dataflow/environments/resolve-by-name.d.ts +2 -2
  85. package/dataflow/environments/scoping.d.ts +1 -1
  86. package/dataflow/extractor.d.ts +5 -5
  87. package/dataflow/extractor.js +10 -2
  88. package/dataflow/graph/diff.d.ts +3 -3
  89. package/dataflow/graph/graph.d.ts +8 -7
  90. package/dataflow/graph/quads.d.ts +2 -2
  91. package/dataflow/graph/vertex.d.ts +5 -5
  92. package/dataflow/internal/info.d.ts +2 -2
  93. package/dataflow/internal/linker.d.ts +3 -3
  94. package/dataflow/internal/process/access.d.ts +3 -3
  95. package/dataflow/internal/process/expression-list.d.ts +3 -3
  96. package/dataflow/internal/process/expression-list.js +0 -4
  97. package/dataflow/internal/process/functions/argument.d.ts +4 -4
  98. package/dataflow/internal/process/functions/exit-points.d.ts +1 -1
  99. package/dataflow/internal/process/functions/function-call.d.ts +3 -3
  100. package/dataflow/internal/process/functions/function-call.js +7 -1
  101. package/dataflow/internal/process/functions/function-definition.d.ts +3 -3
  102. package/dataflow/internal/process/functions/parameter.d.ts +3 -3
  103. package/dataflow/internal/process/functions/source.d.ts +8 -0
  104. package/dataflow/internal/process/functions/source.js +81 -0
  105. package/dataflow/internal/process/if-then-else.d.ts +3 -3
  106. package/dataflow/internal/process/loops/for-loop.d.ts +3 -3
  107. package/dataflow/internal/process/loops/repeat-loop.d.ts +3 -3
  108. package/dataflow/internal/process/loops/while-loop.d.ts +3 -3
  109. package/dataflow/internal/process/operators/assignment.d.ts +3 -3
  110. package/dataflow/internal/process/operators/non-assignment-binary-op.d.ts +3 -3
  111. package/dataflow/internal/process/operators/pipe.d.ts +3 -3
  112. package/dataflow/internal/process/operators/unary-op.d.ts +3 -3
  113. package/dataflow/internal/process/symbol.d.ts +3 -3
  114. package/dataflow/internal/process/uninteresting-leaf.d.ts +2 -2
  115. package/dataflow/processor.d.ts +12 -3
  116. package/flowr.d.ts +5 -2
  117. package/flowr.js +19 -12
  118. package/package.json +50 -18
  119. package/r-bridge/lang-4.x/ast/index.d.ts +1 -0
  120. package/r-bridge/lang-4.x/ast/index.js +3 -0
  121. package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -2
  122. package/r-bridge/lang-4.x/ast/model/model.d.ts +6 -6
  123. package/r-bridge/lang-4.x/ast/model/nodes/info/index.d.ts +2 -2
  124. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +3 -3
  125. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -3
  126. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +3 -3
  127. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -3
  128. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -2
  129. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -2
  130. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -2
  131. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +4 -4
  132. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +4 -4
  133. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +4 -4
  134. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +3 -3
  135. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -2
  136. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -2
  137. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -2
  138. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -3
  139. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +3 -3
  140. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -2
  141. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +3 -3
  142. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -3
  143. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -2
  144. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -3
  145. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +3 -3
  146. package/r-bridge/lang-4.x/ast/model/operators.d.ts +1 -1
  147. package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +4 -2
  148. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +6 -1
  149. package/r-bridge/lang-4.x/ast/model/processing/fold.d.ts +3 -3
  150. package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +1 -1
  151. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +3 -3
  152. package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +1 -1
  153. package/r-bridge/lang-4.x/ast/parser/json/format.d.ts +14 -0
  154. package/r-bridge/lang-4.x/ast/parser/json/format.js +26 -0
  155. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +7 -0
  156. package/r-bridge/lang-4.x/ast/parser/json/parser.js +57 -0
  157. package/r-bridge/lang-4.x/ast/parser/xml/data.d.ts +4 -7
  158. package/r-bridge/lang-4.x/ast/parser/xml/hooks.d.ts +5 -5
  159. package/r-bridge/lang-4.x/ast/parser/xml/index.d.ts +0 -2
  160. package/r-bridge/lang-4.x/ast/parser/xml/index.js +0 -2
  161. package/r-bridge/lang-4.x/ast/parser/xml/input-format.d.ts +6 -2
  162. package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +7 -10
  163. package/r-bridge/lang-4.x/ast/parser/xml/internal/access.d.ts +3 -3
  164. package/r-bridge/lang-4.x/ast/parser/xml/internal/access.js +2 -2
  165. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then-else.d.ts +3 -3
  166. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then-else.js +1 -1
  167. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then.d.ts +3 -3
  168. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then.js +2 -2
  169. package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/expression.d.ts +3 -3
  170. package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/expression.js +4 -4
  171. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/argument.d.ts +3 -3
  172. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/argument.js +2 -2
  173. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/call.d.ts +3 -3
  174. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/call.js +4 -4
  175. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/definition.d.ts +3 -3
  176. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/definition.js +2 -2
  177. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/parameter.d.ts +3 -3
  178. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/parameter.js +2 -2
  179. package/r-bridge/lang-4.x/ast/parser/xml/internal/index.d.ts +0 -1
  180. package/r-bridge/lang-4.x/ast/parser/xml/internal/index.js +0 -1
  181. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/break.d.ts +3 -3
  182. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/break.js +2 -2
  183. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/for.d.ts +3 -3
  184. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/for.js +3 -6
  185. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/next.d.ts +3 -3
  186. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/next.js +2 -2
  187. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/repeat.d.ts +3 -3
  188. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/repeat.js +2 -2
  189. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/while.d.ts +3 -3
  190. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/while.js +2 -2
  191. package/r-bridge/lang-4.x/ast/parser/xml/internal/meta.d.ts +9 -14
  192. package/r-bridge/lang-4.x/ast/parser/xml/internal/meta.js +15 -23
  193. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/binary.d.ts +3 -3
  194. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/binary.js +6 -6
  195. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/special.d.ts +1 -1
  196. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/unary.d.ts +3 -3
  197. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/unary.js +3 -3
  198. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/comment.d.ts +3 -3
  199. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/comment.js +2 -2
  200. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/line-directive.d.ts +3 -3
  201. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/line-directive.js +2 -2
  202. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/elements.d.ts +4 -4
  203. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/elements.js +3 -3
  204. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/root.d.ts +3 -3
  205. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/root.js +3 -4
  206. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/single-element.d.ts +4 -4
  207. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/single-element.js +2 -2
  208. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/number.d.ts +4 -4
  209. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/number.js +2 -2
  210. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/string.d.ts +3 -3
  211. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/string.js +2 -2
  212. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/symbol.d.ts +3 -3
  213. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/symbol.js +4 -4
  214. package/r-bridge/lang-4.x/values.d.ts +0 -1
  215. package/r-bridge/lang-4.x/values.js +14 -6
  216. package/r-bridge/retriever.d.ts +26 -22
  217. package/r-bridge/retriever.js +73 -23
  218. package/r-bridge/shell-executor.d.ts +11 -0
  219. package/r-bridge/shell-executor.js +50 -0
  220. package/r-bridge/shell.d.ts +12 -31
  221. package/r-bridge/shell.js +36 -94
  222. package/reconstruct/reconstruct.d.ts +1 -1
  223. package/slicing/criterion/collect-all.d.ts +3 -3
  224. package/slicing/criterion/filters/all-variables.d.ts +1 -1
  225. package/slicing/criterion/parse.d.ts +1 -1
  226. package/slicing/static/static-slicer.d.ts +3 -3
  227. package/statistics/features/common-syntax-probability.d.ts +3 -2
  228. package/statistics/features/common-syntax-probability.js +0 -3
  229. package/statistics/features/feature.d.ts +6 -6
  230. package/statistics/features/post-processing.d.ts +2 -2
  231. package/statistics/features/supported/assignments/assignments.d.ts +2 -2
  232. package/statistics/features/supported/assignments/post-process.d.ts +2 -2
  233. package/statistics/features/supported/assignments/post-process.js +6 -6
  234. package/statistics/features/supported/comments/comments.d.ts +2 -2
  235. package/statistics/features/supported/comments/post-process.d.ts +2 -2
  236. package/statistics/features/supported/comments/post-process.js +2 -2
  237. package/statistics/features/supported/control-flow/control-flow.d.ts +2 -2
  238. package/statistics/features/supported/control-flow/post-process.d.ts +2 -2
  239. package/statistics/features/supported/data-access/data-access.d.ts +3 -3
  240. package/statistics/features/supported/data-access/post-process.d.ts +2 -2
  241. package/statistics/features/supported/data-access/post-process.js +4 -4
  242. package/statistics/features/supported/defined-functions/defined-functions.d.ts +4 -4
  243. package/statistics/features/supported/defined-functions/post-process.d.ts +2 -2
  244. package/statistics/features/supported/defined-functions/post-process.js +4 -4
  245. package/statistics/features/supported/expression-list/expression-list.d.ts +2 -2
  246. package/statistics/features/supported/expression-list/post-process.d.ts +2 -2
  247. package/statistics/features/supported/expression-list/post-process.js +3 -3
  248. package/statistics/features/supported/loops/loops.d.ts +2 -2
  249. package/statistics/features/supported/loops/post-process.d.ts +2 -2
  250. package/statistics/features/supported/loops/post-process.js +3 -3
  251. package/statistics/features/supported/used-functions/post-process.d.ts +2 -2
  252. package/statistics/features/supported/used-functions/post-process.js +5 -5
  253. package/statistics/features/supported/used-functions/used-functions.d.ts +3 -3
  254. package/statistics/features/supported/used-packages/post-process.d.ts +2 -2
  255. package/statistics/features/supported/used-packages/post-process.js +5 -5
  256. package/statistics/features/supported/used-packages/used-packages.d.ts +2 -2
  257. package/statistics/features/supported/values/post-process.d.ts +2 -2
  258. package/statistics/features/supported/values/post-process.js +3 -3
  259. package/statistics/features/supported/values/values.d.ts +2 -2
  260. package/statistics/features/supported/variables/post-process.d.ts +3 -3
  261. package/statistics/features/supported/variables/post-process.js +3 -3
  262. package/statistics/features/supported/variables/variables.d.ts +2 -2
  263. package/statistics/meta-statistics.d.ts +1 -1
  264. package/statistics/output/ansi.js +1 -1
  265. package/statistics/output/print-stats.d.ts +2 -2
  266. package/statistics/output/statistics-file.d.ts +1 -1
  267. package/statistics/statistics.d.ts +4 -4
  268. package/statistics/statistics.js +7 -8
  269. package/util/args.d.ts +8 -4
  270. package/util/args.js +11 -4
  271. package/util/{cfg.d.ts → cfg/cfg.d.ts} +18 -6
  272. package/util/{cfg.js → cfg/cfg.js} +42 -37
  273. package/util/cfg/visitor.d.ts +14 -0
  274. package/util/cfg/visitor.js +64 -0
  275. package/util/diff.d.ts +1 -1
  276. package/util/files.d.ts +7 -1
  277. package/util/files.js +11 -1
  278. package/util/log.js +3 -0
  279. package/util/mermaid/ast.d.ts +1 -1
  280. package/util/mermaid/cfg.d.ts +2 -2
  281. package/util/mermaid/dfg.d.ts +3 -3
  282. package/util/objects.d.ts +1 -1
  283. package/util/quads.d.ts +2 -2
  284. package/util/summarizer/benchmark/data.d.ts +1 -1
  285. package/util/summarizer/benchmark/first-phase/input.d.ts +2 -1
  286. package/util/summarizer/benchmark/first-phase/input.js +20 -4
  287. package/util/summarizer/benchmark/first-phase/process.d.ts +4 -3
  288. package/util/summarizer/benchmark/first-phase/process.js +14 -5
  289. package/util/summarizer/benchmark/second-phase/graph.d.ts +1 -1
  290. package/util/summarizer/benchmark/second-phase/graph.js +1 -1
  291. package/util/summarizer/benchmark/second-phase/process.d.ts +3 -1
  292. package/util/summarizer/benchmark/second-phase/process.js +48 -11
  293. package/util/summarizer/benchmark/summarizer.d.ts +3 -6
  294. package/util/summarizer/benchmark/summarizer.js +16 -11
  295. package/util/summarizer/statistics/first-phase/process.js +8 -8
  296. package/util/summarizer/statistics/post-process/clusterer.d.ts +2 -2
  297. package/util/summarizer/statistics/post-process/file-based-count.d.ts +1 -1
  298. package/util/summarizer/statistics/post-process/histogram.d.ts +2 -2
  299. package/util/summarizer/statistics/post-process/post-process-output.d.ts +2 -2
  300. package/util/summarizer/statistics/post-process/post-process-output.js +4 -5
  301. package/util/summarizer/statistics/second-phase/process.d.ts +2 -2
  302. package/util/summarizer/statistics/summarizer.d.ts +3 -2
  303. package/util/summarizer/summarizer.d.ts +1 -1
  304. package/r-bridge/lang-4.x/ast/parser/xml/config.d.ts +0 -25
  305. package/r-bridge/lang-4.x/ast/parser/xml/config.js +0 -16
  306. package/r-bridge/lang-4.x/ast/parser/xml/internal/xml-to-json.d.ts +0 -9
  307. package/r-bridge/lang-4.x/ast/parser/xml/internal/xml-to-json.js +0 -51
  308. package/r-bridge/lang-4.x/ast/parser/xml/parser.d.ts +0 -17
  309. package/r-bridge/lang-4.x/ast/parser/xml/parser.js +0 -30
@@ -25,7 +25,10 @@ async function benchmark() {
25
25
  // we do not use the limit argument to be able to pick the limit randomly
26
26
  (0, assert_1.guard)(options.input !== undefined, 'No input file given');
27
27
  (0, assert_1.guard)(options.output !== undefined, 'No output file given');
28
- console.log(`[${options.input}] Appending output to ${options.output}`);
28
+ (0, assert_1.guard)((options['file-id'] === undefined) === (options['run-num'] === undefined), 'When giving a file-id or run-num, both have to be given');
29
+ // prefix for printing to console, includes file id and run number if present
30
+ const prefix = `[${options.input}${options['file-id'] !== undefined ? ` (file ${options['file-id']}, run ${options['run-num']})` : ''}]`;
31
+ console.log(`${prefix} Appending output to ${options.output}`);
29
32
  // ensure the file exists
30
33
  const fileStat = fs_1.default.statSync(options.input);
31
34
  (0, assert_1.guard)(fileStat.isFile(), `File ${options.input} does not exist or is no file`);
@@ -35,21 +38,27 @@ async function benchmark() {
35
38
  await slicer.init(request);
36
39
  // ${escape}1F${escape}1G${escape}2K for line reset
37
40
  if (options.slice === 'all') {
38
- const count = await slicer.sliceForAll(slicing_1.DefaultAllVariablesFilter, (i, total, arr) => console.log(`[${options.input}] Slicing ${i + 1}/${total} [${JSON.stringify(arr[i])}]`));
39
- console.log(`[${options.input}] Completed Slicing`);
41
+ const count = await slicer.sliceForAll(slicing_1.DefaultAllVariablesFilter, (i, total, arr) => console.log(`${prefix} Slicing ${i + 1}/${total} [${JSON.stringify(arr[i])}]`));
42
+ console.log(`${prefix} Completed Slicing`);
40
43
  (0, assert_1.guard)(count > 0, `No possible slices found for ${options.input}, skipping in count`);
41
44
  }
42
45
  else {
43
- console.log(`[${options.input}] Skipping Slicing due to --slice=${options.slice}`);
46
+ console.log(`${prefix} Skipping Slicing due to --slice=${options.slice}`);
44
47
  }
45
48
  const { stats } = slicer.finish();
49
+ const output = {
50
+ filename: options.input,
51
+ 'file-id': options['file-id'],
52
+ 'run-num': options['run-num'],
53
+ stats
54
+ };
46
55
  // append line by line
47
- fs_1.default.appendFileSync(options.output, `${JSON.stringify({ filename: options.input, stats }, json_1.jsonReplacer)}\n`);
56
+ fs_1.default.appendFileSync(options.output, `${JSON.stringify(output, json_1.jsonReplacer)}\n`);
48
57
  }
49
58
  catch (e) {
50
59
  if (e instanceof Error) {
51
60
  if (!e.message.includes('unable to parse R')) {
52
- console.log(`[${options.input}] Non R-Side error : ${e.message}`);
61
+ console.log(`${prefix} Non R-Side error : ${e.message}`);
53
62
  }
54
63
  }
55
64
  slicer.ensureSessionClosed(); // ensure finish
@@ -1,3 +1,3 @@
1
- import { FeatureKey } from '../../statistics';
1
+ import type { FeatureKey } from '../../statistics';
2
2
  export declare function validateFeatures(features: (string[] | ['all'] | FeatureKey[])): Set<FeatureKey>;
3
3
  export declare function retrieveArchiveName(p: string): string;
@@ -1,4 +1,4 @@
1
- import { OptionDefinition } from 'command-line-usage';
1
+ import type { OptionDefinition } from 'command-line-usage';
2
2
  /**
3
3
  * This interface describes options, that every script *must* provide.
4
4
  */
@@ -15,15 +15,18 @@ exports.benchmarkOptions = [
15
15
  { name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging [do not use for the real benchmark as this affects the time measurements, but only to find errors]' },
16
16
  { name: 'help', alias: 'h', type: Boolean, description: 'Print this usage guide' },
17
17
  { name: 'limit', alias: 'l', type: Number, description: 'Limit the number of files to process (if given, this will choose these files randomly and add the chosen names to the output' },
18
+ { name: 'runs', alias: 'r', type: Number, description: 'The amount of benchmark runs that should be done, out of which an average will be calculated' },
18
19
  { name: 'input', alias: 'i', type: String, description: 'Pass a folder or file as src to read from', multiple: true, defaultOption: true, defaultValue: [], typeLabel: '{underline files/folders}' },
19
20
  { name: 'parallel', alias: 'p', type: String, description: 'Number of parallel executors (defaults to {italic max(cpu.count-1, 1)})', defaultValue: Math.max(os_1.default.cpus().length - 1, 1), typeLabel: '{underline number}' },
20
21
  { name: 'slice', alias: 's', type: String, description: 'Automatically slice for *all* variables (default) or *no* slicing and only parsing/dataflow construction', defaultValue: 'all', typeLabel: '{underline all/no}' },
21
- { name: 'output', alias: 'o', type: String, description: `File to write all the measurements to in a per-file-basis (defaults to {italic benchmark-${StartTimeString}.json})`, defaultValue: `benchmark-${StartTimeString}.json`, typeLabel: '{underline file}' }
22
+ { name: 'output', alias: 'o', type: String, description: `Directory to write all the measurements to in a per-file-basis (defaults to {italic benchmark-${StartTimeString}})`, defaultValue: `benchmark-${StartTimeString}`, typeLabel: '{underline file}' }
22
23
  ];
23
24
  exports.benchmarkHelperOptions = [
24
25
  { name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging [do not use for the real benchmark as this affects the time measurements, but only to find errors]' },
25
26
  { name: 'help', alias: 'h', type: Boolean, description: 'Print this usage guide' },
26
27
  { name: 'input', alias: 'i', type: String, description: 'Pass a single file as src to read from', multiple: false, defaultOption: true, typeLabel: '{underline file}' },
28
+ { name: 'file-id', alias: 'd', type: Number, description: 'A numeric file id that can be used to match an input and run-num to a file' },
29
+ { name: 'run-num', alias: 'r', type: Number, description: 'The n-th time that the file with the given file-id is being benchmarked' },
27
30
  { name: 'slice', alias: 's', type: String, description: 'Automatically slice for *all* variables (default) or *no* slicing and only parsing/dataflow construction', defaultValue: 'all', typeLabel: '{underline all/no}' },
28
31
  { name: 'output', alias: 'o', type: String, description: 'File to write the measurements to (appends a single line in JSON format)', typeLabel: '{underline file}' },
29
32
  ];
@@ -4,7 +4,7 @@
4
4
  * @module
5
5
  */
6
6
  import { scripts } from './scripts-info';
7
- import { CommonOptions } from './options';
7
+ import type { CommonOptions } from './options';
8
8
  /**
9
9
  * Just a helping data structure to allow the user to provide example usages of the respective script.
10
10
  * The subtitle will be displayed next to the title.
@@ -3,8 +3,8 @@
3
3
  *
4
4
  * @module
5
5
  */
6
- import { MergeableRecord } from '../../util/objects';
7
- import { OptionDefinition } from 'command-line-usage';
6
+ import type { MergeableRecord } from '../../util/objects';
7
+ import type { OptionDefinition } from 'command-line-usage';
8
8
  interface BaseScriptInformation extends MergeableRecord {
9
9
  toolName: string;
10
10
  target: string;
@@ -21,4 +21,5 @@ export interface HelperScriptInformation extends BaseScriptInformation {
21
21
  }
22
22
  export type ScriptInformation = MasterScriptInformation | HelperScriptInformation;
23
23
  export declare const scripts: Record<"slicer" | "benchmark" | "stats" | "summarizer" | "export-quads" | "stats-helper" | "benchmark-helper", ScriptInformation>;
24
+ export declare function getValidOptionsForCompletion(options: readonly OptionDefinition[], prevArgs: readonly string[]): string[];
24
25
  export {};
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.scripts = void 0;
3
+ exports.getValidOptionsForCompletion = exports.scripts = void 0;
4
4
  const options_1 = require("./options");
5
+ const commands_1 = require("../repl/commands");
5
6
  /**
6
7
  * We hold `_scripts` internally, as the modifiable variant and export the readonly scripts
7
8
  */
@@ -66,4 +67,17 @@ const _scripts = {
66
67
  }
67
68
  };
68
69
  exports.scripts = _scripts;
70
+ function getValidOptionsForCompletion(options, prevArgs) {
71
+ return options.filter(o => canAddOption(o, prevArgs)).flatMap(o => {
72
+ const args = [(0, commands_1.asOptionName)(o.name)];
73
+ if (o.alias) {
74
+ args.push((0, commands_1.asOptionName)(o.alias));
75
+ }
76
+ return args;
77
+ });
78
+ }
79
+ exports.getValidOptionsForCompletion = getValidOptionsForCompletion;
80
+ function canAddOption(option, prevArgs) {
81
+ return option.multiple || !prevArgs.includes((0, commands_1.asOptionName)(option.name)) && (!option.alias || !prevArgs.includes((0, commands_1.asOptionName)(option.alias)));
82
+ }
69
83
  //# sourceMappingURL=scripts-info.js.map
@@ -17,12 +17,8 @@ const options = (0, common_1.processCommandLineArgs)('export-quads', [], {
17
17
  ]
18
18
  });
19
19
  const shell = new r_bridge_1.RShell();
20
- shell.tryToInjectHomeLibPath();
21
20
  async function writeQuadForSingleFile(request, output) {
22
- const normalized = await (0, r_bridge_1.retrieveNormalizedAstFromRCode)({
23
- ...request,
24
- ensurePackageInstalled: true
25
- }, shell);
21
+ const normalized = await (0, r_bridge_1.retrieveNormalizedAstFromRCode)(request, shell);
26
22
  const serialized = (0, quads_1.serialize2quads)(normalized.ast, { context: request.content });
27
23
  log_1.log.info(`Appending quads to ${output}`);
28
24
  fs_1.default.appendFileSync(output, serialized);
@@ -1,3 +1,3 @@
1
- import { ReplCommand } from './main';
1
+ import type { ReplCommand } from './main';
2
2
  export declare const controlflowCommand: ReplCommand;
3
3
  export declare const controlflowStarCommand: ReplCommand;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.controlflowStarCommand = exports.controlflowCommand = void 0;
4
4
  const core_1 = require("../../../core");
5
5
  const r_bridge_1 = require("../../../r-bridge");
6
- const cfg_1 = require("../../../util/cfg");
6
+ const cfg_1 = require("../../../util/cfg/cfg");
7
7
  const mermaid_1 = require("../../../util/mermaid");
8
8
  async function controlflow(shell, remainingLine) {
9
9
  return await new core_1.SteppingSlicer({
@@ -13,7 +13,7 @@ async function controlflow(shell, remainingLine) {
13
13
  }).allRemainingSteps();
14
14
  }
15
15
  exports.controlflowCommand = {
16
- description: 'Get mermaid code for the control-flow graph of R code, start with \'file://\' to indicate a file',
16
+ description: `Get mermaid code for the control-flow graph of R code, start with '${r_bridge_1.fileProtocol}' to indicate a file`,
17
17
  usageExample: ':controlflow',
18
18
  aliases: ['cfg', 'cf'],
19
19
  script: false,
@@ -24,7 +24,7 @@ exports.controlflowCommand = {
24
24
  }
25
25
  };
26
26
  exports.controlflowStarCommand = {
27
- description: 'Get a mermaid url of the control-flow graph of R code, start with \'file://\' to indicate a file',
27
+ description: `Get a mermaid url of the control-flow graph of R code, start with '${r_bridge_1.fileProtocol}' to indicate a file`,
28
28
  usageExample: ':controlflow',
29
29
  aliases: ['cfg*', 'cf*'],
30
30
  script: false,
@@ -1,11 +1,13 @@
1
- import { ReplCommand } from './main';
1
+ import type { ReplCommand } from './main';
2
2
  export declare const helpCommand: ReplCommand;
3
3
  /**
4
4
  * The names of all commands including their aliases (but without the leading `:`)
5
5
  */
6
- export declare const commandNames: string[];
6
+ export declare function getCommandNames(): string[];
7
7
  /**
8
8
  * Get the command for a given command name or alias.
9
9
  * @param command - The name of the command (without the leading `:`)
10
10
  */
11
11
  export declare function getCommand(command: string): ReplCommand | undefined;
12
+ export declare function asOptionName(argument: string): string;
13
+ export declare function longestCommandName(): number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getCommand = exports.commandNames = exports.helpCommand = void 0;
3
+ exports.longestCommandName = exports.asOptionName = exports.getCommand = exports.getCommandNames = exports.helpCommand = void 0;
4
4
  const quit_1 = require("./quit");
5
5
  const common_1 = require("../../common");
6
6
  const execute_1 = require("../execute");
@@ -28,16 +28,17 @@ exports.helpCommand = {
28
28
  usageExample: ':help',
29
29
  aliases: ['h', '?'],
30
30
  fn: output => {
31
+ initCommandMapping();
31
32
  output.stdout(`
32
33
  You can always just enter R expressions which get evaluated right away:
33
34
  ${prompt_1.rawPrompt} ${(0, statistics_1.bold)('1 + 1', output.formatter)}
34
35
  ${(0, statistics_1.italic)('[1] 2', output.formatter)}
35
36
 
36
37
  Besides that, you can use the following commands. The scripts ${(0, statistics_1.italic)('can', output.formatter)} accept further arguments. There are the following basic commands:
37
- ${Array.from(Object.entries(commands)).filter(([, { script }]) => !script).map(c => printHelpForScript(c, output.formatter)).join('\n')}
38
+ ${Array.from(Object.entries(commands())).filter(([, { script }]) => !script).map(c => printHelpForScript(c, output.formatter)).join('\n')}
38
39
 
39
40
  Furthermore, you can directly call the following scripts which accept arguments. If you are unsure, try to add ${(0, statistics_1.italic)('--help', output.formatter)} after the command.
40
- ${Array.from(Object.entries(commands)).filter(([, { script }]) => script).map(([command, { description }]) => ` ${(0, statistics_1.bold)(padCmd(':' + command), output.formatter)}${description}`).join('\n')}
41
+ ${Array.from(Object.entries(commands())).filter(([, { script }]) => script).map(([command, { description }]) => ` ${(0, statistics_1.bold)(padCmd(':' + command), output.formatter)}${description}`).join('\n')}
41
42
 
42
43
  You can combine commands by separating them with a semicolon ${(0, statistics_1.bold)(';', output.formatter)}.
43
44
  `);
@@ -46,7 +47,7 @@ You can combine commands by separating them with a semicolon ${(0, statistics_1.
46
47
  /**
47
48
  * All commands that should be available in the REPL.
48
49
  */
49
- const commands = {
50
+ const _commands = {
50
51
  'help': exports.helpCommand,
51
52
  'quit': quit_1.quitCommand,
52
53
  'version': version_1.versionCommand,
@@ -59,45 +60,83 @@ const commands = {
59
60
  'controlflow': cfg_1.controlflowCommand,
60
61
  'controlflow*': cfg_1.controlflowStarCommand
61
62
  };
62
- for (const [script, { target, description, type }] of Object.entries(common_1.scripts)) {
63
- if (type === 'master script') {
64
- commands[script] = {
65
- description,
66
- aliases: [],
67
- script: true,
68
- usageExample: `:${script} --help`,
69
- fn: async (output, _s, remainingLine) => {
70
- await (0, execute_1.waitOnScript)(`${__dirname}/../../${target}`, (0, args_1.splitAtEscapeSensitive)(remainingLine), stdio => (0, execute_1.stdioCaptureProcessor)(stdio, msg => output.stdout(msg), msg => output.stderr(msg)));
71
- }
72
- };
63
+ let commandsInitialized = false;
64
+ function commands() {
65
+ if (commandsInitialized) {
66
+ return _commands;
73
67
  }
68
+ commandsInitialized = true;
69
+ for (const [script, { target, description, type }] of Object.entries(common_1.scripts)) {
70
+ if (type === 'master script') {
71
+ _commands[script] = {
72
+ description,
73
+ aliases: [],
74
+ script: true,
75
+ usageExample: `:${script} --help`,
76
+ fn: async (output, _s, remainingLine) => {
77
+ await (0, execute_1.waitOnScript)(`${__dirname}/../../${target}`, (0, args_1.splitAtEscapeSensitive)(remainingLine), stdio => (0, execute_1.stdioCaptureProcessor)(stdio, msg => output.stdout(msg), msg => output.stderr(msg)));
78
+ }
79
+ };
80
+ }
81
+ }
82
+ return _commands;
74
83
  }
75
84
  /**
76
85
  * The names of all commands including their aliases (but without the leading `:`)
77
86
  */
78
- exports.commandNames = [];
87
+ function getCommandNames() {
88
+ if (commandNames === undefined) {
89
+ initCommandMapping();
90
+ }
91
+ return commandNames;
92
+ }
93
+ exports.getCommandNames = getCommandNames;
94
+ let commandNames = undefined;
79
95
  // maps command names or aliases to the actual command name
80
- const commandMapping = {};
81
- for (const [command, { aliases }] of Object.entries(commands)) {
82
- (0, assert_1.guard)(commandMapping[command] === undefined, `Command ${command} is already registered!`);
83
- commandMapping[command] = command;
84
- for (const alias of aliases) {
85
- (0, assert_1.guard)(commandMapping[alias] === undefined, `Command (alias) ${alias} is already registered!`);
86
- commandMapping[alias] = command;
96
+ let commandMapping = undefined;
97
+ function initCommandMapping() {
98
+ commandMapping = {};
99
+ commandNames = [];
100
+ for (const [command, { aliases }] of Object.entries(commands())) {
101
+ (0, assert_1.guard)(commandMapping[command] === undefined, `Command ${command} is already registered!`);
102
+ commandMapping[command] = command;
103
+ for (const alias of aliases) {
104
+ (0, assert_1.guard)(commandMapping[alias] === undefined, `Command (alias) ${alias} is already registered!`);
105
+ commandMapping[alias] = command;
106
+ }
107
+ commandNames.push(command);
108
+ commandNames.push(...aliases);
87
109
  }
88
- exports.commandNames.push(command);
89
- exports.commandNames.push(...aliases);
90
110
  }
91
111
  /**
92
112
  * Get the command for a given command name or alias.
93
113
  * @param command - The name of the command (without the leading `:`)
94
114
  */
95
115
  function getCommand(command) {
96
- return commands[commandMapping[command]];
116
+ if (commandMapping === undefined) {
117
+ initCommandMapping();
118
+ }
119
+ return commands()[commandMapping[command]];
97
120
  }
98
121
  exports.getCommand = getCommand;
99
- const longestKey = Array.from(Object.keys(commands), k => k.length).reduce((p, n) => Math.max(p, n), 0);
122
+ function asOptionName(argument) {
123
+ if (argument.length == 1) {
124
+ return `-${argument}`;
125
+ }
126
+ else {
127
+ return `--${argument}`;
128
+ }
129
+ }
130
+ exports.asOptionName = asOptionName;
131
+ let _longestCommandName = undefined;
132
+ function longestCommandName() {
133
+ if (_longestCommandName === undefined) {
134
+ _longestCommandName = Array.from(Object.keys(commands()), k => k.length).reduce((p, n) => Math.max(p, n), 0);
135
+ }
136
+ return _longestCommandName;
137
+ }
138
+ exports.longestCommandName = longestCommandName;
100
139
  function padCmd(string) {
101
- return String(string).padEnd(longestKey + 2, ' ');
140
+ return String(string).padEnd(longestCommandName() + 2, ' ');
102
141
  }
103
142
  //# sourceMappingURL=commands.js.map
@@ -1,3 +1,3 @@
1
- import { ReplCommand } from './main';
1
+ import type { ReplCommand } from './main';
2
2
  export declare const dataflowCommand: ReplCommand;
3
3
  export declare const dataflowStarCommand: ReplCommand;
@@ -12,7 +12,7 @@ async function dataflow(shell, remainingLine) {
12
12
  }).allRemainingSteps();
13
13
  }
14
14
  exports.dataflowCommand = {
15
- description: 'Get mermaid code for the dataflow graph of R code, start with \'file://\' to indicate a file',
15
+ description: `Get mermaid code for the dataflow graph of R code, start with '${r_bridge_1.fileProtocol}' to indicate a file`,
16
16
  usageExample: ':dataflow',
17
17
  aliases: ['d', 'df'],
18
18
  script: false,
@@ -22,7 +22,7 @@ exports.dataflowCommand = {
22
22
  }
23
23
  };
24
24
  exports.dataflowStarCommand = {
25
- description: 'Get a mermaid url of the dataflow graph of R code, start with \'file://\' to indicate a file',
25
+ description: `Get a mermaid url of the dataflow graph of R code, start with '${r_bridge_1.fileProtocol}' to indicate a file`,
26
26
  usageExample: ':dataflow*',
27
27
  aliases: ['d*', 'df*'],
28
28
  script: false,
@@ -1,4 +1,4 @@
1
- import { RShell } from '../../../r-bridge';
2
- import { ReplCommand, ReplOutput } from './main';
1
+ import type { RShell } from '../../../r-bridge';
2
+ import type { ReplCommand, ReplOutput } from './main';
3
3
  export declare function executeRShellCommand(output: ReplOutput, shell: RShell, statement: string): Promise<void>;
4
4
  export declare const executeCommand: ReplCommand;
@@ -1,5 +1,5 @@
1
- import { RShell } from '../../../r-bridge';
2
- import { OutputFormatter } from '../../../statistics';
1
+ import type { RShell } from '../../../r-bridge';
2
+ import type { OutputFormatter } from '../../../statistics';
3
3
  /**
4
4
  * Defines the main interface for output of the repl.
5
5
  * This allows us to redirect it (e.g., in the case of a server connection or tests).
@@ -1,3 +1,3 @@
1
- import { ReplCommand } from './main';
1
+ import type { ReplCommand } from './main';
2
2
  export declare const normalizeCommand: ReplCommand;
3
3
  export declare const normalizeStarCommand: ReplCommand;
@@ -12,7 +12,7 @@ async function normalize(shell, remainingLine) {
12
12
  }).allRemainingSteps();
13
13
  }
14
14
  exports.normalizeCommand = {
15
- description: 'Get mermaid code for the normalized AST of R code, start with \'file://\' to indicate a file',
15
+ description: `Get mermaid code for the normalized AST of R code, start with '${r_bridge_1.fileProtocol}' to indicate a file`,
16
16
  usageExample: ':normalize',
17
17
  aliases: ['n'],
18
18
  script: false,
@@ -22,7 +22,7 @@ exports.normalizeCommand = {
22
22
  }
23
23
  };
24
24
  exports.normalizeStarCommand = {
25
- description: 'Get a mermaid url of the normalized AST of R code, start with \'file://\' to indicate a file',
25
+ description: `Get a mermaid url of the normalized AST of R code, start with '${r_bridge_1.fileProtocol}' to indicate a file`,
26
26
  usageExample: ':normalize',
27
27
  aliases: ['n*'],
28
28
  script: false,
@@ -1,2 +1,2 @@
1
- import { ReplCommand } from './main';
1
+ import type { ReplCommand } from './main';
2
2
  export declare const parseCommand: ReplCommand;
@@ -4,8 +4,9 @@ exports.parseCommand = void 0;
4
4
  const r_bridge_1 = require("../../../r-bridge");
5
5
  const internal_1 = require("../../../r-bridge/lang-4.x/ast/parser/xml/internal");
6
6
  const core_1 = require("../../../core");
7
- const objects_1 = require("../../../util/objects");
8
- function toDepthMap(xml, config) {
7
+ const format_1 = require("../../../r-bridge/lang-4.x/ast/parser/json/format");
8
+ const parser_1 = require("../../../r-bridge/lang-4.x/ast/parser/json/parser");
9
+ function toDepthMap(xml) {
9
10
  const root = (0, r_bridge_1.getKeysGuarded)(xml, "exprlist" /* RawRType.ExpressionList */);
10
11
  const visit = [{ depth: 0, node: root }];
11
12
  const result = [];
@@ -14,7 +15,7 @@ function toDepthMap(xml, config) {
14
15
  if (current === undefined) {
15
16
  continue;
16
17
  }
17
- const children = current.node[config.childrenName] ?? [];
18
+ const children = current.node[r_bridge_1.childrenKey] ?? [];
18
19
  result.push({ ...current, leaf: children.length === 0 });
19
20
  children.reverse();
20
21
  const nextDepth = current.depth + 1;
@@ -62,7 +63,7 @@ function retrieveLocationString(locationRaw) {
62
63
  return ` (${extracted.start.line}:${extracted.start.column}─${extracted.end.line}:${extracted.end.column})`;
63
64
  }
64
65
  }
65
- function depthListToTextTree(list, config, f) {
66
+ function depthListToTextTree(list, f) {
66
67
  let result = '';
67
68
  const deadDepths = new Set();
68
69
  let i = 0;
@@ -72,13 +73,13 @@ function depthListToTextTree(list, config, f) {
72
73
  result += initialIndentation(i, depth, deadDepths, nextDepth, list, f);
73
74
  result += f.reset();
74
75
  const raw = (0, internal_1.objectWithArrUnwrap)(node);
75
- const content = raw[config.contentName];
76
- const locationRaw = raw[config.attributeName];
76
+ const content = raw[r_bridge_1.contentKey];
77
+ const locationRaw = raw[r_bridge_1.attributesKey];
77
78
  let location = '';
78
79
  if (locationRaw !== undefined) {
79
80
  location = retrieveLocationString(locationRaw);
80
81
  }
81
- const type = (0, internal_1.getTokenType)(config.tokenMap, node);
82
+ const type = (0, internal_1.getTokenType)(node);
82
83
  if (leaf) {
83
84
  const suffix = `${f.format(content ? JSON.stringify(content) : '', { style: 1 /* FontStyles.Bold */ })}${f.format(location, { style: 3 /* FontStyles.Italic */ })}`;
84
85
  result += `${type} ${suffix}`;
@@ -91,7 +92,7 @@ function depthListToTextTree(list, config, f) {
91
92
  return result;
92
93
  }
93
94
  exports.parseCommand = {
94
- description: 'Prints ASCII Art of the parsed, unmodified AST, start with \'file://\' to indicate a file',
95
+ description: `Prints ASCII Art of the parsed, unmodified AST, start with '${r_bridge_1.fileProtocol}' to indicate a file`,
95
96
  usageExample: ':parse',
96
97
  aliases: ['p'],
97
98
  script: false,
@@ -99,11 +100,10 @@ exports.parseCommand = {
99
100
  const result = await new core_1.SteppingSlicer({
100
101
  stepOfInterest: 'parse',
101
102
  shell,
102
- request: (0, r_bridge_1.requestFromInput)(remainingLine.trim())
103
+ request: (0, r_bridge_1.requestFromInput)((0, r_bridge_1.removeRQuotes)(remainingLine.trim()))
103
104
  }).allRemainingSteps();
104
- const config = (0, objects_1.deepMergeObject)(r_bridge_1.DEFAULT_XML_PARSER_CONFIG, { tokenMap: await shell.tokenMap() });
105
- const object = await (0, internal_1.xlm2jsonObject)(config, result.parse);
106
- output.stdout(depthListToTextTree(toDepthMap(object, config), config, output.formatter));
105
+ const object = (0, parser_1.convertPreparedParsedData)((0, format_1.prepareParsedData)(result.parse));
106
+ output.stdout(depthListToTextTree(toDepthMap(object), output.formatter));
107
107
  }
108
108
  };
109
109
  //# sourceMappingURL=parse.js.map
@@ -1,2 +1,2 @@
1
- import { ReplCommand } from './main';
1
+ import type { ReplCommand } from './main';
2
2
  export declare const quitCommand: ReplCommand;
@@ -7,6 +7,9 @@ exports.quitCommand = {
7
7
  aliases: ['q', 'exit'],
8
8
  usageExample: ':quit',
9
9
  script: false,
10
- fn: () => { log_1.log.info('bye'); process.exit(0); }
10
+ fn: () => {
11
+ log_1.log.info('bye');
12
+ process.exit(0);
13
+ }
11
14
  };
12
15
  //# sourceMappingURL=quit.js.map
@@ -1,4 +1,4 @@
1
- import { ReplCommand, ReplOutput } from './main';
1
+ import type { ReplCommand, ReplOutput } from './main';
2
2
  import { RShell } from '../../../r-bridge';
3
3
  type Version = `${number}.${number}.${number}`;
4
4
  /**
@@ -5,8 +5,8 @@
5
5
  * @module
6
6
  */
7
7
  import { RShell } from '../../r-bridge';
8
- import { ReplOutput } from './commands';
9
- import * as readline from 'node:readline';
8
+ import type { ReplOutput } from './commands';
9
+ import * as readline from 'readline';
10
10
  /**
11
11
  * Used by the repl to provide automatic completions for a given (partial) input line
12
12
  */
@@ -32,8 +32,10 @@ export declare function replProcessAnswer(output: ReplOutput, expr: string, shel
32
32
  * If you want to provide a custom one but use the same `completer`, refer to {@link replCompleter}.
33
33
  * For the default arguments, see {@link DEFAULT_REPL_READLINE_CONFIGURATION}.
34
34
  * @param output - Defines two methods that every function in the repl uses to output its data.
35
+ * @param historyFile - The file to use for persisting the repl's history. Passing undefined causes history not to be saved.
35
36
  *
36
37
  * For the execution, this function makes use of {@link replProcessAnswer}
37
38
  *
38
39
  */
39
- export declare function repl(shell?: RShell, rl?: readline.Interface, output?: ReplOutput): Promise<void>;
40
+ export declare function repl(shell?: RShell, rl?: readline.Interface, output?: ReplOutput, historyFile?: string | undefined): Promise<void>;
41
+ export declare function loadReplHistory(historyFile: string): string[] | undefined;