@eagleoutice/flowr 2.11.1 → 2.12.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 +193 -263
  2. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -1
  3. package/abstract-interpretation/domains/set-range-domain.js +1 -1
  4. package/abstract-interpretation/domains/set-upper-bound-domain.js +6 -2
  5. package/benchmark/slicer.d.ts +1 -1
  6. package/benchmark/slicer.js +3 -1
  7. package/benchmark/summarizer/second-phase/graph.js +5 -0
  8. package/cli/common/options.d.ts +8 -0
  9. package/cli/common/options.js +2 -0
  10. package/cli/common/scripts-info.d.ts +8 -0
  11. package/cli/repl/commands/repl-commands.d.ts +1 -0
  12. package/cli/repl/commands/repl-commands.js +66 -15
  13. package/cli/repl/commands/repl-dataflow.js +48 -4
  14. package/cli/repl/commands/repl-main.d.ts +2 -0
  15. package/cli/repl/commands/repl-main.js +5 -0
  16. package/cli/repl/commands/repl-query.d.ts +4 -1
  17. package/cli/repl/commands/repl-query.js +72 -22
  18. package/cli/repl/commands/repl-signature.d.ts +7 -0
  19. package/cli/repl/commands/repl-signature.js +119 -0
  20. package/cli/repl/core.d.ts +8 -1
  21. package/cli/repl/core.js +46 -6
  22. package/cli/repl/ghost-hint.d.ts +37 -0
  23. package/cli/repl/ghost-hint.js +72 -0
  24. package/cli/repl/parser/slice-query-parser.d.ts +11 -1
  25. package/cli/repl/parser/slice-query-parser.js +45 -16
  26. package/cli/repl/print-version.d.ts +2 -4
  27. package/cli/repl/print-version.js +41 -23
  28. package/cli/repl/server/connection.js +19 -17
  29. package/cli/slicer-app.d.ts +2 -0
  30. package/cli/slicer-app.js +3 -3
  31. package/cli/wiki.d.ts +2 -2
  32. package/cli/wiki.js +2 -2
  33. package/config.d.ts +63 -2
  34. package/config.js +64 -8
  35. package/control-flow/cfg-dead-code.js +0 -1
  36. package/control-flow/control-flow-graph.js +6 -6
  37. package/control-flow/diff-cfg.js +2 -2
  38. package/control-flow/semantic-cfg-guided-visitor.js +2 -0
  39. package/core/print/slice-diff-ansi.js +8 -8
  40. package/core/steps/all/core/20-dataflow.d.ts +2 -2
  41. package/core/steps/all/static-slicing/00-slice.d.ts +5 -0
  42. package/core/steps/all/static-slicing/00-slice.js +1 -1
  43. package/core/steps/all/static-slicing/10-reconstruct.d.ts +7 -0
  44. package/core/steps/all/static-slicing/10-reconstruct.js +6 -2
  45. package/core/steps/pipeline/default-pipelines.d.ts +20 -16
  46. package/data/r-base-packages.generated.d.ts +44 -0
  47. package/data/r-base-packages.generated.js +32 -0
  48. package/data/r-base-primitives.generated.d.ts +1 -0
  49. package/data/r-base-primitives.generated.js +15 -0
  50. package/data/sigdb/sigdb.remote.json +112 -0
  51. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  52. package/dataflow/environments/built-in-proc-name.js +4 -0
  53. package/dataflow/environments/built-in.d.ts +14 -4
  54. package/dataflow/environments/built-in.js +13 -2
  55. package/dataflow/environments/data-masking-functions.d.ts +12 -0
  56. package/dataflow/environments/data-masking-functions.js +46 -0
  57. package/dataflow/environments/default-builtin-config.d.ts +72 -19
  58. package/dataflow/environments/default-builtin-config.js +48 -14
  59. package/dataflow/environments/diff.js +1 -1
  60. package/dataflow/environments/environment.js +1 -2
  61. package/dataflow/environments/identifier.d.ts +11 -4
  62. package/dataflow/environments/identifier.js +28 -10
  63. package/dataflow/environments/resolve-by-name.js +16 -2
  64. package/dataflow/extractor.js +6 -3
  65. package/dataflow/graph/call-graph.d.ts +2 -2
  66. package/dataflow/graph/df-helper.d.ts +4 -4
  67. package/dataflow/graph/diff-dataflow-graph.js +2 -2
  68. package/dataflow/graph/edge.d.ts +3 -3
  69. package/dataflow/graph/edge.js +3 -3
  70. package/dataflow/graph/graph-helper.d.ts +2 -2
  71. package/dataflow/internal/linker.js +1 -1
  72. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +7 -0
  73. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +20 -0
  74. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +1 -0
  75. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -49
  76. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -1
  77. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +7 -1
  78. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +19 -0
  79. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +111 -6
  80. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +13 -0
  81. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -3
  82. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +9 -0
  83. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +19 -0
  84. package/dataflow/internal/process/functions/call/built-in/built-in-with.js +12 -4
  85. package/dataflow/internal/process/functions/call/common.js +8 -1
  86. package/dataflow/internal/process/functions/call/default-call-handling.js +6 -0
  87. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +17 -0
  88. package/dataflow/internal/process/functions/call/known-call-handling.js +32 -0
  89. package/dataflow/internal/process/functions/call/named-call-handling.js +29 -7
  90. package/dataflow/internal/process/functions/process-argument.js +12 -1
  91. package/dataflow/internal/process/process-named-call.d.ts +18 -1
  92. package/dataflow/internal/process/process-named-call.js +94 -0
  93. package/dataflow/processor.d.ts +18 -0
  94. package/documentation/data/faq/faqs.js +5 -1
  95. package/documentation/doc-capabilities.js +1 -1
  96. package/documentation/doc-util/doc-cli-option.d.ts +10 -0
  97. package/documentation/doc-util/doc-cli-option.js +23 -0
  98. package/documentation/doc-util/doc-dfg.js +2 -1
  99. package/documentation/doc-util/doc-query.d.ts +9 -3
  100. package/documentation/doc-util/doc-query.js +9 -4
  101. package/documentation/wiki-dataflow-graph.js +8 -5
  102. package/documentation/wiki-interface.js +3 -1
  103. package/documentation/wiki-linter.js +1 -1
  104. package/documentation/wiki-linting-and-testing.js +4 -1
  105. package/documentation/wiki-mk/doc-context.d.ts +14 -0
  106. package/documentation/wiki-mk/doc-context.js +3 -0
  107. package/documentation/wiki-mk/doc-maker.js +3 -1
  108. package/documentation/wiki-query.js +19 -1
  109. package/documentation/wiki-setup.js +10 -7
  110. package/documentation/wiki-signature-database.d.ts +16 -0
  111. package/documentation/wiki-signature-database.js +293 -0
  112. package/linter/linter-format.d.ts +7 -0
  113. package/linter/linter-rules.d.ts +10 -9
  114. package/linter/rules/naming-convention.d.ts +1 -0
  115. package/linter/rules/naming-convention.js +2 -0
  116. package/linter/rules/no-leaked-credentials.js +1 -2
  117. package/linter/rules/roxygen-arguments.js +18 -5
  118. package/linter/rules/stop-with-call-arg.js +2 -2
  119. package/linter/rules/undefined-symbol-util.d.ts +36 -0
  120. package/linter/rules/undefined-symbol-util.js +149 -0
  121. package/linter/rules/undefined-symbol.d.ts +58 -17
  122. package/linter/rules/undefined-symbol.js +143 -33
  123. package/linter/rules/unused-definition.d.ts +8 -1
  124. package/linter/rules/unused-definition.js +126 -1
  125. package/package.json +22 -10
  126. package/project/context/abstract-flowr-analyzer-context.js +7 -1
  127. package/project/context/flowr-analyzer-context.d.ts +8 -0
  128. package/project/context/flowr-analyzer-context.js +10 -0
  129. package/project/context/flowr-analyzer-dependencies-context.d.ts +28 -4
  130. package/project/context/flowr-analyzer-dependencies-context.js +51 -2
  131. package/project/context/flowr-analyzer-files-context.d.ts +1 -0
  132. package/project/context/flowr-analyzer-files-context.js +2 -1
  133. package/project/context/flowr-analyzer-functions-context.js +1 -1
  134. package/project/context/flowr-file.d.ts +5 -0
  135. package/project/context/flowr-file.js +5 -0
  136. package/project/flowr-analyzer-builder.js +12 -2
  137. package/project/plugins/file-plugins/files/flowr-description-file.js +6 -3
  138. package/project/plugins/file-plugins/files/flowr-namespace-file.js +9 -3
  139. package/project/plugins/file-plugins/files/flowr-news-file.js +1 -3
  140. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +26 -0
  141. package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +39 -0
  142. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
  143. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -2
  144. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -0
  145. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +18 -2
  146. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +19 -0
  147. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +120 -0
  148. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +518 -0
  149. package/project/plugins/package-version-plugins/package.d.ts +5 -3
  150. package/project/plugins/package-version-plugins/package.js +27 -25
  151. package/project/plugins/plugin-registry.d.ts +3 -2
  152. package/project/plugins/plugin-registry.js +4 -2
  153. package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +7 -2
  154. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +3 -1
  155. package/project/sigdb/build.d.ts +131 -0
  156. package/project/sigdb/build.js +628 -0
  157. package/project/sigdb/codec.d.ts +51 -0
  158. package/project/sigdb/codec.js +122 -0
  159. package/project/sigdb/decode.d.ts +58 -0
  160. package/project/sigdb/decode.js +129 -0
  161. package/project/sigdb/decompress.d.ts +44 -0
  162. package/project/sigdb/decompress.js +176 -0
  163. package/project/sigdb/hash.d.ts +9 -0
  164. package/project/sigdb/hash.js +54 -0
  165. package/project/sigdb/index-format.d.ts +40 -0
  166. package/project/sigdb/index-format.js +28 -0
  167. package/project/sigdb/manifest.d.ts +68 -0
  168. package/project/sigdb/manifest.js +146 -0
  169. package/project/sigdb/reader.d.ts +250 -0
  170. package/project/sigdb/reader.js +692 -0
  171. package/project/sigdb/schema.d.ts +196 -0
  172. package/project/sigdb/schema.js +33 -0
  173. package/project/sigdb/sigdb-download.d.ts +65 -0
  174. package/project/sigdb/sigdb-download.js +237 -0
  175. package/project/sigdb/signature-match.d.ts +26 -0
  176. package/project/sigdb/signature-match.js +40 -0
  177. package/project/sigdb/version.d.ts +20 -0
  178. package/project/sigdb/version.js +55 -0
  179. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -3
  180. package/queries/catalog/config-query/config-query-format.d.ts +3 -1
  181. package/queries/catalog/config-query/config-query-format.js +68 -9
  182. package/queries/catalog/dataflow-query/dataflow-query-format.js +11 -1
  183. package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
  184. package/queries/catalog/linter-query/linter-query-executor.d.ts +2 -0
  185. package/queries/catalog/linter-query/linter-query-executor.js +6 -1
  186. package/queries/catalog/linter-query/linter-query-format.d.ts +2 -1
  187. package/queries/catalog/linter-query/linter-query-format.js +40 -8
  188. package/queries/catalog/project-query/project-query-executor.d.ts +15 -0
  189. package/queries/catalog/project-query/project-query-executor.js +96 -4
  190. package/queries/catalog/project-query/project-query-format.d.ts +44 -0
  191. package/queries/catalog/project-query/project-query-format.js +33 -2
  192. package/queries/catalog/signature-query/signature-query-executor.d.ts +29 -0
  193. package/queries/catalog/signature-query/signature-query-executor.js +461 -0
  194. package/queries/catalog/signature-query/signature-query-format.d.ts +138 -0
  195. package/queries/catalog/signature-query/signature-query-format.js +76 -0
  196. package/queries/catalog/signature-query/signature-query-render.d.ts +15 -0
  197. package/queries/catalog/signature-query/signature-query-render.js +155 -0
  198. package/queries/catalog/static-slice-query/static-slice-query-executor.js +9 -3
  199. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +10 -0
  200. package/queries/catalog/static-slice-query/static-slice-query-format.js +19 -1
  201. package/queries/query-print.js +5 -0
  202. package/queries/query.d.ts +10 -1
  203. package/queries/query.js +5 -2
  204. package/r-bridge/init.js +5 -1
  205. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +10 -0
  206. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +55 -0
  207. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +16 -0
  208. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +27 -0
  209. package/r-bridge/lang-4.x/ast/parser/json/format.js +89 -2
  210. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -4
  211. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +2 -1
  212. package/r-bridge/parser.d.ts +2 -0
  213. package/r-bridge/retriever.js +4 -1
  214. package/r-bridge/roxygen2/documentation-provider.js +2 -1
  215. package/r-bridge/shell.d.ts +5 -0
  216. package/r-bridge/shell.js +17 -1
  217. package/reconstruct/inline/source-inline-map.d.ts +48 -0
  218. package/reconstruct/inline/source-inline-map.js +94 -0
  219. package/reconstruct/reconstruct.d.ts +19 -2
  220. package/reconstruct/reconstruct.js +79 -16
  221. package/search/search-executor/search-generators.js +5 -22
  222. package/search/search-executor/search-transformer.js +10 -6
  223. package/slicing/criterion/parse.d.ts +22 -4
  224. package/slicing/criterion/parse.js +125 -18
  225. package/slicing/static/slice-call.d.ts +24 -1
  226. package/slicing/static/slice-call.js +90 -0
  227. package/slicing/static/static-slicer.d.ts +7 -0
  228. package/slicing/static/static-slicer.js +38 -3
  229. package/util/collections/arrays.d.ts +4 -5
  230. package/util/collections/arrays.js +7 -18
  231. package/util/hash.d.ts +14 -0
  232. package/util/hash.js +31 -0
  233. package/util/mermaid/dfg.d.ts +7 -2
  234. package/util/mermaid/dfg.js +53 -13
  235. package/util/r-base-packages.d.ts +19 -0
  236. package/util/r-base-packages.js +72 -0
  237. package/util/r-license.js +2 -10
  238. package/util/r-version.d.ts +45 -15
  239. package/util/r-version.js +97 -36
  240. package/util/range.d.ts +15 -0
  241. package/util/range.js +39 -0
  242. package/util/schema.d.ts +10 -0
  243. package/util/schema.js +22 -0
  244. package/util/text/ansi.d.ts +3 -0
  245. package/util/text/ansi.js +10 -0
  246. package/util/text/args.js +1 -2
  247. package/util/version.js +28 -8
  248. package/data/pkgdb/pkgdb-latest.json.br +0 -0
  249. package/data/pkgdb/pkgdb-tiny.json.br +0 -0
  250. package/documentation/wiki-package-database.d.ts +0 -9
  251. package/documentation/wiki-package-database.js +0 -63
  252. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +0 -63
  253. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +0 -176
  254. package/project/plugins/package-version-plugins/pkgdb.d.ts +0 -133
  255. package/project/plugins/package-version-plugins/pkgdb.js +0 -370
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.processAsNamedCall = processAsNamedCall;
4
+ exports.processChainedCall = processChainedCall;
4
5
  const named_call_handling_1 = require("./functions/call/named-call-handling");
5
6
  const make_argument_1 = require("./functions/call/argument/make-argument");
7
+ const process_argument_1 = require("./functions/process-argument");
6
8
  const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
9
+ const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
10
+ const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
11
+ const assert_1 = require("../../../util/assert");
7
12
  /**
8
13
  * Helper function for {@link processNamedCall} using the given `functionName` as the name of the function.
9
14
  */
@@ -16,4 +21,93 @@ function processAsNamedCall({ info, lexeme, location }, data, name, args) {
16
21
  location,
17
22
  }, (0, make_argument_1.wrapArgumentsUnnamed)(args, data.completeAst.idMap), info.id, data);
18
23
  }
24
+ function isBinaryOpOrPipe(node) {
25
+ return node.type === type_1.RType.BinaryOp || node.type === type_1.RType.Pipe;
26
+ }
27
+ function isInfixSpecialCall(node) {
28
+ return node.type === type_1.RType.FunctionCall && node.named === true && node.infixSpecial === true && node.arguments.length === 2;
29
+ }
30
+ function isChainNode(node) {
31
+ return node !== undefined && (isBinaryOpOrPipe(node) || isInfixSpecialCall(node));
32
+ }
33
+ /**
34
+ * The raw (unwrapped) left operand of a chain node, used to detect whether the chain continues.
35
+ * <p>
36
+ * Unlike {@link RType#BinaryOp}, whose `lhs` is the raw operand, both parser backends always pre-wrap a
37
+ * {@link RType#Pipe}'s `lhs` (and an infix-special {@link RType#FunctionCall}'s first argument) as an
38
+ * {@link RArgument}, so those need unwrapping via `.value` first.
39
+ */
40
+ function chainLhsRaw(node) {
41
+ if (node.type === type_1.RType.FunctionCall) {
42
+ const arg = node.arguments[0];
43
+ return arg === r_function_call_1.EmptyArgument ? undefined : arg.value;
44
+ }
45
+ return r_argument_1.RArgument.is(node.lhs) ? node.lhs.value : node.lhs;
46
+ }
47
+ /** The left operand of a chain node, wrapped as the {@link RArgument} that {@link processAllArguments} would process it as. */
48
+ function chainLhsArgument(node, idMap) {
49
+ if (node.type === type_1.RType.FunctionCall) {
50
+ const arg = node.arguments[0];
51
+ (0, assert_1.guard)(arg !== r_function_call_1.EmptyArgument, 'an infix-special call always has a non-empty first argument');
52
+ return arg;
53
+ }
54
+ if (r_argument_1.RArgument.is(node.lhs)) {
55
+ return node.lhs;
56
+ }
57
+ const wrapped = (0, make_argument_1.toUnnamedArgument)(node.lhs, idMap);
58
+ (0, assert_1.guard)(wrapped !== r_function_call_1.EmptyArgument, 'the lhs of a binary operator is never empty');
59
+ return wrapped;
60
+ }
61
+ /**
62
+ * Processes a single chain node (see {@link ChainNode}), recursing normally into its children. A caller folding
63
+ * a whole chain (see {@link processChainedCall}) may pass an already-processed left operand via
64
+ * `data.precomputedFirstArg` (keyed by `node.info.id`) to avoid recursing into it again.
65
+ */
66
+ function processSingleChainNode(node, data) {
67
+ if (node.type === type_1.RType.FunctionCall) {
68
+ return (0, named_call_handling_1.processNamedCall)(node.functionName, node.arguments, node.info.id, data);
69
+ }
70
+ const { info, lexeme, location, lhs, rhs } = node;
71
+ return (0, named_call_handling_1.processNamedCall)({
72
+ type: type_1.RType.Symbol,
73
+ info,
74
+ content: node.type === type_1.RType.Pipe ? lexeme : node.operator,
75
+ lexeme,
76
+ location,
77
+ }, (0, make_argument_1.wrapArgumentsUnnamed)([lhs, rhs], data.completeAst.idMap), info.id, data);
78
+ }
79
+ /**
80
+ * Processes a {@link ChainNode}: {@link RType#BinaryOp}, {@link RType#Pipe}, and magrittr-style `%op%` calls
81
+ * (infix-special {@link RType#FunctionCall}s) all nest on their left operand, so a long `a + b + c + ...` or
82
+ * `a %>% f() %>% f() %>% ...` chain buries it arbitrarily deep.
83
+ * This walks the left spine of chain nodes with an explicit loop (bounded stack usage regardless of
84
+ * chain length), processes the innermost (leftmost) node normally, and then folds outward: each level's left
85
+ * operand is wrapped via {@link processFunctionArgument}.
86
+ */
87
+ function processChainedCall(node, data) {
88
+ if (!isChainNode(chainLhsRaw(node))) {
89
+ return processSingleChainNode(node, data);
90
+ }
91
+ const spine = [node];
92
+ let cur = chainLhsRaw(node);
93
+ while (true) {
94
+ spine.push(cur);
95
+ const next = chainLhsRaw(cur);
96
+ if (!isChainNode(next)) {
97
+ break;
98
+ }
99
+ cur = next;
100
+ }
101
+ // process the innermost (leftmost) node normally, then fold outward through the rest of the spine
102
+ let result = processSingleChainNode(spine[spine.length - 1], data);
103
+ for (let i = spine.length - 2; i >= 0; i--) {
104
+ const level = spine[i];
105
+ const lhsRaw = chainLhsRaw(level);
106
+ (0, assert_1.guard)(lhsRaw !== undefined, 'a chain node always has a left operand');
107
+ const wrappedLhs = chainLhsArgument(level, data.completeAst.idMap);
108
+ const lhsInfo = (0, process_argument_1.processFunctionArgument)(wrappedLhs, { ...data, precomputedValue: { nodeId: lhsRaw.info.id, info: result } });
109
+ result = processSingleChainNode(level, { ...data, precomputedFirstArg: { rootId: level.info.id, info: lhsInfo } });
110
+ }
111
+ return result;
112
+ }
19
113
  //# sourceMappingURL=process-named-call.js.map
@@ -41,6 +41,24 @@ export interface DataflowProcessorInformation<OtherInfo> {
41
41
  * so its vertex needs no environment snapshot (it would be discarded by markAsOnlyBuiltIn anyway).
42
42
  */
43
43
  readonly builtInNoEnv?: NodeId;
44
+ /**
45
+ * Escape hatch for hot recursive paths.
46
+ * When set and its `rootId` matches the function call currently being processed by {@link processAllArguments},
47
+ * its `info` is used as the already-processed first argument instead of processing that argument again.
48
+ */
49
+ readonly precomputedFirstArg?: {
50
+ readonly rootId: NodeId;
51
+ readonly info: DataflowInformation;
52
+ };
53
+ /**
54
+ * Companion to {@link precomputedFirstArg}: when set and its `nodeId` matches the node
55
+ * {@link processFunctionArgument} is about to process as an argument's value, its `info` is used instead of
56
+ * processing (and recursing into) that node again. This allows to separate arg wrappers from their content!
57
+ */
58
+ readonly precomputedValue?: {
59
+ readonly nodeId: NodeId;
60
+ readonly info: DataflowInformation;
61
+ };
44
62
  }
45
63
  export type DataflowProcessor<OtherInfo, NodeType extends RNodeWithParent<OtherInfo>> = (node: NodeType, data: DataflowProcessorInformation<OtherInfo>) => DataflowInformation;
46
64
  type NodeWithKey<OtherInfo, Key> = RNode<OtherInfo & ParentInformation> & {
@@ -15,6 +15,10 @@ function registerFaqs(ctx) {
15
15
  Tests are labeled based on the *flowR* capabilities that they test for.
16
16
  The list of supported capabilities can be found on the ${ctx.linkPage('wiki/Capabilities', 'Capabilities')} wiki page.
17
17
  For more extensive information on test labels, see the ${ctx.linkPage('wiki/Linting and Testing', 'test labels wiki section', 'test-labels')}.
18
+ `)
19
+ .addFaq('How do I run *all checks* before pushing?', `
20
+ Run \`npm run checkup\`: it runs the linter, the functionality and system tests, the wiki generation, and the docker image build + smoke test concurrently, then prints one pass/fail summary.
21
+ Run a subset with the job ids (e.g. \`npm run checkup -- lint tests\`) or skip the container build with \`npm run checkup -- --no-docker\`.
18
22
  `)
19
23
  .addFaq('How to get a REPL with debug-info/*hot-reload*?', `
20
24
  To enter the development repl, execute \`npm run main-dev\` in contrast to \`npm run flowr\`
@@ -95,7 +99,7 @@ or [rdocumentation.org](https://rdocumentation.org/). Additionally, the package
95
99
  be downloaded directly from [cran](https://cran.r-project.org/).
96
100
  `)
97
101
  .addFaq('How does flowR know a *package\'s exports*?', `
98
- See the ${ctx.linkPage('wiki/Package Database', 'Package Database')} wiki page.
102
+ See the ${ctx.linkPage('wiki/Signature Database', 'Signature Database')} wiki page.
99
103
  `);
100
104
  wikiFaq.withTopic('editor.configs')
101
105
  .addFaq('How can I make eslint and ZED work together?', `Use this project config (\`.zed/settings.json\`) to disable all formatters except eslint:
@@ -58,7 +58,7 @@ function getTestDetails(info, capability) {
58
58
  grouped.delete('output');
59
59
  const testString = [`${uniqueTests.length} test${uniqueTests.length !== 1 ? 's' : ''}`];
60
60
  // sort by count
61
- const sorted = [...grouped.entries()].sort((a, b) => b[1] - a[1]);
61
+ const sorted = [...grouped.entries()].sort((a, b) => b[0].localeCompare(a[0]));
62
62
  for (const [context, count] of sorted) {
63
63
  testString.push(`${context}: ${count}`);
64
64
  }
@@ -2,6 +2,8 @@
2
2
  import { scripts } from '../../cli/common/scripts-info';
3
3
  import { flowrMainOptionDefinitions } from '../../cli/flowr-main-options';
4
4
  import type { ReplCommandNames } from '../../cli/repl/commands/repl-commands';
5
+ import { FlowrConfig } from '../../config';
6
+ import type { AutocompletablePaths } from '../../util/objects';
5
7
  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;
6
8
  /**
7
9
  * Produce the documentation string for a CLI long option
@@ -11,6 +13,14 @@ export declare function getCliLongOptionOf<ScriptName extends keyof typeof scrip
11
13
  * Produce the documentation string for multiple CLI long options
12
14
  */
13
15
  export declare function multipleCliOptions<ScriptName extends keyof typeof scripts | 'flowr', OptionName extends ScriptOptions<ScriptName>>(scriptName: ScriptName, ...options: OptionName[]): string;
16
+ /**
17
+ * Produce a documentation link for a flowR configuration option (e.g. `solver.sigdb.enabled`).
18
+ * The link points at the configuration section of the Interface wiki page and carries the option's
19
+ * schema type, description, and any enumerated values as a hover tooltip.
20
+ * @param path - The (autocompleted) `.`-separated configuration path.
21
+ * @param quote - Whether to render the path as inline code. Default is `true`.
22
+ */
23
+ export declare function getConfigOption(path: AutocompletablePaths<FlowrConfig>, quote?: boolean): string;
14
24
  /**
15
25
  * Produce the documentation string for a REPL command
16
26
  */
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCliLongOptionOf = getCliLongOptionOf;
4
4
  exports.multipleCliOptions = multipleCliOptions;
5
+ exports.getConfigOption = getConfigOption;
5
6
  exports.getReplCommand = getReplCommand;
6
7
  /** Automatically provides hover over with the documentation for these! */
7
8
  const scripts_info_1 = require("../../cli/common/scripts-info");
@@ -10,6 +11,9 @@ const html_hover_over_1 = require("../../util/html-hover-over");
10
11
  const flowr_main_options_1 = require("../../cli/flowr-main-options");
11
12
  const repl_commands_1 = require("../../cli/repl/commands/repl-commands");
12
13
  const doc_escape_1 = require("./doc-escape");
14
+ const config_1 = require("../../config");
15
+ const schema_1 = require("../../util/schema");
16
+ const doc_files_1 = require("./doc-files");
13
17
  /**
14
18
  * Produce the documentation string for a CLI long option
15
19
  */
@@ -31,6 +35,25 @@ function getCliLongOptionOf(scriptName, optionName, withAlias = false, quote = t
31
35
  function multipleCliOptions(scriptName, ...options) {
32
36
  return options.map(o => getCliLongOptionOf(scriptName, o, false, true)).join(' ');
33
37
  }
38
+ /**
39
+ * Produce a documentation link for a flowR configuration option (e.g. `solver.sigdb.enabled`).
40
+ * The link points at the configuration section of the Interface wiki page and carries the option's
41
+ * schema type, description, and any enumerated values as a hover tooltip.
42
+ * @param path - The (autocompleted) `.`-separated configuration path.
43
+ * @param quote - Whether to render the path as inline code. Default is `true`.
44
+ */
45
+ function getConfigOption(path, quote = true) {
46
+ const info = (0, schema_1.schemaPathInfo)(config_1.FlowrConfig.Schema, path.split('.'));
47
+ let tooltip = `Configuration Option (${info.type ?? 'option'})`;
48
+ if (info.description) {
49
+ tooltip += `: ${info.description}`;
50
+ }
51
+ if (info.valids && info.valids.length > 0) {
52
+ tooltip += ` (one of ${info.valids.map(v => JSON.stringify(v)).join(', ')})`;
53
+ }
54
+ const label = quote ? `<code>${(0, doc_escape_1.escapeHTML)(path)}</code>` : (0, doc_escape_1.escapeHTML)(path);
55
+ return `<a href="${doc_files_1.FlowrWikiBaseRef}/Interface#configuring-flowr" title=${JSON.stringify((0, doc_escape_1.escapeHTML)(tooltip))}>${label}</a>`;
56
+ }
34
57
  /**
35
58
  * Produce the documentation string for a REPL command
36
59
  */
@@ -52,7 +52,8 @@ async function printDfGraphForCode(parser, code, { callGraph = false, simplified
52
52
  if (switchCodeAndGraph) {
53
53
  (0, assert_1.guard)(showCode, 'can not switch code and graph if code is not shown');
54
54
  }
55
- const metaInfo = `The analysis required _${(0, time_1.printAsMs)(duration)}_ (including parse and normalize, using the ${ctx ? ctx.linkPage('wiki/Engines', parser.name) : `[${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines)`} engine) within the generation environment.`;
55
+ const sigDbNote = `No ${ctx ? ctx.linkPage('wiki/Signature Database', 'signature database') : `[signature database](${doc_files_1.FlowrWikiBaseRef}/Signature-Database)`} is mounted for these generated graphs, so \`library()\` calls attach no package exports; base-R names are still qualified via the generated base-package store (e.g. \`acf\` as \`stats::acf\`).`;
56
+ const metaInfo = `The analysis required _${(0, time_1.printAsMs)(duration)}_ (including parse and normalize, using the ${ctx ? ctx.linkPage('wiki/Engines', parser.name) : `[${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines)`} engine) within the generation environment. ${sigDbNote}`;
56
57
  const graph = callGraph ? call_graph_1.CallGraph.compute(result.dataflow.graph) : result.dataflow.graph;
57
58
  const dfGraph = printDfGraph(graph, mark, simplified);
58
59
  const simplyText = simplified ? '(simplified) ' : '';
@@ -11,11 +11,16 @@ export interface ShowQueryOptions {
11
11
  readonly collapseQuery?: boolean;
12
12
  readonly shorthand?: string;
13
13
  readonly ctx?: GeneralDocContext;
14
+ /** additional in-memory files registered before the request, e.g. the targets of `source(...)` calls */
15
+ readonly files?: readonly {
16
+ readonly name: string;
17
+ readonly content: string;
18
+ }[];
14
19
  }
15
20
  /**
16
21
  * Visualizes a query and its results in markdown format.
17
22
  */
18
- export declare function showQuery<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(parser: KnownParser, code: string, queries: Queries<Base, VirtualArguments>, { showCode, collapseResult, collapseQuery, shorthand, ctx }?: ShowQueryOptions): Promise<string>;
23
+ export declare function showQuery<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(parser: KnownParser, code: string, queries: Queries<Base, VirtualArguments>, { showCode, collapseResult, collapseQuery, shorthand, ctx, files }?: ShowQueryOptions): Promise<string>;
19
24
  export interface QueryDocumentation {
20
25
  readonly name: string;
21
26
  readonly type: 'virtual' | 'active';
@@ -34,9 +39,10 @@ export declare const RegisteredQueries: {
34
39
  */
35
40
  export declare function registerQueryDocumentation(query: SupportedQueryTypes | SupportedVirtualQueryTypes, doc: QueryDocumentation): void;
36
41
  /**
37
- * Creates a REPL shorthand for the given slicing criteria and R code.
42
+ * Creates a REPL shorthand for the given slicing criteria and R code (`f` requests a forward slice,
43
+ * `i` inlines resolvable `source()` calls into the reconstruction; the flags may be combined as `fi`).
38
44
  */
39
- export declare function sliceQueryShorthand(criteria: SlicingCriteria, code: string, forward?: boolean): string;
45
+ export declare function sliceQueryShorthand(criteria: SlicingCriteria, code: string, forward?: boolean, inline?: boolean): string;
40
46
  /**
41
47
  *
42
48
  */
@@ -15,13 +15,17 @@ const doc_code_1 = require("./doc-code");
15
15
  const time_1 = require("../../util/text/time");
16
16
  const query_print_1 = require("../../queries/query-print");
17
17
  const flowr_analyzer_builder_1 = require("../../project/flowr-analyzer-builder");
18
+ const flowr_file_1 = require("../../project/context/flowr-file");
18
19
  const doc_cli_option_1 = require("./doc-cli-option");
19
20
  /**
20
21
  * Visualizes a query and its results in markdown format.
21
22
  */
22
- async function showQuery(parser, code, queries, { showCode, collapseResult, collapseQuery, shorthand, ctx } = {}) {
23
+ async function showQuery(parser, code, queries, { showCode, collapseResult, collapseQuery, shorthand, ctx, files } = {}) {
23
24
  const now = performance.now();
24
25
  const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder().setParser(parser).build();
26
+ for (const file of files ?? []) {
27
+ analyzer.addFile(new flowr_file_1.FlowrInlineTextFile(file.name, file.content));
28
+ }
25
29
  analyzer.addRequest(code);
26
30
  const results = await analyzer.query(queries);
27
31
  const duration = performance.now() - now;
@@ -86,10 +90,11 @@ function registerQueryDocumentation(query, doc) {
86
90
  map.set(query, doc);
87
91
  }
88
92
  /**
89
- * Creates a REPL shorthand for the given slicing criteria and R code.
93
+ * Creates a REPL shorthand for the given slicing criteria and R code (`f` requests a forward slice,
94
+ * `i` inlines resolvable `source()` calls into the reconstruction; the flags may be combined as `fi`).
90
95
  */
91
- function sliceQueryShorthand(criteria, code, forward) {
92
- return `(${(criteria.join(';'))})${forward ? 'f' : ''} "${code}"`;
96
+ function sliceQueryShorthand(criteria, code, forward, inline) {
97
+ return `(${(criteria.join(';'))})${forward ? 'f' : ''}${inline ? 'i' : ''} "${code}"`;
93
98
  }
94
99
  function linkify(name) {
95
100
  return name.toLowerCase().replace(/ /g, '-');
@@ -185,9 +185,11 @@ ${(0, doc_structure_1.block)({
185
185
  type: vertex_1.VertexType.FunctionCall,
186
186
  description: `
187
187
  Describes any kind of function call, including unnamed calls and those that happen implicitly!
188
- In general the vertex provides you with information about
188
+ In general the vertex provides you with information about
189
189
  the _name_ of the called function, the passed _arguments_, and the _environment_ in which the call happens (if it is of importance).
190
190
 
191
+ Whenever flowR can determine which package a call resolves to &mdash; via a loaded \`library()\`/\`::\`, or via the always-available base-R packages taken from the ${ctx.linkPage('wiki/Signature Database', 'signature database')} &mdash; the mermaid visualization prints the **package-qualified name** in place of the bare one (e.g. \`acf\` is shown as \`stats::acf\`). To obtain this qualified identifier programmatically from a call's origins, use \`Identifier.toQualified\` (see the \`origin\` property below and the ${ctx.linkPage('wiki/Signature Database', 'signature database')} for where the base-R knowledge comes from).
192
+
191
193
  However, the implementation reveals that it may hold an additional \`onlyBuiltin\` flag to indicate that the call is only calling builtin functions &mdash; however, this is only a flag to improve performance,
192
194
  and it should not be relied on as it may under-approximate the actual calling targets (e.g., being \`false\` even though all calls resolve to builtins).
193
195
 
@@ -481,7 +483,7 @@ ${(0, doc_structure_1.details)('Example: Parameters of a Function', await (async
481
483
  const code = 'f <- function(x, y = 3) x + y';
482
484
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([10, 1, 3]), exposeResult: true, ctx });
483
485
  const ast = await (0, doc_normalized_ast_1.printNormalizedAstForCode)(parser, code, { prefix: 'flowchart LR\n', showCode: false, ctx });
484
- const functionDefinition = [...info.dataflow.graph.vertices(true)].find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionDefinition);
486
+ const functionDefinition = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionDefinition);
485
487
  (0, assert_1.guard)(functionDefinition !== undefined, () => `Could not find function definition for ${code}`);
486
488
  const [id] = functionDefinition;
487
489
  const normalized = info.normalize.idMap.get(id);
@@ -861,11 +863,12 @@ ${(0, doc_structure_1.section)('Lexeme', 3, 'vtx-lexeme')}
861
863
 
862
864
  Also in the first line, next to the [syntactic type](#vtx-synt-type), you can find the lexeme of the vertex (if it has one, e.g., for a variable definition or use).
863
865
  This usually represents the textual source string of the respective vertex, and is also linked to the ${ctx.linkPage('wiki/Normalized AST')}.
866
+ For a clearer hierarchy, the lexeme is rendered in **bold** while the [syntactic type](#vtx-synt-type) is de-emphasized in _italics_ (mermaid markdown labels do not support a per-token font color, so a true gray tone would require styling the whole node). Only the token the source actually wrote is bold: when a call is shown with a package-qualified name that flowR *added* (e.g. the code wrote \`acf\` but it is displayed as \`stats::acf\`), the added \`stats::\` prefix stays non-bold, whereas a namespace written verbatim in the source is part of the lexeme and is bold as a whole.
864
867
  You can access the lexeme too with ${ctx.linkO(model_1.RNode, 'lexeme')}.
865
868
 
866
869
  ${(0, doc_structure_1.section)('Vertex Id', 3, 'vtx-id')}
867
870
 
868
- In the second line, you will usually find the id (in the form of a ${ctx.link(node_id_1.NodeId, undefined, { type: 'variable' })}) of the vertex,
871
+ In the second line, you will usually find the id (in the form of a ${ctx.link(node_id_1.NodeId, undefined, { type: 'variable' })}) of the vertex &mdash; kept compact by sharing the line with the [location](#vtx-location), in the form \`*location* (**id: <id>**)\` with the id in **bold** &mdash;
869
872
  alongside its [control dependencies](#control-dependencies) if it has any. This id links the vertex to the respective node in the ${ctx.linkPage('wiki/Normalized AST')} (and all other perspectives created by flowR).
870
873
  To give you an example, have a look at the following graph:
871
874
 
@@ -875,7 +878,7 @@ on the \`if\`, which only triggers when the condition is \`true\` (as indicated
875
878
 
876
879
  ${(0, doc_structure_1.section)('Location', 3, 'vtx-location')}
877
880
 
878
- The third line indicates the compressed ${ctx.link(range_1.SourceRange)} of the vertex in the format \`startLine.startCharacter - endLine.endCharacter\`. If the range reads \`1.7\`,
881
+ The second line also indicates the compressed ${ctx.link(range_1.SourceRange)} of the vertex (directly before the [id](#vtx-id)) in the format \`startLine.startCharacter - endLine.endCharacter\`. If the range reads \`1.7\`,
879
882
  this is short for \`1.7-1.7\`, likewise, \`1.7-9\` is short for \`1.7-1.9\`. So, \`1.7-9\` describes something starting
880
883
  in the first line at the seventh character and ending in the first line at the ninth character.
881
884
 
@@ -883,7 +886,7 @@ ${(0, doc_structure_1.section)('Arguments and Additional Information', 3, 'vtx-a
883
886
 
884
887
  Some vertices (e.g., [function calls](#function-call-vertex)) have additional information, like the arguments of the call.
885
888
  As you can see with the \`if\` example above alongside the [vertex id](#vtx-id),
886
- these vertices also have an additional line which lists the ids of the arguments in order to clear any ambiguity in case, for example,
889
+ these vertices also have an additional line (prefixed with \`arg:\`) which lists the ids of the arguments in order to clear any ambiguity in case, for example,
887
890
  the mermaid graph layouting fumbles the order.
888
891
 
889
892
  ${(0, doc_structure_1.section)('Vertices', 2, 'vertices')}
@@ -161,6 +161,7 @@ ${await (0, doc_repl_1.documentReplSession)(parser, [{
161
161
  }], { openOutput: true })}
162
162
 
163
163
  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).
164
+ Pass \`--inline\` to splice resolvable \`source()\` calls into the reconstruction so the slice is a single self-contained R text (the same as the static slice query's \`inlineSources\` flag).
164
165
 
165
166
  ### Example: Interfacing with the File System
166
167
 
@@ -253,6 +254,7 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
253
254
  repl: {
254
255
  quickStats: false,
255
256
  dfProcessorHeat: false,
257
+ hints: true,
256
258
  plugins: ['flowr:default']
257
259
  },
258
260
  project: {
@@ -263,7 +265,7 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
263
265
  variables: config_1.VariableResolve.Alias,
264
266
  evalStrings: true,
265
267
  trackEnvironments: true,
266
- pkgdb: { enabled: true, eagerlyLoad: false, eagerlyLoadExports: false },
268
+ sigdb: { enabled: true, loadProjectDependencies: true, eagerlyLoad: false, eagerlyLoadExports: false, linkBaseR: false, linkDescriptionDependencies: false },
267
269
  resolveSource: {
268
270
  dropPaths: config_1.DropPathsOption.No,
269
271
  ignoreCapitalization: true,
@@ -210,7 +210,7 @@ async function getTextMainPage(knownParser, tagTypes, ctx) {
210
210
  const rules = registerRules(knownParser, tagTypes.info);
211
211
  return `
212
212
  This page describes the flowR linter, which is a tool that utilizes flowR's dataflow analysis to find common issues in R scripts. The linter can currently be used through the linter ${ctx.linkPage('wiki/Query API', 'query')}.
213
- Some rules also draw on the ${ctx.linkPage('wiki/Package Database', 'package database')}.
213
+ Some rules also draw on the ${ctx.linkPage('wiki/Signature Database', 'signature database')}.
214
214
  For example:
215
215
 
216
216
  ${await (async () => {
@@ -43,8 +43,11 @@ for the latest benchmark results, see the [benchmark results](${doc_files_1.Flow
43
43
 
44
44
  Currently, flowR contains three testing suites: one for [functionality](#functionality-tests),
45
45
  one for [system tests](#system-tests), and one for [performance](#performance-tests). We explain each of them in the following.
46
- In addition to running those tests, you can use the more generalized \`npm run checkup\`.
46
+ In addition to running those tests, you can use the more generalized \`npm run checkup\`.
47
47
  This command includes the construction of the docker image, the generation of the wiki pages, and the linter.
48
+ It runs these jobs concurrently but caps the test workers so the combined run fits the machine (it splits the
49
+ available cores across the parallel \`vitest\` jobs via \`--maxWorkers\` instead of letting each grab every core).
50
+ Pass job ids to run a subset (e.g. \`npm run checkup -- lint tests\`) or \`--no-docker\` to skip the image build.
48
51
 
49
52
  <a id='functionality-tests'></a>
50
53
  ### 🧪 Functionality Tests
@@ -4,6 +4,8 @@ import type { ValidWikiDocumentTargetsNoSuffix } from '../../cli/wiki';
4
4
  import type { PathLike } from 'fs';
5
5
  import type { scripts } from '../../cli/common/scripts-info';
6
6
  import type { ScriptOptions } from '../doc-util/doc-cli-option';
7
+ import type { FlowrConfig } from '../../config';
8
+ import type { AutocompletablePaths } from '../../util/objects';
7
9
  import type { ReplCommandNames } from '../../cli/repl/commands/repl-commands';
8
10
  /**
9
11
  * Context available when generating documentation for a wiki in markdown format
@@ -311,6 +313,18 @@ export interface GeneralDocContext {
311
313
  * @see {@link getReplCommand} - for the underlying impl.
312
314
  */
313
315
  replCmd(commandName: ReplCommandNames, quote?: boolean, showStar?: boolean): string;
316
+ /**
317
+ * Generates a link to a flowR configuration option, resolving its schema type and description as a hover tooltip.
318
+ * @example
319
+ * ```ts
320
+ * linkConfig('solver.sigdb.enabled')
321
+ * ```
322
+ * Returns a link to the configuration section of the Interface wiki page, showing `solver.sigdb.enabled` with its documentation on hover.
323
+ * @param path - The `.`-separated configuration path (autocompletes to valid config keys only).
324
+ * @param quote - Whether to render the path as inline code. Default is `false`.
325
+ * @see {@link getConfigOption} - for the underlying impl.
326
+ */
327
+ linkConfig<K extends AutocompletablePaths<FlowrConfig>>(path: K, quote?: boolean): string;
314
328
  }
315
329
  /**
316
330
  * Creates a wiki context for generating documentation for code elements.
@@ -136,6 +136,9 @@ function makeDocContextForTypes(shell, ...rootFolders) {
136
136
  },
137
137
  replCmd(commandName, quote = true, showStar = false) {
138
138
  return (0, doc_cli_option_1.getReplCommand)(commandName, quote, showStar);
139
+ },
140
+ linkConfig(path, quote = false) {
141
+ return (0, doc_cli_option_1.getConfigOption)(path, quote);
139
142
  }
140
143
  };
141
144
  }
@@ -26,7 +26,9 @@ const DefaultReplacementPatterns = [
26
26
  [/%2Fhome%2F([a-zA-Z0-9._-]+%2F)*/g, ''],
27
27
  // async wrapper depends on whether the promise got fulfilled already
28
28
  [/async|%20/g, ''],
29
- [/\s*Copied mermaid url to clipboard\s*\([^)]+\)/gmi, '']
29
+ [/\s*Copied mermaid url to clipboard\s*\([^)]+\)/gmi, ''],
30
+ // mute signature database load time variance in wiki table
31
+ [/≈\s*<?[\d.]+\s*[µm]s/g, '']
30
32
  ];
31
33
  /**
32
34
  * Abstract base class for generating wiki files.
@@ -548,6 +548,8 @@ Now, the results no longer contain calls to \`plot\` that are not defined locall
548
548
  buildExplanation: async (shell, ctx) => {
549
549
  const exampleCode = 'x <- 1\ny <- 2\nz <- 3\nx';
550
550
  const criteria = ['3@z', '4@x'];
551
+ const sourceExample = 'source("library.R")\nprint(greeting)';
552
+ const sourceCriteria = ['2@print'];
551
553
  return `
552
554
  To slice, _flowR_ needs one thing from you: a variable or a list of variables (function calls are supported to, referring to the anonymous
553
555
  return of the call) that you want to slice the dataflow graph for (additionally, you have to tell flowR if you want to have a forward slice).
@@ -580,6 +582,22 @@ ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
580
582
  direction: slice_direction_1.SliceDirection.Forward
581
583
  }], { showCode: false, shorthand: (0, doc_query_1.sliceQueryShorthand)(['1@x'], (0, doc_escape_1.escapeNewline)(exampleCode), true), ctx })}
582
584
 
585
+ If your program pulls in other files with \`source(...)\`, the \`inlineSources\` flag splices the reconstruction
586
+ of each resolvable sourced file into the place of its \`source()\` call, so the slice becomes a single
587
+ self-contained R text (cyclic or unresolvable \`source()\` calls are kept verbatim and reported via
588
+ \`reconstruct.inlineWarnings\`). With the ${(0, doc_cli_option_1.getReplCommand)('query')} REPL command you append an \`i\` to the
589
+ criteria (and may combine it with the forward \`f\` as \`fi\`), for example (with a faked \`library.R\` providing \`greeting\`):
590
+ ${await (0, doc_query_1.showQuery)(shell, sourceExample, [{
591
+ type: 'static-slice',
592
+ criteria: sourceCriteria,
593
+ inlineSources: true
594
+ }], {
595
+ showCode: false,
596
+ shorthand: (0, doc_query_1.sliceQueryShorthand)(sourceCriteria, (0, doc_escape_1.escapeNewline)(sourceExample), false, true),
597
+ ctx,
598
+ files: [{ name: 'library.R', content: 'greeting <- "hello"\nunused <- 123' }]
599
+ })}
600
+
583
601
  You can disable ${ctx.linkPage('wiki/Interface', 'magic comments', 'slice-magic-comments')} using the \`noMagicComments\` flag.
584
602
  This query replaces the old ${ctx.linkPage('wiki/Interface', '`request-slice`', 'message-request-slice')} message.
585
603
  `;
@@ -660,7 +678,7 @@ print("hello world!")
660
678
  return `
661
679
  This query extracts all dependencies from an R script, using a combination of a ${(0, doc_query_1.linkToQueryOfName)('call-context')}
662
680
  and more advanced tracking in the ${ctx.linkPage('wiki/Dataflow Graph', 'Dataflow Graph')}.
663
- Loaded libraries are resolved against the ${ctx.linkPage('wiki/Package Database', 'package database')}.
681
+ Loaded libraries are resolved against the ${ctx.linkPage('wiki/Signature Database', 'signature database')}.
664
682
 
665
683
  In other words, if you have a script simply reading: \`${exampleCode}\`, the following query returns the loaded library:
666
684
  ${await (0, doc_query_1.showQuery)(shell, exampleCode, [{
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WikiSetup = void 0;
4
4
  const doc_maker_1 = require("./wiki-mk/doc-maker");
5
+ const doc_files_1 = require("./doc-util/doc-files");
5
6
  /**
6
7
  * https://github.com/flowr-analysis/flowr/wiki/Setup
7
8
  */
@@ -23,7 +24,7 @@ or use its ${ctx.linkPage('flowr:vscode', 'Visual Studio Code extension')} and $
23
24
 
24
25
 
25
26
  If you want to develop for _flowR_, you want to see how to [build from scratch](#-building-from-scratch) and have a
26
- look at the [Contributing Guidelines](https://github.com/flowr-analysis/flowr/tree/main//.github/CONTRIBUTING.md).
27
+ look at the [Contributing Guidelines](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/CONTRIBUTING.md).
27
28
 
28
29
  ## 🗒️ Using the Visual Studio Code Extension
29
30
 
@@ -65,12 +66,12 @@ For more information, see the ${ctx.linkPage('wiki/Interface')} wiki page.
65
66
  ## ⚒️ Building From Scratch
66
67
 
67
68
  To use _flowR_, you may need [_R_](https://www.r-project.org/) installed and on your path
68
- (this only affects the [\`r-shell\` engine][r-shell], which is _not_ the default).
69
+ (this only affects the ${ctx.linkPage('wiki/Engines', '`r-shell` engine')}, which is _not_ the default).
69
70
 
70
71
  ### Installing R
71
72
  Although there are several ways to do so, there is nothing wrong with installing&nbsp;R with the help of your favorite package manager or directly from the [website](https://cloud.r-project.org/).<a href="#note1" id="note1ref"><sup>&lt;1&gt;</sup></a>
72
73
  For 🪟&nbsp;Windows, see [here](https://www.hanss.info/sebastian/post/rtools-path/) for an explanation on how to add [_R_](https://www.r-project.org/) to your path variable.
73
- Again, you only require this for the [\`r-shell\` engine][r-shell].
74
+ Again, you only require this for the ${ctx.linkPage('wiki/Engines', '`r-shell` engine')}.
74
75
 
75
76
  ### Installing Node.js
76
77
 
@@ -105,15 +106,17 @@ At the time of writing this, there is currently no page for frequently encounter
105
106
  ## 📜 Developing for _flowR_
106
107
 
107
108
  If you want to develop for _flowR_, explore the wiki.
108
- For details on _how_ to contribute, please refer to the [CONTRIBUTING.md](https://github.com/flowr-analysis/flowr/blob/main/.github/CONTRIBUTING.md) in the repository.
109
+ For details on _how_ to contribute, please refer to the [CONTRIBUTING.md](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/CONTRIBUTING.md) in the repository.
110
+
111
+ ### 📦 The Signature Database
112
+
113
+ _flowR_ resolves \`library(pkg)\`/\`pkg::fn\` calls from a downloaded signature database (\`flowr-sigdb\`); no shards are committed (only the \`sigdb.remote.json\` pointer), everything else is fetched on demand &mdash; see the ${ctx.linkPage('wiki/Signature Database')} page.
109
114
 
110
115
  -----
111
116
  <a id="note1" href="#note1ref">&lt;1&gt;</a>: Currently, _flowR_ is only tested with R versions \`4.x\` and \`3.6.x\`.
112
117
 
113
118
  <a id="note2" href="#note2ref">&lt;2&gt;</a>: We use
114
- [git-lfs](https://git-lfs.com/) to store larger files, especially for the wiki pages. So if you want to work on these parts, make sure to have it set-up (see the [CONTRIBUTING.md](https://github.com/flowr-analysis/flowr/blob/main/.github/CONTRIBUTING.md) in the repository for more information).
115
-
116
- [r-shell]: (https://github.com/flowr-analysis/flowr/wiki/Engines)
119
+ [git-lfs](https://git-lfs.com/) to store larger files, especially for the wiki pages. So if you want to work on these parts, make sure to have it set-up (see the [CONTRIBUTING.md](${doc_files_1.RemoteFlowrFilePathBaseRef}/.github/CONTRIBUTING.md) in the repository for more information).
117
120
  `.trim();
118
121
  }
119
122
  }
@@ -0,0 +1,16 @@
1
+ import type { DocMakerArgs } from './wiki-mk/doc-maker';
2
+ import { DocMaker } from './wiki-mk/doc-maker';
3
+ /**
4
+ * https://github.com/flowr-analysis/flowr/wiki/Package-Database
5
+ */
6
+ export declare class WikiSignatureDatabase extends DocMaker<'wiki/Signature Database.md'> {
7
+ constructor();
8
+ /**
9
+ * Regenerate only when the CRAN shards are actually present. A fresh checkout (and every CI run) ships no shards
10
+ * at all until they are downloaded, and this page documents the *CRAN* database: regenerating without them would
11
+ * replace the shard table and figures with empty/base-only numbers and publish that over the real page. Skipping
12
+ * leaves the committed page untouched, so the workflow reports no change and publishes nothing.
13
+ */
14
+ make(args: Parameters<DocMaker<'wiki/Signature Database.md'>['make']>[0]): Promise<boolean>;
15
+ text({ ctx }: DocMakerArgs): Promise<string>;
16
+ }