@eagleoutice/flowr 2.6.3 → 2.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (276) hide show
  1. package/README.md +22 -22
  2. package/abstract-interpretation/absint-visitor.d.ts +160 -0
  3. package/abstract-interpretation/absint-visitor.js +279 -0
  4. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +4 -7
  5. package/abstract-interpretation/data-frame/dataframe-domain.js +26 -16
  6. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +6 -4
  7. package/abstract-interpretation/data-frame/mappers/access-mapper.js +11 -14
  8. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +10 -9
  9. package/abstract-interpretation/data-frame/mappers/arguments.js +8 -5
  10. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +18 -18
  11. package/abstract-interpretation/data-frame/mappers/function-mapper.js +53 -58
  12. package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +7 -5
  13. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +26 -29
  14. package/abstract-interpretation/data-frame/semantics.js +48 -44
  15. package/abstract-interpretation/data-frame/shape-inference.d.ts +52 -28
  16. package/abstract-interpretation/data-frame/shape-inference.js +67 -90
  17. package/abstract-interpretation/domains/abstract-domain.d.ts +1 -0
  18. package/abstract-interpretation/domains/abstract-domain.js +3 -2
  19. package/abstract-interpretation/domains/bounded-set-domain.d.ts +2 -2
  20. package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
  21. package/abstract-interpretation/domains/interval-domain.d.ts +4 -4
  22. package/abstract-interpretation/domains/interval-domain.js +3 -6
  23. package/abstract-interpretation/domains/lattice.d.ts +2 -0
  24. package/abstract-interpretation/domains/lattice.js +3 -1
  25. package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -1
  26. package/abstract-interpretation/domains/positive-interval-domain.js +1 -1
  27. package/abstract-interpretation/domains/satisfiable-domain.d.ts +2 -2
  28. package/abstract-interpretation/domains/satisfiable-domain.js +2 -2
  29. package/abstract-interpretation/domains/set-range-domain.d.ts +104 -0
  30. package/abstract-interpretation/domains/set-range-domain.js +406 -0
  31. package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +2 -2
  32. package/abstract-interpretation/domains/set-upper-bound-domain.js +2 -2
  33. package/abstract-interpretation/domains/singleton-domain.d.ts +2 -2
  34. package/abstract-interpretation/domains/singleton-domain.js +2 -2
  35. package/benchmark/slicer.d.ts +2 -1
  36. package/benchmark/slicer.js +50 -29
  37. package/benchmark/stats/print.js +8 -5
  38. package/benchmark/stats/stats.d.ts +3 -2
  39. package/benchmark/summarizer/data.d.ts +11 -8
  40. package/benchmark/summarizer/first-phase/process.js +11 -8
  41. package/benchmark/summarizer/second-phase/process.js +24 -18
  42. package/cli/common/options.d.ts +431 -8
  43. package/cli/common/options.js +1 -1
  44. package/cli/common/scripts-info.d.ts +431 -7
  45. package/cli/flowr-main-options.d.ts +102 -2
  46. package/cli/flowr.d.ts +102 -2
  47. package/cli/repl/commands/repl-commands.d.ts +25 -0
  48. package/cli/repl/commands/repl-query.js +17 -5
  49. package/cli/wiki.d.ts +13 -0
  50. package/cli/wiki.js +7 -2
  51. package/config.d.ts +4 -4
  52. package/config.js +1 -1
  53. package/control-flow/basic-cfg-guided-visitor.js +7 -8
  54. package/control-flow/cfg-dead-code.js +3 -2
  55. package/control-flow/control-flow-graph.d.ts +1 -1
  56. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  57. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  58. package/control-flow/useless-loop.js +4 -2
  59. package/core/steps/all/static-slicing/00-slice.d.ts +3 -0
  60. package/core/steps/all/static-slicing/00-slice.js +2 -1
  61. package/core/steps/pipeline/default-pipelines.d.ts +42 -42
  62. package/dataflow/cluster.js +2 -2
  63. package/dataflow/environments/append.d.ts +5 -0
  64. package/dataflow/environments/append.js +6 -20
  65. package/dataflow/environments/built-in.d.ts +2 -1
  66. package/dataflow/environments/clone.d.ts +1 -1
  67. package/dataflow/environments/clone.js +3 -27
  68. package/dataflow/environments/define.d.ts +7 -3
  69. package/dataflow/environments/define.js +9 -56
  70. package/dataflow/environments/diff.js +1 -1
  71. package/dataflow/environments/environment.d.ts +48 -28
  72. package/dataflow/environments/environment.js +187 -62
  73. package/dataflow/environments/overwrite.js +2 -45
  74. package/dataflow/environments/reference-to-maybe.d.ts +13 -0
  75. package/dataflow/environments/reference-to-maybe.js +54 -0
  76. package/dataflow/environments/resolve-by-name.d.ts +6 -1
  77. package/dataflow/environments/resolve-by-name.js +56 -4
  78. package/dataflow/environments/scoping.d.ts +2 -2
  79. package/dataflow/environments/scoping.js +7 -7
  80. package/dataflow/eval/resolve/alias-tracking.d.ts +10 -4
  81. package/dataflow/eval/resolve/alias-tracking.js +16 -14
  82. package/dataflow/eval/resolve/resolve-argument.d.ts +2 -1
  83. package/dataflow/eval/resolve/resolve-argument.js +8 -8
  84. package/dataflow/eval/resolve/resolve.d.ts +13 -11
  85. package/dataflow/eval/resolve/resolve.js +16 -15
  86. package/dataflow/extractor.js +1 -7
  87. package/dataflow/fn/higher-order-function.d.ts +2 -1
  88. package/dataflow/fn/higher-order-function.js +4 -4
  89. package/dataflow/graph/dataflowgraph-builder.d.ts +9 -5
  90. package/dataflow/graph/dataflowgraph-builder.js +21 -11
  91. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  92. package/dataflow/graph/graph.d.ts +10 -2
  93. package/dataflow/graph/graph.js +41 -12
  94. package/dataflow/graph/invert-dfg.d.ts +3 -2
  95. package/dataflow/graph/invert-dfg.js +3 -3
  96. package/dataflow/graph/resolve-graph.d.ts +2 -1
  97. package/dataflow/graph/resolve-graph.js +2 -2
  98. package/dataflow/graph/vertex.d.ts +3 -3
  99. package/dataflow/graph/vertex.js +3 -3
  100. package/dataflow/info.d.ts +1 -1
  101. package/dataflow/internal/linker.d.ts +2 -0
  102. package/dataflow/internal/linker.js +13 -19
  103. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +7 -1
  104. package/dataflow/internal/process/functions/call/argument/unpack-argument.js +12 -3
  105. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +2 -2
  107. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -1
  108. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +3 -3
  109. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +9 -9
  110. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -7
  111. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
  112. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
  113. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +9 -13
  114. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +1 -1
  115. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +3 -1
  116. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +8 -6
  117. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +1 -1
  118. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
  119. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
  120. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  121. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +6 -4
  122. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  123. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -5
  124. package/dataflow/internal/process/functions/call/common.js +2 -3
  125. package/dataflow/internal/process/functions/call/known-call-handling.js +1 -1
  126. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
  127. package/dataflow/internal/process/functions/process-argument.js +1 -1
  128. package/dataflow/internal/process/process-symbol.js +1 -1
  129. package/dataflow/internal/process/process-value.d.ts +1 -1
  130. package/dataflow/internal/process/process-value.js +7 -7
  131. package/dataflow/processor.d.ts +1 -5
  132. package/documentation/doc-capabilities.d.ts +1 -1
  133. package/documentation/doc-readme.d.ts +1 -1
  134. package/documentation/doc-util/doc-cfg.js +1 -1
  135. package/documentation/doc-util/doc-cli-option.d.ts +6 -6
  136. package/documentation/doc-util/doc-cli-option.js +3 -3
  137. package/documentation/doc-util/doc-dfg.d.ts +1 -1
  138. package/documentation/doc-util/doc-dfg.js +3 -2
  139. package/documentation/doc-util/doc-files.d.ts +3 -0
  140. package/documentation/doc-util/doc-files.js +4 -1
  141. package/documentation/doc-util/doc-normalized-ast.js +5 -4
  142. package/documentation/doc-util/doc-types.d.ts +1 -1
  143. package/documentation/doc-util/doc-types.js +2 -2
  144. package/documentation/issue-linting-rule.d.ts +1 -1
  145. package/documentation/wiki-analyzer.d.ts +1 -1
  146. package/documentation/wiki-analyzer.js +14 -1
  147. package/documentation/wiki-cfg.d.ts +1 -1
  148. package/documentation/wiki-core.d.ts +1 -1
  149. package/documentation/wiki-dataflow-graph.d.ts +1 -1
  150. package/documentation/wiki-dataflow-graph.js +10 -11
  151. package/documentation/wiki-engine.d.ts +1 -1
  152. package/documentation/wiki-engine.js +9 -10
  153. package/documentation/wiki-faq.d.ts +1 -1
  154. package/documentation/wiki-faq.js +0 -1
  155. package/documentation/wiki-interface.d.ts +1 -1
  156. package/documentation/wiki-interface.js +12 -13
  157. package/documentation/wiki-linter.d.ts +1 -1
  158. package/documentation/wiki-linter.js +1 -1
  159. package/documentation/wiki-linting-and-testing.d.ts +1 -1
  160. package/documentation/wiki-mk/doc-context.d.ts +54 -1
  161. package/documentation/wiki-mk/doc-context.js +17 -0
  162. package/documentation/wiki-mk/doc-maker.d.ts +5 -5
  163. package/documentation/wiki-mk/doc-maker.js +5 -2
  164. package/documentation/wiki-normalized-ast.d.ts +1 -1
  165. package/documentation/wiki-onboarding.d.ts +1 -1
  166. package/documentation/wiki-overview.d.ts +9 -0
  167. package/documentation/wiki-overview.js +248 -0
  168. package/documentation/wiki-query.d.ts +1 -1
  169. package/documentation/wiki-query.js +17 -1
  170. package/documentation/wiki-search.d.ts +1 -1
  171. package/documentation/wiki-setup.d.ts +9 -0
  172. package/documentation/wiki-setup.js +122 -0
  173. package/linter/linter-rules.d.ts +2 -2
  174. package/linter/rules/absolute-path.js +4 -4
  175. package/linter/rules/dataframe-access-validation.d.ts +2 -2
  176. package/linter/rules/dataframe-access-validation.js +9 -11
  177. package/linter/rules/function-finder-util.d.ts +2 -2
  178. package/linter/rules/function-finder-util.js +1 -1
  179. package/linter/rules/network-functions.js +1 -1
  180. package/linter/rules/seeded-randomness.d.ts +1 -1
  181. package/linter/rules/seeded-randomness.js +5 -5
  182. package/linter/rules/unused-definition.js +1 -1
  183. package/package.json +1 -2
  184. package/project/context/flowr-analyzer-context.d.ts +11 -0
  185. package/project/context/flowr-analyzer-context.js +3 -0
  186. package/project/context/flowr-analyzer-environment-context.d.ts +47 -0
  187. package/project/context/flowr-analyzer-environment-context.js +50 -0
  188. package/project/context/flowr-analyzer-files-context.d.ts +9 -1
  189. package/project/context/flowr-analyzer-files-context.js +4 -0
  190. package/project/context/flowr-file.d.ts +2 -0
  191. package/project/context/flowr-file.js +2 -0
  192. package/project/plugins/file-plugins/{flowr-description-file.d.ts → files/flowr-description-file.d.ts} +1 -1
  193. package/project/plugins/file-plugins/files/flowr-description-file.js +75 -0
  194. package/project/plugins/file-plugins/files/flowr-news-file.d.ts +27 -0
  195. package/project/plugins/file-plugins/files/flowr-news-file.js +152 -0
  196. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
  197. package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
  198. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +23 -0
  199. package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +35 -0
  200. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +1 -1
  201. package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +1 -1
  202. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
  203. package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +1 -1
  204. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +1 -1
  205. package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +1 -1
  206. package/project/plugins/flowr-analyzer-plugin-defaults.js +2 -0
  207. package/project/plugins/plugin-registry.d.ts +2 -1
  208. package/project/plugins/plugin-registry.js +2 -0
  209. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
  210. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -4
  211. package/queries/catalog/control-flow-query/control-flow-query-format.js +3 -2
  212. package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
  213. package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -4
  214. package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
  215. package/queries/catalog/df-shape-query/df-shape-query-executor.js +5 -3
  216. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +4 -4
  217. package/queries/catalog/df-shape-query/df-shape-query-format.js +2 -2
  218. package/queries/catalog/files-query/files-query-executor.d.ts +6 -0
  219. package/queries/catalog/files-query/files-query-executor.js +49 -0
  220. package/queries/catalog/files-query/files-query-format.d.ts +36 -0
  221. package/queries/catalog/files-query/files-query-format.js +114 -0
  222. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
  223. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  224. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +1 -1
  225. package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
  226. package/queries/query.d.ts +10 -1
  227. package/queries/query.js +3 -1
  228. package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -1
  229. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +8 -8
  230. package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +8 -8
  231. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +0 -1
  232. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +0 -1
  233. package/slicing/static/slice-call.d.ts +3 -2
  234. package/slicing/static/slice-call.js +4 -4
  235. package/slicing/static/static-slicer.d.ts +3 -1
  236. package/slicing/static/static-slicer.js +6 -7
  237. package/statistics/features/supported/control-flow/control-flow.js +1 -1
  238. package/statistics/features/supported/data-access/data-access.js +1 -1
  239. package/statistics/features/supported/used-functions/used-functions.js +1 -1
  240. package/statistics/features/supported/variables/variables.js +2 -1
  241. package/util/containers.js +2 -2
  242. package/util/files.d.ts +0 -7
  243. package/util/files.js +0 -41
  244. package/util/mermaid/ast.d.ts +3 -2
  245. package/util/mermaid/ast.js +13 -7
  246. package/util/mermaid/cfg.d.ts +3 -2
  247. package/util/mermaid/cfg.js +26 -6
  248. package/util/mermaid/dfg.d.ts +2 -7
  249. package/util/mermaid/dfg.js +10 -6
  250. package/util/mermaid/info.d.ts +17 -0
  251. package/util/mermaid/info.js +5 -0
  252. package/util/prefix.d.ts +9 -5
  253. package/util/prefix.js +14 -6
  254. package/util/r-regex.d.ts +21 -0
  255. package/util/r-regex.js +25 -0
  256. package/util/simple-df/dfg-view.d.ts +2 -1
  257. package/util/simple-df/dfg-view.js +2 -2
  258. package/util/text/args.js +12 -3
  259. package/util/version.js +1 -1
  260. package/abstract-interpretation/data-frame/absint-info.d.ts +0 -109
  261. package/abstract-interpretation/data-frame/absint-info.js +0 -31
  262. package/abstract-interpretation/data-frame/absint-visitor.d.ts +0 -57
  263. package/abstract-interpretation/data-frame/absint-visitor.js +0 -176
  264. package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +0 -19
  265. package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +0 -33
  266. package/dataflow/environments/remove.d.ts +0 -12
  267. package/dataflow/environments/remove.js +0 -52
  268. package/documentation/doc-util/doc-print.d.ts +0 -5
  269. package/documentation/doc-util/doc-print.js +0 -36
  270. package/project/plugins/file-plugins/flowr-description-file.js +0 -37
  271. package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
  272. package/project/plugins/file-plugins/notebooks/notebook.js +0 -2
  273. /package/project/plugins/file-plugins/{notebooks → files}/flowr-jupyter-file.d.ts +0 -0
  274. /package/project/plugins/file-plugins/{notebooks → files}/flowr-jupyter-file.js +0 -0
  275. /package/project/plugins/file-plugins/{notebooks → files}/flowr-rmarkdown-file.d.ts +0 -0
  276. /package/project/plugins/file-plugins/{notebooks → files}/flowr-rmarkdown-file.js +0 -0
@@ -7,18 +7,18 @@ const identifier_1 = require("../../environments/identifier");
7
7
  /**
8
8
  *
9
9
  */
10
- function processValue({ info: { id } }, data) {
10
+ function processValue({ info: { id } }, { controlDependencies, completeAst: { idMap }, ctx: { env }, environment }) {
11
11
  return {
12
12
  unknownReferences: [],
13
- in: [{ nodeId: id, name: undefined, controlDependencies: data.controlDependencies, type: identifier_1.ReferenceType.Constant }],
13
+ in: [{ nodeId: id, name: undefined, controlDependencies, type: identifier_1.ReferenceType.Constant }],
14
14
  out: [],
15
- environment: data.environment,
16
- graph: new graph_1.DataflowGraph(data.completeAst.idMap).addVertex({
15
+ environment,
16
+ graph: new graph_1.DataflowGraph(idMap).addVertex({
17
17
  tag: vertex_1.VertexType.Value,
18
18
  id: id,
19
- cds: data.controlDependencies
20
- }),
21
- exitPoints: [{ nodeId: id, type: 0 /* ExitPointType.Default */, controlDependencies: data.controlDependencies }],
19
+ cds: controlDependencies
20
+ }, env.makeCleanEnv()),
21
+ exitPoints: [{ nodeId: id, type: 0 /* ExitPointType.Default */, controlDependencies }],
22
22
  entryPoint: id
23
23
  };
24
24
  }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import type { ControlDependency, DataflowInformation } from './info';
5
5
  import type { NormalizedAst, ParentInformation, RNodeWithParent } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
6
- import type { IEnvironment, REnvironmentInformation } from './environments/environment';
6
+ import type { REnvironmentInformation } from './environments/environment';
7
7
  import type { RNode } from '../r-bridge/lang-4.x/ast/model/model';
8
8
  import type { KnownParserType, Parser } from '../r-bridge/parser';
9
9
  import type { FlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
@@ -31,10 +31,6 @@ export interface DataflowProcessorInformation<OtherInfo> {
31
31
  * The chain of control-flow {@link NodeId}s that lead to the current node (e.g., of known ifs).
32
32
  */
33
33
  readonly controlDependencies: ControlDependency[] | undefined;
34
- /**
35
- * The built-in environment
36
- */
37
- readonly builtInEnvironment: IEnvironment;
38
34
  /**
39
35
  * The flowr context used for environment seeding, files, and precision control, ...
40
36
  */
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/wiki/Capabilities
5
5
  */
6
- export declare class DocCapabilities extends DocMaker {
6
+ export declare class DocCapabilities extends DocMaker<'wiki/Capabilities.md'> {
7
7
  constructor();
8
8
  protected text({ treeSitter }: DocMakerArgs): Promise<string>;
9
9
  }
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/blob/main/README.md
5
5
  */
6
- export declare class DocReadme extends DocMaker {
6
+ export declare class DocReadme extends DocMaker<'README.md'> {
7
7
  constructor();
8
8
  text({ treeSitter }: DocMakerArgs): Promise<string>;
9
9
  }
@@ -30,7 +30,7 @@ async function getCfg(parser, code, simplifications = [], useDfg = true) {
30
30
  */
31
31
  function printCfg(cfg, ast, prefix = 'flowchart BT\n', simplify = false) {
32
32
  return `
33
- ${(0, doc_code_1.codeBlock)('mermaid', (0, cfg_1.cfgToMermaid)(cfg, ast, prefix, simplify))}
33
+ ${(0, doc_code_1.codeBlock)('mermaid', (0, cfg_1.cfgToMermaid)(cfg, ast, { prefix, simplify }))}
34
34
  `;
35
35
  }
36
36
  /**
@@ -1,17 +1,17 @@
1
1
  /** Automatically provides hover over with the documentation for these! */
2
2
  import { scripts } from '../../cli/common/scripts-info';
3
3
  import { flowrMainOptionDefinitions } from '../../cli/flowr-main-options';
4
- type ScriptOptions<Type extends keyof typeof scripts | 'flowr'> = Type extends keyof typeof scripts ? typeof scripts[Type]['options'][number]['name'] : Type extends 'flowr' ? typeof flowrMainOptionDefinitions[number]['name'] : never;
4
+ import type { ReplCommandNames } from '../../cli/repl/commands/repl-commands';
5
+ export type ScriptOptions<Type extends keyof typeof scripts | 'flowr'> = Type extends keyof typeof scripts ? typeof scripts[Type]['options'][number]['name'] : Type extends 'flowr' ? typeof flowrMainOptionDefinitions[number]['name'] : never;
5
6
  /**
6
- *
7
+ * Produce the documentation string for a CLI long option
7
8
  */
8
9
  export declare function getCliLongOptionOf<ScriptName extends keyof typeof scripts | 'flowr', OptionName extends ScriptOptions<ScriptName>>(scriptName: ScriptName, optionName: OptionName, withAlias?: boolean, quote?: boolean): string;
9
10
  /**
10
- *
11
+ * Produce the documentation string for multiple CLI long options
11
12
  */
12
13
  export declare function multipleCliOptions<ScriptName extends keyof typeof scripts | 'flowr', OptionName extends ScriptOptions<ScriptName>>(scriptName: ScriptName, ...options: OptionName[]): string;
13
14
  /**
14
- *
15
+ * Produce the documentation string for a REPL command
15
16
  */
16
- export declare function getReplCommand(commandName: string, quote?: boolean, showStar?: boolean): string;
17
- export {};
17
+ export declare function getReplCommand(commandName: ReplCommandNames | string, quote?: boolean, showStar?: boolean): string;
@@ -11,7 +11,7 @@ const flowr_main_options_1 = require("../../cli/flowr-main-options");
11
11
  const repl_commands_1 = require("../../cli/repl/commands/repl-commands");
12
12
  const doc_escape_1 = require("./doc-escape");
13
13
  /**
14
- *
14
+ * Produce the documentation string for a CLI long option
15
15
  */
16
16
  function getCliLongOptionOf(scriptName, optionName, withAlias = false, quote = true) {
17
17
  const script = scriptName === 'flowr' ? flowr_main_options_1.flowrMainOptionDefinitions : scripts_info_1.scripts[scriptName].options;
@@ -26,13 +26,13 @@ function getCliLongOptionOf(scriptName, optionName, withAlias = false, quote = t
26
26
  return (0, html_hover_over_1.textWithTooltip)(`${char}-${ligatureBreaker}-${optionName}${char}`, 'Description (Command Line Argument): ' + description) + alias;
27
27
  }
28
28
  /**
29
- *
29
+ * Produce the documentation string for multiple CLI long options
30
30
  */
31
31
  function multipleCliOptions(scriptName, ...options) {
32
32
  return options.map(o => getCliLongOptionOf(scriptName, o, false, true)).join(' ');
33
33
  }
34
34
  /**
35
- *
35
+ * Produce the documentation string for a REPL command
36
36
  */
37
37
  function getReplCommand(commandName, quote = true, showStar = false) {
38
38
  const availableNames = (0, repl_commands_1.getReplCommands)();
@@ -1,8 +1,8 @@
1
1
  import type { DataflowGraph, UnknownSideEffect } from '../../dataflow/graph/graph';
2
- import { type MermaidMarkdownMark } from '../../util/mermaid/dfg';
3
2
  import type { DEFAULT_DATAFLOW_PIPELINE } from '../../core/steps/pipeline/default-pipelines';
4
3
  import type { PipelineOutput } from '../../core/steps/pipeline/pipeline';
5
4
  import type { KnownParser } from '../../r-bridge/parser';
5
+ import type { MermaidMarkdownMark } from '../../util/mermaid/info';
6
6
  /**
7
7
  * Visualizes the dataflow graph as a mermaid graph inside a markdown code block.
8
8
  * Please use this only for documentation purposes, for programmatic usage use {@link graphToMermaid} directly.
@@ -82,13 +82,14 @@ ${switchCodeAndGraph ? dfGraph : codeText}
82
82
  }
83
83
  /** returns resolved expected df graph */
84
84
  async function verifyExpectedSubgraph(parser, code, expectedSubgraph) {
85
+ const context = (0, flowr_analyzer_context_1.contextFromInput)(code);
85
86
  /* we verify that we get what we want first! */
86
87
  const info = await (0, default_pipelines_1.createDataflowPipeline)(parser, {
87
- context: (0, flowr_analyzer_context_1.contextFromInput)(code),
88
+ context: context,
88
89
  getId: (0, decorate_1.deterministicCountingIdGenerator)(0)
89
90
  }).allRemainingSteps();
90
91
  expectedSubgraph.setIdMap(info.normalize.idMap);
91
- expectedSubgraph = (0, resolve_graph_1.resolveDataflowGraph)(expectedSubgraph);
92
+ expectedSubgraph = (0, resolve_graph_1.resolveDataflowGraph)(expectedSubgraph, context);
92
93
  const report = (0, diff_dataflow_graph_1.diffOfDataflowGraphs)({ name: 'expected', graph: expectedSubgraph }, { name: 'got', graph: info.dataflow.graph }, {
93
94
  leftIsSubgraph: true
94
95
  });
@@ -3,11 +3,14 @@ export declare const FlowrGithubBaseRef = "https://github.com/flowr-analysis";
3
3
  export declare const FlowrSiteBaseRef = "https://flowr-analysis.github.io/flowr";
4
4
  export declare const RemoteFlowrFilePathBaseRef = "https://github.com/flowr-analysis/flowr/tree/main/";
5
5
  export declare const FlowrWikiBaseRef = "https://github.com/flowr-analysis/flowr/wiki";
6
+ export declare const FlowrGithubRef: string;
6
7
  export declare const FlowrNpmRef = "https://www.npmjs.com/package/@eagleoutice/flowr";
7
8
  export declare const FlowrDockerRef = "https://hub.docker.com/r/eagleoutice/flowr";
8
9
  export declare const FlowrCodecovRef = "https://app.codecov.io/gh/flowr-analysis/flowr";
9
10
  export declare const FlowrVsCode = "https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr";
10
11
  export declare const FlowrPositron = "https://open-vsx.org/extension/code-inspect/vscode-flowr";
12
+ export declare const FlowrRStudioAddin = "https://github.com/flowr-analysis/rstudio-addin-flowr";
13
+ export declare const FlowrRAdapter = "https://github.com/flowr-analysis/flowr-r-adapter";
11
14
  /**
12
15
  * Returns a markdown link to the given file path relative to the project root.
13
16
  */
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.FlowrPositron = exports.FlowrVsCode = exports.FlowrCodecovRef = exports.FlowrDockerRef = exports.FlowrNpmRef = exports.FlowrWikiBaseRef = exports.RemoteFlowrFilePathBaseRef = exports.FlowrSiteBaseRef = exports.FlowrGithubBaseRef = exports.FlowrGithubGroupName = void 0;
6
+ exports.FlowrRAdapter = exports.FlowrRStudioAddin = exports.FlowrPositron = exports.FlowrVsCode = exports.FlowrCodecovRef = exports.FlowrDockerRef = exports.FlowrNpmRef = exports.FlowrGithubRef = exports.FlowrWikiBaseRef = exports.RemoteFlowrFilePathBaseRef = exports.FlowrSiteBaseRef = exports.FlowrGithubBaseRef = exports.FlowrGithubGroupName = void 0;
7
7
  exports.getFilePathMd = getFilePathMd;
8
8
  exports.getFileContentFromRoot = getFileContentFromRoot;
9
9
  exports.linkFlowRSourceFile = linkFlowRSourceFile;
@@ -13,11 +13,14 @@ exports.FlowrGithubBaseRef = `https://github.com/${exports.FlowrGithubGroupName}
13
13
  exports.FlowrSiteBaseRef = `https://${exports.FlowrGithubGroupName}.github.io/flowr`;
14
14
  exports.RemoteFlowrFilePathBaseRef = `${exports.FlowrGithubBaseRef}/flowr/tree/main/`;
15
15
  exports.FlowrWikiBaseRef = `${exports.FlowrGithubBaseRef}/flowr/wiki`;
16
+ exports.FlowrGithubRef = exports.FlowrGithubBaseRef + '/flowr';
16
17
  exports.FlowrNpmRef = 'https://www.npmjs.com/package/@eagleoutice/flowr';
17
18
  exports.FlowrDockerRef = 'https://hub.docker.com/r/eagleoutice/flowr';
18
19
  exports.FlowrCodecovRef = `https://app.codecov.io/gh/${exports.FlowrGithubGroupName}/flowr`;
19
20
  exports.FlowrVsCode = 'https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr';
20
21
  exports.FlowrPositron = 'https://open-vsx.org/extension/code-inspect/vscode-flowr';
22
+ exports.FlowrRStudioAddin = `${exports.FlowrGithubBaseRef}/rstudio-addin-flowr`;
23
+ exports.FlowrRAdapter = `${exports.FlowrGithubBaseRef}/flowr-r-adapter`;
21
24
  /**
22
25
  * Returns a markdown link to the given file path relative to the project root.
23
26
  */
@@ -19,7 +19,7 @@ const flowr_analyzer_context_1 = require("../../project/context/flowr-analyzer-c
19
19
  function printNormalizedAst(ast, prefix = 'flowchart TD\n') {
20
20
  return `
21
21
  \`\`\`mermaid
22
- ${(0, ast_1.normalizedAstToMermaid)(ast, prefix)}
22
+ ${(0, ast_1.normalizedAstToMermaid)(ast, { prefix })}
23
23
  \`\`\`
24
24
  `;
25
25
  }
@@ -50,7 +50,7 @@ ${code}
50
50
  <summary style="color:gray">Mermaid Code</summary>
51
51
 
52
52
  \`\`\`
53
- ${(0, ast_1.normalizedAstToMermaid)(result.normalize.ast, prefix)}
53
+ ${(0, ast_1.normalizedAstToMermaid)(result.normalize.ast, { prefix })}
54
54
  \`\`\`
55
55
 
56
56
  </details>
@@ -64,12 +64,13 @@ ${(0, ast_1.normalizedAstToMermaid)(result.normalize.ast, prefix)}
64
64
  */
65
65
  async function verifyExpectedSubgraph(shell, code, expectedSubgraph) {
66
66
  /* we verify that we get what we want first! */
67
+ const context = (0, flowr_analyzer_context_1.contextFromInput)(code);
67
68
  const info = await (0, default_pipelines_1.createDataflowPipeline)(shell, {
68
- context: (0, flowr_analyzer_context_1.contextFromInput)(code),
69
+ context: context,
69
70
  getId: (0, decorate_1.deterministicCountingIdGenerator)(0)
70
71
  }).allRemainingSteps();
71
72
  expectedSubgraph.setIdMap(info.normalize.idMap);
72
- expectedSubgraph = (0, resolve_graph_1.resolveDataflowGraph)(expectedSubgraph);
73
+ expectedSubgraph = (0, resolve_graph_1.resolveDataflowGraph)(expectedSubgraph, context);
73
74
  const report = (0, diff_dataflow_graph_1.diffOfDataflowGraphs)({ name: 'expected', graph: expectedSubgraph }, { name: 'got', graph: info.dataflow.graph }, {
74
75
  leftIsSubgraph: true
75
76
  });
@@ -133,7 +133,7 @@ export interface FnElementInfo {
133
133
  export declare function printCodeOfElement({ program, info, dropLinesEnd, dropLinesStart, doNotAutoGobble, hideDefinedAt }: FnElementInfo, name: string): string;
134
134
  /**
135
135
  * Create a short link to a type in the documentation.
136
- * If you create a wiki, please refer to the functions provided by the {@link GeneralWikiContext}.
136
+ * If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
137
137
  * @param name - The name of the type, e.g. `MyType`, may include a container, e.g.,`MyContainer::MyType` (this works with function nestings too)
138
138
  * Use `:::` if you want to access a scoped function, but the name should be displayed without the scope
139
139
  * @param hierarchy - The hierarchy of types to search in
@@ -477,7 +477,7 @@ function printCodeOfElement({ program, info, dropLinesEnd = 0, dropLinesStart =
477
477
  const lines = code.replaceAll('\t', ' ').split(/\n/g);
478
478
  let gobble = Number.POSITIVE_INFINITY;
479
479
  for (const line of lines) {
480
- const match = line.match(/^(\s+)\S+/);
480
+ const match = line.match(/^(\s*)\S+/);
481
481
  if (match) {
482
482
  gobble = Math.min(gobble, match[1].length);
483
483
  }
@@ -523,7 +523,7 @@ function retrieveNode(name, hierarchy, fuzzy = false, type = undefined) {
523
523
  }
524
524
  /**
525
525
  * Create a short link to a type in the documentation.
526
- * If you create a wiki, please refer to the functions provided by the {@link GeneralWikiContext}.
526
+ * If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
527
527
  * @param name - The name of the type, e.g. `MyType`, may include a container, e.g.,`MyContainer::MyType` (this works with function nestings too)
528
528
  * Use `:::` if you want to access a scoped function, but the name should be displayed without the scope
529
529
  * @param hierarchy - The hierarchy of types to search in
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/blob/main/.github/ISSUE_TEMPLATE/linting-rule.yaml
5
5
  */
6
- export declare class IssueLintingRule extends DocMaker {
6
+ export declare class IssueLintingRule extends DocMaker<'.github/ISSUE_TEMPLATE/linting-rule.yaml'> {
7
7
  constructor();
8
8
  text({ ctx }: DocMakerArgs): string;
9
9
  }
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/wiki/Analyzer
5
5
  */
6
- export declare class WikiAnalyzer extends DocMaker {
6
+ export declare class WikiAnalyzer extends DocMaker<'wiki/Analyzer.md'> {
7
7
  constructor();
8
8
  text({ ctx }: DocMakerArgs): string;
9
9
  }
@@ -26,6 +26,7 @@ const flowr_analyzer_plugin_defaults_1 = require("../project/plugins/flowr-analy
26
26
  const doc_maker_1 = require("./wiki-mk/doc-maker");
27
27
  const flowr_analyzer_rmd_file_plugin_1 = require("../project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin");
28
28
  const flowr_analyzer_plugin_1 = require("../project/plugins/flowr-analyzer-plugin");
29
+ const flowr_analyzer_environment_context_1 = require("../project/context/flowr-analyzer-environment-context");
29
30
  async function analyzerQuickExample() {
30
31
  const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
31
32
  .setEngine('tree-sitter')
@@ -78,7 +79,8 @@ ${(0, doc_structure_1.collapsibleToc)({
78
79
  'Context Information': {
79
80
  'Files Context': undefined,
80
81
  'Loading Order Context': undefined,
81
- 'Dependencies Context': undefined
82
+ 'Dependencies Context': undefined,
83
+ 'Environment Context': undefined
82
84
  },
83
85
  'Caching': undefined
84
86
  })}
@@ -396,6 +398,17 @@ Probably the most important method is
396
398
  ${ctx.linkM(flowr_analyzer_dependencies_context_1.FlowrAnalyzerDependenciesContext, 'getDependency', { codeFont: true, realNameWrapper: 'i' })}
397
399
  that allows you to query for a specific dependency by name.
398
400
 
401
+ ${(0, doc_structure_1.section)('Environment Context', 3)}
402
+
403
+ Here is the structure of the ${ctx.link(flowr_analyzer_environment_context_1.FlowrAnalyzerEnvironmentContext)} that provides access to the built-in environment:
404
+
405
+ ${ctx.hierarchy(flowr_analyzer_environment_context_1.FlowrAnalyzerEnvironmentContext, { showImplSnippet: false })}
406
+
407
+ The environment context provides access to the built-in environment via
408
+ ${ctx.linkM(flowr_analyzer_environment_context_1.FlowrAnalyzerEnvironmentContext, 'makeCleanEnv', { codeFont: true, realNameWrapper: 'i' })}.
409
+ It also provides the empty built-in environment, which only contains primitives, via
410
+ ${ctx.linkM(flowr_analyzer_environment_context_1.FlowrAnalyzerEnvironmentContext, 'makeCleanEnvWithEmptyBuiltIns', { codeFont: true, realNameWrapper: 'i' })}.
411
+
399
412
  ${(0, doc_structure_1.section)('Caching', 2)}
400
413
 
401
414
  To speed up analyses, flowR provides a caching mechanism that stores intermediate results of the analysis.
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/wiki/Control-Flow-Graph
5
5
  */
6
- export declare class WikiCfg extends DocMaker {
6
+ export declare class WikiCfg extends DocMaker<'wiki/Control Flow Graph.md'> {
7
7
  constructor();
8
8
  text({ ctx, shell }: DocMakerArgs): Promise<string>;
9
9
  }
@@ -8,7 +8,7 @@ export declare function inspectContextExample(analyzer: FlowrAnalyzer): void;
8
8
  /**
9
9
  * https://github.com/flowr-analysis/flowr/wiki/Core
10
10
  */
11
- export declare class WikiCore extends DocMaker {
11
+ export declare class WikiCore extends DocMaker<'wiki/Core.md'> {
12
12
  constructor();
13
13
  text({ shell, treeSitter, ctx }: DocMakerArgs): Promise<string>;
14
14
  }
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph
5
5
  */
6
- export declare class WikiDataflowGraph extends DocMaker {
6
+ export declare class WikiDataflowGraph extends DocMaker<'wiki/Dataflow Graph.md'> {
7
7
  constructor();
8
8
  protected text({ ctx, treeSitter }: DocMakerArgs): Promise<string>;
9
9
  }
@@ -195,7 +195,7 @@ However, in general, flowR may use any fitting handler as an origin. For example
195
195
  ${(0, doc_structure_1.details)('Example: Simple Function Call (unresolved)', await (async () => {
196
196
  const code = 'foo(x,3,y=3,)';
197
197
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([8]), exposeResult: true });
198
- const callInfo = [...info.dataflow.graph.vertices(true)].find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name === 'foo');
198
+ const callInfo = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name === 'foo');
199
199
  (0, assert_1.guard)(callInfo !== undefined, () => `Could not find call vertex for ${code}`);
200
200
  const [callId, callVert] = callInfo;
201
201
  const inverseMapReferenceTypes = Object.fromEntries(Object.entries(identifier_1.ReferenceType).map(([k, v]) => [v, k]));
@@ -308,7 +308,7 @@ Consider a case in which you have a built-in function (like the assignment opera
308
308
 
309
309
  ${await (async () => {
310
310
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 2\nif(u) `<-` <- `*`\nx <- 3', { switchCodeAndGraph: true, mark: new Set([9, '9->0', '9->10']), exposeResult: true });
311
- const interestingUseOfAssignment = [...info.dataflow.graph.vertices(true)].find(([, vertex]) => vertex.id === 11);
311
+ const interestingUseOfAssignment = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.id === 11);
312
312
  (0, assert_1.guard)(interestingUseOfAssignment !== undefined, () => 'Could not find interesting assignment vertex for the code');
313
313
  const [id, interestingVertex] = interestingUseOfAssignment;
314
314
  const env = interestingVertex.environment;
@@ -333,7 +333,7 @@ Hence, trying to re-resolve the call using ${ctx.link(linker_1.getAllFunctionCal
333
333
  the following target ids: { \`${[...(0, linker_1.getAllFunctionCallTargets)(id, info.dataflow.graph)].join('`, `')}\` }.
334
334
  This way we know that the call may refer to the built-in assignment operator or to the multiplication.
335
335
  Similarly, trying to resolve the name with ${ctx.link(resolve_by_name_1.resolveByName)}\` using the environment attached to the call vertex (filtering for any reference type) returns (in a similar fashion):
336
- { \`${(0, resolve_by_name_1.resolveByName)(name, env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
336
+ { \`${(0, resolve_by_name_1.resolveByNameAnyType)(name, env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
337
337
 
338
338
  `;
339
339
  })()}
@@ -449,8 +449,7 @@ vertices of function definitions or not (e.g., \`${new graph_1.DataflowGraph(und
449
449
 
450
450
  ${(0, doc_structure_1.details)('Example: Nested Function Definitions', await (async () => {
451
451
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, 'f <- function() { g <- function() 3 }', { mark: new Set([9, 6]), exposeResult: true });
452
- const definitions = info.dataflow.graph.vertices(true)
453
- .filter(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionDefinition)
452
+ const definitions = info.dataflow.graph.verticesOfType(vertex_1.VertexType.FunctionDefinition)
454
453
  .map(([id, vertex]) => `| \`${id}\` | { \`${[...vertex.subflow.graph].join('`, `')}\` } |`)
455
454
  .toArray();
456
455
  return `
@@ -740,7 +739,7 @@ class WikiDataflowGraph extends doc_maker_1.DocMaker {
740
739
  return `
741
740
  This page briefly summarizes flowR's dataflow graph, represented by the ${ctx.link(graph_1.DataflowGraph)} class within the code.
742
741
  In case you want to manually build such a graph (e.g., for testing), you can use the ${ctx.link(dataflowgraph_builder_1.DataflowGraphBuilder)}.
743
- If you are interested in which features we support and which features are still to be worked on, please refer to our [capabilities](${doc_files_1.FlowrWikiBaseRef}/Capabilities) page.
742
+ If you are interested in which features we support and which features are still to be worked on, please refer to our ${ctx.linkPage('wiki/Capabilities')} page.
744
743
  In summary, we discuss the following topics:
745
744
 
746
745
  - [Vertices](#vertices)
@@ -759,12 +758,12 @@ wiki page if you are unsure.
759
758
 
760
759
  > [!TIP]
761
760
  > If you want to investigate the dataflow graph,
762
- > you can either use the [Visual Studio Code extension](${doc_files_1.FlowrGithubBaseRef}/vscode-flowr) or the ${(0, doc_cli_option_1.getReplCommand)('dataflow*')}
763
- > command in the REPL (see the [Interface wiki page](${doc_files_1.FlowrWikiBaseRef}/Interface) for more information).
764
- > There is also a simplified perspective available with ${(0, doc_cli_option_1.getReplCommand)('dataflowsimple*')} that does not show everything but is easier to read.
761
+ > you can either use the [Visual Studio Code extension](${doc_files_1.FlowrVsCode}) or the ${ctx.replCmd('dataflow*')}
762
+ > command in the REPL (see the ${ctx.linkPage('wiki/Interface', 'Interface wiki page')} for more information).
763
+ > There is also a simplified perspective available with ${ctx.replCmd('dataflowsimple*')} that does not show everything but is easier to read.
765
764
  > When using _flowR_ as a library, you may use the functions in ${(0, doc_files_1.getFilePathMd)('../util/mermaid/dfg.ts')}.
766
765
  >
767
- > If you receive a dataflow graph in its serialized form (e.g., by talking to a [_flowR_ server](${doc_files_1.FlowrWikiBaseRef}/Interface)), you can use ${ctx.link(`${graph_1.DataflowGraph.name}::${graph_1.DataflowGraph.fromJson.name}`, { realNameWrapper: 'i', codeFont: true })} to retrieve the graph from the JSON representation.
766
+ > If you receive a dataflow graph in its serialized form (e.g., by talking to a [_flowR_ server](${doc_files_1.FlowrWikiBaseRef}/Interface)), you can use ${ctx.linkM(graph_1.DataflowGraph, 'fromJson', { realNameWrapper: 'i', codeFont: true })} to retrieve the graph from the JSON representation.
768
767
  >
769
768
  > Also, check out the [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-df-diff](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-df-diff) repository for a complete example project creating and comparing dataflow graphs.
770
769
 
@@ -774,7 +773,7 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'x <- 3\ny <- x + 1\ny')}
774
773
  The above dataflow graph showcases the general gist. We define a dataflow graph as a directed graph G = (V, E), differentiating between ${(0, doc_data_dfg_util_1.getAllVertices)().length} types of vertices V and
775
774
  ${(0, doc_data_dfg_util_1.getAllEdges)().length} types of edges E allowing each vertex to have a single, and each edge to have multiple distinct types.
776
775
  Additionally, every node may have links to its [control dependencies](#control-dependencies) (which you may view as a ${(0, text_1.nth)((0, doc_data_dfg_util_1.getAllEdges)().length + 1)} edge type,
777
- although they are explicitly no data dependency and relate to the [Control Flow Graph](${doc_files_1.FlowrWikiBaseRef}/Control%20Flow%20Graph)).
776
+ although they are explicitly no data dependency and relate to the ${ctx.linkPage('wiki/Control Flow Graph')}.
778
777
 
779
778
  <details open>
780
779
 
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/wiki/Engines
5
5
  */
6
- export declare class WikiEngine extends DocMaker {
6
+ export declare class WikiEngine extends DocMaker<'wiki/Engines.md'> {
7
7
  constructor();
8
8
  text({ ctx }: DocMakerArgs): string;
9
9
  }
@@ -5,7 +5,6 @@ const shell_1 = require("../r-bridge/shell");
5
5
  const shell_executor_1 = require("../r-bridge/shell-executor");
6
6
  const tree_sitter_executor_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor");
7
7
  const doc_files_1 = require("./doc-util/doc-files");
8
- const doc_cli_option_1 = require("./doc-util/doc-cli-option");
9
8
  const doc_structure_1 = require("./doc-util/doc-structure");
10
9
  const doc_maker_1 = require("./wiki-mk/doc-maker");
11
10
  /**
@@ -30,13 +29,13 @@ we provide the concept of engines.
30
29
  Engines can be loaded with [flowR's configuration file](${doc_files_1.FlowrWikiBaseRef}/Interface#configuring-flowr). Additionally, they
31
30
  are exposed with some command line options (e.g., when using the docker image of flowR):
32
31
 
33
- - ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'engine.r-shell.disabled', false)} to disable the ${ctx.link(shell_1.RShell)} engine
34
- - ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'engine.r-shell.r-path', false)} (which is the canonical version of ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'r-path')})
35
- - ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'engine.tree-sitter.disabled', false)} to disable the ${ctx.link(tree_sitter_executor_1.TreeSitterExecutor)} engine
36
- - ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'engine.tree-sitter.lax', false)} to use lax parsing with tree-sitter
37
- - ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'engine.tree-sitter.wasm-path', false)} pass the path to the wasm of the r grammar of tree-sitter (see [below](#tree-sitter))
38
- - ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'engine.tree-sitter.tree-sitter-wasm-path', false)} pass the path to the wasm of tree-sitter (see [below](#tree-sitter))
39
- - ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'default-engine', false)} to set the default engine to use
32
+ - ${ctx.cliOption('flowr', 'engine.r-shell.disabled', false)} to disable the ${ctx.link(shell_1.RShell)} engine
33
+ - ${ctx.cliOption('flowr', 'engine.r-shell.r-path', false)} (which is the canonical version of ${ctx.cliOption('flowr', 'r-path')})
34
+ - ${ctx.cliOption('flowr', 'engine.tree-sitter.disabled', false)} to disable the ${ctx.link(tree_sitter_executor_1.TreeSitterExecutor)} engine
35
+ - ${ctx.cliOption('flowr', 'engine.tree-sitter.lax', false)} to use lax parsing with tree-sitter
36
+ - ${ctx.cliOption('flowr', 'engine.tree-sitter.wasm-path', false)} pass the path to the wasm of the r grammar of tree-sitter (see [below](#tree-sitter))
37
+ - ${ctx.cliOption('flowr', 'engine.tree-sitter.tree-sitter-wasm-path', false)} pass the path to the wasm of tree-sitter (see [below](#tree-sitter))
38
+ - ${ctx.cliOption('flowr', 'default-engine', false)} to set the default engine to use
40
39
 
41
40
  <a id="tree-sitter"></a>
42
41
  ## Dealing with the Tree-Sitter Engine
@@ -47,8 +46,8 @@ ${(0, doc_structure_1.block)({
47
46
  })}
48
47
 
49
48
  In general, there is no need for you to pass custom paths using either
50
- ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'engine.tree-sitter.wasm-path', false)} or
51
- ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'engine.tree-sitter.tree-sitter-wasm-path', false)}.
49
+ ${ctx.cliOption('flowr', 'engine.tree-sitter.wasm-path', false)} or
50
+ ${ctx.cliOption('flowr', 'engine.tree-sitter.tree-sitter-wasm-path', false)}.
52
51
  However, you may want to experiment with the R grammar or provide a newer
53
52
  one in case that of _flowR_ is outdated.
54
53
 
@@ -2,7 +2,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
2
2
  /**
3
3
  * https://github.com/flowr-analysis/flowr/wiki/FAQ
4
4
  */
5
- export declare class WikiFaq extends DocMaker {
5
+ export declare class WikiFaq extends DocMaker<'wiki/FAQ.md'> {
6
6
  constructor();
7
7
  text(): string;
8
8
  }
@@ -14,7 +14,6 @@ class WikiFaq extends doc_maker_1.DocMaker {
14
14
  const faqs = (0, faqs_1.registerFaqs)();
15
15
  return `
16
16
  ${faqs.toMarkdown()}
17
-
18
17
  `.trim();
19
18
  }
20
19
  }
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/wiki/Interface
5
5
  */
6
- export declare class WikiInterface extends DocMaker {
6
+ export declare class WikiInterface extends DocMaker<'wiki/Interface.md'> {
7
7
  constructor();
8
8
  protected text({ shell, ctx, treeSitter }: DocMakerArgs): Promise<string>;
9
9
  }
@@ -94,11 +94,11 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
94
94
 
95
95
  `;
96
96
  }
97
- async function explainRepl(parser) {
97
+ async function explainRepl(parser, ctx) {
98
98
  return `
99
99
  > [!NOTE]
100
- > To execute arbitrary R commands with a repl request, _flowR_ has to be started explicitly with ${(0, doc_cli_option_1.getCliLongOptionOf)('flowr', 'r-session-access')}.
101
- > Please be aware that this introduces a security risk and note that this relies on the [\`r-shell\` engine](${doc_files_1.FlowrWikiBaseRef}/Engines).
100
+ > To execute arbitrary R commands with a repl request, _flowR_ has to be started explicitly with ${ctx.cliOption('flowr', 'r-session-access')}.
101
+ > Please be aware that this introduces a security risk and note that this relies on the ${ctx.linkPage('wiki/Engines', '`r-shell` engine')} .
102
102
 
103
103
  Although primarily meant for users to explore,
104
104
  there is nothing which forbids simply calling _flowR_ as a subprocess to use standard-in, -output, and -error
@@ -108,8 +108,8 @@ with the [REPL Request](#message-request-repl-execution) message).
108
108
  The read-eval-print loop&nbsp;(REPL) works relatively simple.
109
109
  You can submit an expression (using <kbd>Enter</kbd>),
110
110
  which is interpreted as an R&nbsp;expression by default but interpreted as a *command* if it starts with a colon (\`:\`).
111
- The best command to get started with the REPL is ${(0, doc_cli_option_1.getReplCommand)('help')}.
112
- Besides, you can leave the REPL either with the command ${(0, doc_cli_option_1.getReplCommand)('quit')} or by pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> twice.
111
+ The best command to get started with the REPL is ${ctx.replCmd('help')}.
112
+ Besides, you can leave the REPL either with the command ${ctx.replCmd('quit')} or by pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> twice.
113
113
  When writing a *command*, you may press <kbd>Tab</kbd> to get a list of completions, if available.
114
114
  Multiple commands can be entered in a single line by separating them with a semicolon (\`;\`), e.g. \`:parse "x<-2"; :df*\`.
115
115
  If a command is given without R code, the REPL will re-use R code given in a previous command.
@@ -142,20 +142,20 @@ the REPL will re-use previously obtained information and not re-parse the code a
142
142
  ### Example: Retrieving the Dataflow Graph
143
143
 
144
144
  To retrieve a URL to the [mermaid](https://mermaid.js.org/) diagram of the dataflow of a given expression,
145
- use ${(0, doc_cli_option_1.getReplCommand)('dataflow*')} (or ${(0, doc_cli_option_1.getReplCommand)('dataflow')} to get the mermaid code in the cli):
145
+ use ${ctx.replCmd('dataflow*')} (or ${ctx.replCmd('dataflow')} to get the mermaid code in the cli):
146
146
 
147
147
  ${await (0, doc_repl_1.documentReplSession)(parser, [{
148
148
  command: ':dataflow* y <- 1 + x',
149
149
  description: `Retrieve the dataflow graph of the expression \`y <- 1 + x\`. It looks like this:\n${await (0, doc_dfg_1.printDfGraphForCode)(parser, 'y <- 1 + x')}`
150
150
  }])}
151
151
 
152
- For the slicing with ${(0, doc_cli_option_1.getReplCommand)('slicer')}, you have access to the same [magic comments](#slice-magic-comments) as with the [slice request](#message-request-slice).
152
+ For the slicing with ${ctx.replCmd('slicer')}, you have access to the same [magic comments](#slice-magic-comments) as with the [slice request](#message-request-slice).
153
153
 
154
154
  ### Example: Interfacing with the File System
155
155
 
156
- Many commands that allow for an R-expression (like ${(0, doc_cli_option_1.getReplCommand)('dataflow*')}) allow for a file as well
156
+ Many commands that allow for an R-expression (like ${ctx.replCmd('dataflow*')}) allow for a file as well
157
157
  if the argument starts with \`${retriever_1.fileProtocol}\`.
158
- If you are working from the root directory of the _flowR_ repository, the following gives you the parsed AST of the example file using the ${(0, doc_cli_option_1.getReplCommand)('parse')} command:
158
+ If you are working from the root directory of the _flowR_ repository, the following gives you the parsed AST of the example file using the ${ctx.replCmd('parse')} command:
159
159
 
160
160
  ${await (0, doc_repl_1.documentReplSession)(parser, [{
161
161
  command: `:parse ${retriever_1.fileProtocol}test/testfiles/example.R`,
@@ -232,9 +232,9 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
232
232
  }
233
233
  },
234
234
  abstractInterpretation: {
235
+ wideningThreshold: 4,
235
236
  dataFrame: {
236
237
  maxColNames: 20,
237
- wideningThreshold: 4,
238
238
  readLoadedData: {
239
239
  readExternalFiles: true,
240
240
  maxReadLines: 1_000_000
@@ -436,8 +436,7 @@ class WikiInterface extends doc_maker_1.DocMaker {
436
436
  }
437
437
  async text({ shell, ctx, treeSitter }) {
438
438
  return `
439
- Although far from being as detailed as the in-depth explanation of
440
- [_flowR_](${doc_files_1.FlowrWikiBaseRef}/Core),
439
+ Although far from being as detailed as the in-depth explanation of ${ctx.linkPage('wiki/Core', '_flowR_')},
441
440
  this wiki page explains how to interface with _flowR_ in more detail.
442
441
  In general, command line arguments and other options provide short descriptions on hover over.
443
442
 
@@ -454,7 +453,7 @@ ${await explainServer(shell)}
454
453
  <a id='using-the-repl'></a>
455
454
  ## 💻 Using the REPL
456
455
 
457
- ${await explainRepl(treeSitter)}
456
+ ${await explainRepl(treeSitter, ctx)}
458
457
 
459
458
  <a id='configuring-flowr'></a>
460
459
  ## ⚙️ Configuring FlowR
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/wiki/Linter
5
5
  */
6
- export declare class WikiLinter extends DocMaker {
6
+ export declare class WikiLinter extends DocMaker<'wiki/Linter.md'> {
7
7
  constructor();
8
8
  protected text({ treeSitter }: DocMakerArgs): Promise<string>;
9
9
  }
@@ -144,7 +144,7 @@ df[6, "value"]
144
144
  const certaintyText = `\`${(0, html_hover_over_1.textWithTooltip)(rule.info.certainty, certaintyDoc)}\``;
145
145
  if (format === 'short') {
146
146
  ruleExplanations.set(name, () => Promise.resolve(`
147
- **[${rule.info.name}](${doc_files_1.FlowrWikiBaseRef}/${getPageNameForLintingRule(name)}):** ${rule.info.description} [see ${(0, doc_types_1.shortLinkFile)(ruleType, types)}]\\
147
+ **[${rule.info.name}](${doc_files_1.FlowrWikiBaseRef}/${encodeURIComponent(getPageNameForLintingRule(name))}):** ${rule.info.description} [see ${(0, doc_types_1.shortLinkFile)(ruleType, types)}]\\
148
148
  ${tags}
149
149
 
150
150
  `.trim()));
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
3
3
  /**
4
4
  * https://github.com/flowr-analysis/flowr/wiki/Linting-and-Testing
5
5
  */
6
- export declare class WikiLintingAndTesting extends DocMaker {
6
+ export declare class WikiLintingAndTesting extends DocMaker<'wiki/Linting and Testing.md'> {
7
7
  constructor();
8
8
  protected text({ ctx }: DocMakerArgs): string;
9
9
  }