@eagleoutice/flowr 2.8.15 → 2.9.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 (179) hide show
  1. package/README.md +25 -26
  2. package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +4 -3
  3. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -3
  4. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +2 -1
  5. package/abstract-interpretation/data-frame/mappers/arguments.js +2 -1
  6. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +4 -3
  7. package/abstract-interpretation/data-frame/mappers/function-mapper.js +13 -10
  8. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +7 -6
  9. package/abstract-interpretation/data-frame/resolve-args.js +2 -1
  10. package/benchmark/slicer.d.ts +0 -16
  11. package/benchmark/slicer.js +0 -47
  12. package/benchmark/stats/print.js +0 -6
  13. package/benchmark/stats/stats.d.ts +0 -3
  14. package/benchmark/summarizer/second-phase/process.js +0 -6
  15. package/cli/benchmark-app.d.ts +0 -1
  16. package/cli/benchmark-app.js +0 -1
  17. package/cli/benchmark-helper-app.d.ts +0 -1
  18. package/cli/benchmark-helper-app.js +1 -5
  19. package/cli/common/options.d.ts +0 -10
  20. package/cli/common/options.js +0 -2
  21. package/cli/common/scripts-info.d.ts +0 -10
  22. package/cli/repl/server/connection.js +1 -1
  23. package/config.d.ts +0 -15
  24. package/config.js +0 -21
  25. package/control-flow/cfg-dead-code.js +0 -3
  26. package/control-flow/extract-cfg.js +4 -0
  27. package/control-flow/semantic-cfg-guided-visitor.d.ts +7 -0
  28. package/control-flow/semantic-cfg-guided-visitor.js +11 -4
  29. package/dataflow/cluster.js +2 -2
  30. package/dataflow/environments/built-in-config.d.ts +1 -0
  31. package/dataflow/environments/built-in.d.ts +9 -3
  32. package/dataflow/environments/built-in.js +15 -7
  33. package/dataflow/environments/default-builtin-config.d.ts +10 -1
  34. package/dataflow/environments/default-builtin-config.js +6 -4
  35. package/dataflow/environments/define.d.ts +4 -11
  36. package/dataflow/environments/define.js +16 -96
  37. package/dataflow/environments/diff.js +3 -2
  38. package/dataflow/environments/environment.d.ts +17 -6
  39. package/dataflow/environments/environment.js +69 -18
  40. package/dataflow/environments/identifier.d.ts +92 -6
  41. package/dataflow/environments/identifier.js +159 -1
  42. package/dataflow/environments/resolve-by-name.d.ts +4 -4
  43. package/dataflow/environments/resolve-by-name.js +24 -8
  44. package/dataflow/eval/resolve/resolve.d.ts +10 -6
  45. package/dataflow/eval/resolve/resolve.js +12 -7
  46. package/dataflow/extractor.js +6 -3
  47. package/dataflow/fn/higher-order-function.js +4 -4
  48. package/dataflow/graph/call-graph.d.ts +1 -1
  49. package/dataflow/graph/call-graph.js +10 -8
  50. package/dataflow/graph/diff-dataflow-graph.js +6 -4
  51. package/dataflow/graph/edge.d.ts +48 -31
  52. package/dataflow/graph/edge.js +66 -60
  53. package/dataflow/graph/graph.d.ts +7 -7
  54. package/dataflow/graph/quads.js +1 -1
  55. package/dataflow/graph/resolve-graph.js +1 -1
  56. package/dataflow/graph/unknown-replacement.d.ts +2 -1
  57. package/dataflow/graph/vertex.d.ts +2 -103
  58. package/dataflow/graph/vertex.js +0 -44
  59. package/dataflow/internal/linker.d.ts +2 -2
  60. package/dataflow/internal/linker.js +26 -18
  61. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +3 -65
  62. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +4 -6
  63. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +12 -46
  64. package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
  65. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +4 -4
  66. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -2
  67. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +8 -5
  68. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +4 -4
  69. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +2 -2
  70. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -2
  71. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +1 -69
  72. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
  73. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
  74. package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +11 -0
  75. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +46 -0
  76. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +3 -2
  77. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +0 -2
  78. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +11 -72
  79. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +1 -2
  80. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -1
  81. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +4 -3
  82. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -2
  83. package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +1 -60
  84. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
  85. package/dataflow/internal/process/functions/call/common.d.ts +3 -1
  86. package/dataflow/internal/process/functions/call/common.js +4 -16
  87. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +6 -2
  88. package/dataflow/internal/process/functions/call/known-call-handling.js +2 -3
  89. package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +1 -1
  90. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
  91. package/dataflow/internal/process/functions/process-parameter.js +1 -1
  92. package/dataflow/internal/process/process-named-call.d.ts +2 -1
  93. package/dataflow/internal/process/process-named-call.js +0 -1
  94. package/dataflow/internal/process/process-symbol.d.ts +3 -1
  95. package/dataflow/internal/process/process-symbol.js +8 -5
  96. package/dataflow/origin/dfg-get-origin.d.ts +2 -2
  97. package/dataflow/origin/dfg-get-origin.js +4 -4
  98. package/dataflow/origin/dfg-get-symbol-refs.js +2 -2
  99. package/documentation/data/interface/doc-writing-code.d.ts +6 -0
  100. package/documentation/data/interface/doc-writing-code.js +176 -0
  101. package/documentation/doc-util/doc-types.d.ts +3 -1
  102. package/documentation/doc-util/doc-types.js +4 -2
  103. package/documentation/wiki-absint.js +2 -1
  104. package/documentation/wiki-analyzer.js +17 -2
  105. package/documentation/wiki-cfg.js +2 -2
  106. package/documentation/wiki-dataflow-graph.js +9 -8
  107. package/documentation/wiki-interface.js +8 -164
  108. package/documentation/wiki-mk/doc-context.d.ts +12 -1
  109. package/documentation/wiki-mk/doc-context.js +21 -4
  110. package/documentation/wiki-normalized-ast.js +5 -0
  111. package/linter/linter-rules.d.ts +3 -3
  112. package/linter/rules/absolute-path.js +23 -23
  113. package/linter/rules/dataframe-access-validation.js +2 -1
  114. package/linter/rules/deprecated-functions.d.ts +1 -1
  115. package/linter/rules/deprecated-functions.js +1 -1
  116. package/linter/rules/function-finder-util.d.ts +2 -2
  117. package/linter/rules/network-functions.d.ts +1 -1
  118. package/linter/rules/seeded-randomness.d.ts +2 -2
  119. package/linter/rules/seeded-randomness.js +5 -4
  120. package/linter/rules/unused-definition.js +4 -4
  121. package/package.json +5 -5
  122. package/project/context/flowr-analyzer-context.d.ts +17 -1
  123. package/project/context/flowr-analyzer-context.js +17 -1
  124. package/project/context/flowr-analyzer-meta-context.d.ts +51 -0
  125. package/project/context/flowr-analyzer-meta-context.js +47 -0
  126. package/project/flowr-analyzer.d.ts +17 -1
  127. package/project/flowr-analyzer.js +18 -0
  128. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +15 -0
  129. package/project/plugins/file-plugins/files/flowr-description-file.js +26 -0
  130. package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +17 -3
  131. package/project/plugins/file-plugins/files/flowr-namespace-file.js +292 -10
  132. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
  133. package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -2
  134. package/project/plugins/flowr-analyzer-plugin-defaults.js +2 -0
  135. package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
  136. package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +12 -0
  137. package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +42 -0
  138. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
  139. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +2 -2
  140. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
  141. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +2 -2
  142. package/project/plugins/plugin-registry.d.ts +2 -1
  143. package/project/plugins/plugin-registry.js +2 -0
  144. package/queries/catalog/call-context-query/call-context-query-executor.js +6 -4
  145. package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -1
  146. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +3 -3
  147. package/queries/catalog/dependencies-query/dependencies-query-format.js +5 -3
  148. package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
  149. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -2
  150. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -1
  151. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +1 -1
  152. package/r-bridge/data/data.d.ts +8 -3
  153. package/r-bridge/data/data.js +9 -3
  154. package/r-bridge/lang-4.x/ast/model/model.d.ts +0 -11
  155. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +2 -1
  156. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -1
  157. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +7 -3
  158. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +2 -1
  159. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +0 -1
  160. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +0 -1
  161. package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +0 -1
  162. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +0 -1
  163. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.d.ts +1 -2
  164. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +12 -13
  165. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +4 -11
  166. package/reconstruct/reconstruct.js +6 -5
  167. package/search/flowr-search-filters.js +2 -1
  168. package/search/search-executor/search-enrichers.d.ts +1 -2
  169. package/search/search-executor/search-enrichers.js +2 -1
  170. package/slicing/static/slice-call.js +5 -5
  171. package/slicing/static/static-slicer.js +2 -2
  172. package/statistics/features/common-syntax-probability.js +3 -2
  173. package/statistics/features/supported/defined-functions/defined-functions.js +3 -3
  174. package/statistics/features/supported/used-functions/used-functions.js +3 -2
  175. package/util/mermaid/dfg.js +3 -3
  176. package/util/simple-df/dfg-ascii.js +5 -5
  177. package/util/version.js +1 -1
  178. package/util/containers.d.ts +0 -66
  179. package/util/containers.js +0 -143
@@ -83,10 +83,10 @@ ${subExplanations.length > 0 ? await printAllSubExplanations(parser, subExplanat
83
83
  `;
84
84
  }
85
85
  function edgeTypeToId(edgeType) {
86
- return (0, edge_1.edgeTypeToName)(edgeType).toLowerCase().replaceAll(' ', '-');
86
+ return edge_1.DfEdge.typeToName(edgeType).toLowerCase().replaceAll(' ', '-');
87
87
  }
88
88
  function linkEdgeName(edgeType, page = '') {
89
- return `[\`${(0, edge_1.edgeTypeToName)(edgeType)}\`](${page}#${edgeTypeToId(edgeType)})`;
89
+ return `[\`${edge_1.DfEdge.typeToName(edgeType)}\`](${page}#${edgeTypeToId(edgeType)})`;
90
90
  }
91
91
  async function getVertexExplanations(parser, ctx) {
92
92
  /* we use the map to ensure order easily :D */
@@ -198,7 +198,7 @@ However, in general, flowR may use any fitting handler as an origin (see the ${c
198
198
  ${(0, doc_structure_1.details)('Example: Simple Function Call (unresolved)', await (async () => {
199
199
  const code = 'foo(x,3,y=3,)';
200
200
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([8]), exposeResult: true });
201
- const callInfo = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name === 'foo');
201
+ const callInfo = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && identifier_1.Identifier.getName(vertex.name) === 'foo');
202
202
  (0, assert_1.guard)(callInfo !== undefined, () => `Could not find call vertex for ${code}`);
203
203
  const [callId, callVert] = callInfo;
204
204
  const inverseMapReferenceTypes = Object.fromEntries(Object.entries(identifier_1.ReferenceType).map(([k, v]) => [v, k]));
@@ -265,7 +265,7 @@ ${await (async () => {
265
265
  const code = 'foo <- function() 3\nfoo()';
266
266
  const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { exposeResult: true, mark: new Set([6, '6->0', '6->1', '6->3']) });
267
267
  const numberOfEdges = [...info.dataflow.graph.edges()].flatMap(e => [...e[1].keys()]).length;
268
- const callVertex = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name === 'foo');
268
+ const callVertex = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && identifier_1.Identifier.getName(vertex.name) === 'foo');
269
269
  (0, assert_1.guard)(callVertex !== undefined, () => `Could not find call vertex for ${code}`);
270
270
  const [callId] = callVertex;
271
271
  return `
@@ -336,7 +336,7 @@ Hence, trying to re-resolve the call using ${ctx.link(linker_1.getAllFunctionCal
336
336
  the following target ids: { \`${[...(0, linker_1.getAllFunctionCallTargets)(id, info.dataflow.graph)].join('`, `')}\` }.
337
337
  This way we know that the call may refer to the built-in assignment operator or to the multiplication.
338
338
  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):
339
- { \`${(0, resolve_by_name_1.resolveByNameAnyType)(name, env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
339
+ { \`${(0, resolve_by_name_1.resolveByNameAnyType)(identifier_1.Identifier.make(name), env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
340
340
 
341
341
  `;
342
342
  })()}
@@ -1004,7 +1004,8 @@ Depending on what you are interested in, there exists a plethora of functions an
1004
1004
  * ${ctx.link(node_id_1.recoverName)} and ${ctx.link(node_id_1.recoverContent)} to get the name or content of a vertex in the dataflow graph
1005
1005
  * ${ctx.link(alias_tracking_1.resolveIdToValue)} to resolve the value of a variable or id (if possible, see [below](#dfg-resolving-values))
1006
1006
  * ${ctx.link(alias_tracking_1.getAliases)} to get all (potentially currently) aliases of a given definition
1007
- * ${ctx.link(edge_1.edgeIncludesType)} to check if an edge includes a specific type and ${ctx.link(edge_1.splitEdgeTypes)} to split the bitmask of edges into its types (see [below](#dfg-resolving-values))
1007
+ * ${ctx.link('DfEdge', undefined, { type: 'variable' })} to get helpful functions wrt. edges (see [below](#dfg-resolving-values))
1008
+ * ${ctx.link('Identifier', undefined, { type: 'variable' })} to get helpful functions wrt. identifiers
1008
1009
  * ${ctx.link(identify_link_to_last_call_relation_1.getValueOfArgument)} to get the (syntactical) value of an argument in a function call
1009
1010
  * ${ctx.link(dfg_get_origin_1.getOriginInDfg)} to get information about where a read, call, ... comes from (see [below](#dfg-resolving-values))
1010
1011
 
@@ -1047,8 +1048,8 @@ ${await (async () => {
1047
1048
  }
1048
1049
  throw new Error('Could not find edge');
1049
1050
  })()}&mdash;which is usually not very helpful.
1050
- You can use ${ctx.link(edge_1.splitEdgeTypes.name)} to get the individual bitmasks of all included types, and
1051
- ${ctx.link(edge_1.edgeIncludesType.name)} to check whether a specific type (or one of a collection of types) is included in the edge.
1051
+ You can use ${ctx.link('DfEdge::splitTypes')} to get the individual bitmasks of all included types, and
1052
+ ${ctx.link('DfEdge::includesType')} to check whether a specific type (or one of a collection of types) is included in the edge.
1052
1053
 
1053
1054
  ${(0, doc_structure_1.section)('Handling Origins', 3, 'dfg-handling-origins')}
1054
1055
 
@@ -16,12 +16,10 @@ const schema_1 = require("../util/schema");
16
16
  const ansi_1 = require("../util/text/ansi");
17
17
  const flowr_main_options_1 = require("../cli/flowr-main-options");
18
18
  const doc_issue_1 = require("./doc-util/doc-issue");
19
- const pipeline_executor_1 = require("../core/pipeline-executor");
20
19
  const doc_structure_1 = require("./doc-util/doc-structure");
21
- const tree_sitter_executor_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor");
22
- const flowr_analyzer_1 = require("../project/flowr-analyzer");
23
20
  const doc_maker_1 = require("./wiki-mk/doc-maker");
24
21
  const built_in_1 = require("../dataflow/environments/built-in");
22
+ const doc_writing_code_1 = require("./data/interface/doc-writing-code");
25
23
  async function explainServer(parser) {
26
24
  (0, doc_data_server_messages_1.documentAllServerMessages)();
27
25
  return `
@@ -252,7 +250,6 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
252
250
  solver: {
253
251
  variables: config_1.VariableResolve.Alias,
254
252
  evalStrings: true,
255
- pointerTracking: true,
256
253
  resolveSource: {
257
254
  dropPaths: config_1.DropPathsOption.No,
258
255
  ignoreCapitalization: true,
@@ -307,159 +304,6 @@ ${(0, schema_1.describeSchema)(config_1.flowrConfigFileSchema, ansi_1.markdownFo
307
304
 
308
305
  `;
309
306
  }
310
- function explainWritingCode(shell, ctx) {
311
- return `
312
- _flowR_ can be used as a [module](${doc_files_1.FlowrNpmRef}) and offers several main classes and interfaces that are interesting for extension writers
313
- (see the [Visual Studio Code extension](${doc_files_1.FlowrGithubBaseRef}/vscode-flowr) or the [core](${doc_files_1.FlowrWikiBaseRef}/Core) wiki page for more information).
314
-
315
- ### Using the ${ctx.link(shell_1.RShell)} to Interact with R
316
-
317
- The ${ctx.link(shell_1.RShell.name)} class allows interfacing with the \`R\`&nbsp;ecosystem installed on the host system.
318
- Please have a look at [flowR's engines](${doc_files_1.FlowrWikiBaseRef}/Engines) for more information on alterantives (for example, the ${ctx.link(tree_sitter_executor_1.TreeSitterExecutor)}).
319
-
320
- ${(0, doc_structure_1.block)({
321
- type: 'IMPORTANT',
322
- content: `
323
- Each ${ctx.link(shell_1.RShell.name)} controls a new instance of the R&nbsp;interpreter,
324
- make sure to call ${(0, doc_code_1.codeInline)(ctx.linkM(shell_1.RShell, 'close', { codeFont: false, realNameWrapper: 'i' }) + '()')} when you are done.`
325
- })}
326
-
327
- You can start a new "session" simply by constructing a new object with ${(0, doc_code_1.codeInline)('new ' + ctx.link(shell_1.RShell, { codeFont: false }) + '()')}.
328
-
329
- However, there are several options that may be of interest
330
- (e.g., to automatically revive the shell in case of errors or to control the name location of the R process on the system).
331
-
332
- With a shell object (let's call it \`shell\`), you can execute R code by using ${ctx.linkM(shell_1.RShell, 'sendCommand', { realNameWrapper: 'i' })},
333
- for example ${(0, doc_code_1.codeInline)('shell.' + ctx.linkM(shell_1.RShell, 'sendCommand', { codeFont: false, hideClass: true }) + '("1 + 1")')}.
334
- However, this does not return anything, so if you want to collect the output of your command, use
335
- ${ctx.linkM(shell_1.RShell, 'sendCommandWithOutput', { realNameWrapper: 'i' })} instead.
336
-
337
- Besides that, the command ${ctx.linkM(shell_1.RShell, 'tryToInjectHomeLibPath')} may be of interest, as it enables all libraries available on the host system.
338
-
339
- ### Creating _flowR_ analyses
340
-
341
- Nowadays, instances of ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} should be used as central frontend to get analysis results from _flowR_.
342
- For example, a program slice can be created like this:
343
-
344
- ${(0, doc_code_1.codeBlock)('ts', `
345
- const analyzer = await new FlowrAnalyzerBuilder(requestFromInput('x <- 1\\ny <- x\\nx')).build();
346
- const result = await analyzer.query([
347
- {
348
- type: 'static-slice',
349
- criteria: ['3@x']
350
- }
351
- ]);
352
- //console.log(result['static-slice']);
353
- `)}
354
-
355
- ### The Pipeline Executor
356
-
357
- Once, in the beginning, _flowR_ was meant to produce a dataflow graph merely to provide *program slices*.
358
- However, with continuous updates, the [dataflow graph](${doc_files_1.FlowrWikiBaseRef}/Dataflow-Graph) repeatedly proves to be the more interesting part.
359
- With this, we restructured _flowR_'s originally *hardcoded* pipeline to be far more flexible.
360
- Now, it can be theoretically extended or replaced with arbitrary steps, optional steps, and what we call 'decorations' of these steps.
361
- In short, a slicing pipeline using the ${ctx.link(pipeline_executor_1.PipelineExecutor)} looks like this:
362
-
363
- ${(0, doc_code_1.codeBlock)('ts', `
364
- const slicer = new ${pipeline_executor_1.PipelineExecutor.name}(DEFAULT_SLICING_PIPELINE, {
365
- parser: new ${shell_1.RShell.name}(),
366
- request: ${retriever_1.requestFromInput.name}('x <- 1\\nx + 1'),
367
- criterion: ['2@x']
368
- })
369
- const slice = await slicer.allRemainingSteps()
370
- // console.log(slice.reconstruct.code)
371
- `)}
372
-
373
- ${(0, doc_structure_1.details)('More Information', `
374
-
375
- If you compare this, with what you would have done with the old (and removed) \`SteppingSlicer\`,
376
- this essentially just requires you to replace the \`SteppingSlicer\` with the ${ctx.link(pipeline_executor_1.PipelineExecutor)}
377
- and to pass the ${ctx.link('DEFAULT_SLICING_PIPELINE')} as the first argument.
378
- The ${ctx.link(pipeline_executor_1.PipelineExecutor)}...
379
-
380
- 1. Provides structures to investigate the results of all intermediate steps
381
- 2. Can be executed step-by-step
382
- 3. Can repeat steps (e.g., to calculate multiple slices on the same input)
383
-
384
- See the in-code documentation for more information.
385
-
386
- `)}
387
-
388
-
389
- ### Generate Statistics
390
-
391
-
392
- <details>
393
-
394
- <summary>Adding a New Feature to Extract</summary>
395
-
396
- In this example, we construct a new feature to extract, with the name "*example*".
397
- Whenever this name appears, you may substitute this with whatever name fits your feature best (as long as the name is unique).
398
-
399
- 1. **Create a new file in \`src/statistics/features/supported\`**\\
400
- Create the file \`example.ts\`, and add its export to the \`index.ts\` file in the same directory (if not done automatically).
401
-
402
- 2. **Create the basic structure**\\
403
- To get a better feel of what a feature must have, let's look
404
- at the basic structure (of course, due to TypeScript syntax,
405
- there are other ways to achieve the same goal):
406
-
407
- \`\`\`ts
408
- const initialExampleInfo = {
409
- /* whatever start value is good for you */
410
- someCounter: 0
411
- }
412
-
413
- export type ExampleInfo = Writable<typeof initialExampleInfo>
414
-
415
- export const example: Feature<ExampleInfo> = {
416
- name: 'Example Feature',
417
- description: 'A longer example description',
418
-
419
- process(existing: ExampleInfo, input: FeatureProcessorInput): ExampleInfo {
420
- /* perform analysis on the input */
421
- return existing
422
- },
423
-
424
- initialValue: initialExampleInfo
425
- }
426
- \`\`\`
427
-
428
- The \`initialExampleInfo\` type holds the initial values for each counter that you want to maintain during the feature extraction (they will usually be initialized with 0). The resulting \`ExampleInfo\` type holds the structure of the data that is to be counted. Due to the vast amount of data processed, information like the name and location of a function call is not stored here, but instead written to disk (see below).
429
-
430
- Every new feature must be of the \`Feature<Info>\` type, with \`Info\` referring to a \`FeatureInfo\` (like \`ExampleInfo\` in this example). Next to a \`name\` and a \`description\`, each Feature must provide:
431
-
432
- - a processor that extracts the information from the input, adding it to the existing information.
433
- - a function returning the initial value of the information (in this case, \`initialExampleInfo\`).
434
-
435
- 3. **Add it to the feature-mapping**\\
436
- Now, in the \`feature.ts\` file in \`src/statistics/features\`, add your feature to the \`ALL_FEATURES\` object.
437
-
438
- Now, we want to extract something. For the *example* feature created in the previous steps, we choose to count the amount of \`COMMENT\` tokens.
439
- So we define a corresponding [XPath](https://developer.mozilla.org/en-US/docs/Web/XPath) query:
440
-
441
- \`\`\`ts
442
- const commentQuery: Query = xpath.parse('//COMMENT')
443
- \`\`\`
444
-
445
- Within our feature's \`process\` function, running the query is as simple as:
446
-
447
- \`\`\`ts
448
- const comments = commentQuery.select({ node: input.parsedRAst })
449
- \`\`\`
450
-
451
- Now we could do a lot of further processing, but for simplicity, we only record every comment found this way:
452
-
453
- \`\`\`ts
454
- appendStatisticsFile(example.name, 'comments', comments, input.filepath)
455
- \`\`\`
456
-
457
- We use \`example.name\` to avoid duplication with the name that we’ve assigned to the feature. It corresponds to the name of the folder in the statistics output.
458
- \`'comments'\` refers to a freely chosen (but unique) name, that will be used as the name for the output file within the folder. The \`comments\` variable holds the result of the query, which is an array of nodes. Finally, we pass the \`filepath\` of the file that was analyzed (if known), so that it can be added to the statistics file (as additional information).
459
-
460
- </details>
461
- `;
462
- }
463
307
  /**
464
308
  * https://github.com/flowr-analysis/flowr/wiki/Interface
465
309
  */
@@ -474,20 +318,15 @@ this wiki page explains how to interface with _flowR_ in more detail.
474
318
  In general, command line arguments and other options provide short descriptions on hover over.
475
319
 
476
320
  * [💻 Using the REPL](#using-the-repl)
477
- * [💬 Communicating with the Server](#communicating-with-the-server)
478
321
  * [⚙️ Configuring FlowR](#configuring-flowr)
479
322
  * [⚒️ Writing Code](#writing-code)
323
+ * [💬 Communicating with the Server](#communicating-with-the-server)
480
324
 
481
325
  <a id='using-the-repl'></a>
482
326
  ## 💻 Using the REPL
483
327
 
484
328
  ${await explainRepl(treeSitter, ctx)}
485
329
 
486
- <a id='communicating-with-the-server'></a>
487
- ## 💬 Communicating with the Server
488
-
489
- ${await explainServer(shell)}
490
-
491
330
 
492
331
  <a id='configuring-flowr'></a>
493
332
  ## ⚙️ Configuring FlowR
@@ -497,7 +336,12 @@ ${explainConfigFile()}
497
336
  <a id='writing-code'></a>
498
337
  ## ⚒️ Writing Code
499
338
 
500
- ${explainWritingCode(shell, ctx)}
339
+ ${(0, doc_writing_code_1.explainWritingCode)(shell, ctx)}
340
+
341
+ <a id='communicating-with-the-server'></a>
342
+ ## 💬 Communicating with the Server
343
+
344
+ ${await explainServer(shell)}
501
345
  `;
502
346
  }
503
347
  }
@@ -46,6 +46,16 @@ type ProtoKeys<T> = T extends {
46
46
  type StaticKeys<T> = T extends {
47
47
  prototype: infer P;
48
48
  } ? Exclude<keyof T, keyof P> : never;
49
+ export declare const ConstantWikiLinkInfo: {
50
+ readonly 'flowr:npm': "https://www.npmjs.com/package/@eagleoutice/flowr";
51
+ readonly 'flowr:github': string;
52
+ readonly 'flowr:wiki': "https://github.com/flowr-analysis/flowr/wiki";
53
+ readonly 'flowr:docker': "https://hub.docker.com/r/eagleoutice/flowr";
54
+ readonly 'flowr:vscode': "https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr";
55
+ readonly 'flowr:positron': "https://open-vsx.org/extension/code-inspect/vscode-flowr";
56
+ readonly 'flowr:rstudio-addin': "https://github.com/flowr-analysis/rstudio-addin-flowr";
57
+ readonly 'flowr:radapter': "https://github.com/flowr-analysis/flowr-r-adapter";
58
+ };
49
59
  /**
50
60
  * Provides methods to generate links, code snippets, and documentation for code elements.
51
61
  * These wrap around a collection of useful helpers originating from the doc utils.
@@ -184,11 +194,12 @@ export interface GeneralDocContext {
184
194
  * linkWikiPage('wiki/Setup')
185
195
  * ```
186
196
  * Creates a link to the `wiki/Setup` wiki page with the link text `Setup`.
197
+ * This also supports a select subset of external pages in the context of flowR
187
198
  * @param pageName - The name of the wiki page to link to.
188
199
  * @param linkText - Optional text to display for the link. If not provided, the page name will be used.
189
200
  * @param segment - An optional segment within the page to link to (e.g., a header anchor).
190
201
  */
191
- linkPage(pageName: ValidWikiDocumentTargetsNoSuffix, linkText?: string, segment?: string): string;
202
+ linkPage(pageName: ValidWikiDocumentTargetsNoSuffix | keyof typeof ConstantWikiLinkInfo, linkText?: string, segment?: string): string;
192
203
  /**
193
204
  * Generates a link to a code file in the code base.
194
205
  * @param path - The path to the code file.
@@ -3,6 +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.ConstantWikiLinkInfo = void 0;
6
7
  exports.makeDocContextForTypes = makeDocContextForTypes;
7
8
  const doc_types_1 = require("../doc-util/doc-types");
8
9
  const path_1 = __importDefault(require("path"));
@@ -21,6 +22,16 @@ function getNameFromElementIdOrRef(element) {
21
22
  return element;
22
23
  }
23
24
  }
25
+ exports.ConstantWikiLinkInfo = {
26
+ 'flowr:npm': doc_files_1.FlowrNpmRef,
27
+ 'flowr:github': doc_files_1.FlowrGithubRef,
28
+ 'flowr:wiki': doc_files_1.FlowrWikiBaseRef,
29
+ 'flowr:docker': doc_files_1.FlowrDockerRef,
30
+ 'flowr:vscode': doc_files_1.FlowrVsCode,
31
+ 'flowr:positron': doc_files_1.FlowrPositron,
32
+ 'flowr:rstudio-addin': doc_files_1.FlowrRStudioAddin,
33
+ 'flowr:radapter': doc_files_1.FlowrRAdapter
34
+ };
24
35
  /**
25
36
  * Creates a wiki context for generating documentation for code elements.
26
37
  * This context provides methods to create links, code snippets, and documentation for code elements.
@@ -44,8 +55,8 @@ function makeDocContextForTypes(shell, ...rootFolders) {
44
55
  return (0, doc_types_1.getDocumentationForType)(getNameFromElementIdOrRef(element), info, '', filter);
45
56
  },
46
57
  link(element, fmt, filter) {
47
- (0, assert_1.guard)(filter === undefined, 'ElementFilter is not yet supported for link');
48
- return (0, doc_types_1.shortLink)(getNameFromElementIdOrRef(element), info, fmt?.codeFont, fmt?.realNameWrapper);
58
+ (0, assert_1.guard)(filter?.file === undefined, 'filtering for files is not yet supported for link');
59
+ return (0, doc_types_1.shortLink)(getNameFromElementIdOrRef(element), info, fmt?.codeFont, fmt?.realNameWrapper, filter?.fuzzy, filter?.type);
49
60
  },
50
61
  linkM(cls, element, fmt, filter) {
51
62
  const className = cls.prototype.constructor.name;
@@ -83,8 +94,14 @@ function makeDocContextForTypes(shell, ...rootFolders) {
83
94
  },
84
95
  linkPage(pageName, linkText, segment) {
85
96
  const text = linkText ?? pageName.split('/').pop() ?? pageName;
86
- const link = pageName.toLowerCase().replace(/ /g, '-');
87
- return `[${text}](${doc_files_1.FlowrGithubRef}/${link}${segment ? `#${segment}` : ''})`;
97
+ let link;
98
+ if (pageName in exports.ConstantWikiLinkInfo) {
99
+ link = exports.ConstantWikiLinkInfo[pageName];
100
+ }
101
+ else {
102
+ link = `${doc_files_1.FlowrWikiBaseRef}/${pageName.toLowerCase().replace(/ /g, '-')}`;
103
+ }
104
+ return `[${text}](${link}${segment ? `#${segment}` : ''})`;
88
105
  },
89
106
  linkCode(path, lineNumber) {
90
107
  const lnk = lineNumber ? `${path.toString()}#L${lineNumber}` : path.toString();
@@ -170,6 +170,11 @@ Please note, that they usually operate on the ${ctx.link('RExpressionList')} lev
170
170
  you to decide how you want to traverse multiple files with a ${ctx.link('RProject')} in the AST (you can, for example, simplify flat-map over the files).
171
171
  The ${ctx.link('RProject')} node cannot appear nested within other nodes, so you can safely assume that any child of a node is not an ${ctx.link('RProject')}.
172
172
 
173
+ ${(0, doc_structure_1.block)({
174
+ type: 'TIP',
175
+ content: 'When working with names and identifiers, consider using the utilities provided with the ' + ctx.link('Identifier', undefined, { type: 'variable' }) + ' object.',
176
+ })}
177
+
173
178
  ### Visitors
174
179
 
175
180
  If you want a simple visitor which traverses the AST, the ${ctx.link(visitor_1.visitAst)} function is a good starting point.
@@ -10,7 +10,7 @@ export declare const LintingRules: {
10
10
  results: {
11
11
  certainty: import("./linter-format").LintingResultCertainty;
12
12
  involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
13
- function: import("../dataflow/environments/identifier").Identifier;
13
+ function: import("../dataflow/environments/identifier").BrandedIdentifier;
14
14
  range: import("../util/range").SourceRange;
15
15
  }[];
16
16
  '.meta': import("./rules/function-finder-util").FunctionsMetadata;
@@ -67,7 +67,7 @@ export declare const LintingRules: {
67
67
  results: {
68
68
  involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
69
69
  certainty: import("./linter-format").LintingResultCertainty;
70
- function: import("../dataflow/environments/identifier").Identifier;
70
+ function: import("../dataflow/environments/identifier").BrandedIdentifier;
71
71
  range: import("../util/range").SourceRange;
72
72
  }[];
73
73
  '.meta': import("./rules/seeded-randomness").SeededRandomnessMeta;
@@ -196,7 +196,7 @@ export declare const LintingRules: {
196
196
  results: {
197
197
  certainty: import("./linter-format").LintingResultCertainty;
198
198
  involvedId: import("../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
199
- function: import("../dataflow/environments/identifier").Identifier;
199
+ function: import("../dataflow/environments/identifier").BrandedIdentifier;
200
200
  range: import("../util/range").SourceRange;
201
201
  }[];
202
202
  '.meta': import("./rules/function-finder-util").FunctionsMetadata;
@@ -48,28 +48,28 @@ function buildQuickFix(str, filePath, wd) {
48
48
  }];
49
49
  }
50
50
  /** return all strings constructable by these functions */
51
- const PathFunctions = {
52
- 'file.path': (df, vtx, ctx) => {
53
- const fsep = (0, resolve_argument_1.getArgumentStringValue)(ctx.config.solver.variables, df, vtx, undefined, 'fsep', true, ctx);
54
- // in the future we can access `.Platform$file.sep` here
55
- const sepValues = fsep?.values()?.flatMap(s => s.values().filter(assert_1.isNotUndefined)).toArray() ?? [path_1.default.sep];
56
- if (sepValues.some(s => s === dependencies_query_format_1.Unknown || (0, assert_1.isUndefined)(s))) {
57
- // if we have no fsep, we cannot construct a path
58
- return undefined;
59
- }
60
- const args = (0, resolve_argument_1.getArgumentStringValue)(ctx.config.solver.variables, df, vtx, 'unnamed', undefined, true, ctx);
61
- const argValues = args ? Array.from(args.values()).flatMap(v => [...v]) : [];
62
- if (!argValues || argValues.length === 0 || argValues.some(v => v === dependencies_query_format_1.Unknown || (0, assert_1.isUndefined)(v))) {
63
- // if we have no arguments, we cannot construct a path
64
- return undefined;
65
- }
66
- const results = [];
67
- for (const val of sepValues) {
68
- results.push(argValues.join(val));
69
- }
70
- return results;
71
- }
72
- };
51
+ const PathFunctions = new Map([
52
+ ['file.path', (df, vtx, ctx) => {
53
+ const fsep = (0, resolve_argument_1.getArgumentStringValue)(ctx.config.solver.variables, df, vtx, undefined, 'fsep', true, ctx);
54
+ // in the future we can access `.Platform$file.sep` here
55
+ const sepValues = fsep?.values()?.flatMap(s => s.values().filter(assert_1.isNotUndefined)).toArray() ?? [path_1.default.sep];
56
+ if (sepValues.some(s => s === dependencies_query_format_1.Unknown || (0, assert_1.isUndefined)(s))) {
57
+ // if we have no fsep, we cannot construct a path
58
+ return undefined;
59
+ }
60
+ const args = (0, resolve_argument_1.getArgumentStringValue)(ctx.config.solver.variables, df, vtx, 'unnamed', undefined, true, ctx);
61
+ const argValues = args ? Array.from(args.values()).flatMap(v => [...v]) : [];
62
+ if (!argValues || argValues.length === 0 || argValues.some(v => v === dependencies_query_format_1.Unknown || (0, assert_1.isUndefined)(v))) {
63
+ // if we have no arguments, we cannot construct a path
64
+ return undefined;
65
+ }
66
+ const results = [];
67
+ for (const val of sepValues) {
68
+ results.push(argValues.join(val));
69
+ }
70
+ return results;
71
+ }]
72
+ ]);
73
73
  exports.ABSOLUTE_PATH = {
74
74
  /* this can be done better once we have types */
75
75
  createSearch: (config) => {
@@ -138,7 +138,7 @@ exports.ABSOLUTE_PATH = {
138
138
  else {
139
139
  const dfNode = data.dataflow.graph.getVertex(node.info.id);
140
140
  if ((0, vertex_1.isFunctionCallVertex)(dfNode)) {
141
- const handler = PathFunctions[dfNode.name ?? ''];
141
+ const handler = dfNode.name ? PathFunctions.get(dfNode.name) : undefined;
142
142
  const strings = handler ? handler(data.dataflow.graph, dfNode, data.analyzer.inspectContext()) : [];
143
143
  if (strings) {
144
144
  return strings.filter(s => (0, strings_1.isAbsolutePath)(s, regex)).map(str => ({
@@ -13,6 +13,7 @@ const dfg_1 = require("../../util/mermaid/dfg");
13
13
  const range_1 = require("../../util/range");
14
14
  const linter_format_1 = require("../linter-format");
15
15
  const linter_tags_1 = require("../linter-tags");
16
+ const identifier_1 = require("../../dataflow/environments/identifier");
16
17
  exports.DATA_FRAME_ACCESS_VALIDATION = {
17
18
  createSearch: () => flowr_search_builder_1.Q.all().with(search_enrichers_1.Enrichment.CallTargets, { onlyBuiltin: true }),
18
19
  processSearchResult: (elements, config, data) => {
@@ -67,7 +68,7 @@ exports.DATA_FRAME_ACCESS_VALIDATION = {
67
68
  ...accessed,
68
69
  involvedId: node?.info.id,
69
70
  access: node?.lexeme ?? '???',
70
- ...(operand?.type === type_1.RType.Symbol ? { operand: operand.content } : {}),
71
+ ...(operand?.type === type_1.RType.Symbol ? { operand: identifier_1.Identifier.getName(operand.content) } : {}),
71
72
  range: node?.info.fullRange ?? node?.location ?? (0, range_1.rangeFrom)(-1, -1, -1, -1),
72
73
  certainty: linter_format_1.LintingResultCertainty.Certain
73
74
  }));
@@ -7,7 +7,7 @@ export declare const DEPRECATED_FUNCTIONS: {
7
7
  results: {
8
8
  certainty: import("../linter-format").LintingResultCertainty;
9
9
  involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
10
- function: import("../../dataflow/environments/identifier").Identifier;
10
+ function: import("../../dataflow/environments/identifier").BrandedIdentifier;
11
11
  range: import("../../util/range").SourceRange;
12
12
  }[];
13
13
  '.meta': FunctionsMetadata;
@@ -15,7 +15,7 @@ exports.DEPRECATED_FUNCTIONS = {
15
15
  certainty: linter_format_1.LintingRuleCertainty.BestEffort,
16
16
  description: 'Marks deprecated functions that should not be used anymore.',
17
17
  defaultConfig: {
18
- fns: ['all_equal', 'arrange_all', 'distinct_all', 'filter_all', 'group_by_all', 'summarise_all', 'mutate_all', 'select_all', 'vars', 'all_vars', 'id', 'failwith', 'select_vars', 'rename_vars', 'select_var', 'current_vars', 'bench_tbls', 'compare_tbls', 'compare_tbls2', 'eval_tbls', 'eval_tbls2', 'location', 'changes', 'combine', 'do', 'funs', 'add_count_', 'add_tally_', 'arrange_', 'count_', 'distinct_', 'do_', 'filter_', 'funs_', 'group_by_', 'group_indices_', 'mutate_', 'tally_', 'transmute_', 'rename_', 'rename_vars_', 'select_', 'select_vars_', 'slice_', 'summarise_', 'summarize_', 'summarise_each', 'src_local', 'tbl_df', 'add_rownames', 'group_nest', 'group_split', 'with_groups', 'nest_by', 'progress_estimated', 'recode', 'sample_n', 'top_n', 'transmute', 'fct_explicit_na', 'aes_', 'aes_auto', 'annotation_logticks', 'is.Coord', 'coord_flip', 'coord_map', 'is.facet', 'fortify', 'is.ggproto', 'guide_train', 'is.ggplot', 'qplot', 'is.theme', 'gg_dep', 'liply', 'isplit2', 'list_along', 'cross', 'invoke', 'at_depth', 'prepend', 'rerun', 'splice', '`%@%`', 'rbernoulli', 'rdunif', 'when', 'update_list', 'map_raw', 'accumulate', 'reduce_right', 'flatten', 'map_dfr', 'as_vector', 'transpose', 'melt_delim', 'melt_fwf', 'melt_table', 'read_table2', 'str_interp', 'as_tibble', 'data_frame', 'tibble_', 'data_frame_', 'lst_', 'as_data_frame', 'as.tibble', 'frame_data', 'trunc_mat', 'is.tibble', 'tidy_names', 'set_tidy_names', 'repair_names', 'extract_numeric', 'complete_', 'drop_na_', 'expand_', 'crossing_', 'nesting_', 'extract_', 'fill_', 'gather_', 'nest_', 'separate_rows_', 'separate_', 'spread_', 'unite_', 'unnest_', 'extract', 'gather', 'nest_legacy', 'separate_rows', 'separate', 'spread',]
18
+ fns: ['all_equal', 'arrange_all', 'distinct_all', 'filter_all', 'group_by_all', 'summarise_all', 'mutate_all', 'select_all', 'vars', 'all_vars', 'id', 'failwith', 'select_vars', 'rename_vars', 'select_var', 'current_vars', 'bench_tbls', 'compare_tbls', 'compare_tbls2', 'eval_tbls', 'eval_tbls2', 'location', 'changes', 'combine', 'do', 'funs', 'add_count_', 'add_tally_', 'arrange_', 'count_', 'distinct_', 'do_', 'filter_', 'funs_', 'group_by_', 'group_indices_', 'mutate_', 'tally_', 'transmute_', 'rename_', 'rename_vars_', 'select_', 'select_vars_', 'slice_', 'summarise_', 'summarize_', 'summarise_each', 'src_local', 'tbl_df', 'add_rownames', 'group_nest', 'group_split', 'with_groups', 'nest_by', 'progress_estimated', 'recode', 'sample_n', 'top_n', 'transmute', 'fct_explicit_na', 'aes_', 'aes_auto', 'annotation_logticks', 'is.Coord', 'coord_flip', 'coord_map', 'is.facet', 'fortify', 'is.ggproto', 'guide_train', 'is.ggplot', 'qplot', 'is.theme', 'gg_dep', 'liply', 'isplit2', 'list_along', 'cross', 'invoke', 'at_depth', 'prepend', 'rerun', 'splice', '`%@%`', 'rbernoulli', 'rdunif', 'when', 'update_list', 'map_raw', 'accumulate', 'reduce_right', 'flatten', 'map_dfr', 'as_vector', 'transpose', 'melt_delim', 'melt_fwf', 'melt_table', 'read_table2', 'str_interp', 'as_tibble', 'data_frame', 'tibble_', 'data_frame_', 'lst_', 'as_data_frame', 'as.tibble', 'frame_data', 'trunc_mat', 'is.tibble', 'tidy_names', 'set_tidy_names', 'repair_names', 'extract_numeric', 'complete_', 'drop_na_', 'expand_', 'crossing_', 'nesting_', 'extract_', 'fill_', 'gather_', 'nest_', 'separate_rows_', 'separate_', 'spread_', 'unite_', 'unnest_', 'extract', 'gather', 'nest_legacy', 'separate_rows', 'separate', 'spread']
19
19
  }
20
20
  }
21
21
  };
@@ -1,5 +1,4 @@
1
1
  import type { SourceRange } from '../../util/range';
2
- import type { Identifier } from '../../dataflow/environments/identifier';
3
2
  import { type LintingResult, LintingResultCertainty } from '../linter-format';
4
3
  import type { FlowrSearchElement, FlowrSearchElements } from '../../search/flowr-search';
5
4
  import type { NormalizedAst, ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
@@ -7,6 +6,7 @@ import type { MergeableRecord } from '../../util/objects';
7
6
  import type { DataflowInformation } from '../../dataflow/info';
8
7
  import type { FunctionInfo } from '../../queries/catalog/dependencies-query/function-info/function-info';
9
8
  import type { ReadonlyFlowrAnalysisProvider } from '../../project/flowr-analyzer';
9
+ import type { BrandedIdentifier } from '../../dataflow/environments/identifier';
10
10
  export interface FunctionsResult extends LintingResult {
11
11
  function: string;
12
12
  range: SourceRange;
@@ -30,7 +30,7 @@ export declare const functionFinderUtil: {
30
30
  results: {
31
31
  certainty: LintingResultCertainty;
32
32
  involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
33
- function: Identifier;
33
+ function: BrandedIdentifier;
34
34
  range: SourceRange;
35
35
  }[];
36
36
  '.meta': FunctionsMetadata;
@@ -19,7 +19,7 @@ export declare const NETWORK_FUNCTIONS: {
19
19
  results: {
20
20
  certainty: import("../linter-format").LintingResultCertainty;
21
21
  involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
22
- function: import("../../dataflow/environments/identifier").Identifier;
22
+ function: import("../../dataflow/environments/identifier").BrandedIdentifier;
23
23
  range: import("../../util/range").SourceRange;
24
24
  }[];
25
25
  '.meta': FunctionsMetadata;
@@ -1,7 +1,7 @@
1
1
  import { type LintingResult, LintingResultCertainty, LintingRuleCertainty } from '../linter-format';
2
2
  import type { SourceRange } from '../../util/range';
3
3
  import type { MergeableRecord } from '../../util/objects';
4
- import type { Identifier } from '../../dataflow/environments/identifier';
4
+ import type { BrandedIdentifier } from '../../dataflow/environments/identifier';
5
5
  import { LintingRuleTag } from '../linter-tags';
6
6
  export interface SeededRandomnessResult extends LintingResult {
7
7
  function: string;
@@ -40,7 +40,7 @@ export declare const SEEDED_RANDOMNESS: {
40
40
  results: {
41
41
  involvedId: import("../../r-bridge/lang-4.x/ast/model/processing/node-id").NodeId;
42
42
  certainty: LintingResultCertainty;
43
- function: Identifier;
43
+ function: BrandedIdentifier;
44
44
  range: SourceRange;
45
45
  }[];
46
46
  '.meta': SeededRandomnessMeta;
@@ -5,6 +5,7 @@ const linter_format_1 = require("../linter-format");
5
5
  const flowr_search_builder_1 = require("../../search/flowr-search-builder");
6
6
  const dfg_1 = require("../../util/mermaid/dfg");
7
7
  const search_enrichers_1 = require("../../search/search-executor/search-enrichers");
8
+ const identifier_1 = require("../../dataflow/environments/identifier");
8
9
  const flowr_search_filters_1 = require("../../search/flowr-search-filters");
9
10
  const default_builtin_config_1 = require("../../dataflow/environments/default-builtin-config");
10
11
  const graph_1 = require("../../dataflow/graph/graph");
@@ -31,11 +32,11 @@ exports.SEEDED_RANDOMNESS = {
31
32
  })
32
33
  .with(search_enrichers_1.Enrichment.LastCall, [
33
34
  { callName: config.randomnessProducers.filter(p => p.type === 'function').map(p => p.name) },
34
- { callName: getDefaultAssignments().flatMap(b => b.names), cascadeIf: () => cascade_action_1.CascadeAction.Continue }
35
+ { callName: getDefaultAssignments().flatMap(b => b.names).map(identifier_1.Identifier.getName), cascadeIf: () => cascade_action_1.CascadeAction.Continue }
35
36
  ]),
36
37
  processSearchResult: (elements, config, { dataflow, analyzer }) => {
37
38
  const assignmentProducers = new Set(config.randomnessProducers.filter(p => p.type == 'assignment').map(p => p.name));
38
- const assignmentArgIndexes = new Map(getDefaultAssignments().flatMap(a => a.names.map(n => ([n, a.config?.swapSourceAndTarget ? 1 : 0]))));
39
+ const assignmentArgIndexes = new Map(getDefaultAssignments().flatMap(a => a.names.map(n => ([identifier_1.Identifier.getName(n), a.config?.swapSourceAndTarget ? 1 : 0]))));
39
40
  const metadata = {
40
41
  consumerCalls: 0,
41
42
  callsWithFunctionProducers: 0,
@@ -61,7 +62,7 @@ exports.SEEDED_RANDOMNESS = {
61
62
  const cds = dfgElement ? new Set(dfgElement.cds) : new Set();
62
63
  const producers = (0, search_enrichers_1.enrichmentContent)(element.searchElement, search_enrichers_1.Enrichment.LastCall).linkedIds
63
64
  .map(e => dataflow.graph.getVertex(e.node.info.id));
64
- const { assignment, func } = Object.groupBy(producers, f => assignmentArgIndexes.has(f.name) ? 'assignment' : 'func');
65
+ const { assignment, func } = Object.groupBy(producers, f => assignmentArgIndexes.has(identifier_1.Identifier.getName(f.name)) ? 'assignment' : 'func');
65
66
  let nonConstant = false;
66
67
  const cdsOfProduces = new Set();
67
68
  // function calls are already taken care of through the LastCall enrichment itself
@@ -84,7 +85,7 @@ exports.SEEDED_RANDOMNESS = {
84
85
  }
85
86
  // assignments have to be queried for their destination
86
87
  for (const a of assignment ?? []) {
87
- const argIdx = assignmentArgIndexes.get(a.name);
88
+ const argIdx = assignmentArgIndexes.get(identifier_1.Identifier.getName(a.name));
88
89
  const dest = (0, graph_1.getReferenceOfArgument)(a.args[argIdx]);
89
90
  if (dest !== undefined && assignmentProducers.has((0, node_id_1.recoverName)(dest, dataflow.graph.idMap))) {
90
91
  // we either have arg index 0 or 1 for the assignmentProducers destination, so we select the assignment value as 1-argIdx here
@@ -14,7 +14,7 @@ const InterestingEdgesVariable = edge_1.EdgeType.Reads | edge_1.EdgeType.Calls |
14
14
  const InterestingEdgesFunction = edge_1.EdgeType.Reads | edge_1.EdgeType.Calls; // include read as this could print the function definition
15
15
  const InterestingEdgesTargets = edge_1.EdgeType.SideEffectOnCall;
16
16
  function getDefinitionArguments(def, dfg) {
17
- return [...dfg.outgoingEdges(def) ?? []].filter(([, { types }]) => (0, edge_1.edgeIncludesType)(types, edge_1.EdgeType.DefinedBy))
17
+ return [...dfg.outgoingEdges(def) ?? []].filter(([, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedBy))
18
18
  .map(([target]) => target);
19
19
  }
20
20
  function buildQuickFix(variable, dfg, ast) {
@@ -27,8 +27,8 @@ function buildQuickFix(variable, dfg, ast) {
27
27
  const definedBys = getDefinitionArguments(variable.info.id, dfg);
28
28
  const hasImportantArgs = definedBys.some(d => dfg.unknownSideEffects.has(d))
29
29
  || definedBys.flatMap(e => [...dfg.outgoingEdges(e) ?? []])
30
- .some(([target, { types }]) => {
31
- return (0, edge_1.edgeIncludesType)(types, InterestingEdgesTargets) || dfg.unknownSideEffects.has(target);
30
+ .some(([target, e]) => {
31
+ return edge_1.DfEdge.includesType(e, InterestingEdgesTargets) || dfg.unknownSideEffects.has(target);
32
32
  });
33
33
  if (hasImportantArgs) {
34
34
  return undefined; // we can not remove this definition, it has important arguments
@@ -74,7 +74,7 @@ exports.UNUSED_DEFINITION = {
74
74
  }
75
75
  const ingoingEdges = data.dataflow.graph.ingoingEdges(dfgVertex.id);
76
76
  const interestedIn = (0, vertex_1.isVariableDefinitionVertex)(dfgVertex) ? InterestingEdgesVariable : InterestingEdgesFunction;
77
- const ingoingInteresting = ingoingEdges?.values().some(e => (0, edge_1.edgeIncludesType)(e.types, interestedIn));
77
+ const ingoingInteresting = ingoingEdges?.values().some(e => edge_1.DfEdge.includesType(e, interestedIn));
78
78
  if (ingoingInteresting) {
79
79
  return undefined;
80
80
  }