@eagleoutice/flowr 2.2.15 → 2.3.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 (255) hide show
  1. package/README.md +226 -6
  2. package/abstract-interpretation/data-frame/absint-info.d.ts +109 -0
  3. package/abstract-interpretation/data-frame/absint-info.js +31 -0
  4. package/abstract-interpretation/data-frame/absint-visitor.d.ts +59 -0
  5. package/abstract-interpretation/data-frame/absint-visitor.js +173 -0
  6. package/abstract-interpretation/data-frame/domain.d.ts +107 -0
  7. package/abstract-interpretation/data-frame/domain.js +315 -0
  8. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +17 -0
  9. package/abstract-interpretation/data-frame/mappers/access-mapper.js +166 -0
  10. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +117 -0
  11. package/abstract-interpretation/data-frame/mappers/arguments.js +188 -0
  12. package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +20 -0
  13. package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +34 -0
  14. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +261 -0
  15. package/abstract-interpretation/data-frame/mappers/function-mapper.js +1219 -0
  16. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +12 -0
  17. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +206 -0
  18. package/abstract-interpretation/data-frame/resolve-args.d.ts +42 -0
  19. package/abstract-interpretation/data-frame/resolve-args.js +118 -0
  20. package/abstract-interpretation/data-frame/semantics.d.ts +213 -0
  21. package/abstract-interpretation/data-frame/semantics.js +366 -0
  22. package/abstract-interpretation/data-frame/shape-inference.d.ts +38 -0
  23. package/abstract-interpretation/data-frame/shape-inference.js +117 -0
  24. package/benchmark/slicer.d.ts +18 -2
  25. package/benchmark/slicer.js +143 -5
  26. package/benchmark/stats/print.js +123 -45
  27. package/benchmark/stats/size-of.d.ts +7 -0
  28. package/benchmark/stats/size-of.js +1 -0
  29. package/benchmark/stats/stats.d.ts +30 -1
  30. package/benchmark/stats/stats.js +4 -2
  31. package/benchmark/summarizer/data.d.ts +33 -2
  32. package/benchmark/summarizer/first-phase/input.js +5 -1
  33. package/benchmark/summarizer/first-phase/process.d.ts +2 -1
  34. package/benchmark/summarizer/first-phase/process.js +49 -3
  35. package/benchmark/summarizer/second-phase/process.js +101 -3
  36. package/cli/benchmark-app.d.ts +2 -0
  37. package/cli/benchmark-app.js +5 -1
  38. package/cli/benchmark-helper-app.d.ts +2 -0
  39. package/cli/benchmark-helper-app.js +13 -8
  40. package/cli/common/options.js +4 -0
  41. package/cli/export-quads-app.js +2 -1
  42. package/cli/flowr.js +58 -57
  43. package/cli/repl/commands/repl-cfg.js +13 -13
  44. package/cli/repl/commands/repl-commands.js +2 -2
  45. package/cli/repl/commands/repl-dataflow.js +10 -10
  46. package/cli/repl/commands/repl-execute.d.ts +2 -3
  47. package/cli/repl/commands/repl-execute.js +4 -4
  48. package/cli/repl/commands/repl-lineage.js +4 -4
  49. package/cli/repl/commands/repl-main.d.ts +12 -1
  50. package/cli/repl/commands/repl-normalize.js +6 -6
  51. package/cli/repl/commands/repl-parse.js +2 -2
  52. package/cli/repl/commands/repl-query.js +9 -9
  53. package/cli/repl/commands/repl-version.js +1 -1
  54. package/cli/repl/core.d.ts +5 -2
  55. package/cli/repl/core.js +10 -8
  56. package/cli/repl/server/connection.d.ts +3 -1
  57. package/cli/repl/server/connection.js +7 -5
  58. package/cli/repl/server/server.d.ts +3 -2
  59. package/cli/repl/server/server.js +4 -2
  60. package/cli/script-core/statistics-core.d.ts +2 -1
  61. package/cli/script-core/statistics-core.js +2 -2
  62. package/cli/script-core/statistics-helper-core.d.ts +2 -1
  63. package/cli/script-core/statistics-helper-core.js +5 -4
  64. package/cli/slicer-app.js +4 -2
  65. package/cli/statistics-app.js +2 -1
  66. package/cli/statistics-helper-app.js +2 -1
  67. package/config.d.ts +43 -10
  68. package/config.js +47 -43
  69. package/control-flow/cfg-dead-code.js +45 -2
  70. package/control-flow/cfg-simplification.d.ts +2 -0
  71. package/control-flow/control-flow-graph.d.ts +2 -0
  72. package/control-flow/control-flow-graph.js +8 -0
  73. package/control-flow/dfg-cfg-guided-visitor.d.ts +5 -3
  74. package/control-flow/dfg-cfg-guided-visitor.js +15 -4
  75. package/control-flow/extract-cfg.d.ts +4 -2
  76. package/control-flow/extract-cfg.js +4 -3
  77. package/control-flow/semantic-cfg-guided-visitor.d.ts +20 -2
  78. package/control-flow/semantic-cfg-guided-visitor.js +24 -4
  79. package/core/pipeline-executor.d.ts +4 -1
  80. package/core/pipeline-executor.js +6 -5
  81. package/core/steps/all/core/10-normalize.d.ts +2 -0
  82. package/core/steps/all/core/10-normalize.js +1 -1
  83. package/core/steps/all/core/11-normalize-tree-sitter.d.ts +2 -1
  84. package/core/steps/all/core/11-normalize-tree-sitter.js +2 -2
  85. package/core/steps/all/core/20-dataflow.d.ts +2 -1
  86. package/core/steps/all/core/20-dataflow.js +2 -2
  87. package/core/steps/all/static-slicing/00-slice.d.ts +2 -1
  88. package/core/steps/all/static-slicing/00-slice.js +2 -2
  89. package/core/steps/pipeline/default-pipelines.d.ts +32 -31
  90. package/core/steps/pipeline/default-pipelines.js +8 -8
  91. package/core/steps/pipeline-step.d.ts +2 -1
  92. package/dataflow/environments/built-in-config.d.ts +3 -3
  93. package/dataflow/environments/built-in.d.ts +11 -3
  94. package/dataflow/environments/built-in.js +5 -3
  95. package/dataflow/environments/default-builtin-config.js +4 -2
  96. package/dataflow/environments/define.d.ts +2 -1
  97. package/dataflow/environments/define.js +4 -5
  98. package/dataflow/environments/remove.d.ts +6 -0
  99. package/dataflow/environments/remove.js +29 -0
  100. package/dataflow/eval/resolve/alias-tracking.d.ts +7 -2
  101. package/dataflow/eval/resolve/alias-tracking.js +11 -8
  102. package/dataflow/eval/resolve/resolve-argument.d.ts +8 -0
  103. package/dataflow/eval/resolve/resolve-argument.js +118 -0
  104. package/dataflow/eval/resolve/resolve.d.ts +65 -18
  105. package/dataflow/eval/resolve/resolve.js +144 -48
  106. package/dataflow/eval/values/string/string-constants.d.ts +1 -1
  107. package/dataflow/eval/values/string/string-constants.js +7 -2
  108. package/dataflow/extractor.d.ts +2 -1
  109. package/dataflow/extractor.js +2 -1
  110. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -6
  111. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
  112. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +4 -2
  113. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +11 -11
  114. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +10 -11
  115. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -2
  116. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -3
  117. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +1 -1
  118. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  119. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -3
  120. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +6 -3
  121. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +19 -15
  122. package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
  123. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +1 -1
  124. package/dataflow/internal/process/functions/call/common.js +1 -1
  125. package/dataflow/internal/process/functions/process-parameter.js +1 -1
  126. package/dataflow/origin/dfg-get-symbol-refs.d.ts +21 -0
  127. package/dataflow/origin/dfg-get-symbol-refs.js +50 -0
  128. package/dataflow/processor.d.ts +5 -0
  129. package/documentation/doc-util/doc-cfg.js +4 -3
  130. package/documentation/doc-util/doc-code.d.ts +1 -1
  131. package/documentation/doc-util/doc-dfg.js +3 -2
  132. package/documentation/doc-util/doc-functions.d.ts +24 -0
  133. package/documentation/doc-util/doc-functions.js +65 -0
  134. package/documentation/doc-util/doc-normalized-ast.js +3 -2
  135. package/documentation/doc-util/doc-print.d.ts +5 -0
  136. package/documentation/doc-util/doc-print.js +36 -0
  137. package/documentation/doc-util/doc-query.js +13 -2
  138. package/documentation/doc-util/doc-repl.js +2 -1
  139. package/documentation/doc-util/doc-search.js +3 -2
  140. package/documentation/doc-util/doc-types.d.ts +28 -6
  141. package/documentation/doc-util/doc-types.js +89 -45
  142. package/documentation/print-cfg-wiki.js +6 -7
  143. package/documentation/print-core-wiki.js +5 -5
  144. package/documentation/print-dataflow-graph-wiki.js +10 -10
  145. package/documentation/print-engines-wiki.js +1 -2
  146. package/documentation/print-faq-wiki.js +8 -2
  147. package/documentation/print-interface-wiki.js +12 -2
  148. package/documentation/print-linter-issue.d.ts +1 -0
  149. package/documentation/print-linter-issue.js +71 -0
  150. package/documentation/print-linter-wiki.js +223 -34
  151. package/documentation/print-linting-and-testing-wiki.js +2 -4
  152. package/documentation/print-normalized-ast-wiki.js +3 -3
  153. package/documentation/print-query-wiki.js +18 -2
  154. package/documentation/print-readme.js +24 -1
  155. package/documentation/print-search-wiki.js +1 -2
  156. package/linter/linter-executor.d.ts +3 -1
  157. package/linter/linter-executor.js +3 -2
  158. package/linter/linter-format.d.ts +67 -7
  159. package/linter/linter-format.js +12 -1
  160. package/linter/linter-rules.d.ts +178 -16
  161. package/linter/linter-rules.js +14 -4
  162. package/linter/linter-tags.d.ts +80 -0
  163. package/linter/linter-tags.js +85 -0
  164. package/linter/rules/absolute-path.d.ts +71 -0
  165. package/linter/rules/absolute-path.js +177 -0
  166. package/linter/rules/dataframe-access-validation.d.ts +53 -0
  167. package/linter/rules/dataframe-access-validation.js +116 -0
  168. package/linter/rules/deprecated-functions.d.ts +43 -0
  169. package/linter/rules/deprecated-functions.js +58 -0
  170. package/linter/rules/{2-file-path-validity.d.ts → file-path-validity.d.ts} +16 -6
  171. package/linter/rules/{2-file-path-validity.js → file-path-validity.js} +21 -13
  172. package/linter/rules/naming-convention.d.ts +71 -0
  173. package/linter/rules/naming-convention.js +168 -0
  174. package/linter/rules/seeded-randomness.d.ts +65 -0
  175. package/linter/rules/seeded-randomness.js +122 -0
  176. package/linter/rules/unused-definition.d.ts +41 -0
  177. package/linter/rules/unused-definition.js +105 -0
  178. package/package.json +5 -2
  179. package/queries/base-query-format.d.ts +2 -0
  180. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  181. package/queries/catalog/call-context-query/call-context-query-executor.js +2 -2
  182. package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
  183. package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
  184. package/queries/catalog/config-query/config-query-executor.js +2 -3
  185. package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
  186. package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -2
  187. package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
  188. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
  189. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
  190. package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -116
  191. package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
  192. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +3 -0
  193. package/queries/catalog/df-shape-query/df-shape-query-executor.js +46 -0
  194. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +72 -0
  195. package/queries/catalog/df-shape-query/df-shape-query-format.js +31 -0
  196. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
  197. package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
  198. package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -1
  199. package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
  200. package/queries/catalog/linter-query/linter-query-executor.js +2 -2
  201. package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
  202. package/queries/catalog/linter-query/linter-query-format.js +16 -12
  203. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
  204. package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
  205. package/queries/catalog/project-query/project-query-format.d.ts +1 -1
  206. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
  207. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
  208. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
  209. package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
  210. package/queries/catalog/search-query/search-query-executor.js +2 -2
  211. package/queries/catalog/search-query/search-query-format.d.ts +1 -1
  212. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
  213. package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -2
  214. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
  215. package/queries/query.d.ts +76 -16
  216. package/queries/query.js +2 -0
  217. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -1
  218. package/r-bridge/lang-4.x/ast/parser/json/parser.js +4 -2
  219. package/r-bridge/lang-4.x/convert-values.js +2 -1
  220. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +3 -1
  221. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +4 -4
  222. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +1 -1
  223. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +7 -5
  224. package/r-bridge/shell.d.ts +3 -2
  225. package/r-bridge/shell.js +4 -5
  226. package/search/flowr-search-builder.d.ts +6 -2
  227. package/search/flowr-search-builder.js +7 -0
  228. package/search/flowr-search-filters.d.ts +32 -8
  229. package/search/flowr-search-filters.js +42 -15
  230. package/search/flowr-search.d.ts +4 -0
  231. package/search/search-executor/search-enrichers.d.ts +7 -3
  232. package/search/search-executor/search-enrichers.js +29 -20
  233. package/search/search-executor/search-generators.js +1 -1
  234. package/search/search-executor/search-transformer.d.ts +2 -0
  235. package/search/search-executor/search-transformer.js +10 -1
  236. package/slicing/static/static-slicer.d.ts +1 -1
  237. package/slicing/static/static-slicer.js +2 -3
  238. package/statistics/statistics.d.ts +3 -1
  239. package/statistics/statistics.js +5 -4
  240. package/util/containers.d.ts +12 -9
  241. package/util/containers.js +12 -9
  242. package/util/files.d.ts +8 -2
  243. package/util/files.js +22 -4
  244. package/util/objects.d.ts +5 -4
  245. package/util/r-value.d.ts +23 -0
  246. package/util/r-value.js +113 -0
  247. package/util/range.d.ts +5 -1
  248. package/util/range.js +11 -3
  249. package/util/text/strings.d.ts +6 -0
  250. package/util/text/strings.js +35 -0
  251. package/util/version.js +1 -1
  252. package/linter/rules/1-deprecated-functions.d.ts +0 -34
  253. package/linter/rules/1-deprecated-functions.js +0 -54
  254. package/util/cfg/cfg.d.ts +0 -0
  255. package/util/cfg/cfg.js +0 -2
@@ -40,10 +40,10 @@ const retriever_1 = require("../../../r-bridge/retriever");
40
40
  const cfg_1 = require("../../../util/mermaid/cfg");
41
41
  const ansi_1 = require("../../../util/text/ansi");
42
42
  const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
43
- async function controlflow(parser, remainingLine) {
43
+ async function controlflow(parser, remainingLine, config) {
44
44
  return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
45
45
  request: (0, retriever_1.requestFromInput)(remainingLine.trim())
46
- }).allRemainingSteps();
46
+ }, config).allRemainingSteps();
47
47
  }
48
48
  function handleString(code) {
49
49
  return code.startsWith('"') ? JSON.parse(code) : code;
@@ -51,9 +51,9 @@ function handleString(code) {
51
51
  function formatInfo(out, type) {
52
52
  return out.formatter.format(`Copied ${type} to clipboard.`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
53
53
  }
54
- async function produceAndPrintCfg(shell, remainingLine, output, simplifications, cfgConverter) {
55
- const result = await controlflow(shell, handleString(remainingLine));
56
- const cfg = (0, extract_cfg_1.extractCfg)(result.normalize, result.dataflow.graph, [...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications]);
54
+ async function produceAndPrintCfg(shell, remainingLine, output, simplifications, cfgConverter, config) {
55
+ const result = await controlflow(shell, handleString(remainingLine), config);
56
+ const cfg = (0, extract_cfg_1.extractCfg)(result.normalize, config, result.dataflow.graph, [...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications]);
57
57
  const mermaid = cfgConverter(cfg, result.normalize);
58
58
  output.stdout(mermaid);
59
59
  try {
@@ -69,8 +69,8 @@ exports.controlflowCommand = {
69
69
  usageExample: ':controlflow',
70
70
  aliases: ['cfg', 'cf'],
71
71
  script: false,
72
- fn: async (output, shell, remainingLine) => {
73
- await produceAndPrintCfg(shell, remainingLine, output, [], cfg_1.cfgToMermaid);
72
+ fn: async ({ output, parser, remainingLine, config }) => {
73
+ await produceAndPrintCfg(parser, remainingLine, output, [], cfg_1.cfgToMermaid, config);
74
74
  }
75
75
  };
76
76
  exports.controlflowStarCommand = {
@@ -78,8 +78,8 @@ exports.controlflowStarCommand = {
78
78
  usageExample: ':controlflow*',
79
79
  aliases: ['cfg*', 'cf*'],
80
80
  script: false,
81
- fn: async (output, shell, remainingLine) => {
82
- await produceAndPrintCfg(shell, remainingLine, output, [], cfg_1.cfgToMermaidUrl);
81
+ fn: async ({ output, parser, remainingLine, config }) => {
82
+ await produceAndPrintCfg(parser, remainingLine, output, [], cfg_1.cfgToMermaidUrl, config);
83
83
  }
84
84
  };
85
85
  exports.controlflowBbCommand = {
@@ -87,8 +87,8 @@ exports.controlflowBbCommand = {
87
87
  usageExample: ':controlflowbb',
88
88
  aliases: ['cfgb', 'cfb'],
89
89
  script: false,
90
- fn: async (output, shell, remainingLine) => {
91
- await produceAndPrintCfg(shell, remainingLine, output, ['to-basic-blocks'], cfg_1.cfgToMermaid);
90
+ fn: async ({ output, parser, remainingLine, config }) => {
91
+ await produceAndPrintCfg(parser, remainingLine, output, ['to-basic-blocks'], cfg_1.cfgToMermaid, config);
92
92
  }
93
93
  };
94
94
  exports.controlflowBbStarCommand = {
@@ -96,8 +96,8 @@ exports.controlflowBbStarCommand = {
96
96
  usageExample: ':controlflowbb*',
97
97
  aliases: ['cfgb*', 'cfb*'],
98
98
  script: false,
99
- fn: async (output, shell, remainingLine) => {
100
- await produceAndPrintCfg(shell, remainingLine, output, ['to-basic-blocks'], cfg_1.cfgToMermaidUrl);
99
+ fn: async ({ output, parser, remainingLine, config }) => {
100
+ await produceAndPrintCfg(parser, remainingLine, output, ['to-basic-blocks'], cfg_1.cfgToMermaidUrl, config);
101
101
  }
102
102
  };
103
103
  //# sourceMappingURL=repl-cfg.js.map
@@ -50,7 +50,7 @@ exports.helpCommand = {
50
50
  script: false,
51
51
  usageExample: ':help',
52
52
  aliases: ['h', '?'],
53
- fn: output => {
53
+ fn: ({ output }) => {
54
54
  initCommandMapping();
55
55
  output.stdout(`
56
56
  If enabled ('--r-session-access' and if using the 'r-shell' engine), you can just enter R expressions which get evaluated right away:
@@ -113,7 +113,7 @@ function getReplCommands() {
113
113
  aliases: [],
114
114
  script: true,
115
115
  usageExample: `:${script} --help`,
116
- fn: async (output, _s, remainingLine) => {
116
+ fn: async ({ output, remainingLine }) => {
117
117
  // check if the target *module* exists in the current directory, else try two dirs up, otherwise, fail with a message
118
118
  let path = `${__dirname}/${target}`;
119
119
  if (!hasModule(path)) {
@@ -41,10 +41,10 @@ const ansi_1 = require("../../../util/text/ansi");
41
41
  /**
42
42
  * Obtain the dataflow graph using a known parser (such as the {@link RShell} or {@link TreeSitterExecutor}).
43
43
  */
44
- async function replGetDataflow(parser, code) {
44
+ async function replGetDataflow(config, parser, code) {
45
45
  return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
46
46
  request: (0, retriever_1.requestFromInput)(code.trim())
47
- }).allRemainingSteps();
47
+ }, config).allRemainingSteps();
48
48
  }
49
49
  function handleString(code) {
50
50
  return code.startsWith('"') ? JSON.parse(code) : code;
@@ -57,8 +57,8 @@ exports.dataflowCommand = {
57
57
  usageExample: ':dataflow',
58
58
  aliases: ['d', 'df'],
59
59
  script: false,
60
- fn: async (output, shell, remainingLine) => {
61
- const result = await replGetDataflow(shell, handleString(remainingLine));
60
+ fn: async ({ output, parser, remainingLine, config }) => {
61
+ const result = await replGetDataflow(config, parser, handleString(remainingLine));
62
62
  const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.dataflow.graph, includeEnvironments: false }).string;
63
63
  output.stdout(mermaid);
64
64
  try {
@@ -74,8 +74,8 @@ exports.dataflowStarCommand = {
74
74
  usageExample: ':dataflow*',
75
75
  aliases: ['d*', 'df*'],
76
76
  script: false,
77
- fn: async (output, shell, remainingLine) => {
78
- const result = await replGetDataflow(shell, handleString(remainingLine));
77
+ fn: async ({ output, parser, remainingLine, config }) => {
78
+ const result = await replGetDataflow(config, parser, handleString(remainingLine));
79
79
  const mermaid = (0, dfg_1.graphToMermaidUrl)(result.dataflow.graph, false);
80
80
  output.stdout(mermaid);
81
81
  try {
@@ -91,8 +91,8 @@ exports.dataflowSimplifiedCommand = {
91
91
  usageExample: ':dataflowsimple',
92
92
  aliases: ['ds', 'dfs'],
93
93
  script: false,
94
- fn: async (output, shell, remainingLine) => {
95
- const result = await replGetDataflow(shell, handleString(remainingLine));
94
+ fn: async ({ output, parser, remainingLine, config }) => {
95
+ const result = await replGetDataflow(config, parser, handleString(remainingLine));
96
96
  const mermaid = (0, dfg_1.graphToMermaid)({ graph: result.dataflow.graph, includeEnvironments: false, simplified: true }).string;
97
97
  output.stdout(mermaid);
98
98
  try {
@@ -108,8 +108,8 @@ exports.dataflowSimpleStarCommand = {
108
108
  usageExample: ':dataflowsimple*',
109
109
  aliases: ['ds*', 'dfs*'],
110
110
  script: false,
111
- fn: async (output, shell, remainingLine) => {
112
- const result = await replGetDataflow(shell, handleString(remainingLine));
111
+ fn: async ({ output, parser, remainingLine, config }) => {
112
+ const result = await replGetDataflow(config, parser, handleString(remainingLine));
113
113
  const mermaid = (0, dfg_1.graphToMermaidUrl)(result.dataflow.graph, false, undefined, true);
114
114
  output.stdout(mermaid);
115
115
  try {
@@ -1,4 +1,3 @@
1
- import type { ReplCommand, ReplOutput } from './repl-main';
2
- import type { KnownParser } from '../../../r-bridge/parser';
3
- export declare function tryExecuteRShellCommand(output: ReplOutput, parser: KnownParser, statement: string, allowRSessionAccess: boolean): Promise<void>;
1
+ import type { ReplCommand, ReplCommandInformation } from './repl-main';
2
+ export declare function tryExecuteRShellCommand({ output, parser, allowRSessionAccess, remainingLine }: ReplCommandInformation): Promise<void>;
4
3
  export declare const executeCommand: ReplCommand;
@@ -4,16 +4,16 @@ exports.executeCommand = void 0;
4
4
  exports.tryExecuteRShellCommand = tryExecuteRShellCommand;
5
5
  const ansi_1 = require("../../../util/text/ansi");
6
6
  const shell_1 = require("../../../r-bridge/shell");
7
- async function tryExecuteRShellCommand(output, parser, statement, allowRSessionAccess) {
7
+ async function tryExecuteRShellCommand({ output, parser, allowRSessionAccess, remainingLine }) {
8
8
  if (!allowRSessionAccess) {
9
9
  output.stderr(`${output.formatter.format('You are not allowed to execute arbitrary R code.', { style: 1 /* FontStyles.Bold */, color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground })}
10
- If you want to do so, please restart flowR with the ${output.formatter.format('--r-session-access', { style: 1 /* FontStyles.Bold */ })} flag${parser.name !== 'r-shell' ? '. Additionally, please enable the r-shell engine, e.g., with ' + output.formatter.format('--default-engine r-shell', { style: 1 /* FontStyles.Bold */ }) : ''}. Please be careful of the security implications of this action.`);
10
+ If you want to do so, please restart flowR with the ${output.formatter.format('--r-session-access', { style: 1 /* FontStyles.Bold */ })} flag${parser.name !== 'r-shell' ? '. Additionally, please enable the r-shell engine, e.g., with ' + output.formatter.format('--default-engine r-shell', { style: 1 /* FontStyles.Bold */ }) : ''}. Please be careful of the security implications of this action. When running flowR with npm, you have to use an extra ${output.formatter.format('--', { style: 1 /* FontStyles.Bold */ })} to separate flowR from npm arguments.`);
11
11
  }
12
12
  else if (parser instanceof shell_1.RShell) {
13
- await executeRShellCommand(output, parser, statement);
13
+ await executeRShellCommand(output, parser, remainingLine);
14
14
  }
15
15
  else {
16
- output.stderr(`Executing arbitrary R code is only possible when using the r-shell engine as the default engine. Enable it using the configuration file or the ${output.formatter.format('--default-engine r-shell', { style: 1 /* FontStyles.Bold */ })} command line option.`);
16
+ output.stderr(`Executing arbitrary R code is only possible when using the r-shell engine as the default engine. Enable it using the configuration file or the ${output.formatter.format('--default-engine r-shell', { style: 1 /* FontStyles.Bold */ })} command line option. When running flowR with npm, you have to use an extra ${output.formatter.format('--', { style: 1 /* FontStyles.Bold */ })} to separate flowR from npm arguments.`);
17
17
  }
18
18
  }
19
19
  async function executeRShellCommand(output, shell, statement) {
@@ -10,10 +10,10 @@ const assert_1 = require("../../../util/assert");
10
10
  function splitAt(str, idx) {
11
11
  return [str.slice(0, idx), str.slice(idx)];
12
12
  }
13
- async function getDfg(parser, remainingLine) {
13
+ async function getDfg(config, parser, remainingLine) {
14
14
  return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
15
15
  request: (0, retriever_1.requestFromInput)(remainingLine.trim())
16
- }).allRemainingSteps();
16
+ }, config).allRemainingSteps();
17
17
  }
18
18
  function filterRelevantEdges(edge) {
19
19
  return (0, edge_1.edgeIncludesType)(edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall | edge_1.EdgeType.Returns | edge_1.EdgeType.Reads, edge.types);
@@ -56,9 +56,9 @@ exports.lineageCommand = {
56
56
  usageExample: ':lineage',
57
57
  aliases: ['lin'],
58
58
  script: false,
59
- fn: async (output, shell, remainingLine) => {
59
+ fn: async ({ output, parser, remainingLine, config }) => {
60
60
  const [criterion, rest] = splitAt(remainingLine, remainingLine.indexOf(' '));
61
- const { dataflow: dfg } = await getDfg(shell, rest);
61
+ const { dataflow: dfg } = await getDfg(config, parser, rest);
62
62
  const lineageIds = getLineage(criterion, dfg.graph);
63
63
  output.stdout([...lineageIds].join('\n'));
64
64
  }
@@ -1,5 +1,6 @@
1
1
  import type { OutputFormatter } from '../../../util/text/ansi';
2
2
  import type { KnownParser } from '../../../r-bridge/parser';
3
+ import type { FlowrConfigOptions } from '../../../config';
3
4
  /**
4
5
  * Defines the main interface for output of the repl.
5
6
  * This allows us to redirect it (e.g., in the case of a server connection or tests).
@@ -18,6 +19,16 @@ export interface ReplOutput {
18
19
  * @see ReplOutput
19
20
  */
20
21
  export declare const standardReplOutput: ReplOutput;
22
+ /**
23
+ * Information passed to each repl command function
24
+ */
25
+ export interface ReplCommandInformation {
26
+ output: ReplOutput;
27
+ parser: KnownParser;
28
+ remainingLine: string;
29
+ allowRSessionAccess: boolean;
30
+ config: FlowrConfigOptions;
31
+ }
21
32
  /**
22
33
  * Content of a single command in the repl.
23
34
  * The command may execute an external script or simply call *flowR* functions.
@@ -35,5 +46,5 @@ export interface ReplCommand {
35
46
  * Function to execute when the command is invoked, it must not write to the command line but instead use the output handler.
36
47
  * Furthermore, it has to obey the formatter defined in the {@link ReplOutput}.
37
48
  */
38
- fn: (output: ReplOutput, parser: KnownParser, remainingLine: string, allowRSessionAccess: boolean) => Promise<void> | void;
49
+ fn: (info: ReplCommandInformation) => Promise<void> | void;
39
50
  }
@@ -38,10 +38,10 @@ const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipeli
38
38
  const retriever_1 = require("../../../r-bridge/retriever");
39
39
  const ast_1 = require("../../../util/mermaid/ast");
40
40
  const ansi_1 = require("../../../util/text/ansi");
41
- async function normalize(parser, remainingLine) {
41
+ async function normalize(parser, remainingLine, config) {
42
42
  return await (0, default_pipelines_1.createNormalizePipeline)(parser, {
43
43
  request: (0, retriever_1.requestFromInput)(remainingLine.trim())
44
- }).allRemainingSteps();
44
+ }, config).allRemainingSteps();
45
45
  }
46
46
  function handleString(code) {
47
47
  return code.startsWith('"') ? JSON.parse(code) : code;
@@ -54,8 +54,8 @@ exports.normalizeCommand = {
54
54
  usageExample: ':normalize',
55
55
  aliases: ['n'],
56
56
  script: false,
57
- fn: async (output, shell, remainingLine) => {
58
- const result = await normalize(shell, handleString(remainingLine));
57
+ fn: async ({ output, parser, remainingLine, config }) => {
58
+ const result = await normalize(parser, handleString(remainingLine), config);
59
59
  const mermaid = (0, ast_1.normalizedAstToMermaid)(result.normalize.ast);
60
60
  output.stdout(mermaid);
61
61
  try {
@@ -71,8 +71,8 @@ exports.normalizeStarCommand = {
71
71
  usageExample: ':normalize*',
72
72
  aliases: ['n*'],
73
73
  script: false,
74
- fn: async (output, shell, remainingLine) => {
75
- const result = await normalize(shell, handleString(remainingLine));
74
+ fn: async ({ output, parser, remainingLine, config }) => {
75
+ const result = await normalize(parser, handleString(remainingLine), config);
76
76
  const mermaid = (0, ast_1.normalizedAstToMermaidUrl)(result.normalize.ast);
77
77
  output.stdout(mermaid);
78
78
  try {
@@ -130,10 +130,10 @@ exports.parseCommand = {
130
130
  usageExample: ':parse',
131
131
  aliases: ['p'],
132
132
  script: false,
133
- fn: async (output, parser, remainingLine) => {
133
+ fn: async ({ output, parser, remainingLine, config }) => {
134
134
  const result = await (0, default_pipelines_1.createParsePipeline)(parser, {
135
135
  request: (0, retriever_1.requestFromInput)((0, retriever_1.removeRQuotes)(remainingLine.trim()))
136
- }).allRemainingSteps();
136
+ }, config).allRemainingSteps();
137
137
  if (parser.name === 'r-shell') {
138
138
  const object = (0, format_1.convertPreparedParsedData)((0, format_1.prepareParsedData)(result.parse.parsed));
139
139
  output.stdout(depthListToTextTree(toDepthMap(object), output.formatter));
@@ -9,10 +9,10 @@ const schema_1 = require("../../../util/schema");
9
9
  const query_1 = require("../../../queries/query");
10
10
  const json_1 = require("../../../util/json");
11
11
  const query_print_1 = require("../../../queries/query-print");
12
- async function getDataflow(parser, remainingLine) {
12
+ async function getDataflow(config, parser, remainingLine) {
13
13
  return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
14
14
  request: (0, retriever_1.requestFromInput)(remainingLine.trim())
15
- }).allRemainingSteps();
15
+ }, config).allRemainingSteps();
16
16
  }
17
17
  function printHelp(output) {
18
18
  output.stderr(`Format: ${(0, ansi_1.italic)(':query "<query>" <code>', output.formatter)}`);
@@ -24,7 +24,7 @@ function printHelp(output) {
24
24
  output.stdout('Similarly, \'@<type>\' is interpreted as a query of the given type.');
25
25
  output.stdout(`With this, ${(0, ansi_1.italic)(':query @config', output.formatter)} prints the result of the config query.`);
26
26
  }
27
- async function processQueryArgs(line, parser, output) {
27
+ async function processQueryArgs(line, parser, output, config) {
28
28
  const args = (0, args_1.splitAtEscapeSensitive)(line);
29
29
  const query = args.shift();
30
30
  if (!query) {
@@ -57,9 +57,9 @@ async function processQueryArgs(line, parser, output) {
57
57
  else {
58
58
  parsedQuery = [{ type: 'call-context', callName: query }];
59
59
  }
60
- const processed = await getDataflow(parser, args.join(' '));
60
+ const processed = await getDataflow(config, parser, args.join(' '));
61
61
  return {
62
- query: (0, query_1.executeQueries)({ dataflow: processed.dataflow, ast: processed.normalize }, parsedQuery),
62
+ query: (0, query_1.executeQueries)({ dataflow: processed.dataflow, ast: processed.normalize, config: config }, parsedQuery),
63
63
  processed
64
64
  };
65
65
  }
@@ -68,9 +68,9 @@ exports.queryCommand = {
68
68
  usageExample: ':query "<query>" <code>',
69
69
  aliases: [],
70
70
  script: false,
71
- fn: async (output, parser, remainingLine) => {
71
+ fn: async ({ output, parser, remainingLine, config }) => {
72
72
  const totalStart = Date.now();
73
- const results = await processQueryArgs(remainingLine, parser, output);
73
+ const results = await processQueryArgs(remainingLine, parser, output, config);
74
74
  const totalEnd = Date.now();
75
75
  if (results) {
76
76
  output.stdout((0, query_print_1.asciiSummaryOfQueryResult)(ansi_1.ansiFormatter, totalEnd - totalStart, results.query, results.processed));
@@ -82,8 +82,8 @@ exports.queryStarCommand = {
82
82
  usageExample: ':query* <query> <code>',
83
83
  aliases: [],
84
84
  script: false,
85
- fn: async (output, shell, remainingLine) => {
86
- const results = await processQueryArgs(remainingLine, shell, output);
85
+ fn: async ({ output, parser, remainingLine, config }) => {
86
+ const results = await processQueryArgs(remainingLine, parser, output, config);
87
87
  if (results) {
88
88
  output.stdout(JSON.stringify(results.query, json_1.jsonReplacer));
89
89
  }
@@ -24,6 +24,6 @@ exports.versionCommand = {
24
24
  aliases: [],
25
25
  usageExample: ':version',
26
26
  script: false,
27
- fn: (output, parser) => printVersionInformation(output, parser)
27
+ fn: ({ output, parser }) => printVersionInformation(output, parser)
28
28
  };
29
29
  //# sourceMappingURL=repl-version.js.map
@@ -2,6 +2,7 @@ import * as readline from 'readline';
2
2
  import type { ReplOutput } from './commands/repl-main';
3
3
  import type { MergeableRecord } from '../../util/objects';
4
4
  import type { KnownParser } from '../../r-bridge/parser';
5
+ import type { FlowrConfigOptions } from '../../config';
5
6
  /**
6
7
  * Used by the repl to provide automatic completions for a given (partial) input line
7
8
  */
@@ -10,12 +11,13 @@ export declare function makeDefaultReplReadline(): readline.ReadLineOptions;
10
11
  /**
11
12
  * This function interprets the given `expr` as a REPL command (see {@link repl} for more on the semantics).
12
13
  *
14
+ * @param config - flowr Config
13
15
  * @param output - Defines two methods that every function in the repl uses to output its data.
14
16
  * @param expr - The expression to process.
15
17
  * @param parser - The {@link RShell} or {@link TreeSitterExecutor} to use (see {@link repl}).
16
18
  * @param allowRSessionAccess - If true, allows the execution of arbitrary R code.
17
19
  */
18
- export declare function replProcessAnswer(output: ReplOutput, expr: string, parser: KnownParser, allowRSessionAccess: boolean): Promise<void>;
20
+ export declare function replProcessAnswer(config: FlowrConfigOptions, output: ReplOutput, expr: string, parser: KnownParser, allowRSessionAccess: boolean): Promise<void>;
19
21
  /**
20
22
  * Options for the {@link repl} function.
21
23
  */
@@ -43,9 +45,10 @@ export interface FlowrReplOptions extends MergeableRecord {
43
45
  * - Starting with anything else, indicating default R code to be directly executed. If you kill the underlying shell, that is on you! </li>
44
46
  *
45
47
  * @param options - The options for the repl. See {@link FlowrReplOptions} for more information.
48
+ * @param config - The flowr config
46
49
  *
47
50
  * For the execution, this function makes use of {@link replProcessAnswer}.
48
51
  *
49
52
  */
50
- export declare function repl({ parser, rl, output, historyFile, allowRSessionAccess }: FlowrReplOptions): Promise<void>;
53
+ export declare function repl(config: FlowrConfigOptions, { parser, rl, output, historyFile, allowRSessionAccess }: FlowrReplOptions): Promise<void>;
51
54
  export declare function loadReplHistory(historyFile: string): string[] | undefined;
package/cli/repl/core.js CHANGED
@@ -59,6 +59,7 @@ const retriever_1 = require("../../r-bridge/retriever");
59
59
  const repl_main_1 = require("./commands/repl-main");
60
60
  const shell_1 = require("../../r-bridge/shell");
61
61
  const log_1 = require("../../util/log");
62
+ const config_1 = require("../../config");
62
63
  let _replCompleterKeywords = undefined;
63
64
  function replCompleterKeywords() {
64
65
  if (_replCompleterKeywords === undefined) {
@@ -109,15 +110,14 @@ function makeDefaultReplReadline() {
109
110
  completer: replCompleter
110
111
  };
111
112
  }
112
- ;
113
- async function replProcessStatement(output, statement, parser, allowRSessionAccess) {
113
+ async function replProcessStatement(output, statement, parser, allowRSessionAccess, config) {
114
114
  if (statement.startsWith(':')) {
115
115
  const command = statement.slice(1).split(' ')[0].toLowerCase();
116
116
  const processor = (0, repl_commands_1.getCommand)(command);
117
117
  const bold = (s) => output.formatter.format(s, { style: 1 /* FontStyles.Bold */ });
118
118
  if (processor) {
119
119
  try {
120
- await processor.fn(output, parser, statement.slice(command.length + 2).trim(), allowRSessionAccess);
120
+ await processor.fn({ output, parser, remainingLine: statement.slice(command.length + 2).trim(), allowRSessionAccess, config });
121
121
  }
122
122
  catch (e) {
123
123
  output.stdout(`${bold(`Failed to execute command ${command}`)}: ${e?.message}. Using the ${bold('--verbose')} flag on startup may provide additional information.\n`);
@@ -131,21 +131,22 @@ async function replProcessStatement(output, statement, parser, allowRSessionAcce
131
131
  }
132
132
  }
133
133
  else {
134
- await (0, repl_execute_1.tryExecuteRShellCommand)(output, parser, statement, allowRSessionAccess);
134
+ await (0, repl_execute_1.tryExecuteRShellCommand)({ output, parser, remainingLine: statement, allowRSessionAccess, config });
135
135
  }
136
136
  }
137
137
  /**
138
138
  * This function interprets the given `expr` as a REPL command (see {@link repl} for more on the semantics).
139
139
  *
140
+ * @param config - flowr Config
140
141
  * @param output - Defines two methods that every function in the repl uses to output its data.
141
142
  * @param expr - The expression to process.
142
143
  * @param parser - The {@link RShell} or {@link TreeSitterExecutor} to use (see {@link repl}).
143
144
  * @param allowRSessionAccess - If true, allows the execution of arbitrary R code.
144
145
  */
145
- async function replProcessAnswer(output, expr, parser, allowRSessionAccess) {
146
+ async function replProcessAnswer(config, output, expr, parser, allowRSessionAccess) {
146
147
  const statements = (0, args_1.splitAtEscapeSensitive)(expr, false, ';');
147
148
  for (const statement of statements) {
148
- await replProcessStatement(output, statement, parser, allowRSessionAccess);
149
+ await replProcessStatement(output, statement, parser, allowRSessionAccess, config);
149
150
  }
150
151
  }
151
152
  /**
@@ -156,11 +157,12 @@ async function replProcessAnswer(output, expr, parser, allowRSessionAccess) {
156
157
  * - Starting with anything else, indicating default R code to be directly executed. If you kill the underlying shell, that is on you! </li>
157
158
  *
158
159
  * @param options - The options for the repl. See {@link FlowrReplOptions} for more information.
160
+ * @param config - The flowr config
159
161
  *
160
162
  * For the execution, this function makes use of {@link replProcessAnswer}.
161
163
  *
162
164
  */
163
- async function repl({ parser = new shell_1.RShell({ revive: 2 /* RShellReviveOptions.Always */ }), rl = readline.createInterface(makeDefaultReplReadline()), output = repl_main_1.standardReplOutput, historyFile = defaultHistoryFile, allowRSessionAccess = false }) {
165
+ async function repl(config, { parser = new shell_1.RShell((0, config_1.getEngineConfig)(config, 'r-shell'), { revive: 2 /* RShellReviveOptions.Always */ }), rl = readline.createInterface(makeDefaultReplReadline()), output = repl_main_1.standardReplOutput, historyFile = defaultHistoryFile, allowRSessionAccess = false }) {
164
166
  if (historyFile) {
165
167
  rl.on('history', h => fs_1.default.writeFileSync(historyFile, h.join('\n'), { encoding: 'utf-8' }));
166
168
  }
@@ -169,7 +171,7 @@ async function repl({ parser = new shell_1.RShell({ revive: 2 /* RShellReviveOpt
169
171
  await new Promise((resolve, reject) => {
170
172
  rl.question((0, prompt_1.prompt)(), answer => {
171
173
  rl.pause();
172
- replProcessAnswer(output, answer, parser, allowRSessionAccess).then(() => {
174
+ replProcessAnswer(config, output, answer, parser, allowRSessionAccess).then(() => {
173
175
  rl.resume();
174
176
  resolve();
175
177
  }).catch(reject);
@@ -3,6 +3,7 @@ import { DEFAULT_SLICING_PIPELINE } from '../../../core/steps/pipeline/default-p
3
3
  import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
4
4
  import type { DeepPartial } from 'ts-essentials';
5
5
  import type { KnownParser } from '../../../r-bridge/parser';
6
+ import type { FlowrConfigOptions } from '../../../config';
6
7
  /**
7
8
  * Each connection handles a single client, answering to its requests.
8
9
  * There is no need to construct this class manually, {@link FlowRServer} will do it for you.
@@ -13,8 +14,9 @@ export declare class FlowRServerConnection {
13
14
  private readonly name;
14
15
  private readonly logger;
15
16
  private readonly allowRSessionAccess;
17
+ private readonly config;
16
18
  private readonly fileMap;
17
- constructor(socket: Socket, name: string, parser: KnownParser, allowRSessionAccess: boolean);
19
+ constructor(socket: Socket, name: string, parser: KnownParser, allowRSessionAccess: boolean, config: FlowrConfigOptions);
18
20
  private currentMessageBuffer;
19
21
  private handleData;
20
22
  private handleFileAnalysisRequest;
@@ -71,10 +71,12 @@ class FlowRServerConnection {
71
71
  name;
72
72
  logger;
73
73
  allowRSessionAccess;
74
+ config;
74
75
  // maps token to information
75
76
  fileMap = new Map();
76
77
  // we do not have to ensure synchronized shell-access as we are always running synchronized
77
- constructor(socket, name, parser, allowRSessionAccess) {
78
+ constructor(socket, name, parser, allowRSessionAccess, config) {
79
+ this.config = config;
78
80
  this.socket = socket;
79
81
  this.parser = parser;
80
82
  this.name = name;
@@ -160,7 +162,7 @@ class FlowRServerConnection {
160
162
  async sendFileAnalysisResponse(slicer, results, message) {
161
163
  let cfg = undefined;
162
164
  if (message.cfg) {
163
- cfg = (0, extract_cfg_1.extractCfg)(results.normalize, results.dataflow?.graph);
165
+ cfg = (0, extract_cfg_1.extractCfg)(results.normalize, this.config, results.dataflow?.graph);
164
166
  }
165
167
  const config = () => ({ context: message.filename ?? 'unknown', getId: (0, quads_1.defaultQuadIdGenerator)() });
166
168
  const sanitizedResults = sanitizeAnalysisResults(results);
@@ -222,7 +224,7 @@ class FlowRServerConnection {
222
224
  const slicer = (0, default_pipelines_1.createSlicePipeline)(this.parser, {
223
225
  request,
224
226
  criterion: [] // currently unknown
225
- });
227
+ }, this.config);
226
228
  if (message.filetoken) {
227
229
  this.logger.info(`Storing file token ${message.filetoken}`);
228
230
  this.fileMap.set(message.filetoken, {
@@ -286,7 +288,7 @@ class FlowRServerConnection {
286
288
  stream
287
289
  });
288
290
  };
289
- void (0, core_1.replProcessAnswer)({
291
+ void (0, core_1.replProcessAnswer)(this.config, {
290
292
  formatter: request.ansi ? ansi_1.ansiFormatter : ansi_1.voidFormatter,
291
293
  stdout: msg => out('stdout', msg),
292
294
  stderr: msg => out('stderr', msg)
@@ -346,7 +348,7 @@ class FlowRServerConnection {
346
348
  const { dataflow: dfg, normalize: ast } = fileInformation.pipeline.getResults(true);
347
349
  (0, assert_1.guard)(dfg !== undefined, `Dataflow graph must be present (request: ${request.filetoken})`);
348
350
  (0, assert_1.guard)(ast !== undefined, `AST must be present (request: ${request.filetoken})`);
349
- const results = (0, query_1.executeQueries)({ dataflow: dfg, ast }, request.query);
351
+ const results = (0, query_1.executeQueries)({ dataflow: dfg, ast, config: this.config }, request.query);
350
352
  (0, send_1.sendMessage)(this.socket, {
351
353
  type: 'response-query',
352
354
  id: request.id,
@@ -1,6 +1,6 @@
1
1
  import type { Server } from './net';
2
2
  import { FlowrLogger } from '../../../util/log';
3
- import type { KnownEngines } from '../../../config';
3
+ import type { FlowrConfigOptions, KnownEngines } from '../../../config';
4
4
  export declare const serverLog: FlowrLogger;
5
5
  /**
6
6
  * This class controls the TCP server, which can be started by calling {@link start}.
@@ -13,10 +13,11 @@ export declare class FlowRServer {
13
13
  private readonly defaultEngine;
14
14
  private versionInformation;
15
15
  private readonly allowRSessionAccess;
16
+ private readonly config;
16
17
  /** maps names to the respective connection */
17
18
  private readonly connections;
18
19
  private nameCounter;
19
- constructor(engines: KnownEngines, defaultEngine: keyof KnownEngines, allowRSessionAccess: boolean, server?: Server);
20
+ constructor(engines: KnownEngines, defaultEngine: keyof KnownEngines, allowRSessionAccess: boolean, config: FlowrConfigOptions, server?: Server);
20
21
  start(port: number): Promise<void>;
21
22
  private onConnect;
22
23
  }
@@ -19,15 +19,17 @@ class FlowRServer {
19
19
  defaultEngine;
20
20
  versionInformation;
21
21
  allowRSessionAccess;
22
+ config;
22
23
  /** maps names to the respective connection */
23
24
  connections = new Map();
24
25
  nameCounter = 0;
25
- constructor(engines, defaultEngine, allowRSessionAccess, server = new net_1.NetServer()) {
26
+ constructor(engines, defaultEngine, allowRSessionAccess, config, server = new net_1.NetServer()) {
26
27
  this.server = server;
27
28
  this.server.onConnect(c => this.onConnect(c));
28
29
  this.engines = engines;
29
30
  this.defaultEngine = defaultEngine;
30
31
  this.allowRSessionAccess = allowRSessionAccess;
32
+ this.config = config;
31
33
  }
32
34
  async start(port) {
33
35
  this.versionInformation = await (0, repl_version_1.retrieveVersionInformation)(this.engines[this.defaultEngine]);
@@ -41,7 +43,7 @@ class FlowRServer {
41
43
  }
42
44
  const name = `client-${this.nameCounter++}`;
43
45
  exports.serverLog.info(`Client connected: ${(0, send_1.getUnnamedSocketName)(c)} as "${name}"`);
44
- this.connections.set(name, new connection_1.FlowRServerConnection(c, name, this.engines[this.defaultEngine], this.allowRSessionAccess));
46
+ this.connections.set(name, new connection_1.FlowRServerConnection(c, name, this.engines[this.defaultEngine], this.allowRSessionAccess, this.config));
45
47
  helloClient(c, name, this.versionInformation);
46
48
  c.on('close', () => {
47
49
  this.connections.delete(name);
@@ -1,2 +1,3 @@
1
1
  import type { StatsCliOptions } from '../statistics-app';
2
- export declare function flowrScriptGetStats(options: StatsCliOptions): Promise<void>;
2
+ import type { FlowrConfigOptions } from '../../config';
3
+ export declare function flowrScriptGetStats(options: StatsCliOptions, config: FlowrConfigOptions): Promise<void>;
@@ -57,7 +57,7 @@ async function collectFileArguments(options, verboseAdd, dumpJson, features) {
57
57
  console.log(`Total: ${counter} files (${skipped} skipped with archive existing)`);
58
58
  return files;
59
59
  }
60
- async function flowrScriptGetStats(options) {
60
+ async function flowrScriptGetStats(options, config) {
61
61
  if (options.input.length === 0) {
62
62
  console.error('No input files given. Nothing to do. See \'--help\' if this is an error.');
63
63
  process.exit(0);
@@ -93,7 +93,7 @@ async function flowrScriptGetStats(options) {
93
93
  else {
94
94
  console.log('Run Sequentially as parallel <= 0...');
95
95
  for (const arg of args) {
96
- await (0, statistics_helper_core_1.getStatsForSingleFile)((0, command_line_args_1.default)(scripts_info_1.scripts['stats-helper'].options, { argv: arg }));
96
+ await (0, statistics_helper_core_1.getStatsForSingleFile)((0, command_line_args_1.default)(scripts_info_1.scripts['stats-helper'].options, { argv: arg }), config);
97
97
  }
98
98
  }
99
99
  }
@@ -1,2 +1,3 @@
1
1
  import type { StatsHelperCliOptions } from '../statistics-helper-app';
2
- export declare function getStatsForSingleFile(options: StatsHelperCliOptions): Promise<void>;
2
+ import type { FlowrConfigOptions } from '../../config';
3
+ export declare function getStatsForSingleFile(options: StatsHelperCliOptions, config: FlowrConfigOptions): Promise<void>;