@eagleoutice/flowr 2.0.25 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/benchmark/slicer.js +2 -1
  2. package/benchmark/stats/print.js +3 -4
  3. package/benchmark/stats/size-of.js +9 -7
  4. package/benchmark/summarizer/first-phase/input.d.ts +0 -1
  5. package/benchmark/summarizer/first-phase/input.js +2 -3
  6. package/benchmark/summarizer/first-phase/process.js +7 -7
  7. package/benchmark/summarizer/second-phase/graph.js +1 -2
  8. package/benchmark/summarizer/second-phase/process.d.ts +0 -1
  9. package/benchmark/summarizer/second-phase/process.js +4 -5
  10. package/benchmark/summarizer/summarizer.js +7 -1
  11. package/cli/benchmark-app.js +6 -1
  12. package/cli/common/features.js +2 -3
  13. package/cli/common/script.js +2 -3
  14. package/cli/common/scripts-info.d.ts +69 -1
  15. package/cli/common/scripts-info.js +6 -6
  16. package/cli/flowr-main-options.d.ts +4 -0
  17. package/cli/flowr-main-options.js +88 -0
  18. package/cli/flowr.d.ts +3 -3
  19. package/cli/flowr.js +22 -31
  20. package/cli/repl/commands/{cfg.d.ts → repl-cfg.d.ts} +1 -1
  21. package/cli/repl/commands/{cfg.js → repl-cfg.js} +3 -3
  22. package/cli/repl/commands/{commands.d.ts → repl-commands.d.ts} +3 -1
  23. package/cli/repl/commands/{commands.js → repl-commands.js} +56 -35
  24. package/cli/repl/commands/{dataflow.d.ts → repl-dataflow.d.ts} +1 -1
  25. package/cli/repl/commands/{dataflow.js → repl-dataflow.js} +2 -2
  26. package/cli/repl/commands/{execute.d.ts → repl-execute.d.ts} +1 -1
  27. package/cli/repl/commands/{execute.js → repl-execute.js} +3 -3
  28. package/cli/repl/commands/repl-lineage.d.ts +15 -0
  29. package/cli/repl/commands/{lineage.js → repl-lineage.js} +14 -12
  30. package/cli/repl/commands/{main.js → repl-main.js} +1 -1
  31. package/cli/repl/commands/{normalize.d.ts → repl-normalize.d.ts} +1 -1
  32. package/cli/repl/commands/{normalize.js → repl-normalize.js} +3 -3
  33. package/cli/repl/commands/{parse.d.ts → repl-parse.d.ts} +1 -1
  34. package/cli/repl/commands/{parse.js → repl-parse.js} +3 -2
  35. package/cli/repl/commands/repl-query.d.ts +8 -0
  36. package/cli/repl/commands/repl-query.js +155 -0
  37. package/cli/repl/commands/repl-quit.d.ts +2 -0
  38. package/cli/repl/commands/{quit.js → repl-quit.js} +1 -1
  39. package/cli/repl/commands/{version.d.ts → repl-version.d.ts} +1 -1
  40. package/cli/repl/commands/{version.js → repl-version.js} +4 -4
  41. package/cli/repl/core.d.ts +1 -2
  42. package/cli/repl/core.js +13 -13
  43. package/cli/repl/execute.d.ts +1 -2
  44. package/cli/repl/execute.js +2 -3
  45. package/cli/repl/print-version.js +3 -4
  46. package/cli/repl/server/connection.d.ts +1 -0
  47. package/cli/repl/server/connection.js +45 -12
  48. package/cli/repl/server/messages/{messages.d.ts → all-messages.d.ts} +8 -7
  49. package/cli/repl/server/messages/{messages.js → all-messages.js} +1 -1
  50. package/cli/repl/server/messages/{analysis.d.ts → message-analysis.d.ts} +2 -1
  51. package/cli/repl/server/messages/message-analysis.js +39 -0
  52. package/cli/repl/server/messages/{error.d.ts → message-error.d.ts} +1 -1
  53. package/cli/repl/server/messages/{error.js → message-error.js} +1 -1
  54. package/cli/repl/server/messages/{hello.d.ts → message-hello.d.ts} +4 -3
  55. package/cli/repl/server/messages/message-hello.js +20 -0
  56. package/cli/repl/server/messages/{lineage.d.ts → message-lineage.d.ts} +2 -1
  57. package/cli/repl/server/messages/message-lineage.js +25 -0
  58. package/cli/repl/server/messages/message-query.d.ts +16 -0
  59. package/cli/repl/server/messages/message-query.js +26 -0
  60. package/cli/repl/server/messages/{repl.d.ts → message-repl.d.ts} +3 -1
  61. package/cli/repl/server/messages/message-repl.js +53 -0
  62. package/cli/repl/server/messages/{slice.d.ts → message-slice.d.ts} +2 -1
  63. package/cli/repl/server/messages/{slice.js → message-slice.js} +14 -6
  64. package/cli/repl/server/net.d.ts +0 -1
  65. package/cli/repl/server/send.d.ts +1 -1
  66. package/cli/repl/server/send.js +2 -3
  67. package/cli/repl/server/server.js +2 -2
  68. package/cli/repl/server/validate.d.ts +1 -1
  69. package/cli/repl/server/validate.js +5 -6
  70. package/cli/run-script.d.ts +8 -0
  71. package/cli/run-script.js +18 -0
  72. package/cli/script-core/statistics-core.d.ts +2 -0
  73. package/cli/script-core/statistics-core.js +100 -0
  74. package/cli/script-core/statistics-helper-core.d.ts +2 -0
  75. package/cli/script-core/statistics-helper-core.js +81 -0
  76. package/cli/script-core/summarizer-core.d.ts +2 -0
  77. package/cli/script-core/summarizer-core.js +51 -0
  78. package/cli/statistics-app.js +3 -87
  79. package/cli/statistics-helper-app.js +3 -77
  80. package/cli/summarizer-app.js +2 -48
  81. package/config.d.ts +20 -4
  82. package/config.js +62 -36
  83. package/core/pipeline-executor.js +11 -1
  84. package/core/print/dataflow-printer.js +4 -5
  85. package/core/print/normalize-printer.js +4 -5
  86. package/core/print/parse-printer.js +1 -2
  87. package/core/print/print.js +2 -3
  88. package/core/print/slice-diff-ansi.js +1 -2
  89. package/core/steps/pipeline/create-pipeline.js +1 -2
  90. package/core/steps/pipeline/default-pipelines.d.ts +18 -18
  91. package/core/steps/pipeline/pipeline.js +1 -2
  92. package/dataflow/environments/append.js +1 -2
  93. package/dataflow/environments/built-in-config.d.ts +47 -0
  94. package/dataflow/environments/built-in-config.js +83 -0
  95. package/dataflow/environments/built-in.d.ts +49 -6
  96. package/dataflow/environments/built-in.js +29 -97
  97. package/dataflow/environments/clone.js +2 -2
  98. package/dataflow/environments/default-builtin-config.d.ts +5 -0
  99. package/dataflow/environments/default-builtin-config.js +83 -0
  100. package/dataflow/environments/define.js +1 -2
  101. package/dataflow/environments/diff.js +5 -6
  102. package/dataflow/environments/environment.js +8 -7
  103. package/dataflow/environments/identifier.d.ts +39 -8
  104. package/dataflow/environments/identifier.js +33 -0
  105. package/dataflow/environments/overwrite.d.ts +6 -5
  106. package/dataflow/environments/overwrite.js +16 -9
  107. package/dataflow/environments/resolve-by-name.d.ts +3 -1
  108. package/dataflow/environments/resolve-by-name.js +40 -8
  109. package/dataflow/environments/scoping.js +2 -3
  110. package/dataflow/extractor.js +25 -24
  111. package/dataflow/graph/dataflowgraph-builder.d.ts +139 -0
  112. package/dataflow/graph/dataflowgraph-builder.js +247 -0
  113. package/dataflow/graph/diff.js +12 -11
  114. package/dataflow/graph/edge.d.ts +2 -2
  115. package/dataflow/graph/edge.js +46 -20
  116. package/dataflow/graph/graph.d.ts +14 -6
  117. package/dataflow/graph/graph.js +25 -21
  118. package/dataflow/graph/quads.js +1 -2
  119. package/dataflow/graph/resolve-graph.d.ts +7 -0
  120. package/dataflow/graph/resolve-graph.js +51 -0
  121. package/dataflow/graph/vertex.d.ts +12 -4
  122. package/dataflow/graph/vertex.js +19 -11
  123. package/dataflow/info.d.ts +3 -7
  124. package/dataflow/info.js +7 -8
  125. package/dataflow/internal/linker.d.ts +3 -1
  126. package/dataflow/internal/linker.js +77 -32
  127. package/dataflow/internal/process/functions/call/argument/make-argument.js +5 -5
  128. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -2
  129. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +10 -8
  130. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +5 -1
  131. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +27 -10
  132. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +40 -26
  133. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +30 -20
  134. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +10 -9
  135. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +12 -11
  136. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +6 -5
  137. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +7 -6
  138. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -4
  139. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +10 -6
  140. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +7 -3
  141. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -3
  142. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
  143. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +6 -6
  144. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
  145. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +6 -5
  146. package/dataflow/internal/process/functions/call/common.js +30 -19
  147. package/dataflow/internal/process/functions/call/default-call-handling.js +1 -2
  148. package/dataflow/internal/process/functions/call/known-call-handling.js +8 -6
  149. package/dataflow/internal/process/functions/call/named-call-handling.js +7 -6
  150. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +11 -7
  151. package/dataflow/internal/process/functions/process-argument.js +10 -8
  152. package/dataflow/internal/process/functions/process-parameter.js +8 -6
  153. package/dataflow/internal/process/process-named-call.js +3 -3
  154. package/dataflow/internal/process/process-symbol.js +5 -4
  155. package/dataflow/internal/process/process-uninteresting-leaf.js +1 -2
  156. package/dataflow/internal/process/process-value.js +5 -4
  157. package/dataflow/processor.js +1 -2
  158. package/documentation/data/dfg/doc-data-dfg-util.d.ts +20 -0
  159. package/documentation/data/dfg/doc-data-dfg-util.js +13 -0
  160. package/documentation/data/query/example-query-code.d.ts +1 -0
  161. package/documentation/data/query/example-query-code.js +25 -0
  162. package/documentation/data/server/doc-data-server-messages.d.ts +1 -0
  163. package/documentation/data/server/doc-data-server-messages.js +508 -0
  164. package/documentation/doc-util/doc-auto-gen.d.ts +7 -0
  165. package/documentation/doc-util/doc-auto-gen.js +9 -0
  166. package/documentation/doc-util/doc-cfg.d.ts +7 -0
  167. package/documentation/doc-util/doc-cfg.js +18 -0
  168. package/documentation/doc-util/doc-cli-option.d.ts +8 -0
  169. package/documentation/doc-util/doc-cli-option.js +36 -0
  170. package/documentation/doc-util/doc-code.d.ts +1 -0
  171. package/documentation/doc-util/doc-code.js +7 -0
  172. package/documentation/doc-util/doc-dfg.d.ts +21 -0
  173. package/documentation/doc-util/doc-dfg.js +93 -0
  174. package/documentation/doc-util/doc-docker.d.ts +1 -0
  175. package/documentation/doc-util/doc-docker.js +5 -0
  176. package/documentation/doc-util/doc-env.d.ts +2 -0
  177. package/documentation/doc-util/doc-env.js +20 -0
  178. package/documentation/doc-util/doc-files.d.ts +6 -0
  179. package/documentation/doc-util/doc-files.js +25 -0
  180. package/documentation/doc-util/doc-general.d.ts +2 -0
  181. package/documentation/doc-util/doc-general.js +16 -0
  182. package/documentation/doc-util/doc-hover-over.d.ts +1 -0
  183. package/documentation/doc-util/doc-hover-over.js +7 -0
  184. package/documentation/doc-util/doc-issue.d.ts +1 -0
  185. package/documentation/doc-util/doc-issue.js +6 -0
  186. package/documentation/doc-util/doc-ms.d.ts +1 -0
  187. package/documentation/doc-util/doc-ms.js +8 -0
  188. package/documentation/doc-util/doc-normalized-ast.d.ts +11 -0
  189. package/documentation/doc-util/doc-normalized-ast.js +71 -0
  190. package/documentation/doc-util/doc-query.d.ts +24 -0
  191. package/documentation/doc-util/doc-query.js +113 -0
  192. package/documentation/doc-util/doc-repl.d.ts +13 -0
  193. package/documentation/doc-util/doc-repl.js +79 -0
  194. package/documentation/doc-util/doc-server-message.d.ts +37 -0
  195. package/documentation/doc-util/doc-server-message.js +153 -0
  196. package/documentation/doc-util/doc-structure.d.ts +12 -0
  197. package/documentation/doc-util/doc-structure.js +21 -0
  198. package/documentation/doc-util/doc-types.d.ts +38 -0
  199. package/documentation/doc-util/doc-types.js +276 -0
  200. package/{r-bridge/data/print.js → documentation/print-capabilities-markdown.js} +8 -4
  201. package/documentation/print-dataflow-graph-wiki.d.ts +1 -0
  202. package/documentation/print-dataflow-graph-wiki.js +849 -0
  203. package/documentation/print-interface-wiki.d.ts +1 -0
  204. package/documentation/print-interface-wiki.js +401 -0
  205. package/documentation/print-normalized-ast-wiki.d.ts +1 -0
  206. package/documentation/print-normalized-ast-wiki.js +98 -0
  207. package/documentation/print-query-wiki.d.ts +1 -0
  208. package/documentation/print-query-wiki.js +215 -0
  209. package/package.json +29 -33
  210. package/queries/base-query-format.d.ts +11 -0
  211. package/{cli/repl/server/messages/hello.js → queries/base-query-format.js} +1 -1
  212. package/queries/call-context-query/call-context-query-executor.d.ts +11 -0
  213. package/queries/call-context-query/call-context-query-executor.js +255 -0
  214. package/queries/call-context-query/call-context-query-format.d.ts +72 -0
  215. package/queries/call-context-query/call-context-query-format.js +17 -0
  216. package/queries/query-schema.d.ts +7 -0
  217. package/queries/query-schema.js +31 -0
  218. package/queries/query.d.ts +35 -0
  219. package/queries/query.js +57 -0
  220. package/queries/two-layer-collector.d.ts +8 -0
  221. package/queries/two-layer-collector.js +31 -0
  222. package/queries/virtual-query/compound-query.d.ts +24 -0
  223. package/queries/virtual-query/compound-query.js +18 -0
  224. package/queries/virtual-query/virtual-queries.d.ts +15 -0
  225. package/queries/virtual-query/virtual-queries.js +8 -0
  226. package/r-bridge/data/data.d.ts +5 -0
  227. package/r-bridge/data/data.js +6 -0
  228. package/r-bridge/data/get.js +2 -3
  229. package/r-bridge/init.js +2 -2
  230. package/r-bridge/lang-4.x/ast/model/collect.js +1 -2
  231. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -2
  232. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -0
  233. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -0
  234. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +3 -0
  235. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +5 -0
  236. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +4 -0
  237. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -1
  238. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +10 -1
  239. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +5 -0
  240. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +3 -0
  241. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +3 -0
  242. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +3 -0
  243. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +3 -0
  244. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -1
  245. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -0
  246. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +3 -0
  247. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -2
  248. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -0
  249. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -2
  250. package/r-bridge/lang-4.x/ast/model/operators.js +27 -26
  251. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +9 -9
  252. package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -2
  253. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -0
  254. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +26 -3
  255. package/r-bridge/lang-4.x/ast/model/processing/role.js +1 -2
  256. package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +23 -23
  257. package/r-bridge/lang-4.x/ast/model/processing/visitor.js +23 -23
  258. package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -2
  259. package/r-bridge/lang-4.x/ast/model/type.js +221 -12
  260. package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
  261. package/r-bridge/lang-4.x/ast/parser/json/parser.js +6 -5
  262. package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +3 -3
  263. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then-else.js +4 -4
  264. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then.js +7 -7
  265. package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/normalize-expression.js +4 -4
  266. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-argument.js +10 -10
  267. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-call.js +18 -18
  268. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-definition.js +8 -8
  269. package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-parameter.js +9 -9
  270. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-break.js +3 -3
  271. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-for.js +10 -10
  272. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-next.js +3 -3
  273. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-repeat.js +5 -5
  274. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-while.js +7 -7
  275. package/r-bridge/lang-4.x/ast/parser/xml/internal/normalize-access.js +12 -12
  276. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-binary.js +14 -14
  277. package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-unary.js +4 -4
  278. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-comment.js +3 -3
  279. package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-line-directive.js +4 -4
  280. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-delimiter.js +3 -3
  281. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-expressions.js +13 -13
  282. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-root.js +6 -6
  283. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-single-node.js +19 -19
  284. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-number.js +5 -5
  285. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-string.js +3 -3
  286. package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-symbol.js +2 -3
  287. package/r-bridge/lang-4.x/ast/parser/xml/normalize-meta.js +12 -12
  288. package/r-bridge/lang-4.x/convert-values.js +7 -7
  289. package/r-bridge/retriever.js +12 -11
  290. package/r-bridge/shell.d.ts +0 -1
  291. package/r-bridge/shell.js +6 -1
  292. package/reconstruct/auto-select/auto-select-defaults.js +1 -2
  293. package/reconstruct/auto-select/magic-comments.js +3 -3
  294. package/reconstruct/reconstruct.js +4 -3
  295. package/slicing/criterion/collect-all.js +1 -2
  296. package/slicing/criterion/parse.d.ts +1 -1
  297. package/slicing/criterion/parse.js +6 -5
  298. package/slicing/static/fingerprint.js +2 -3
  299. package/slicing/static/slice-call.js +9 -9
  300. package/slicing/static/static-slicer.js +5 -4
  301. package/statistics/features/common-syntax-probability.js +13 -13
  302. package/statistics/features/feature.d.ts +5 -9
  303. package/statistics/features/feature.js +2 -2
  304. package/statistics/features/post-processing.js +2 -3
  305. package/statistics/features/supported/assignments/assignments.js +3 -2
  306. package/statistics/features/supported/assignments/post-process.js +1 -2
  307. package/statistics/features/supported/comments/post-process.js +1 -2
  308. package/statistics/features/supported/control-flow/control-flow.js +4 -3
  309. package/statistics/features/supported/control-flow/post-process.js +1 -2
  310. package/statistics/features/supported/data-access/data-access.d.ts +2 -2
  311. package/statistics/features/supported/data-access/data-access.js +3 -2
  312. package/statistics/features/supported/data-access/post-process.js +1 -2
  313. package/statistics/features/supported/defined-functions/defined-functions.js +9 -7
  314. package/statistics/features/supported/defined-functions/post-process.d.ts +1 -1
  315. package/statistics/features/supported/defined-functions/post-process.js +2 -3
  316. package/statistics/features/supported/expression-list/post-process.js +1 -2
  317. package/statistics/features/supported/expression-list/{expression-list.js → statistics-expression-list.js} +4 -3
  318. package/statistics/features/supported/loops/loops.js +8 -7
  319. package/statistics/features/supported/loops/post-process.js +1 -2
  320. package/statistics/features/supported/used-functions/post-process.js +2 -3
  321. package/statistics/features/supported/used-functions/used-functions.d.ts +1 -1
  322. package/statistics/features/supported/used-functions/used-functions.js +4 -3
  323. package/statistics/features/supported/used-packages/post-process.js +1 -2
  324. package/statistics/features/supported/values/post-process.js +1 -2
  325. package/statistics/features/supported/variables/post-process.js +2 -3
  326. package/statistics/features/supported/variables/variables.js +2 -1
  327. package/statistics/meta-statistics.js +1 -2
  328. package/statistics/output/print-stats.js +4 -5
  329. package/statistics/output/statistics-file.js +5 -5
  330. package/statistics/statistics.js +2 -3
  331. package/statistics/summarizer/auto-detect.js +1 -2
  332. package/statistics/summarizer/post-process/clusterer.js +1 -2
  333. package/statistics/summarizer/post-process/file-based-count.js +2 -3
  334. package/statistics/summarizer/post-process/histogram.js +3 -4
  335. package/statistics/summarizer/post-process/post-process-output.js +2 -3
  336. package/statistics/summarizer/second-phase/process.d.ts +2 -0
  337. package/statistics/summarizer/second-phase/process.js +2 -2
  338. package/statistics/summarizer/summarizer.js +8 -1
  339. package/util/ansi.d.ts +1 -0
  340. package/util/ansi.js +27 -4
  341. package/util/args.js +2 -3
  342. package/util/arrays.js +8 -9
  343. package/util/assert.js +5 -6
  344. package/util/bimap.d.ts +4 -4
  345. package/util/cfg/cfg.d.ts +1 -0
  346. package/util/cfg/cfg.js +8 -5
  347. package/util/cfg/visitor.d.ts +8 -13
  348. package/util/cfg/visitor.js +22 -56
  349. package/util/diff.js +1 -2
  350. package/util/files.d.ts +0 -1
  351. package/util/files.js +11 -8
  352. package/util/json.js +2 -3
  353. package/util/mermaid/ast.js +7 -7
  354. package/util/mermaid/cfg.js +2 -3
  355. package/util/mermaid/dfg.d.ts +12 -4
  356. package/util/mermaid/dfg.js +28 -16
  357. package/util/mermaid/mermaid.js +5 -4
  358. package/util/numbers.js +1 -2
  359. package/util/objects.d.ts +7 -0
  360. package/util/objects.js +13 -3
  361. package/util/os.js +1 -2
  362. package/util/quads.js +5 -5
  363. package/util/random.js +2 -2
  364. package/util/range.js +8 -9
  365. package/util/schema.d.ts +11 -0
  366. package/util/schema.js +75 -0
  367. package/util/set.js +2 -3
  368. package/util/strings.js +3 -4
  369. package/util/summarizer.js +4 -4
  370. package/util/text.d.ts +1 -0
  371. package/util/text.js +20 -0
  372. package/util/time.js +1 -2
  373. package/util/version.js +2 -3
  374. package/cli/repl/commands/lineage.d.ts +0 -15
  375. package/cli/repl/commands/quit.d.ts +0 -2
  376. package/cli/repl/server/messages/analysis.js +0 -21
  377. package/cli/repl/server/messages/lineage.js +0 -17
  378. package/cli/repl/server/messages/repl.js +0 -37
  379. /package/cli/repl/commands/{main.d.ts → repl-main.d.ts} +0 -0
  380. /package/{r-bridge/data/print.d.ts → documentation/print-capabilities-markdown.d.ts} +0 -0
  381. /package/statistics/features/supported/expression-list/{expression-list.d.ts → statistics-expression-list.d.ts} +0 -0
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseNodesWithUnknownType = exports.normalizeExpressions = exports.splitComments = void 0;
3
+ exports.splitComments = splitComments;
4
+ exports.normalizeExpressions = normalizeExpressions;
5
+ exports.parseNodesWithUnknownType = parseNodesWithUnknownType;
4
6
  const normalize_single_node_1 = require("./normalize-single-node");
5
7
  const parser_1 = require("../../../json/parser");
6
8
  const normalize_meta_1 = require("../../normalize-meta");
@@ -15,6 +17,7 @@ const normalize_symbol_1 = require("../values/normalize-symbol");
15
17
  const normalize_if_then_1 = require("../control/normalize-if-then");
16
18
  const normalize_while_1 = require("../loops/normalize-while");
17
19
  const normalize_if_then_else_1 = require("../control/normalize-if-then-else");
20
+ const type_1 = require("../../../../model/type");
18
21
  const normalize_comment_1 = require("../other/normalize-comment");
19
22
  function normalizeMappedWithoutSemicolonBasedOnType(mappedWithName, data) {
20
23
  let result = undefined;
@@ -46,7 +49,7 @@ function splitComments(tokens) {
46
49
  const comments = [];
47
50
  const others = [];
48
51
  for (const elem of tokens) {
49
- if (elem.name === "COMMENT" /* RawRType.Comment */) {
52
+ if (elem.name === type_1.RawRType.Comment) {
50
53
  comments.push(elem);
51
54
  }
52
55
  else {
@@ -55,19 +58,18 @@ function splitComments(tokens) {
55
58
  }
56
59
  return { comments, others };
57
60
  }
58
- exports.splitComments = splitComments;
59
61
  function splitExprs(tokens) {
60
62
  let last = 0, i = 0;
61
63
  let lastExpr = false;
62
64
  const segments = [];
63
65
  for (const token of tokens) {
64
- if (token.name === ";" /* RawRType.Semicolon */) {
66
+ if (token.name === type_1.RawRType.Semicolon) {
65
67
  segments.push(tokens.slice(last, i));
66
68
  lastExpr = false;
67
69
  last = i + 1;
68
70
  }
69
71
  else {
70
- const thisExpr = token.name === "expr" /* RawRType.Expression */ || token.name === "expr_or_assign_or_help" /* RawRType.ExprOfAssignOrHelp */ || token.name === "equal_assign" /* RawRType.LegacyEqualAssign */;
72
+ const thisExpr = token.name === type_1.RawRType.Expression || token.name === type_1.RawRType.ExprOfAssignOrHelp || token.name === type_1.RawRType.LegacyEqualAssign;
71
73
  if (thisExpr && lastExpr) {
72
74
  if (i > last) {
73
75
  segments.push(tokens.slice(last, i));
@@ -94,18 +96,18 @@ function handleExpressionList(raw) {
94
96
  }
95
97
  const { comments, others: tokens } = splitComments(raw);
96
98
  const first = tokens[0]?.name;
97
- if (first === "{" /* RawRType.BraceLeft */) {
99
+ if (first === type_1.RawRType.BraceLeft) {
98
100
  const endType = tokens[tokens.length - 1].name;
99
- (0, assert_1.guard)(endType === "}" /* RawRType.BraceRight */, () => `expected a brace at the end of the expression list as well, but ${endType} :: ${JSON.stringify(tokens[tokens.length - 1], json_1.jsonReplacer)}`);
101
+ (0, assert_1.guard)(endType === type_1.RawRType.BraceRight, () => `expected a brace at the end of the expression list as well, but ${endType} :: ${JSON.stringify(tokens[tokens.length - 1], json_1.jsonReplacer)}`);
100
102
  return {
101
103
  segments: [tokens.slice(1, tokens.length - 1)],
102
104
  comments,
103
105
  braces: [tokens[0], tokens[tokens.length - 1]]
104
106
  };
105
107
  }
106
- else if (first === "(" /* RawRType.ParenLeft */) {
108
+ else if (first === type_1.RawRType.ParenLeft) {
107
109
  const endType = tokens[tokens.length - 1].name;
108
- (0, assert_1.guard)(endType === ")" /* RawRType.ParenRight */, () => `expected a parenthesis at the end of the expression list as well, but ${endType} :: ${JSON.stringify(tokens[tokens.length - 1], json_1.jsonReplacer)}`);
110
+ (0, assert_1.guard)(endType === type_1.RawRType.ParenRight, () => `expected a parenthesis at the end of the expression list as well, but ${endType} :: ${JSON.stringify(tokens[tokens.length - 1], json_1.jsonReplacer)}`);
109
111
  return {
110
112
  segments: [tokens.slice(1, tokens.length - 1)],
111
113
  comments,
@@ -120,7 +122,7 @@ function processBraces([start, end], processed, comments, data) {
120
122
  const [newStart, newEnd] = [(0, normalize_symbol_1.tryNormalizeSymbol)(data, [start]), (0, normalize_symbol_1.tryNormalizeSymbol)(data, [end])];
121
123
  (0, assert_1.guard)(newStart !== undefined && newEnd !== undefined, () => `expected both start and end to be symbols, but ${JSON.stringify(start, json_1.jsonReplacer)} :: ${JSON.stringify(end, json_1.jsonReplacer)}`);
122
124
  return {
123
- type: "RExpressionList" /* RType.ExpressionList */,
125
+ type: type_1.RType.ExpressionList,
124
126
  children: processed,
125
127
  grouping: [newStart, newEnd],
126
128
  lexeme: undefined,
@@ -145,7 +147,7 @@ function normalizeExpressions(data, tokens) {
145
147
  parsedComments = comments.map(c => (0, normalize_comment_1.normalizeComment)(data, c.content));
146
148
  if (segments.length > 1 || braces) {
147
149
  const processed = segments.flatMap(s => normalizeExpressions(data, s));
148
- (0, assert_1.guard)(!processed.some(x => x.type === "RDelimiter" /* RType.Delimiter */), () => `expected no delimiter tokens in ${JSON.stringify(processed)}`);
150
+ (0, assert_1.guard)(!processed.some(x => x.type === type_1.RType.Delimiter), () => `expected no delimiter tokens in ${JSON.stringify(processed)}`);
149
151
  if (braces) {
150
152
  return [processBraces(braces, processed, parsedComments, data)];
151
153
  }
@@ -168,7 +170,6 @@ function normalizeExpressions(data, tokens) {
168
170
  }
169
171
  return [...parsedComments, ...normalizeMappedWithoutSemicolonBasedOnType(mappedWithName, data)];
170
172
  }
171
- exports.normalizeExpressions = normalizeExpressions;
172
173
  function parseNodesWithUnknownType(data, mappedWithName) {
173
174
  const parsedNodes = [];
174
175
  // used to indicate the new root node of this set of nodes
@@ -178,5 +179,4 @@ function parseNodesWithUnknownType(data, mappedWithName) {
178
179
  }
179
180
  return parsedNodes;
180
181
  }
181
- exports.parseNodesWithUnknownType = parseNodesWithUnknownType;
182
182
  //# sourceMappingURL=normalize-expressions.js.map
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeRootObjToAst = void 0;
3
+ exports.normalizeRootObjToAst = normalizeRootObjToAst;
4
4
  const input_format_1 = require("../../input-format");
5
5
  const normalize_meta_1 = require("../../normalize-meta");
6
6
  const normalize_expressions_1 = require("./normalize-expressions");
7
7
  const log_1 = require("../../../../../../../util/log");
8
8
  const arrays_1 = require("../../../../../../../util/arrays");
9
+ const type_1 = require("../../../../model/type");
9
10
  function normalizeRootObjToAst(data, obj) {
10
- const exprContent = (0, input_format_1.getKeyGuarded)(obj, "exprlist" /* RawRType.ExpressionList */);
11
- (0, normalize_meta_1.assureTokenType)(exprContent, "exprlist" /* RawRType.ExpressionList */);
11
+ const exprContent = (0, input_format_1.getKeyGuarded)(obj, type_1.RawRType.ExpressionList);
12
+ (0, normalize_meta_1.assureTokenType)(exprContent, type_1.RawRType.ExpressionList);
12
13
  let parsedChildren = [];
13
14
  if (input_format_1.childrenKey in exprContent) {
14
15
  const children = (0, input_format_1.getKeyGuarded)(exprContent, input_format_1.childrenKey);
@@ -17,9 +18,9 @@ function normalizeRootObjToAst(data, obj) {
17
18
  else {
18
19
  log_1.log.debug('no children found, assume empty input');
19
20
  }
20
- const [delimiters, nodes] = (0, arrays_1.partition)(parsedChildren, x => x.type === "RDelimiter" /* RType.Delimiter */ || x.type === "RComment" /* RType.Comment */);
21
+ const [delimiters, nodes] = (0, arrays_1.partition)(parsedChildren, x => x.type === type_1.RType.Delimiter || x.type === type_1.RType.Comment);
21
22
  return {
22
- type: "RExpressionList" /* RType.ExpressionList */,
23
+ type: type_1.RType.ExpressionList,
23
24
  children: nodes,
24
25
  grouping: undefined,
25
26
  lexeme: undefined,
@@ -30,5 +31,4 @@ function normalizeRootObjToAst(data, obj) {
30
31
  }
31
32
  };
32
33
  }
33
- exports.normalizeRootObjToAst = normalizeRootObjToAst;
34
34
  //# sourceMappingURL=normalize-root.js.map
@@ -1,11 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeSingleNode = void 0;
3
+ exports.normalizeSingleNode = normalizeSingleNode;
4
4
  const normalize_meta_1 = require("../../normalize-meta");
5
5
  const input_format_1 = require("../../input-format");
6
6
  const normalize_line_directive_1 = require("../other/normalize-line-directive");
7
7
  const assert_1 = require("../../../../../../../util/assert");
8
8
  const normalize_delimiter_1 = require("./normalize-delimiter");
9
+ const type_1 = require("../../../../model/type");
9
10
  const normalize_comment_1 = require("../other/normalize-comment");
10
11
  const normalize_expression_1 = require("../expression/normalize-expression");
11
12
  const normalize_number_1 = require("../values/normalize-number");
@@ -23,31 +24,31 @@ const normalize_symbol_1 = require("../values/normalize-symbol");
23
24
  */
24
25
  function normalizeSingleNode(data, elem) {
25
26
  switch (elem.name) {
26
- case "(" /* RawRType.ParenLeft */:
27
- case ")" /* RawRType.ParenRight */:
28
- case "{" /* RawRType.BraceLeft */:
29
- case "}" /* RawRType.BraceRight */:
27
+ case type_1.RawRType.ParenLeft:
28
+ case type_1.RawRType.ParenRight:
29
+ case type_1.RawRType.BraceLeft:
30
+ case type_1.RawRType.BraceRight:
30
31
  return (0, normalize_delimiter_1.normalizeDelimiter)(elem);
31
- case "COMMENT" /* RawRType.Comment */:
32
+ case type_1.RawRType.Comment:
32
33
  return (0, normalize_comment_1.normalizeComment)(data, elem.content);
33
- case "LINE_DIRECTIVE" /* RawRType.LineDirective */:
34
+ case type_1.RawRType.LineDirective:
34
35
  return (0, normalize_line_directive_1.normalizeLineDirective)(data, elem.content);
35
- case "exprlist" /* RawRType.ExpressionList */:
36
- case "expr" /* RawRType.Expression */:
37
- case "expr_or_assign_or_help" /* RawRType.ExprOfAssignOrHelp */:
38
- case "equal_assign" /* RawRType.LegacyEqualAssign */:
36
+ case type_1.RawRType.ExpressionList:
37
+ case type_1.RawRType.Expression:
38
+ case type_1.RawRType.ExprOfAssignOrHelp:
39
+ case type_1.RawRType.LegacyEqualAssign:
39
40
  return (0, normalize_expression_1.normalizeExpression)(data, elem.content);
40
- case "NUM_CONST" /* RawRType.NumericConst */:
41
+ case type_1.RawRType.NumericConst:
41
42
  return (0, normalize_number_1.normalizeNumber)(data, elem.content);
42
- case "STR_CONST" /* RawRType.StringConst */:
43
+ case type_1.RawRType.StringConst:
43
44
  return (0, normalize_string_1.normalizeString)(data, elem.content);
44
- case "BREAK" /* RawRType.Break */:
45
+ case type_1.RawRType.Break:
45
46
  return (0, normalize_break_1.normalizeBreak)(data, elem.content);
46
- case "NEXT" /* RawRType.Next */:
47
+ case type_1.RawRType.Next:
47
48
  return (0, normalize_next_1.normalizeNext)(data, elem.content);
48
- case "SYMBOL" /* RawRType.Symbol */:
49
- case "SLOT" /* RawRType.Slot */:
50
- case "NULL_CONST" /* RawRType.NullConst */: {
49
+ case type_1.RawRType.Symbol:
50
+ case type_1.RawRType.Slot:
51
+ case type_1.RawRType.NullConst: {
51
52
  const symbol = (0, normalize_symbol_1.tryNormalizeSymbol)(data, (0, normalize_meta_1.getWithTokenType)([elem.content]));
52
53
  (0, assert_1.guard)(symbol !== undefined, () => `should have been parsed to a symbol but was ${JSON.stringify(symbol)}`);
53
54
  return symbol;
@@ -56,5 +57,4 @@ function normalizeSingleNode(data, elem) {
56
57
  throw new input_format_1.XmlParseError(`unknown type ${elem.name} for ${JSON.stringify(elem)} in ${JSON.stringify(data)}`);
57
58
  }
58
59
  }
59
- exports.normalizeSingleNode = normalizeSingleNode;
60
60
  //# sourceMappingURL=normalize-single-node.js.map
@@ -1,8 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeNumber = void 0;
3
+ exports.normalizeNumber = normalizeNumber;
4
4
  const convert_values_1 = require("../../../../../convert-values");
5
5
  const normalize_meta_1 = require("../../normalize-meta");
6
+ const type_1 = require("../../../../model/type");
6
7
  /**
7
8
  * Normalize the given object as a R number (see {@link number2ts}), supporting booleans (see {@link boolean2ts}),
8
9
  * and special values.
@@ -27,24 +28,23 @@ function normalizeNumber(data, obj) {
27
28
  return {
28
29
  ...common,
29
30
  namespace: undefined,
30
- type: "RSymbol" /* RType.Symbol */,
31
+ type: type_1.RType.Symbol,
31
32
  content
32
33
  };
33
34
  }
34
35
  else if ((0, convert_values_1.isBoolean)(content)) {
35
36
  return {
36
37
  ...common,
37
- type: "RLogical" /* RType.Logical */,
38
+ type: type_1.RType.Logical,
38
39
  content: (0, convert_values_1.boolean2ts)(content)
39
40
  };
40
41
  }
41
42
  else {
42
43
  return {
43
44
  ...common,
44
- type: "RNumber" /* RType.Number */,
45
+ type: type_1.RType.Number,
45
46
  content: (0, convert_values_1.number2ts)(content)
46
47
  };
47
48
  }
48
49
  }
49
- exports.normalizeNumber = normalizeNumber;
50
50
  //# sourceMappingURL=normalize-number.js.map
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.normalizeString = void 0;
3
+ exports.normalizeString = normalizeString;
4
4
  const normalize_meta_1 = require("../../normalize-meta");
5
5
  const assert_1 = require("../../../../../../../util/assert");
6
6
  const convert_values_1 = require("../../../../../convert-values");
7
+ const type_1 = require("../../../../model/type");
7
8
  /**
8
9
  * Normalize the given object as a R string (see {@link string2ts}).
9
10
  * This requires you to check the corresponding name beforehand.
@@ -21,7 +22,7 @@ function normalizeString(data, obj) {
21
22
  stringContent = data.currentLexeme;
22
23
  }
23
24
  return {
24
- type: "RString" /* RType.String */,
25
+ type: type_1.RType.String,
25
26
  location,
26
27
  content: (0, convert_values_1.string2ts)(stringContent),
27
28
  lexeme: stringContent,
@@ -32,5 +33,4 @@ function normalizeString(data, obj) {
32
33
  }
33
34
  };
34
35
  }
35
- exports.normalizeString = normalizeString;
36
36
  //# sourceMappingURL=normalize-string.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.tryNormalizeSymbol = void 0;
3
+ exports.tryNormalizeSymbol = tryNormalizeSymbol;
4
4
  const assert_1 = require("../../../../../../../util/assert");
5
5
  const parser_1 = require("../../../json/parser");
6
6
  const normalize_meta_1 = require("../../normalize-meta");
@@ -36,7 +36,7 @@ function tryNormalizeSymbol(data, objs) {
36
36
  return undefined;
37
37
  }
38
38
  return {
39
- type: "RSymbol" /* RType.Symbol */,
39
+ type: type_1.RType.Symbol,
40
40
  namespace,
41
41
  location,
42
42
  // remove backticks from symbol
@@ -49,5 +49,4 @@ function tryNormalizeSymbol(data, objs) {
49
49
  }
50
50
  };
51
51
  }
52
- exports.tryNormalizeSymbol = tryNormalizeSymbol;
53
52
  //# sourceMappingURL=normalize-symbol.js.map
@@ -1,9 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ensureExpressionList = exports.ensureChildrenAreLhsAndRhsOrdered = exports.retrieveOpName = exports.getWithTokenType = exports.getTokenType = exports.assureTokenType = exports.retrieveMetaStructure = exports.extractLocation = exports.objectWithArrUnwrap = void 0;
3
+ exports.objectWithArrUnwrap = objectWithArrUnwrap;
4
+ exports.extractLocation = extractLocation;
5
+ exports.retrieveMetaStructure = retrieveMetaStructure;
6
+ exports.assureTokenType = assureTokenType;
7
+ exports.getTokenType = getTokenType;
8
+ exports.getWithTokenType = getWithTokenType;
9
+ exports.retrieveOpName = retrieveOpName;
10
+ exports.ensureChildrenAreLhsAndRhsOrdered = ensureChildrenAreLhsAndRhsOrdered;
11
+ exports.ensureExpressionList = ensureExpressionList;
4
12
  const range_1 = require("../../../../../util/range");
5
13
  const assert_1 = require("../../../../../util/assert");
6
14
  const input_format_1 = require("./input-format");
15
+ const type_1 = require("../../model/type");
7
16
  /**
8
17
  * if the passed object is an array with only one element, remove the array wrapper
9
18
  */
@@ -21,14 +30,12 @@ function objectWithArrUnwrap(obj) {
21
30
  throw new input_format_1.XmlParseError(`expected array or object, yet received ${JSON.stringify(obj)}`);
22
31
  }
23
32
  }
24
- exports.objectWithArrUnwrap = objectWithArrUnwrap;
25
33
  /**
26
34
  * given a xml element, extract the source location of the corresponding element in the R-ast
27
35
  */
28
36
  function extractLocation(ast) {
29
37
  return (0, range_1.rangeFrom)(ast['line1'], ast['col1'], ast['line2'], ast['col2']);
30
38
  }
31
- exports.extractLocation = extractLocation;
32
39
  /**
33
40
  * The json object that represents the input xml contains various meta-information.
34
41
  * This function extracts the meta-information and returns it.
@@ -47,14 +54,12 @@ function retrieveMetaStructure(obj) {
47
54
  content
48
55
  };
49
56
  }
50
- exports.retrieveMetaStructure = retrieveMetaStructure;
51
57
  function assureTokenType(obj, expectedName) {
52
58
  const name = getTokenType(obj);
53
59
  if (name !== expectedName) {
54
60
  throw new input_format_1.XmlParseError(`expected name to be ${expectedName}, yet received ${name} for ${JSON.stringify(obj)}`);
55
61
  }
56
62
  }
57
- exports.assureTokenType = assureTokenType;
58
63
  /**
59
64
  * Extract the token-type of the given object. This is based on the knowledge, that all json objects created
60
65
  * from the R xml have a name attached.
@@ -64,21 +69,18 @@ exports.assureTokenType = assureTokenType;
64
69
  function getTokenType(content) {
65
70
  return content[input_format_1.nameKey];
66
71
  }
67
- exports.getTokenType = getTokenType;
68
72
  function getWithTokenType(obj) {
69
73
  return obj.map(content => ({
70
74
  name: getTokenType(content),
71
75
  content
72
76
  }));
73
77
  }
74
- exports.getWithTokenType = getWithTokenType;
75
78
  function retrieveOpName(operator) {
76
79
  /*
77
80
  * only real arithmetic ops have their operation as their own name, the others identify via content
78
81
  */
79
82
  return operator.content[input_format_1.contentKey];
80
83
  }
81
- exports.retrieveOpName = retrieveOpName;
82
84
  /**
83
85
  * Ensure that the first child is completely before the second child.
84
86
  *
@@ -92,11 +94,10 @@ function ensureChildrenAreLhsAndRhsOrdered(first, second) {
92
94
  throw new input_format_1.XmlParseError(`expected the first child to be the lhs, yet received ${JSON.stringify(first)} & ${JSON.stringify(second)}`);
93
95
  }
94
96
  }
95
- exports.ensureChildrenAreLhsAndRhsOrdered = ensureChildrenAreLhsAndRhsOrdered;
96
97
  function ensureExpressionList(node) {
97
- if (node.type !== "RExpressionList" /* RType.ExpressionList */) {
98
+ if (node.type !== type_1.RType.ExpressionList) {
98
99
  return {
99
- type: "RExpressionList" /* RType.ExpressionList */,
100
+ type: type_1.RType.ExpressionList,
100
101
  grouping: undefined,
101
102
  location: node.location,
102
103
  info: node.info,
@@ -106,5 +107,4 @@ function ensureExpressionList(node) {
106
107
  }
107
108
  return node;
108
109
  }
109
- exports.ensureExpressionList = ensureExpressionList;
110
110
  //# sourceMappingURL=normalize-meta.js.map
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ exports.RNull = exports.RNa = exports.RInf = exports.RIntegerMarker = exports.RImaginaryMarker = exports.RNumHexFloatRegex = exports.RFalse = exports.RTrue = void 0;
4
+ exports.ts2r = ts2r;
5
+ exports.isBoolean = isBoolean;
6
+ exports.boolean2ts = boolean2ts;
7
+ exports.number2ts = number2ts;
8
+ exports.string2ts = string2ts;
9
+ exports.isNA = isNA;
4
10
  class ValueConversionError extends Error {
5
11
  constructor(message) {
6
12
  super(message);
@@ -43,7 +49,6 @@ function ts2r(value) {
43
49
  }
44
50
  throw new ValueConversionError(`cannot convert value of type ${typeof value} to R code`);
45
51
  }
46
- exports.ts2r = ts2r;
47
52
  /** The R literal for the logical true */
48
53
  exports.RTrue = 'TRUE';
49
54
  /** The R literal for the logical false */
@@ -51,7 +56,6 @@ exports.RFalse = 'FALSE';
51
56
  function isBoolean(value) {
52
57
  return value === exports.RTrue || value === exports.RFalse;
53
58
  }
54
- exports.isBoolean = isBoolean;
55
59
  function boolean2ts(value) {
56
60
  if (value === exports.RTrue) {
57
61
  return true;
@@ -61,7 +65,6 @@ function boolean2ts(value) {
61
65
  }
62
66
  throw new ValueConversionError(`value ${value} is not a legal R boolean`);
63
67
  }
64
- exports.boolean2ts = boolean2ts;
65
68
  exports.RNumHexFloatRegex = /^\s*0x(?<intPart>[0-9a-f]+)?(\.(?<floatPart>[0-9a-f]*))?p(?<exp>[-+]?\d+)\s*$/;
66
69
  function getDecimalPlacesWithRadix(floatPart, radix) {
67
70
  return [...floatPart].reduce((acc, c, idx) => acc + parseInt(c, radix) / (radix ** (idx + 1)), 0);
@@ -113,7 +116,6 @@ function number2ts(value) {
113
116
  };
114
117
  }
115
118
  }
116
- exports.number2ts = number2ts;
117
119
  /**
118
120
  * Convert a valid R string into a {@link RStringValue}.
119
121
  *
@@ -147,11 +149,9 @@ function string2ts(value) {
147
149
  throw new ValueConversionError(`expected string to start with a known quote (' or "), or raw, yet received ${value}`);
148
150
  }
149
151
  }
150
- exports.string2ts = string2ts;
151
152
  exports.RNa = 'NA';
152
153
  exports.RNull = 'NULL';
153
154
  function isNA(value) {
154
155
  return value === exports.RNa;
155
156
  }
156
- exports.isNA = isNA;
157
157
  //# sourceMappingURL=convert-values.js.map
@@ -3,7 +3,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.retrieveNumberOfRTokensOfLastParse = exports.removeRQuotes = exports.retrieveNormalizedAstFromRCode = exports.retrieveParseDataFromRCode = exports.isEmptyRequest = exports.requestFingerprint = exports.requestProviderFromText = exports.requestProviderFromFile = exports.requestFromInput = exports.fileProtocol = void 0;
6
+ exports.fileProtocol = void 0;
7
+ exports.requestFromInput = requestFromInput;
8
+ exports.requestProviderFromFile = requestProviderFromFile;
9
+ exports.requestProviderFromText = requestProviderFromText;
10
+ exports.requestFingerprint = requestFingerprint;
11
+ exports.isEmptyRequest = isEmptyRequest;
12
+ exports.retrieveParseDataFromRCode = retrieveParseDataFromRCode;
13
+ exports.retrieveNormalizedAstFromRCode = retrieveNormalizedAstFromRCode;
14
+ exports.removeRQuotes = removeRQuotes;
15
+ exports.retrieveNumberOfRTokensOfLastParse = retrieveNumberOfRTokensOfLastParse;
7
16
  const strings_1 = require("../util/strings");
8
17
  const assert_1 = require("../util/assert");
9
18
  const shell_executor_1 = require("./shell-executor");
@@ -11,6 +20,7 @@ const object_hash_1 = __importDefault(require("object-hash"));
11
20
  const parser_1 = require("./lang-4.x/ast/parser/json/parser");
12
21
  const init_1 = require("./init");
13
22
  const convert_values_1 = require("./lang-4.x/convert-values");
23
+ const type_1 = require("./lang-4.x/ast/model/type");
14
24
  exports.fileProtocol = 'file://';
15
25
  /**
16
26
  * Creates a {@link RParseRequests} from a given input.
@@ -29,7 +39,6 @@ function requestFromInput(input) {
29
39
  content: file ? content.slice(7) : content
30
40
  };
31
41
  }
32
- exports.requestFromInput = requestFromInput;
33
42
  function requestProviderFromFile() {
34
43
  return {
35
44
  createRequest(path) {
@@ -40,7 +49,6 @@ function requestProviderFromFile() {
40
49
  }
41
50
  };
42
51
  }
43
- exports.requestProviderFromFile = requestProviderFromFile;
44
52
  function requestProviderFromText(text) {
45
53
  return {
46
54
  createRequest(path) {
@@ -51,15 +59,12 @@ function requestProviderFromText(text) {
51
59
  }
52
60
  };
53
61
  }
54
- exports.requestProviderFromText = requestProviderFromText;
55
62
  function requestFingerprint(request) {
56
63
  return (0, object_hash_1.default)(request);
57
64
  }
58
- exports.requestFingerprint = requestFingerprint;
59
65
  function isEmptyRequest(request) {
60
66
  return request.content.trim().length === 0;
61
67
  }
62
- exports.isEmptyRequest = isEmptyRequest;
63
68
  /**
64
69
  * Provides the capability to parse R files/R code using the R parser.
65
70
  * Depends on {@link RShell} to provide a connection to R.
@@ -81,7 +86,6 @@ function retrieveParseDataFromRCode(request, shell) {
81
86
  return shell.sendCommandWithOutput(command).then(result => guardRetrievedOutput(result.join(shell.options.eol), request));
82
87
  }
83
88
  }
84
- exports.retrieveParseDataFromRCode = retrieveParseDataFromRCode;
85
89
  /**
86
90
  * Uses {@link retrieveParseDataFromRCode} and returns the nicely formatted object-AST.
87
91
  * If successful, allows further querying the last result with {@link retrieveNumberOfRTokensOfLastParse}.
@@ -90,7 +94,6 @@ async function retrieveNormalizedAstFromRCode(request, shell) {
90
94
  const data = await retrieveParseDataFromRCode(request, shell);
91
95
  return (0, parser_1.normalize)(data);
92
96
  }
93
- exports.retrieveNormalizedAstFromRCode = retrieveNormalizedAstFromRCode;
94
97
  /**
95
98
  * If the string has (R-)quotes around it, they will be removed; otherwise the string is returned unchanged.
96
99
  */
@@ -102,17 +105,15 @@ function removeRQuotes(str) {
102
105
  return str;
103
106
  }
104
107
  }
105
- exports.removeRQuotes = removeRQuotes;
106
108
  /**
107
109
  * Needs to be called *after* {@link retrieveParseDataFromRCode} (or {@link retrieveNormalizedAstFromRCode})
108
110
  */
109
111
  async function retrieveNumberOfRTokensOfLastParse(shell, ignoreComments = false) {
110
- const rows = ignoreComments ? `flowr_output[flowr_output$token != "${"COMMENT" /* RawRType.Comment */}", ]` : 'flowr_output';
112
+ const rows = ignoreComments ? `flowr_output[flowr_output$token != "${type_1.RawRType.Comment}", ]` : 'flowr_output';
111
113
  const result = await shell.sendCommandWithOutput(`cat(nrow(${rows}),${(0, convert_values_1.ts2r)(shell.options.eol)})`);
112
114
  (0, assert_1.guard)(result.length === 1, () => `expected exactly one line to obtain the number of R tokens, but got: ${JSON.stringify(result)}`);
113
115
  return Number(result[0]);
114
116
  }
115
- exports.retrieveNumberOfRTokensOfLastParse = retrieveNumberOfRTokensOfLastParse;
116
117
  function guardRetrievedOutput(output, request) {
117
118
  (0, assert_1.guard)(output !== init_1.ErrorMarker, () => `unable to parse R code (see the log for more information) for request ${JSON.stringify(request)}}`);
118
119
  return output;
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  import { type MergeableRecord } from '../util/objects';
3
2
  import type { SemVer } from 'semver';
4
3
  import type { AsyncOrSync } from 'ts-essentials';
package/r-bridge/shell.js CHANGED
@@ -333,7 +333,12 @@ class RShellSession {
333
333
  if (filesToUnlink !== undefined) {
334
334
  log_1.log.info(`unlinking ${filesToUnlink.length} files (${JSON.stringify(filesToUnlink)})`);
335
335
  for (const f of filesToUnlink) {
336
- fs_1.default.rmSync(f, { recursive: true, force: true });
336
+ try {
337
+ fs_1.default.rmSync(f, { recursive: true, force: true });
338
+ }
339
+ catch (e) {
340
+ log_1.log.error(`failed to unlink file ${f}`);
341
+ }
337
342
  }
338
343
  }
339
344
  const killResult = this.bareSession.kill();
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.doNotAutoSelect = void 0;
3
+ exports.doNotAutoSelect = doNotAutoSelect;
4
4
  /**
5
5
  * A variant of the {@link AutoSelectPredicate} which does not select any additional statements (~&gt; false)
6
6
  */
7
7
  function doNotAutoSelect(_node) {
8
8
  return false;
9
9
  }
10
- exports.doNotAutoSelect = doNotAutoSelect;
11
10
  //# sourceMappingURL=auto-select-defaults.js.map
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.makeMagicCommentHandler = void 0;
3
+ exports.makeMagicCommentHandler = makeMagicCommentHandler;
4
4
  const visitor_1 = require("../../r-bridge/lang-4.x/ast/model/processing/visitor");
5
+ const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
5
6
  const assert_1 = require("../../util/assert");
6
7
  function getLoc({ location, info: { fullRange } }) {
7
8
  const loc = location ?? fullRange;
@@ -58,7 +59,7 @@ function makeMagicCommentHandler(and) {
58
59
  return;
59
60
  }
60
61
  for (const c of comments) {
61
- if (c.type !== "RComment" /* RType.Comment */ || !c.content.startsWith(' flowr@')) {
62
+ if (c.type !== type_1.RType.Comment || !c.content.startsWith(' flowr@')) {
62
63
  continue;
63
64
  }
64
65
  const match = commentTriggerRegex.exec(c.content);
@@ -82,5 +83,4 @@ function makeMagicCommentHandler(and) {
82
83
  return and?.(node, normalizedAst) ?? false;
83
84
  };
84
85
  }
85
- exports.makeMagicCommentHandler = makeMagicCommentHandler;
86
86
  //# sourceMappingURL=magic-comments.js.map
@@ -5,9 +5,11 @@
5
5
  * @module
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.reconstructToCode = exports.reconstructLogger = void 0;
8
+ exports.reconstructLogger = void 0;
9
+ exports.reconstructToCode = reconstructToCode;
9
10
  const log_1 = require("../util/log");
10
11
  const assert_1 = require("../util/assert");
12
+ const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
11
13
  const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
12
14
  const stateful_fold_1 = require("../r-bridge/lang-4.x/ast/model/processing/stateful-fold");
13
15
  const auto_select_defaults_1 = require("./auto-select/auto-select-defaults");
@@ -102,7 +104,7 @@ function reconstructBinaryOp(n, lhs, rhs, config) {
102
104
  return lhs;
103
105
  }
104
106
  }
105
- return reconstructRawBinaryOperator(lhs, n.type === "RPipe" /* RType.Pipe */ ? '|>' : n.operator, rhs);
107
+ return reconstructRawBinaryOperator(lhs, n.type === type_1.RType.Pipe ? '|>' : n.operator, rhs);
106
108
  }
107
109
  function reconstructForLoop(loop, variable, vector, body, config) {
108
110
  if (!isSelected(config, loop) && variable.length === 0 && vector.length === 0) {
@@ -444,5 +446,4 @@ function reconstructToCode(ast, selection, autoSelectIf = auto_select_defaults_1
444
446
  (0, log_1.expensiveTrace)(exports.reconstructLogger, () => `reconstructed ast before string conversion: ${JSON.stringify(result)}`);
445
447
  return removeOuterExpressionListIfApplicable(result, linesWithAutoSelected.size);
446
448
  }
447
- exports.reconstructToCode = reconstructToCode;
448
449
  //# sourceMappingURL=reconstruct.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.collectAllSlicingCriteria = void 0;
3
+ exports.collectAllSlicingCriteria = collectAllSlicingCriteria;
4
4
  const assert_1 = require("../../util/assert");
5
5
  const arrays_1 = require("../../util/arrays");
6
6
  const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
@@ -23,5 +23,4 @@ function* collectAllSlicingCriteria(ast, filter) {
23
23
  }
24
24
  }
25
25
  }
26
- exports.collectAllSlicingCriteria = collectAllSlicingCriteria;
27
26
  //# sourceMappingURL=collect-all.js.map
@@ -1,7 +1,7 @@
1
1
  import { type NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
2
2
  import type { AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
3
  /** Either `line:column`, `line@variable-name`, or `$id` */
4
- export type SingleSlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${number}`;
4
+ export type SingleSlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${NodeId}`;
5
5
  export type SlicingCriteria = SingleSlicingCriterion[];
6
6
  /**
7
7
  * Thrown if the given slicing criteria can not be found