@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
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.expressionList = void 0;
4
4
  const post_process_1 = require("./post-process");
5
5
  const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/visitor");
6
+ const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
6
7
  const initialExpressionListInfo = {
7
8
  allExpressionLists: 0,
8
9
  deepestNesting: 0
@@ -11,13 +12,13 @@ function visitLists(info, input) {
11
12
  let nest = -1; // we start with nesting 0
12
13
  let total = 0;
13
14
  (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
14
- if (node.type === "RExpressionList" /* RType.ExpressionList */) {
15
+ if (node.type === type_1.RType.ExpressionList) {
15
16
  nest++;
16
17
  total++;
17
18
  info.deepestNesting = Math.max(info.deepestNesting, nest);
18
19
  }
19
20
  }, node => {
20
- if (node.type === "RExpressionList" /* RType.ExpressionList */) {
21
+ if (node.type === type_1.RType.ExpressionList) {
21
22
  nest--;
22
23
  }
23
24
  });
@@ -33,4 +34,4 @@ exports.expressionList = {
33
34
  initialValue: initialExpressionListInfo,
34
35
  postProcess: post_process_1.postProcess
35
36
  };
36
- //# sourceMappingURL=expression-list.js.map
37
+ //# sourceMappingURL=statistics-expression-list.js.map
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.loops = void 0;
4
4
  const common_syntax_probability_1 = require("../../common-syntax-probability");
5
5
  const post_process_1 = require("./post-process");
6
+ const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
6
7
  const statistics_file_1 = require("../../../output/statistics-file");
7
8
  const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/visitor");
8
9
  const initialLoopInfo = {
@@ -26,28 +27,28 @@ function visitLoops(info, input) {
26
27
  const loopStack = [];
27
28
  (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
28
29
  switch (node.type) {
29
- case "RNext" /* RType.Next */:
30
+ case type_1.RType.Next:
30
31
  info.nextStatements++;
31
32
  return;
32
- case "RBreak" /* RType.Break */:
33
+ case type_1.RType.Break:
33
34
  info.breakStatements++;
34
35
  return;
35
- case "RFunctionCall" /* RType.FunctionCall */:
36
+ case type_1.RType.FunctionCall:
36
37
  if (node.named && isImplicitLoop.test(node.functionName.lexeme)) {
37
38
  info.implicitLoops++;
38
39
  (0, statistics_file_1.appendStatisticsFile)(exports.loops.name, 'implicit-loop', [node.functionName.info.fullLexeme ?? node.functionName.lexeme], input.filepath);
39
40
  }
40
41
  return;
41
- case "RForLoop" /* RType.ForLoop */:
42
+ case type_1.RType.ForLoop:
42
43
  (0, common_syntax_probability_1.updateCommonSyntaxTypeCounts)(info.forLoops, node.vector);
43
44
  (0, common_syntax_probability_1.updateCommonSyntaxTypeCounts)(info.forLoopVar, node.variable);
44
45
  (0, common_syntax_probability_1.updateCommonSyntaxTypeCounts)(info.forBody, ...node.body.children);
45
46
  break;
46
- case "RWhileLoop" /* RType.WhileLoop */:
47
+ case type_1.RType.WhileLoop:
47
48
  (0, common_syntax_probability_1.updateCommonSyntaxTypeCounts)(info.whileLoops, node.condition);
48
49
  (0, common_syntax_probability_1.updateCommonSyntaxTypeCounts)(info.whileBody, ...node.body.children);
49
50
  break;
50
- case "RRepeatLoop" /* RType.RepeatLoop */:
51
+ case type_1.RType.RepeatLoop:
51
52
  info.repeatLoops++;
52
53
  (0, common_syntax_probability_1.updateCommonSyntaxTypeCounts)(info.repeatBody, ...node.body.children);
53
54
  break;
@@ -61,7 +62,7 @@ function visitLoops(info, input) {
61
62
  loopStack.push(node);
62
63
  }, node => {
63
64
  // drop again :D
64
- if (node.type === "RForLoop" /* RType.ForLoop */ || node.type === "RWhileLoop" /* RType.WhileLoop */ || node.type === "RRepeatLoop" /* RType.RepeatLoop */) {
65
+ if (node.type === type_1.RType.ForLoop || node.type === type_1.RType.WhileLoop || node.type === type_1.RType.RepeatLoop) {
65
66
  loopStack.pop();
66
67
  }
67
68
  });
@@ -3,7 +3,7 @@ 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.postProcess = void 0;
6
+ exports.postProcess = postProcess;
7
7
  const post_processing_1 = require("../../post-processing");
8
8
  const common_syntax_probability_1 = require("../../common-syntax-probability");
9
9
  const path_1 = __importDefault(require("path"));
@@ -67,5 +67,4 @@ function postProcess(featureRoot, info, outputPath, config) {
67
67
  }
68
68
  metaOut.close();
69
69
  }
70
- exports.postProcess = postProcess;
71
70
  //# sourceMappingURL=post-process.js.map
@@ -3,7 +3,7 @@ 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.postProcess = void 0;
6
+ exports.postProcess = postProcess;
7
7
  const common_syntax_probability_1 = require("../../common-syntax-probability");
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const fs_1 = __importDefault(require("fs"));
@@ -51,7 +51,7 @@ function retrieveFunctionCallInformation(featureRoot, info, config, outputPath)
51
51
  const totalSum = (0, summarizer_1.summarizeMeasurement)(total.flat(), info.size);
52
52
  const argsSum = (0, summarizer_1.summarizeMeasurement)(args.flat(), info.size);
53
53
  const lineFracSum = (0, summarizer_1.summarizeMeasurement)(lineFrac.flat());
54
- // we write in csv style :), we escape the key in case it contains commas (with filenames)etc.
54
+ // we write in csv style :), we escape the key in case it contains commas (with filenames) etc.
55
55
  fnOutStream.write(`${JSON.stringify(key ?? 'unknown')},${uniqueProjects.size},${uniqueFiles.size},${(0, summarizer_1.summarizedMeasurement2Csv)(totalSum)},${(0, summarizer_1.summarizedMeasurement2Csv)(argsSum)},${(0, summarizer_1.summarizedMeasurement2Csv)(lineFracSum)}\n`);
56
56
  }
57
57
  fnOutStream.close();
@@ -124,7 +124,6 @@ function postProcess(featureRoot, info, outputPath, config) {
124
124
  console.log(` [${(0, time_1.date2string)(new Date())}] Used functions reading completed, summarizing info...`);
125
125
  retrieveFunctionCallMetaInformation(info, outputPath);
126
126
  }
127
- exports.postProcess = postProcess;
128
127
  function processNextLine(data, lineNumber, info, line, config, importants) {
129
128
  if (lineNumber % 2_500 === 0) {
130
129
  console.log(` [${(0, time_1.date2string)(new Date())}] Used functions processed ${lineNumber} lines`);
@@ -3,7 +3,7 @@ import type { Writable } from 'ts-essentials';
3
3
  import type { CommonSyntaxTypeCounts } from '../../common-syntax-probability';
4
4
  declare const initialFunctionUsageInfo: {
5
5
  allFunctionCalls: number;
6
- args: Record<number, bigint | CommonSyntaxTypeCounts<bigint>>;
6
+ args: Record<number, bigint | CommonSyntaxTypeCounts>;
7
7
  /** `a(b(), c(3, d()))` has 3 (`b`, `c`, `d`) */
8
8
  nestedFunctionCalls: number;
9
9
  deepestNesting: number;
@@ -6,6 +6,7 @@ const post_process_1 = require("./post-process");
6
6
  const range_1 = require("../../../../util/range");
7
7
  const unpack_argument_1 = require("../../../../dataflow/internal/process/functions/call/argument/unpack-argument");
8
8
  const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/visitor");
9
+ const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
9
10
  const statistics_file_1 = require("../../../output/statistics-file");
10
11
  const edge_1 = require("../../../../dataflow/graph/edge");
11
12
  const initialFunctionUsageInfo = {
@@ -50,7 +51,7 @@ function visitCalls(info, input) {
50
51
  const calls = [];
51
52
  const allCalls = [];
52
53
  (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
53
- if (node.type !== "RFunctionCall" /* RType.FunctionCall */) {
54
+ if (node.type !== type_1.RType.FunctionCall) {
54
55
  return;
55
56
  }
56
57
  if (calls.length > 0) {
@@ -61,7 +62,7 @@ function visitCalls(info, input) {
61
62
  const dataflowNode = input.dataflow.graph.get(node.info.id);
62
63
  let hasCallsEdge = false;
63
64
  if (dataflowNode) {
64
- hasCallsEdge = [...dataflowNode[1].values()].some(e => (0, edge_1.edgeIncludesType)(e.types, 4 /* EdgeType.Calls */));
65
+ hasCallsEdge = [...dataflowNode[1].values()].some(e => (0, edge_1.edgeIncludesType)(e.types, edge_1.EdgeType.Calls));
65
66
  }
66
67
  if (!node.named) {
67
68
  info.unnamedCalls++;
@@ -87,7 +88,7 @@ function visitCalls(info, input) {
87
88
  calls.push(node);
88
89
  }, node => {
89
90
  // drop again :D
90
- if (node.type === "RFunctionCall" /* RType.FunctionCall */) {
91
+ if (node.type === type_1.RType.FunctionCall) {
91
92
  calls.pop();
92
93
  }
93
94
  });
@@ -3,7 +3,7 @@ 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.postProcess = void 0;
6
+ exports.postProcess = postProcess;
7
7
  const post_processing_1 = require("../../post-processing");
8
8
  const used_packages_1 = require("./used-packages");
9
9
  const fs_1 = __importDefault(require("fs"));
@@ -66,7 +66,6 @@ function postProcess(featureRoot, info, outputPath, config) {
66
66
  }
67
67
  out.close();
68
68
  }
69
- exports.postProcess = postProcess;
70
69
  // directly writes the results to the output path
71
70
  function retrieveDataForLoad(operator, readFromPath, outputPath, config) {
72
71
  const input = path_1.default.join(readFromPath, `${operator}.txt`);
@@ -3,7 +3,7 @@ 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.postProcess = void 0;
6
+ exports.postProcess = postProcess;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const path_1 = __importDefault(require("path"));
9
9
  const post_processing_1 = require("../../post-processing");
@@ -67,5 +67,4 @@ function postProcess(featureRoot, info, outputPath, config) {
67
67
  }
68
68
  magicNumbersOutStream.close();
69
69
  }
70
- exports.postProcess = postProcess;
71
70
  //# sourceMappingURL=post-process.js.map
@@ -3,7 +3,8 @@ 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.writeVariableInfoToCsv = exports.postProcess = void 0;
6
+ exports.postProcess = postProcess;
7
+ exports.writeVariableInfoToCsv = writeVariableInfoToCsv;
7
8
  const post_processing_1 = require("../../post-processing");
8
9
  const fs_1 = __importDefault(require("fs"));
9
10
  const path_1 = __importDefault(require("path"));
@@ -64,7 +65,6 @@ function postProcess(featureRoot, info, outputPath, config) {
64
65
  collectDefinedVariables(featureRoot, info, config, outputPath);
65
66
  collectRedefinedVariables(featureRoot, info, config, outputPath);
66
67
  }
67
- exports.postProcess = postProcess;
68
68
  function writeVariableInfoToCsv(outputPath, filename, data) {
69
69
  const out = fs_1.default.createWriteStream(path_1.default.join(outputPath, filename));
70
70
  out.write(`variable,unique-projects,unique-files,${(0, summarizer_1.summarizedMeasurement2CsvHeader)('count')},${(0, summarizer_1.summarizedMeasurement2CsvHeader)('line-frac')}\n`);
@@ -76,7 +76,6 @@ function writeVariableInfoToCsv(outputPath, filename, data) {
76
76
  }
77
77
  out.close();
78
78
  }
79
- exports.writeVariableInfoToCsv = writeVariableInfoToCsv;
80
79
  function collectVariableInfoFor(filepath, info, config) {
81
80
  // variable name to summary
82
81
  const collected = new Map();
@@ -4,6 +4,7 @@ exports.variables = void 0;
4
4
  const post_process_1 = require("./post-process");
5
5
  const range_1 = require("../../../../util/range");
6
6
  const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/visitor");
7
+ const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
7
8
  const r_symbol_1 = require("../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
8
9
  const statistics_file_1 = require("../../../output/statistics-file");
9
10
  const initialVariableInfo = {
@@ -15,7 +16,7 @@ const initialVariableInfo = {
15
16
  };
16
17
  function visitVariables(info, input) {
17
18
  (0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
18
- if (node.type !== "RSymbol" /* RType.Symbol */ || (0, r_symbol_1.isSpecialSymbol)(node)) {
19
+ if (node.type !== type_1.RType.Symbol || (0, r_symbol_1.isSpecialSymbol)(node)) {
19
20
  return;
20
21
  }
21
22
  // search for the node in the DF graph
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.initialMetaStatistics = void 0;
3
+ exports.initialMetaStatistics = initialMetaStatistics;
4
4
  /**
5
5
  * Returns an initial {@link MetaStatistics} object, using neutral defaults (like the empty list).
6
6
  */
@@ -13,5 +13,4 @@ function initialMetaStatistics() {
13
13
  lines: []
14
14
  };
15
15
  }
16
- exports.initialMetaStatistics = initialMetaStatistics;
17
16
  //# sourceMappingURL=meta-statistics.js.map
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.printFeatureStatisticsEntry = exports.printFeatureStatistics = exports.statsString = exports.minMaxAvgAndMedian = void 0;
3
+ exports.minMaxAvgAndMedian = minMaxAvgAndMedian;
4
+ exports.statsString = statsString;
5
+ exports.printFeatureStatistics = printFeatureStatistics;
6
+ exports.printFeatureStatisticsEntry = printFeatureStatisticsEntry;
4
7
  const ansi_1 = require("../../util/ansi");
5
8
  const json_1 = require("../../util/json");
6
9
  const feature_1 = require("../features/feature");
@@ -15,14 +18,12 @@ function minMaxAvgAndMedian(data) {
15
18
  median: data[Math.floor(data.length / 2)]
16
19
  };
17
20
  }
18
- exports.minMaxAvgAndMedian = minMaxAvgAndMedian;
19
21
  function formatStatNumber(num) {
20
22
  return num === undefined ? '<?>' : Number(num.toFixed(3)).toLocaleString();
21
23
  }
22
24
  function statsString(data, suffix = '') {
23
25
  return `[${formatStatNumber(data.min)}${suffix} .. ${formatStatNumber(data.max)}${suffix}] (avg: ${formatStatNumber(data.avg)}${suffix}, median: ${formatStatNumber(data.median)}${suffix})`;
24
26
  }
25
- exports.statsString = statsString;
26
27
  function printFeatureStatistics(statistics, features = 'all') {
27
28
  for (const feature of Object.keys(statistics.features)) {
28
29
  if (features !== 'all' && !features.has(feature)) {
@@ -45,7 +46,6 @@ function printFeatureStatistics(statistics, features = 'all') {
45
46
  \t\tline length range: ${statsString(lineLengths, ' chars')}
46
47
  `);
47
48
  }
48
- exports.printFeatureStatistics = printFeatureStatistics;
49
49
  const pad = 3;
50
50
  function printFeatureStatisticsEntry(info) {
51
51
  let longestKey = 0;
@@ -65,5 +65,4 @@ function printFeatureStatisticsEntry(info) {
65
65
  console.log(`${key.padEnd(longestKey + pad)} ${value.padStart(longestValue)}`);
66
66
  }
67
67
  }
68
- exports.printFeatureStatisticsEntry = printFeatureStatisticsEntry;
69
68
  //# sourceMappingURL=print-stats.js.map
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.appendStatisticsFile = exports.initDummyFileProvider = exports.initFileProvider = exports.statisticsFileProvider = exports.extractNodeContent = void 0;
3
+ exports.statisticsFileProvider = void 0;
4
+ exports.extractNodeContent = extractNodeContent;
5
+ exports.initFileProvider = initFileProvider;
6
+ exports.initDummyFileProvider = initDummyFileProvider;
7
+ exports.appendStatisticsFile = appendStatisticsFile;
4
8
  const file_provider_1 = require("./file-provider");
5
9
  const log_1 = require("../../util/log");
6
10
  /**
@@ -18,7 +22,6 @@ function extractNodeContent(node) {
18
22
  }
19
23
  return result?.trim()?.replaceAll('\n', '\\n') ?? '<unknown>';
20
24
  }
21
- exports.extractNodeContent = extractNodeContent;
22
25
  initDummyFileProvider();
23
26
  /**
24
27
  * Make the statistics write to a given output directory.
@@ -27,7 +30,6 @@ function initFileProvider(outputDirectory) {
27
30
  log_1.log.debug(`Initializing file provider for output directory ${outputDirectory}`);
28
31
  exports.statisticsFileProvider = new file_provider_1.StatisticFileProvider(outputDirectory);
29
32
  }
30
- exports.initFileProvider = initFileProvider;
31
33
  /**
32
34
  * Either ignore the statistics or write them to a given map (e.g., for testing).
33
35
  *
@@ -36,7 +38,6 @@ exports.initFileProvider = initFileProvider;
36
38
  function initDummyFileProvider(map) {
37
39
  exports.statisticsFileProvider = new file_provider_1.DummyAppendProvider(map);
38
40
  }
39
- exports.initDummyFileProvider = initDummyFileProvider;
40
41
  /**
41
42
  * Append the content of all nodes to the storage file for the given feature
42
43
  * @param name - The name of the feature {@link Feature#name}
@@ -65,5 +66,4 @@ function appendStatisticsFile(name, fn, nodes, context, unique = false) {
65
66
  values = values.map(value => JSON.stringify(context === undefined ? [value] : [value, context]));
66
67
  exports.statisticsFileProvider.append(name, fn, values.join('\n'));
67
68
  }
68
- exports.appendStatisticsFile = appendStatisticsFile;
69
69
  //# sourceMappingURL=statistics-file.js.map
@@ -3,7 +3,8 @@ 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.extractUsageStatistics = exports.staticRequests = void 0;
6
+ exports.staticRequests = staticRequests;
7
+ exports.extractUsageStatistics = extractUsageStatistics;
7
8
  const xmldom_1 = require("@xmldom/xmldom");
8
9
  const fs_1 = __importDefault(require("fs"));
9
10
  const meta_statistics_1 = require("./meta-statistics");
@@ -25,7 +26,6 @@ function staticRequests(...requests) {
25
26
  }
26
27
  }();
27
28
  }
28
- exports.staticRequests = staticRequests;
29
29
  /**
30
30
  * Extract all wanted statistic information from a set of requests using the presented R session.
31
31
  *
@@ -59,7 +59,6 @@ async function extractUsageStatistics(shell, onRequest, features, requests, root
59
59
  }
60
60
  return { features: result, meta, outputs };
61
61
  }
62
- exports.extractUsageStatistics = extractUsageStatistics;
63
62
  function initializeFeatureStatistics() {
64
63
  const result = {};
65
64
  for (const key of feature_1.allFeatureNames) {
@@ -3,7 +3,7 @@ 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.detectSummarizationType = void 0;
6
+ exports.detectSummarizationType = detectSummarizationType;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  const summarizer_1 = require("./summarizer");
9
9
  const log_1 = require("../../util/log");
@@ -28,5 +28,4 @@ async function detectSummarizationType(inputPath) {
28
28
  log_1.log.info(`Detected benchmark summarization with no file (first ${thresholdInit}) matching ${summarizer_1.statisticsFileNameRegex.source}`);
29
29
  return "benchmark" /* SummarizerType.Benchmark */;
30
30
  }
31
- exports.detectSummarizationType = detectSummarizationType;
32
31
  //# sourceMappingURL=auto-detect.js.map
@@ -3,7 +3,7 @@ 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.clusterStatisticsOutput = void 0;
6
+ exports.clusterStatisticsOutput = clusterStatisticsOutput;
7
7
  /**
8
8
  * Reading the given file line by line and expecting constructs of {@link StatisticsOutputFormat},
9
9
  * this module is responsible for identifying interesting groups of same data.
@@ -39,5 +39,4 @@ function clusterStatisticsOutput(filepath, contextIdMap = new defaultmap_1.Defau
39
39
  valueInfoMap
40
40
  };
41
41
  }
42
- exports.clusterStatisticsOutput = clusterStatisticsOutput;
43
42
  //# sourceMappingURL=clusterer.js.map
@@ -3,7 +3,8 @@ 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.writeFileBasedCountToFile = exports.fileBasedCount = void 0;
6
+ exports.fileBasedCount = fileBasedCount;
7
+ exports.writeFileBasedCountToFile = writeFileBasedCountToFile;
7
8
  const fs_1 = __importDefault(require("fs"));
8
9
  /**
9
10
  * The purpose of this function is to reformat {@link ClusterReport} in way that lists file-based contributions.
@@ -25,7 +26,6 @@ function fileBasedCount(report) {
25
26
  rows: rows
26
27
  };
27
28
  }
28
- exports.fileBasedCount = fileBasedCount;
29
29
  /**
30
30
  * The threshold will cap of values larger to the threshold.
31
31
  */
@@ -45,5 +45,4 @@ function writeFileBasedCountToFile(table, filepath) {
45
45
  fs_1.default.writeSync(handle, `%%% max: ${max}\n`);
46
46
  fs_1.default.closeSync(handle);
47
47
  }
48
- exports.writeFileBasedCountToFile = writeFileBasedCountToFile;
49
48
  //# sourceMappingURL=file-based-count.js.map
@@ -3,7 +3,9 @@ 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.histograms2table = exports.histogramFromNumbers = exports.histogramsFromClusters = void 0;
6
+ exports.histogramsFromClusters = histogramsFromClusters;
7
+ exports.histogramFromNumbers = histogramFromNumbers;
8
+ exports.histograms2table = histograms2table;
7
9
  const fs_1 = __importDefault(require("fs"));
8
10
  const bimap_1 = require("../../../util/bimap");
9
11
  const defaultmap_1 = require("../../../util/defaultmap");
@@ -36,7 +38,6 @@ function histogramsFromClusters(report, binSize, relateValuesToNumberOfLines, ..
36
38
  }
37
39
  return [...valueCounts.entries()].map(([name, counts]) => filter.length === 0 || filter.includes(name) ? histogramFromNumbers(name, binSize, counts) : undefined).filter(assert_1.isNotUndefined);
38
40
  }
39
- exports.histogramsFromClusters = histogramsFromClusters;
40
41
  /**
41
42
  * Produces a histogram from a list of numbers.
42
43
  * Because we need to create several histograms of different datasets and want to compare them, we do not accept the
@@ -61,7 +62,6 @@ function histogramFromNumbers(name, binSize, values) {
61
62
  ...summarized
62
63
  };
63
64
  }
64
- exports.histogramFromNumbers = histogramFromNumbers;
65
65
  /**
66
66
  * Takes an array of histograms created by {@link histogramFromNumbers} and produces a CSV table from it.
67
67
  * They must have the same bin-size for this function to work.
@@ -101,7 +101,6 @@ function histograms2table(histograms, countAsDensity = false) {
101
101
  rows: rows
102
102
  };
103
103
  }
104
- exports.histograms2table = histograms2table;
105
104
  function guardForLargestBinSize(histograms) {
106
105
  const first = histograms[0];
107
106
  let mostBins = first.bins.length;
@@ -3,7 +3,8 @@ 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.printClusterReport = exports.postProcessFeatureFolder = void 0;
6
+ exports.postProcessFeatureFolder = postProcessFeatureFolder;
7
+ exports.printClusterReport = printClusterReport;
7
8
  const path_1 = __importDefault(require("path"));
8
9
  const fs_1 = __importDefault(require("fs"));
9
10
  const clusterer_1 = require("./clusterer");
@@ -35,7 +36,6 @@ function postProcessFeatureFolder(filepath, features) {
35
36
  }
36
37
  return results;
37
38
  }
38
- exports.postProcessFeatureFolder = postProcessFeatureFolder;
39
39
  /**
40
40
  * Process a single feature folder like `Assignments/`
41
41
  *
@@ -101,5 +101,4 @@ function printClusterReport(report, limit = 1000) {
101
101
  }
102
102
  return shortStats.map(({ name }) => name);
103
103
  }
104
- exports.printClusterReport = printClusterReport;
105
104
  //# sourceMappingURL=post-process-output.js.map
@@ -1,5 +1,7 @@
1
1
  import type { StatisticsSummarizerConfiguration } from '../summarizer';
2
2
  import type { CommonSummarizerConfiguration } from '../../../util/summarizer';
3
+ import type { FeatureStatisticsWithMeta } from '../../features/feature';
4
+ export declare function postProcessFeatures(config: StatisticsSummarizerConfiguration, filepath: string, outputPath: string, logger: (message: string) => void, metaFeatureInformation: Map<string, FeatureStatisticsWithMeta>): void;
3
5
  /**
4
6
  * Post process the collections in a given folder, retrieving the final summaries.
5
7
  *
@@ -3,7 +3,8 @@ 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.postProcessFeatureFolder = void 0;
6
+ exports.postProcessFeatures = postProcessFeatures;
7
+ exports.postProcessFeatureFolder = postProcessFeatureFolder;
7
8
  const fs_1 = __importDefault(require("fs"));
8
9
  const path_1 = __importDefault(require("path"));
9
10
  const time_1 = require("../../../util/time");
@@ -83,7 +84,6 @@ function postProcessFeatureFolder(logger, filepath, config, outputPath) {
83
84
  postProcessFeatures(config, filepath, outputPath, logger, metaFeatureInformation);
84
85
  postProcessMeta(config, filepath, outputPath, logger, metaFeatureInformation);
85
86
  }
86
- exports.postProcessFeatureFolder = postProcessFeatureFolder;
87
87
  function extractMetaInformationFrom(logger, metaFeaturesPath, metaStatsPath) {
88
88
  const storage = new Map();
89
89
  logger(` [${(0, time_1.date2string)(new Date())}] Collect feature statistics`);
@@ -13,6 +13,7 @@ const summarizer_1 = require("../../util/summarizer");
13
13
  const strings_1 = require("../../util/strings");
14
14
  const files_1 = require("../../util/files");
15
15
  const time_1 = require("../../util/time");
16
+ const log_1 = require("../../util/log");
16
17
  exports.statisticsFileNameRegex = /.*--.*\.tar\.gz$/;
17
18
  /**
18
19
  * The returned map contains the full path as key, mapping it to the complete contents.
@@ -84,7 +85,12 @@ class StatisticsSummarizer extends summarizer_1.Summarizer {
84
85
  removeIfExists(path) {
85
86
  if (path && fs_1.default.existsSync(path)) {
86
87
  this.log(`Removing existing ${path}`);
87
- fs_1.default.rmSync(path, { recursive: true, force: true });
88
+ try {
89
+ fs_1.default.rmSync(path, { recursive: true, force: true });
90
+ }
91
+ catch (e) {
92
+ log_1.log.error('failure in cleanup');
93
+ }
88
94
  }
89
95
  }
90
96
  /**
@@ -104,6 +110,7 @@ class StatisticsSummarizer extends summarizer_1.Summarizer {
104
110
  }
105
111
  catch (e) {
106
112
  this.log(` Failed to extract ${f}, skipping...`);
113
+ this.log(' Error: ' + JSON.stringify(e));
107
114
  continue;
108
115
  }
109
116
  this.log(' Migrating files...');
package/util/ansi.d.ts CHANGED
@@ -32,6 +32,7 @@ export interface OutputFormatter {
32
32
  reset(): string;
33
33
  }
34
34
  export declare const voidFormatter: OutputFormatter;
35
+ export declare const markdownFormatter: OutputFormatter;
35
36
  /**
36
37
  * This does not work if the {@link setFormatter|formatter} is void. Tries to format the text with a bold font weight.
37
38
  */
package/util/ansi.js CHANGED
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.setFormatter = exports.formatter = exports.ansiFormatter = exports.escape = exports.bold = exports.italic = exports.voidFormatter = exports.ColorEffect = void 0;
3
+ exports.formatter = exports.ansiFormatter = exports.escape = exports.markdownFormatter = exports.voidFormatter = exports.ColorEffect = void 0;
4
+ exports.italic = italic;
5
+ exports.bold = bold;
6
+ exports.setFormatter = setFormatter;
4
7
  // noinspection JSUnusedGlobalSymbols
5
8
  var ColorEffect;
6
9
  (function (ColorEffect) {
@@ -18,20 +21,41 @@ exports.voidFormatter = new class {
18
21
  return '';
19
22
  }
20
23
  }();
24
+ exports.markdownFormatter = new class {
25
+ format(input, options) {
26
+ if (options && 'style' in options) {
27
+ if (options.style === 1 /* FontStyles.Bold */) {
28
+ input = `**${input}**`;
29
+ }
30
+ else if (options.style === 3 /* FontStyles.Italic */) {
31
+ input = `_${input}_`;
32
+ }
33
+ else {
34
+ throw new Error(`Unsupported font style: ${options.style}`);
35
+ }
36
+ }
37
+ input = input.replaceAll(/\\/g, '\\\\');
38
+ return input.replaceAll(/\n/g, '\\\n').replaceAll(/ /g, '&nbsp;');
39
+ }
40
+ getFormatString(_options) {
41
+ return '';
42
+ }
43
+ reset() {
44
+ return '';
45
+ }
46
+ }();
21
47
  /**
22
48
  * This does not work if the {@link setFormatter|formatter} is void. Tries to format the text with a bold font weight.
23
49
  */
24
50
  function italic(s, f = exports.formatter, options) {
25
51
  return f.format(s, { style: 3 /* FontStyles.Italic */, ...options });
26
52
  }
27
- exports.italic = italic;
28
53
  /**
29
54
  * This does not work if the {@link setFormatter|formatter} is void. Tries to format the text with an italic font shape.
30
55
  */
31
56
  function bold(s, f = exports.formatter, options) {
32
57
  return f.format(s, { style: 1 /* FontStyles.Bold */, ...options });
33
58
  }
34
- exports.bold = bold;
35
59
  exports.escape = '\x1b[';
36
60
  const colorSuffix = 'm';
37
61
  exports.ansiFormatter = {
@@ -54,5 +78,4 @@ exports.formatter = exports.ansiFormatter;
54
78
  function setFormatter(setFormatter) {
55
79
  exports.formatter = setFormatter;
56
80
  }
57
- exports.setFormatter = setFormatter;
58
81
  //# sourceMappingURL=ansi.js.map
package/util/args.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * @module
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.splitAtEscapeSensitive = void 0;
8
+ exports.splitAtEscapeSensitive = splitAtEscapeSensitive;
9
9
  /**
10
10
  * This splits an input string on the given split string (e.g., ` `), but checks if the string is quoted or escaped.
11
11
  *
@@ -58,7 +58,7 @@ function splitAtEscapeSensitive(inputString, escapeQuote = true, split = ' ') {
58
58
  current += c;
59
59
  }
60
60
  }
61
- else if (c === '\\') {
61
+ else if (c === '\\' && escapeQuote) {
62
62
  escaped = true;
63
63
  }
64
64
  else {
@@ -70,5 +70,4 @@ function splitAtEscapeSensitive(inputString, escapeQuote = true, split = ' ') {
70
70
  }
71
71
  return args;
72
72
  }
73
- exports.splitAtEscapeSensitive = splitAtEscapeSensitive;
74
73
  //# sourceMappingURL=args.js.map