@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,19 +1,8 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const features_1 = require("./common/features");
7
- const path_1 = __importDefault(require("path"));
8
- const fs_1 = __importDefault(require("fs"));
9
- const log_1 = require("../util/log");
10
- const ansi_1 = require("../util/ansi");
11
- const parallel_1 = require("../util/parallel");
12
- const files_1 = require("../util/files");
13
- const json_1 = require("../util/json");
14
3
  const script_1 = require("./common/script");
15
- const statistics_file_1 = require("../statistics/output/statistics-file");
16
- const options = (0, script_1.processCommandLineArgs)('stats', [], {
4
+ const statistics_core_1 = require("./script-core/statistics-core");
5
+ const scriptOptions = (0, script_1.processCommandLineArgs)('stats', [], {
17
6
  subtitle: 'Given input files or folders, this will collect usage statistics for the given features and write them to a file',
18
7
  examples: [
19
8
  '{bold -i} {italic example.R} {bold -i} {italic example2.R} {bold --output-dir} {italic "output-folder/"}',
@@ -22,78 +11,5 @@ const options = (0, script_1.processCommandLineArgs)('stats', [], {
22
11
  '{bold --help}'
23
12
  ]
24
13
  });
25
- if (options.input.length === 0) {
26
- console.error('No input files given. Nothing to do. See \'--help\' if this is an error.');
27
- process.exit(0);
28
- }
29
- if (options['no-ansi']) {
30
- log_1.log.info('disabling ansi colors');
31
- (0, ansi_1.setFormatter)(ansi_1.voidFormatter);
32
- }
33
- const processedFeatures = (0, features_1.validateFeatures)(options.features);
34
- (0, statistics_file_1.initFileProvider)(options['output-dir']);
35
- const testRegex = /[^/]*\/test/i;
36
- const exampleRegex = /[^/]*\/example/i;
37
- function getPrefixForFile(file) {
38
- if (testRegex.test(file)) {
39
- return 'test-';
40
- }
41
- else if (exampleRegex.test(file)) {
42
- return 'example-';
43
- }
44
- else {
45
- return '';
46
- }
47
- }
48
- function getSuffixForFile(base, file) {
49
- const subpath = path_1.default.relative(base, file);
50
- return '--' + subpath.replace(/\//g, '/');
51
- }
52
- async function collectFileArguments(verboseAdd, dumpJson, features) {
53
- const files = [];
54
- let counter = 0;
55
- let presentSteps = 5000;
56
- let skipped = 0;
57
- for await (const f of (0, files_1.allRFilesFrom)(options.input)) {
58
- const outputDir = path_1.default.join(options['output-dir'], `${getPrefixForFile(f.content)}${getSuffixForFile(options.input.length === 1 ? options.input[0] : '', f.content)}`);
59
- const target = (0, features_1.retrieveArchiveName)(outputDir);
60
- if (fs_1.default.existsSync(target)) {
61
- console.log(`Archive ${target} exists. Skip.`);
62
- skipped++;
63
- continue;
64
- }
65
- files.push(['--input', f.content, '--output-dir', outputDir, '--compress', '--root-dir', options.input.length === 1 ? options.input[0] : '""', ...verboseAdd, ...features, ...dumpJson]);
66
- if (++counter % presentSteps === 0) {
67
- console.log(`Collected ${counter} files`);
68
- if (counter >= 10 * presentSteps) {
69
- presentSteps *= 5;
70
- }
71
- }
72
- }
73
- console.log(`Total: ${counter} files (${skipped} skipped with archive existing)`);
74
- return files;
75
- }
76
- async function getStats() {
77
- console.log(`Processing features: ${JSON.stringify(processedFeatures, json_1.jsonReplacer)}`);
78
- console.log(`Using ${options.parallel} parallel executors`);
79
- const verboseAdd = options.verbose ? ['--verbose'] : [];
80
- const features = [...processedFeatures].flatMap(s => ['--features', s]);
81
- const dumpJson = options['dump-json'] ? ['--dump-json'] : [];
82
- // we do not use the limit argument to be able to pick the limit randomly
83
- const args = await collectFileArguments(verboseAdd, dumpJson, features);
84
- if (options.limit) {
85
- console.log('Shuffle...');
86
- log_1.log.info(`limiting to ${options.limit} files`);
87
- // shuffle and limit
88
- args.sort(() => Math.random() - 0.5);
89
- }
90
- console.log('Prepare Pool...');
91
- const limit = options.limit ?? args.length;
92
- const pool = new parallel_1.LimitedThreadPool(`${__dirname}/statistics-helper-app`, args, limit, options.parallel);
93
- console.log('Run Pool...');
94
- await pool.run();
95
- const stats = pool.getStats();
96
- console.log(`Processed ${stats.counter} files, skipped ${stats.skipped.length} files due to errors`);
97
- }
98
- void getStats();
14
+ void (0, statistics_core_1.flowrScriptGetStats)(scriptOptions);
99
15
  //# sourceMappingURL=statistics-app.js.map
@@ -1,87 +1,13 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- const fs_1 = __importDefault(require("fs"));
7
- const features_1 = require("./common/features");
8
- const log_1 = require("../util/log");
9
- const ansi_1 = require("../util/ansi");
10
- const tar_1 = require("tar");
11
- const cfg_1 = require("../util/cfg/cfg");
12
- const print_1 = require("../core/print/print");
13
- const _00_parse_1 = require("../core/steps/all/core/00-parse");
14
- const _10_normalize_1 = require("../core/steps/all/core/10-normalize");
15
- const _20_dataflow_1 = require("../core/steps/all/core/20-dataflow");
16
- const json_1 = require("../util/json");
17
- const time_1 = require("../util/time");
18
- const assert_1 = require("../util/assert");
19
3
  const script_1 = require("./common/script");
20
- const shell_1 = require("../r-bridge/shell");
21
- const statistics_file_1 = require("../statistics/output/statistics-file");
22
- const statistics_1 = require("../statistics/statistics");
23
- const options = (0, script_1.processCommandLineArgs)('stats-helper', [], {
4
+ const statistics_helper_core_1 = require("./script-core/statistics-helper-core");
5
+ const scriptOptions = (0, script_1.processCommandLineArgs)('stats-helper', [], {
24
6
  subtitle: 'Given a single input file, this will collect usage statistics for the given features and write them to a file',
25
7
  examples: [
26
8
  '{bold -i} {italic example.R} {bold -i} {italic example2.R} {bold --output-dir} {italic "output-folder/"}',
27
9
  '{bold --help}'
28
10
  ]
29
11
  });
30
- if (options['no-ansi']) {
31
- log_1.log.info('disabling ansi colors');
32
- (0, ansi_1.setFormatter)(ansi_1.voidFormatter);
33
- }
34
- let target = undefined;
35
- if (options.compress) {
36
- target = (0, features_1.retrieveArchiveName)(options['output-dir']);
37
- if (fs_1.default.existsSync(target)) {
38
- console.log(`Archive ${target} exists. Skip.`);
39
- process.exit(0);
40
- }
41
- }
42
- // assume correct
43
- const processedFeatures = new Set(options.features);
44
- const shell = new shell_1.RShell();
45
- (0, statistics_file_1.initFileProvider)(options['output-dir']);
46
- function compressFolder(folder, target) {
47
- // eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
48
- (0, tar_1.create)({
49
- gzip: true,
50
- file: target,
51
- portable: true,
52
- preservePaths: false
53
- }, [folder]).then(() => {
54
- // now, remove the folder
55
- fs_1.default.rmSync(folder, { recursive: true, force: true });
56
- }, () => {
57
- console.log(`failed to compress ${folder}`);
58
- });
59
- }
60
- async function getStatsForSingleFile() {
61
- await shell.obtainTmpDir();
62
- const stats = await (0, statistics_1.extractUsageStatistics)(shell, () => { }, processedFeatures, (0, statistics_1.staticRequests)({ request: 'file', content: options.input }), options['root-dir']);
63
- // console.warn(`skipped ${stats.meta.failedRequests.length} requests due to errors (run with logs to get more info)`)
64
- if (stats.outputs.size === 1) {
65
- if (options['dump-json']) {
66
- const [, output] = [...stats.outputs.entries()][0];
67
- const cfg = (0, cfg_1.extractCFG)(output.normalize);
68
- statistics_file_1.statisticsFileProvider.append('output-json', 'parse', await (0, print_1.printStepResult)(_00_parse_1.PARSE_WITH_R_SHELL_STEP, output.parse, 2 /* StepOutputFormat.Json */));
69
- statistics_file_1.statisticsFileProvider.append('output-json', 'normalize', await (0, print_1.printStepResult)(_10_normalize_1.NORMALIZE, output.normalize, 2 /* StepOutputFormat.Json */));
70
- statistics_file_1.statisticsFileProvider.append('output-json', 'dataflow', await (0, print_1.printStepResult)(_20_dataflow_1.STATIC_DATAFLOW, output.dataflow, 2 /* StepOutputFormat.Json */));
71
- statistics_file_1.statisticsFileProvider.append('output-json', 'cfg', JSON.stringify(cfg, json_1.jsonReplacer));
72
- }
73
- statistics_file_1.statisticsFileProvider.append('meta', 'stats', JSON.stringify({ ...stats.meta, file: options.input }, json_1.jsonReplacer));
74
- statistics_file_1.statisticsFileProvider.append('meta', 'features', JSON.stringify(stats.features, json_1.jsonReplacer));
75
- }
76
- else {
77
- log_1.log.error(`expected exactly one output vs. ${stats.outputs.size}, got: ${JSON.stringify([...stats.outputs.keys()], json_1.jsonReplacer, 2)}`);
78
- }
79
- if (options.compress) {
80
- (0, assert_1.guard)(target !== undefined, 'target must be defined given the compress option');
81
- console.log(`[${(0, time_1.date2string)(new Date())}] Compressing ${options['output-dir']} to ${target}`);
82
- compressFolder(options['output-dir'], target);
83
- }
84
- shell.close();
85
- }
86
- void getStatsForSingleFile();
12
+ void (0, statistics_helper_core_1.getStatsForSingleFile)(scriptOptions);
87
13
  //# sourceMappingURL=statistics-helper-app.js.map
@@ -7,11 +7,8 @@
7
7
  * @module
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- const summarizer_1 = require("../benchmark/summarizer/summarizer");
11
- const summarizer_2 = require("../statistics/summarizer/summarizer");
12
- const auto_detect_1 = require("../statistics/summarizer/auto-detect");
13
10
  const script_1 = require("./common/script");
14
- const feature_1 = require("../statistics/features/feature");
11
+ const summarizer_core_1 = require("./script-core/summarizer-core");
15
12
  const options = (0, script_1.processCommandLineArgs)('summarizer', ['input'], {
16
13
  subtitle: 'Summarize and explain the results of the benchmark tool. Summarizes in two stages: first per-request, and then overall',
17
14
  examples: [
@@ -19,48 +16,5 @@ const options = (0, script_1.processCommandLineArgs)('summarizer', ['input'], {
19
16
  '{bold --help}'
20
17
  ]
21
18
  });
22
- const outputBase = (options.output ?? options.input).replace(/\.json$|\/$/, '-summary');
23
- console.log(`Writing outputs to base ${outputBase}`);
24
- function getBenchmarkSummarizer() {
25
- return new summarizer_1.BenchmarkSummarizer({
26
- graphOutputPath: options.graph ? `${outputBase}-graph.json` : undefined,
27
- inputPath: options.input,
28
- intermediateOutputPath: outputBase,
29
- outputPath: `${outputBase}-ultimate.json`,
30
- logger: console.log
31
- });
32
- }
33
- function getStatisticsSummarizer() {
34
- return new summarizer_2.StatisticsSummarizer({
35
- inputPath: options.input,
36
- outputPath: `${outputBase}-final`,
37
- intermediateOutputPath: `${outputBase}-intermediate/`,
38
- projectSkip: options['project-skip'],
39
- featuresToUse: feature_1.allFeatureNames,
40
- logger: console.log
41
- });
42
- }
43
- async function retrieveSummarizer() {
44
- const type = options.type === 'auto' ? await (0, auto_detect_1.detectSummarizationType)(options.input) : options.type;
45
- if (type === "benchmark" /* SummarizerType.Benchmark */) {
46
- console.log('Summarizing benchmark');
47
- return getBenchmarkSummarizer();
48
- }
49
- else if (type === "statistics" /* SummarizerType.Statistics */) {
50
- console.log('Summarizing statistics');
51
- return getStatisticsSummarizer();
52
- }
53
- else {
54
- console.error('Unknown type', type, 'either give "benchmark" or "statistics"');
55
- process.exit(1);
56
- }
57
- }
58
- async function run() {
59
- const summarizer = await retrieveSummarizer();
60
- if (!options['ultimate-only']) {
61
- await summarizer.preparationPhase(options.categorize);
62
- }
63
- await summarizer.summarizePhase();
64
- }
65
- void run();
19
+ void (0, summarizer_core_1.flowrScriptSummarizer)(options);
66
20
  //# sourceMappingURL=summarizer-app.js.map
package/config.d.ts CHANGED
@@ -1,16 +1,32 @@
1
1
  import type { MergeableRecord } from './util/objects';
2
+ import Joi from 'joi';
3
+ import type { BuiltInDefinitions } from './dataflow/environments/built-in-config';
2
4
  export interface FlowrConfigOptions extends MergeableRecord {
3
5
  /**
4
6
  * Whether source calls should be ignored, causing {@link processSourceCall}'s behavior to be skipped
5
7
  */
6
- ignoreSourceCalls: boolean;
8
+ readonly ignoreSourceCalls: boolean;
7
9
  /**
8
10
  * The path to the R executable to use. If this is undefined, {@link DEFAULT_R_PATH} will be used.
9
11
  */
10
- rPath: string | undefined;
12
+ readonly rPath: string | undefined;
13
+ /** Configure language semantics and how flowR handles them */
14
+ readonly semantics: {
15
+ /** Semantics regarding the handlings of the environment */
16
+ readonly environment: {
17
+ /** Do you want to overwrite (parts) of the builtin definition? */
18
+ readonly overwriteBuiltIns: {
19
+ /** Should the default configuration still be loaded? */
20
+ readonly loadDefaults?: boolean;
21
+ /** The definitions to load */
22
+ readonly definitions: BuiltInDefinitions;
23
+ };
24
+ };
25
+ };
11
26
  }
12
27
  export declare const defaultConfigOptions: FlowrConfigOptions;
13
- export declare const defaultConfigFile = "flowr.json";
14
- export declare function setConfigFile(workingDirectory?: string, file?: string, forceLoad?: boolean): void;
28
+ export declare const flowrConfigFileSchema: Joi.ObjectSchema<any>;
29
+ export declare function setConfigFile(file: string | undefined, workingDirectory?: string, forceLoad?: boolean): void;
30
+ export declare function parseConfig(jsonString: string): FlowrConfigOptions | undefined;
15
31
  export declare function setConfig(config: FlowrConfigOptions): void;
16
32
  export declare function getConfig(): FlowrConfigOptions;
package/config.js CHANGED
@@ -3,7 +3,11 @@ 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.getConfig = exports.setConfig = exports.setConfigFile = exports.defaultConfigFile = exports.defaultConfigOptions = void 0;
6
+ exports.flowrConfigFileSchema = exports.defaultConfigOptions = void 0;
7
+ exports.setConfigFile = setConfigFile;
8
+ exports.parseConfig = parseConfig;
9
+ exports.setConfig = setConfig;
10
+ exports.getConfig = getConfig;
7
11
  const objects_1 = require("./util/objects");
8
12
  const path_1 = __importDefault(require("path"));
9
13
  const fs_1 = __importDefault(require("fs"));
@@ -12,63 +16,85 @@ const files_1 = require("./util/files");
12
16
  const joi_1 = __importDefault(require("joi"));
13
17
  exports.defaultConfigOptions = {
14
18
  ignoreSourceCalls: false,
15
- rPath: undefined
19
+ rPath: undefined,
20
+ semantics: {
21
+ environment: {
22
+ overwriteBuiltIns: {
23
+ loadDefaults: true,
24
+ definitions: []
25
+ }
26
+ }
27
+ }
16
28
  };
17
- exports.defaultConfigFile = 'flowr.json';
18
- const schema = joi_1.default.object({
19
- ignoreSourceCalls: joi_1.default.boolean().optional()
20
- });
29
+ exports.flowrConfigFileSchema = joi_1.default.object({
30
+ ignoreSourceCalls: joi_1.default.boolean().optional().description('Whether source calls should be ignored, causing {@link processSourceCall}\'s behavior to be skipped.'),
31
+ rPath: joi_1.default.string().optional().description('The path to the R executable to use. If this is undefined, this uses the default path.'),
32
+ semantics: joi_1.default.object({
33
+ environment: joi_1.default.object({
34
+ overwriteBuiltIns: joi_1.default.object({
35
+ loadDefaults: joi_1.default.boolean().optional().description('Should the default configuration still be loaded?'),
36
+ definitions: joi_1.default.array().items(joi_1.default.object()).optional().description('The definitions to load/overwrite.')
37
+ }).optional().description('Do you want to overwrite (parts) of the builtin definition?')
38
+ }).optional().description('Semantics regarding the handlings of the environment.')
39
+ }).description('Configure language semantics and how flowR handles them.')
40
+ }).description('The configuration file format for flowR.');
41
+ // we don't load from a config file at all by default unless setConfigFile is called
42
+ let configFile = undefined;
21
43
  let configWorkingDirectory = process.cwd();
22
- let configFile = exports.defaultConfigFile;
23
44
  let currentConfig;
24
- function setConfigFile(workingDirectory = process.cwd(), file = exports.defaultConfigFile, forceLoad = false) {
25
- configWorkingDirectory = workingDirectory;
45
+ function setConfigFile(file, workingDirectory = process.cwd(), forceLoad = false) {
26
46
  configFile = file;
47
+ configWorkingDirectory = workingDirectory;
27
48
  // reset the config so it gets reloaded
28
49
  currentConfig = undefined;
29
50
  if (forceLoad) {
30
51
  getConfig();
31
52
  }
32
53
  }
33
- exports.setConfigFile = setConfigFile;
54
+ function parseConfig(jsonString) {
55
+ try {
56
+ const parsed = JSON.parse(jsonString);
57
+ const validate = exports.flowrConfigFileSchema.validate(parsed);
58
+ if (!validate.error) {
59
+ // assign default values to all config options except for the specified ones
60
+ return (0, objects_1.deepMergeObject)(exports.defaultConfigOptions, parsed);
61
+ }
62
+ else {
63
+ log_1.log.error(`Failed to validate config ${jsonString}: ${validate.error.message}`);
64
+ return undefined;
65
+ }
66
+ }
67
+ catch (e) {
68
+ log_1.log.error(`Failed to parse config ${jsonString}: ${e.message}`);
69
+ }
70
+ }
34
71
  function setConfig(config) {
35
72
  currentConfig = config;
36
73
  }
37
- exports.setConfig = setConfig;
38
74
  function getConfig() {
39
75
  // lazy-load the config based on the current settings
40
76
  if (currentConfig === undefined) {
41
- setConfig(parseConfigOptions(configWorkingDirectory, configFile));
77
+ setConfig(loadConfigFromFile(configFile, configWorkingDirectory));
42
78
  }
43
79
  return currentConfig;
44
80
  }
45
- exports.getConfig = getConfig;
46
- function parseConfigOptions(workingDirectory, configFile) {
47
- let searchPath = path_1.default.resolve(workingDirectory);
48
- do {
49
- const configPath = path_1.default.join(searchPath, configFile);
50
- if (fs_1.default.existsSync(configPath)) {
51
- try {
52
- const text = fs_1.default.readFileSync(configPath, { encoding: 'utf-8' });
53
- const parsed = JSON.parse(text);
54
- const validate = schema.validate(parsed);
55
- if (!validate.error) {
56
- // assign default values to all config options except for the specified ones
57
- const ret = (0, objects_1.deepMergeObject)(exports.defaultConfigOptions, parsed);
58
- log_1.log.info(`Using config ${JSON.stringify(ret)} from ${configPath}`);
81
+ function loadConfigFromFile(configFile, workingDirectory) {
82
+ if (configFile !== undefined) {
83
+ let searchPath = path_1.default.resolve(workingDirectory);
84
+ do {
85
+ const configPath = path_1.default.join(searchPath, configFile);
86
+ if (fs_1.default.existsSync(configPath)) {
87
+ log_1.log.trace(`Found config at ${configPath}`);
88
+ const ret = parseConfig(fs_1.default.readFileSync(configPath, { encoding: 'utf-8' }));
89
+ if (ret) {
90
+ log_1.log.info(`Using config ${JSON.stringify(ret)}`);
59
91
  return ret;
60
92
  }
61
- else {
62
- log_1.log.error(`Failed to validate config file at ${configPath}: ${validate.error.message}`);
63
- }
64
- }
65
- catch (e) {
66
- log_1.log.error(`Failed to parse config file at ${configPath}: ${e.message}`);
67
93
  }
68
- }
69
- // move up to parent directory
70
- searchPath = (0, files_1.getParentDirectory)(searchPath);
71
- } while (fs_1.default.existsSync(searchPath));
94
+ // move up to parent directory
95
+ searchPath = (0, files_1.getParentDirectory)(searchPath);
96
+ } while (fs_1.default.existsSync(searchPath));
97
+ }
72
98
  log_1.log.info(`Using default config ${JSON.stringify(exports.defaultConfigOptions)}`);
73
99
  return exports.defaultConfigOptions;
74
100
  }
@@ -2,6 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PipelineExecutor = void 0;
4
4
  const assert_1 = require("../util/assert");
5
+ const config_1 = require("../config");
6
+ const built_in_1 = require("../dataflow/environments/built-in");
7
+ const built_in_config_1 = require("../dataflow/environments/built-in-config");
5
8
  /**
6
9
  * The pipeline executor allows to execute arbitrary {@link Pipeline|pipelines} in a step-by-step fashion.
7
10
  * If you are not yet in the possession of a {@link Pipeline|pipeline}, you can use the {@link createPipeline} function
@@ -103,6 +106,13 @@ class PipelineExecutor {
103
106
  this.pipeline = pipeline;
104
107
  this.length = pipeline.order.length;
105
108
  this.input = input;
109
+ const config = (0, config_1.getConfig)();
110
+ const builtIns = config.semantics.environment.overwriteBuiltIns;
111
+ if (!builtIns.loadDefaults) {
112
+ built_in_1.BuiltInMemory.clear();
113
+ built_in_1.EmptyBuiltInMemory.clear();
114
+ }
115
+ (0, built_in_config_1.registerBuiltInDefinitions)(builtIns.definitions);
106
116
  }
107
117
  /**
108
118
  * Retrieve the current {@link PipelineStepStage|stage} the pipeline executor is in.
@@ -133,7 +143,7 @@ class PipelineExecutor {
133
143
  *
134
144
  * @param intermediate - Normally you can only receive the results *after* the stepper completed the step of interested.
135
145
  * However, if you pass `true` to this parameter, you can also receive the results *before* the {@link PipelineExecutor|pipeline executor}
136
- * completed, although the typing system then can not guarantee which of the steps have already happened.
146
+ * completed, although the typing system then cannot guarantee which of the steps have already happened.
137
147
  */
138
148
  getResults(intermediate = false) {
139
149
  (0, assert_1.guard)(intermediate || this.stepCounter >= this.length, 'Without the intermediate flag, the pipeline must be completed before providing access to the results.');
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dataflowGraphToQuads = exports.dataflowGraphToMermaidUrl = exports.dataflowGraphToMermaid = exports.dataflowGraphToJson = void 0;
3
+ exports.dataflowGraphToJson = dataflowGraphToJson;
4
+ exports.dataflowGraphToMermaid = dataflowGraphToMermaid;
5
+ exports.dataflowGraphToMermaidUrl = dataflowGraphToMermaidUrl;
6
+ exports.dataflowGraphToQuads = dataflowGraphToQuads;
4
7
  const json_1 = require("../../util/json");
5
8
  const quads_1 = require("../../dataflow/graph/quads");
6
9
  const dfg_1 = require("../../util/mermaid/dfg");
@@ -46,17 +49,13 @@ function objectJson(df) {
46
49
  function dataflowGraphToJson(df) {
47
50
  return objectJson(df);
48
51
  }
49
- exports.dataflowGraphToJson = dataflowGraphToJson;
50
52
  function dataflowGraphToMermaid(df) {
51
53
  return (0, dfg_1.graphToMermaid)({ graph: df.graph }).string;
52
54
  }
53
- exports.dataflowGraphToMermaid = dataflowGraphToMermaid;
54
55
  function dataflowGraphToMermaidUrl(df) {
55
56
  return (0, dfg_1.graphToMermaidUrl)(df.graph);
56
57
  }
57
- exports.dataflowGraphToMermaidUrl = dataflowGraphToMermaidUrl;
58
58
  function dataflowGraphToQuads(df, config) {
59
59
  return (0, quads_1.df2quads)(df.graph, config);
60
60
  }
61
- exports.dataflowGraphToQuads = dataflowGraphToQuads;
62
61
  //# sourceMappingURL=dataflow-printer.js.map
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.printNormalizedAstToMermaidUrl = exports.printNormalizedAstToMermaid = exports.normalizedAstToQuads = exports.normalizedAstToJson = void 0;
3
+ exports.normalizedAstToJson = normalizedAstToJson;
4
+ exports.normalizedAstToQuads = normalizedAstToQuads;
5
+ exports.printNormalizedAstToMermaid = printNormalizedAstToMermaid;
6
+ exports.printNormalizedAstToMermaidUrl = printNormalizedAstToMermaidUrl;
4
7
  const json_1 = require("../../util/json");
5
8
  const quads_1 = require("../../util/quads");
6
9
  const ast_1 = require("../../util/mermaid/ast");
@@ -15,17 +18,13 @@ function normalizedAstToJson(ast) {
15
18
  return (0, json_1.jsonReplacer)(k, v);
16
19
  });
17
20
  }
18
- exports.normalizedAstToJson = normalizedAstToJson;
19
21
  function normalizedAstToQuads(ast, config) {
20
22
  return (0, quads_1.serialize2quads)(ast.ast, config);
21
23
  }
22
- exports.normalizedAstToQuads = normalizedAstToQuads;
23
24
  function printNormalizedAstToMermaid(ast) {
24
25
  return (0, ast_1.normalizedAstToMermaid)(ast.ast);
25
26
  }
26
- exports.printNormalizedAstToMermaid = printNormalizedAstToMermaid;
27
27
  function printNormalizedAstToMermaidUrl(ast) {
28
28
  return (0, ast_1.normalizedAstToMermaidUrl)(ast.ast);
29
29
  }
30
- exports.printNormalizedAstToMermaidUrl = printNormalizedAstToMermaidUrl;
31
30
  //# sourceMappingURL=normalize-printer.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseToQuads = void 0;
3
+ exports.parseToQuads = parseToQuads;
4
4
  const quads_1 = require("../../util/quads");
5
5
  const parser_1 = require("../../r-bridge/lang-4.x/ast/parser/json/parser");
6
6
  const format_1 = require("../../r-bridge/lang-4.x/ast/parser/json/format");
@@ -27,5 +27,4 @@ function parseToQuads(code, config) {
27
27
  // recursively filter so that if the object contains one of the keys 'a', 'b' or 'c', all other keys are ignored
28
28
  return (0, quads_1.serialize2quads)(filterObject(obj, new Set([input_format_1.attributesKey, input_format_1.childrenKey, input_format_1.contentKey])), config);
29
29
  }
30
- exports.parseToQuads = parseToQuads;
31
30
  //# sourceMappingURL=parse-printer.js.map
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.printStepResult = exports.internalPrinter = void 0;
3
+ exports.internalPrinter = internalPrinter;
4
+ exports.printStepResult = printStepResult;
4
5
  const assert_1 = require("../../util/assert");
5
6
  /**
6
7
  * Helper function to support the {@link Internal} format, as it is simply returning the input.
@@ -10,7 +11,6 @@ const assert_1 = require("../../util/assert");
10
11
  function internalPrinter(input) {
11
12
  return input;
12
13
  }
13
- exports.internalPrinter = internalPrinter;
14
14
  /**
15
15
  * For a `step` of the given name, which returned the given `data`. Convert that data into the given `format`.
16
16
  * Depending on your step and the format this may require `additional` inputs.
@@ -20,5 +20,4 @@ function printStepResult(step, data, format, ...additional) {
20
20
  (0, assert_1.guard)(printer !== undefined, `printer for ${step.name} does not support ${String(format)}`);
21
21
  return printer(data, ...additional);
22
22
  }
23
- exports.printStepResult = printStepResult;
24
23
  //# sourceMappingURL=print.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sliceDiffAnsi = void 0;
3
+ exports.sliceDiffAnsi = sliceDiffAnsi;
4
4
  const range_1 = require("../../util/range");
5
5
  const assert_1 = require("../../util/assert");
6
6
  const ansi_1 = require("../../util/ansi");
@@ -45,5 +45,4 @@ function sliceDiffAnsi(slice, normalized, criteriaIds, originalCode) {
45
45
  }
46
46
  return `${grayOut()}${lines.join('\n')}${ansi_1.ansiFormatter.reset()}`;
47
47
  }
48
- exports.sliceDiffAnsi = sliceDiffAnsi;
49
48
  //# sourceMappingURL=slice-diff-ansi.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.verifyAndBuildPipeline = void 0;
3
+ exports.verifyAndBuildPipeline = verifyAndBuildPipeline;
4
4
  const invalid_pipeline_error_1 = require("./invalid-pipeline-error");
5
5
  const json_1 = require("../../../util/json");
6
6
  const arrays_1 = require("../../../util/arrays");
@@ -35,7 +35,6 @@ function verifyAndBuildPipeline(steps) {
35
35
  firstStepPerRequest: sortedPerFile.length
36
36
  };
37
37
  }
38
- exports.verifyAndBuildPipeline = verifyAndBuildPipeline;
39
38
  function validateStepOutput(sorted, stepMap, steps) {
40
39
  if (sorted.length !== stepMap.size) {
41
40
  // check if any of the dependencies in the map are invalid