@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
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeString = void 0;
4
4
  const meta_1 = require("../meta");
5
5
  const values_1 = require("../../../../../values");
6
- const parser_1 = require("../../parser");
7
6
  const hooks_1 = require("../../hooks");
8
7
  const assert_1 = require("../../../../../../../util/assert");
8
+ const parser_1 = require("../../../json/parser");
9
9
  /**
10
10
  * Normalize the given object as a R string (see {@link string2ts}).
11
11
  * This requires you to check the corresponding name beforehand.
@@ -16,7 +16,7 @@ const assert_1 = require("../../../../../../../util/assert");
16
16
  function normalizeString(data, obj) {
17
17
  parser_1.parseLog.debug('[string]');
18
18
  obj = (0, hooks_1.executeHook)(data.hooks.values.onString.before, data, obj);
19
- const { location, content } = (0, meta_1.retrieveMetaStructure)(data.config, obj);
19
+ const { location, content } = (0, meta_1.retrieveMetaStructure)(obj);
20
20
  // based on https://www.rdocumentation.org/packages/utils/versions/3.6.2/topics/getParseData we do not get strings with 1000 characters or more within the text field.
21
21
  // therefore, we recover the full string from the surrounding expr lexeme field
22
22
  let stringContent = content;
@@ -1,6 +1,6 @@
1
- import { NamedXmlBasedJson } from '../../input-format';
2
- import { RSymbol } from '../../../../model';
3
- import { ParserData } from '../../data';
1
+ import type { NamedXmlBasedJson } from '../../input-format';
2
+ import type { RSymbol } from '../../../../model';
3
+ import type { ParserData } from '../../data';
4
4
  /**
5
5
  * Normalize the given object as an R symbol (incorporating namespace information).
6
6
  * <p>
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tryNormalizeSymbol = void 0;
4
4
  const assert_1 = require("../../../../../../../util/assert");
5
5
  const meta_1 = require("../meta");
6
- const parser_1 = require("../../parser");
7
6
  const model_1 = require("../../../../model");
8
7
  const hooks_1 = require("../../hooks");
9
8
  const strings_1 = require("../../../../../../../util/strings");
9
+ const parser_1 = require("../../../json/parser");
10
10
  /**
11
11
  * Normalize the given object as an R symbol (incorporating namespace information).
12
12
  * <p>
@@ -23,16 +23,16 @@ function tryNormalizeSymbol(data, objs) {
23
23
  objs = (0, hooks_1.executeHook)(data.hooks.values.onSymbol.before, data, objs);
24
24
  let location, content, namespace;
25
25
  if (objs.length === 1 && (0, model_1.isSymbol)(objs[0].name)) {
26
- const meta = (0, meta_1.retrieveMetaStructure)(data.config, objs[0].content);
26
+ const meta = (0, meta_1.retrieveMetaStructure)(objs[0].content);
27
27
  location = meta.location;
28
28
  content = meta.content;
29
29
  namespace = undefined;
30
30
  }
31
31
  else if (objs.length === 3 && (0, model_1.isSymbol)(objs[2].name)) {
32
- const meta = (0, meta_1.retrieveMetaStructure)(data.config, objs[2].content);
32
+ const meta = (0, meta_1.retrieveMetaStructure)(objs[2].content);
33
33
  location = meta.location;
34
34
  content = meta.content;
35
- namespace = (0, meta_1.retrieveMetaStructure)(data.config, objs[0].content).content;
35
+ namespace = (0, meta_1.retrieveMetaStructure)(objs[0].content).content;
36
36
  }
37
37
  else {
38
38
  return (0, hooks_1.executeUnknownHook)(data.hooks.values.onSymbol.unknown, data, objs);
@@ -36,4 +36,3 @@ export declare function string2ts(value: string): RStringValue;
36
36
  export declare const RNa = "NA";
37
37
  export declare const RNull = "NULL";
38
38
  export declare function isNA(value: string): value is (typeof RNa);
39
- export declare function parseCSV(lines: string[]): string[][];
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseCSV = exports.isNA = exports.RNull = exports.RNa = exports.string2ts = exports.number2ts = exports.RInf = exports.RIntegerMarker = exports.RImaginaryMarker = exports.RNumHexFloatRegex = exports.boolean2ts = exports.isBoolean = exports.RFalse = exports.RTrue = exports.ts2r = void 0;
4
- const sync_1 = require("csv-parse/sync");
3
+ exports.isNA = exports.RNull = exports.RNa = exports.string2ts = exports.number2ts = exports.RInf = exports.RIntegerMarker = exports.RImaginaryMarker = exports.RNumHexFloatRegex = exports.boolean2ts = exports.isBoolean = exports.RFalse = exports.RTrue = exports.ts2r = void 0;
5
4
  class ValueConversionError extends Error {
6
5
  constructor(message) {
7
6
  super(message);
@@ -19,6 +18,12 @@ function ts2r(value) {
19
18
  return JSON.stringify(value);
20
19
  }
21
20
  else if (typeof value === 'number') {
21
+ if (isNaN(value)) {
22
+ return exports.RNa;
23
+ }
24
+ else if (!isFinite(value)) {
25
+ return exports.RInf;
26
+ }
22
27
  return value.toString();
23
28
  }
24
29
  else if (typeof value === 'boolean') {
@@ -81,6 +86,13 @@ function number2ts(value) {
81
86
  markedAsInt
82
87
  };
83
88
  }
89
+ if (value === exports.RNa) {
90
+ return {
91
+ num: NaN,
92
+ complexNumber,
93
+ markedAsInt
94
+ };
95
+ }
84
96
  const floatHex = lcValue.match(exports.RNumHexFloatRegex);
85
97
  if (floatHex == null) {
86
98
  return {
@@ -142,8 +154,4 @@ function isNA(value) {
142
154
  return value === exports.RNa;
143
155
  }
144
156
  exports.isNA = isNA;
145
- function parseCSV(lines) {
146
- return (0, sync_1.parse)(lines.join('\n'), { skipEmptyLines: true });
147
- }
148
- exports.parseCSV = parseCSV;
149
157
  //# sourceMappingURL=values.js.map
@@ -1,28 +1,34 @@
1
1
  import { type RShell } from './shell';
2
- import { XmlParserHooks, NormalizedAst } from './lang-4.x';
3
- import { DeepPartial, DeepReadonly } from 'ts-essentials';
2
+ import type { XmlParserHooks, NormalizedAst } from './lang-4.x';
3
+ import type { AsyncOrSync, DeepPartial } from 'ts-essentials';
4
+ import { RShellExecutor } from './shell-executor';
5
+ export declare const fileProtocol: "file://";
4
6
  export interface RParseRequestFromFile {
5
- request: 'file';
7
+ readonly request: 'file';
6
8
  /** The path to the file (absolute paths are probably best here */
7
- content: string;
9
+ readonly content: string;
8
10
  }
9
11
  export interface RParseRequestFromText {
10
- request: 'text';
11
- content: string;
12
+ readonly request: 'text';
13
+ readonly content: string;
12
14
  }
13
- interface RParseRequestBase {
14
- /**
15
- * Ensure that all required packages are present and if not install them?
16
- * The only reason to set this to `false` is probably in a series of parse requests for the same session.
17
- */
18
- ensurePackageInstalled: boolean;
15
+ /**
16
+ * A provider for an {@link RParseRequest} that can be used, for example, to override source file parsing behavior in tests
17
+ */
18
+ export interface RParseRequestProvider {
19
+ createRequest(path: string): RParseRequest;
19
20
  }
20
21
  /**
21
- * A request that can be passed along to {@link retrieveXmlFromRCode}.
22
+ * A request that can be passed along to {@link retrieveParseDataFromRCode}.
22
23
  */
23
- export type RParseRequest = (RParseRequestFromFile | RParseRequestFromText) & RParseRequestBase;
24
- export declare function requestFromInput(input: `file://${string}`): RParseRequestFromFile & RParseRequestBase;
25
- export declare function requestFromInput(input: string): RParseRequestFromText & RParseRequestBase;
24
+ export type RParseRequest = (RParseRequestFromFile | RParseRequestFromText);
25
+ export declare function requestFromInput(input: `${typeof fileProtocol}${string}`): RParseRequestFromFile;
26
+ export declare function requestFromInput(input: string): RParseRequestFromText;
27
+ export declare function requestProviderFromFile(): RParseRequestProvider;
28
+ export declare function requestProviderFromText(text: {
29
+ [path: string]: string;
30
+ }): RParseRequestProvider;
31
+ export declare function requestFingerprint(request: RParseRequest): string;
26
32
  /**
27
33
  * Provides the capability to parse R files/R code using the R parser.
28
34
  * Depends on {@link RShell} to provide a connection to R.
@@ -30,19 +36,17 @@ export declare function requestFromInput(input: string): RParseRequestFromText &
30
36
  * Throws if the file could not be parsed.
31
37
  * If successful, allows to further query the last result with {@link retrieveNumberOfRTokensOfLastParse}.
32
38
  */
33
- export declare function retrieveXmlFromRCode(request: RParseRequest, shell: RShell): Promise<string>;
39
+ export declare function retrieveParseDataFromRCode(request: RParseRequest, shell: (RShell | RShellExecutor)): AsyncOrSync<string>;
34
40
  /**
35
- * Uses {@link retrieveXmlFromRCode} and returns the nicely formatted object-AST.
41
+ * Uses {@link retrieveParseDataFromRCode} and returns the nicely formatted object-AST.
36
42
  * If successful, allows to further query the last result with {@link retrieveNumberOfRTokensOfLastParse}.
37
43
  */
38
44
  export declare function retrieveNormalizedAstFromRCode(request: RParseRequest, shell: RShell, hooks?: DeepPartial<XmlParserHooks>): Promise<NormalizedAst>;
39
45
  /**
40
46
  * If the string has (R-)quotes around it, they will be removed, otherwise the string is returned unchanged.
41
47
  */
42
- export declare function removeTokenMapQuotationMarks(str: string): string;
43
- export type TokenMap = DeepReadonly<Record<string, string>>;
48
+ export declare function removeRQuotes(str: string): string;
44
49
  /**
45
- * Needs to be called *after* {@link retrieveXmlFromRCode} (or {@link retrieveNormalizedAstFromRCode})
50
+ * Needs to be called *after* {@link retrieveParseDataFromRCode} (or {@link retrieveNormalizedAstFromRCode})
46
51
  */
47
52
  export declare function retrieveNumberOfRTokensOfLastParse(shell: RShell): Promise<number>;
48
- export {};
@@ -1,21 +1,53 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.retrieveNumberOfRTokensOfLastParse = exports.removeTokenMapQuotationMarks = exports.retrieveNormalizedAstFromRCode = exports.retrieveXmlFromRCode = exports.requestFromInput = void 0;
6
+ exports.retrieveNumberOfRTokensOfLastParse = exports.removeRQuotes = exports.retrieveNormalizedAstFromRCode = exports.retrieveParseDataFromRCode = exports.requestFingerprint = exports.requestProviderFromText = exports.requestProviderFromFile = exports.requestFromInput = exports.fileProtocol = void 0;
4
7
  const lang_4_x_1 = require("./lang-4.x");
5
8
  const strings_1 = require("../util/strings");
6
9
  const assert_1 = require("../util/assert");
10
+ const shell_executor_1 = require("./shell-executor");
11
+ const object_hash_1 = __importDefault(require("object-hash"));
12
+ const parser_1 = require("./lang-4.x/ast/parser/json/parser");
13
+ exports.fileProtocol = 'file://';
7
14
  /**
8
15
  * Creates a {@link RParseRequest} from a given input.
9
16
  */
10
17
  function requestFromInput(input) {
11
- const file = input.startsWith('file://');
18
+ const file = input.startsWith(exports.fileProtocol);
12
19
  return {
13
20
  request: file ? 'file' : 'text',
14
- content: file ? input.slice(7) : input,
15
- ensurePackageInstalled: false // should be called within describeSession for that!
21
+ content: file ? input.slice(7) : input
16
22
  };
17
23
  }
18
24
  exports.requestFromInput = requestFromInput;
25
+ function requestProviderFromFile() {
26
+ return {
27
+ createRequest(path) {
28
+ return {
29
+ request: 'file',
30
+ content: path,
31
+ };
32
+ }
33
+ };
34
+ }
35
+ exports.requestProviderFromFile = requestProviderFromFile;
36
+ function requestProviderFromText(text) {
37
+ return {
38
+ createRequest(path) {
39
+ return {
40
+ request: 'text',
41
+ content: text[path]
42
+ };
43
+ }
44
+ };
45
+ }
46
+ exports.requestProviderFromText = requestProviderFromText;
47
+ function requestFingerprint(request) {
48
+ return (0, object_hash_1.default)(request);
49
+ }
50
+ exports.requestFingerprint = requestFingerprint;
19
51
  const ErrorMarker = 'err';
20
52
  /**
21
53
  * Provides the capability to parse R files/R code using the R parser.
@@ -24,33 +56,47 @@ const ErrorMarker = 'err';
24
56
  * Throws if the file could not be parsed.
25
57
  * If successful, allows to further query the last result with {@link retrieveNumberOfRTokensOfLastParse}.
26
58
  */
27
- async function retrieveXmlFromRCode(request, shell) {
28
- if (request.ensurePackageInstalled) {
29
- await shell.ensurePackageInstalled('xmlparsedata', true);
30
- }
59
+ function retrieveParseDataFromRCode(request, shell) {
31
60
  const suffix = request.request === 'file' ? ', encoding="utf-8"' : '';
32
- shell.sendCommands(`flowr_output <- flowr_parsed <- "${ErrorMarker}"`,
33
- // now, try to retrieve the ast
34
- `try(flowr_parsed<-parse(${request.request}=${JSON.stringify(request.content)},keep.source=TRUE${suffix}),silent=FALSE)`, 'try(flowr_output<-xmlparsedata::xml_parse_data(flowr_parsed,includeText=TRUE,pretty=FALSE),silent=FALSE)');
35
- const xml = await shell.sendCommandWithOutput(`cat(flowr_output,${(0, lang_4_x_1.ts2r)(shell.options.eol)})`);
36
- const output = xml.join(shell.options.eol);
37
- (0, assert_1.guard)(output !== ErrorMarker, () => `unable to parse R code (see the log for more information) for request ${JSON.stringify(request)}}`);
38
- return output;
61
+ const eol = (0, lang_4_x_1.ts2r)(shell.options.eol);
62
+ const command =
63
+ /* first check if flowr_get is already part of the environment */
64
+ 'if(!exists("flowr_get")){'
65
+ /* if not, define it complete wrapped in a try so that we can handle failures gracefully on stdout */
66
+ + 'flowr_get<-function(...){tryCatch({'
67
+ /* the actual code to parse the R code, ... allows us to keep the old 'file=path' and 'text=content' semantics. we define flowr_output using the super assignment to persist it in the env! */
68
+ + 'flowr_output<<-utils::getParseData(parse(...,keep.source=TRUE),includeText=TRUE);'
69
+ /* json conversion of the output, dataframe="values" allows us to receive a list of lists (which is more compact)!
70
+ * so we do not depend on jsonlite and friends, we do so manually (:sparkles:)
71
+ */
72
+ + `cat("[",paste0(apply(flowr_output,1,function(o)sprintf("[%s,%s,%s,%s,%s,%s,%s,%s,%s]",o[[1]],o[[2]],o[[3]],o[[4]],o[[5]],o[[6]],deparse(o[[7]]),if(o[[8]])"true"else"false",deparse(o[[9]]))),collapse=","),"]",${eol},sep="")`
73
+ /* error handling (just produce the marker) */
74
+ + `},error=function(e){cat("${ErrorMarker}",${eol})})};`
75
+ /* compile the function to improve perf. */
76
+ + 'flowr_get<-compiler::cmpfun(flowr_get)};'
77
+ /* call the function with the request */
78
+ + `flowr_get(${request.request}=${JSON.stringify(request.content)}${suffix})`;
79
+ if (shell instanceof shell_executor_1.RShellExecutor) {
80
+ return guardRetrievedOutput(shell.run(command), request);
81
+ }
82
+ else {
83
+ return shell.sendCommandWithOutput(command).then(result => guardRetrievedOutput(result.join(shell.options.eol), request));
84
+ }
39
85
  }
40
- exports.retrieveXmlFromRCode = retrieveXmlFromRCode;
86
+ exports.retrieveParseDataFromRCode = retrieveParseDataFromRCode;
41
87
  /**
42
- * Uses {@link retrieveXmlFromRCode} and returns the nicely formatted object-AST.
88
+ * Uses {@link retrieveParseDataFromRCode} and returns the nicely formatted object-AST.
43
89
  * If successful, allows to further query the last result with {@link retrieveNumberOfRTokensOfLastParse}.
44
90
  */
45
91
  async function retrieveNormalizedAstFromRCode(request, shell, hooks) {
46
- const xml = await retrieveXmlFromRCode(request, shell);
47
- return await (0, lang_4_x_1.normalize)(xml, await shell.tokenMap(), hooks);
92
+ const data = await retrieveParseDataFromRCode(request, shell);
93
+ return (0, parser_1.normalize)(data, hooks);
48
94
  }
49
95
  exports.retrieveNormalizedAstFromRCode = retrieveNormalizedAstFromRCode;
50
96
  /**
51
97
  * If the string has (R-)quotes around it, they will be removed, otherwise the string is returned unchanged.
52
98
  */
53
- function removeTokenMapQuotationMarks(str) {
99
+ function removeRQuotes(str) {
54
100
  if (str.length > 1 && ((0, strings_1.startAndEndsWith)(str, '\'') || (0, strings_1.startAndEndsWith)(str, '"'))) {
55
101
  return str.slice(1, -1);
56
102
  }
@@ -58,14 +104,18 @@ function removeTokenMapQuotationMarks(str) {
58
104
  return str;
59
105
  }
60
106
  }
61
- exports.removeTokenMapQuotationMarks = removeTokenMapQuotationMarks;
107
+ exports.removeRQuotes = removeRQuotes;
62
108
  /**
63
- * Needs to be called *after* {@link retrieveXmlFromRCode} (or {@link retrieveNormalizedAstFromRCode})
109
+ * Needs to be called *after* {@link retrieveParseDataFromRCode} (or {@link retrieveNormalizedAstFromRCode})
64
110
  */
65
111
  async function retrieveNumberOfRTokensOfLastParse(shell) {
66
- const result = await shell.sendCommandWithOutput(`cat(nrow(getParseData(flowr_parsed)),${(0, lang_4_x_1.ts2r)(shell.options.eol)})`);
112
+ const result = await shell.sendCommandWithOutput(`cat(nrow(flowr_output),${(0, lang_4_x_1.ts2r)(shell.options.eol)})`);
67
113
  (0, assert_1.guard)(result.length === 1, () => `expected exactly one line to obtain the number of R tokens, but got: ${JSON.stringify(result)}`);
68
114
  return Number(result[0]);
69
115
  }
70
116
  exports.retrieveNumberOfRTokensOfLastParse = retrieveNumberOfRTokensOfLastParse;
117
+ function guardRetrievedOutput(output, request) {
118
+ (0, assert_1.guard)(output !== ErrorMarker, () => `unable to parse R code (see the log for more information) for request ${JSON.stringify(request)}}`);
119
+ return output;
120
+ }
71
121
  //# sourceMappingURL=retriever.js.map
@@ -0,0 +1,11 @@
1
+ import type { RShellExecutionOptions } from './shell';
2
+ import type { SemVer } from 'semver';
3
+ export declare class RShellExecutor {
4
+ readonly options: Readonly<RShellExecutionOptions>;
5
+ private readonly prerequisites;
6
+ constructor(options?: Partial<RShellExecutionOptions>);
7
+ continueOnError(): this;
8
+ addPrerequisites(commands: string | string[]): this;
9
+ usedRVersion(): SemVer | null;
10
+ run(command: string, returnErr?: boolean): string;
11
+ }
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.RShellExecutor = void 0;
7
+ const shell_1 = require("./shell");
8
+ const objects_1 = require("../util/objects");
9
+ const child_process_1 = require("child_process");
10
+ const lang_4_x_1 = require("./lang-4.x");
11
+ const preload_1 = __importDefault(require("semver/preload"));
12
+ const log_1 = require("../util/log");
13
+ const executorLog = log_1.log.getSubLogger({ name: 'RShellExecutor' });
14
+ class RShellExecutor {
15
+ options;
16
+ prerequisites = [];
17
+ constructor(options) {
18
+ this.options = (0, objects_1.deepMergeObject)(shell_1.DEFAULT_R_SHELL_OPTIONS, options);
19
+ }
20
+ continueOnError() {
21
+ executorLog.info('continue in case of Errors');
22
+ this.addPrerequisites('options(error=function() {})');
23
+ return this;
24
+ }
25
+ addPrerequisites(commands) {
26
+ this.prerequisites.push(...(typeof commands == 'string' ? [commands] : commands));
27
+ return this;
28
+ }
29
+ usedRVersion() {
30
+ const version = this.run(`cat(paste0(R.version$major,".",R.version$minor), ${(0, lang_4_x_1.ts2r)(this.options.eol)})`);
31
+ executorLog.trace(`raw version: ${JSON.stringify(version)}`);
32
+ return preload_1.default.coerce(version);
33
+ }
34
+ run(command, returnErr = false) {
35
+ command += ';base::quit()';
36
+ if (executorLog.settings.minLevel >= 1 /* LogLevel.Trace */) {
37
+ executorLog.trace(`> ${JSON.stringify(command)}`);
38
+ }
39
+ const returns = (0, child_process_1.spawnSync)(this.options.pathToRExecutable, this.options.commandLineOptions, {
40
+ env: this.options.env,
41
+ cwd: this.options.cwd,
42
+ windowsHide: true,
43
+ encoding: 'utf8',
44
+ input: [...this.prerequisites, command].join(this.options.eol)
45
+ });
46
+ return (returnErr ? returns.stderr : returns.stdout).trim();
47
+ }
48
+ }
49
+ exports.RShellExecutor = RShellExecutor;
50
+ //# sourceMappingURL=shell-executor.js.map
@@ -1,7 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import { type MergeableRecord } from '../util/objects';
3
- import { SemVer } from 'semver';
4
- import { TokenMap } from './retriever';
3
+ import type { SemVer } from 'semver';
5
4
  export type OutputStreamSelector = 'stdout' | 'stderr' | 'both';
6
5
  export interface CollectorTimeout extends MergeableRecord {
7
6
  /**
@@ -33,7 +32,7 @@ export interface OutputCollectorConfiguration extends MergeableRecord {
33
32
  automaticallyTrimOutput: boolean;
34
33
  }
35
34
  export declare const DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION: OutputCollectorConfiguration;
36
- export interface RShellSessionOptions extends MergeableRecord {
35
+ export interface RShellExecutionOptions extends MergeableRecord {
37
36
  /** The path to the R executable, can be only the executable if it is to be found on the PATH. */
38
37
  readonly pathToRExecutable: string;
39
38
  /** Command line options to use when starting the R session. */
@@ -44,12 +43,14 @@ export interface RShellSessionOptions extends MergeableRecord {
44
43
  readonly eol: string;
45
44
  /** The environment variables available in the R session. */
46
45
  readonly env: NodeJS.ProcessEnv;
46
+ /** The path to the library directory, use undefined to let R figure that out for itself */
47
+ readonly homeLibPath: string | undefined;
48
+ }
49
+ export interface RShellSessionOptions extends RShellExecutionOptions {
47
50
  /** If set, the R session will be restarted if it exits due to an error */
48
51
  readonly revive: 'never' | 'on-error' | 'always';
49
52
  /** Called when the R session is restarted, this makes only sense if `revive` is not set to `'never'` */
50
53
  readonly onRevive: (code: number, signal: string | null) => void;
51
- /** The path to the library directory, use undefined to let R figure that out for itself */
52
- readonly homeLibPath: string | undefined;
53
54
  }
54
55
  /**
55
56
  * Configuration of an {@link RShell} instance.
@@ -58,6 +59,8 @@ export interface RShellSessionOptions extends MergeableRecord {
58
59
  export interface RShellOptions extends RShellSessionOptions {
59
60
  readonly sessionName: string;
60
61
  }
62
+ export declare const DEFAULT_R_PATH: string;
63
+ export declare const DEFAULT_R_SHELL_EXEC_OPTIONS: RShellExecutionOptions;
61
64
  export declare const DEFAULT_R_SHELL_OPTIONS: RShellOptions;
62
65
  /**
63
66
  * The `RShell` represents an interactive session with the R interpreter.
@@ -72,7 +75,6 @@ export declare class RShell {
72
75
  private session;
73
76
  private readonly log;
74
77
  private versionCache;
75
- private tokenMapCache;
76
78
  private tempDirs;
77
79
  constructor(options?: Partial<RShellOptions>);
78
80
  private revive;
@@ -82,13 +84,12 @@ export declare class RShell {
82
84
  */
83
85
  sendCommand(command: string): void;
84
86
  usedRVersion(): Promise<SemVer | null>;
87
+ injectLibPaths(...paths: string[]): void;
88
+ tryToInjectHomeLibPath(): void;
85
89
  /**
86
- * Retrieve the token map of the xmlparsedata package.
87
- *
88
- * @note For multiple calls, this makes use of caching
90
+ * checks if a given package is already installed on the system!
89
91
  */
90
- tokenMap(): Promise<TokenMap>;
91
- private retrieveTokenMap;
92
+ isPackageInstalled(packageName: string): Promise<boolean>;
92
93
  /**
93
94
  * Send a command and collect the output
94
95
  *
@@ -112,26 +113,6 @@ export declare class RShell {
112
113
  * continue working!
113
114
  */
114
115
  continueOnError(): void;
115
- injectLibPaths(...paths: string[]): void;
116
- tryToInjectHomeLibPath(): void;
117
- /**
118
- * checks if a given package is already installed on the system!
119
- */
120
- isPackageInstalled(packageName: string): Promise<boolean>;
121
- allInstalledPackages(): Promise<string[]>;
122
- /**
123
- * Installs the package using a temporary location
124
- *
125
- * @param packageName - The package to install
126
- * @param autoload - If true, the package will be loaded after installation
127
- * @param force - If true, the package will be installed no if it is already on the system and ready to be loaded
128
- */
129
- ensurePackageInstalled(packageName: string, autoload?: boolean, force?: boolean): Promise<{
130
- packageName: string;
131
- packageExistedAlready: boolean;
132
- /** the temporary directory used for the installation, undefined if none was used */
133
- libraryLocation?: string;
134
- }>;
135
116
  /**
136
117
  * Obtain the temporary directory used by R.
137
118
  * Additionally, this marks the directory for removal when the shell exits.