@eagleoutice/flowr 2.13.15 → 2.13.16

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 (50) hide show
  1. package/README.md +28 -34
  2. package/abstract-interpretation/unsupported-functions.d.ts +1 -0
  3. package/abstract-interpretation/unsupported-functions.js +1 -0
  4. package/cli/repl/commands/repl-query.js +37 -2
  5. package/cli/repl/core.js +5 -2
  6. package/control-flow/control-flow-graph.d.ts +2 -0
  7. package/control-flow/control-flow-graph.js +2 -0
  8. package/dataflow/eval/values/general.js +3 -0
  9. package/dataflow/fn/higher-order-function.d.ts +1 -1
  10. package/dataflow/fn/higher-order-function.js +20 -1
  11. package/dataflow/graph/call-graph.d.ts +1 -1
  12. package/dataflow/graph/call-graph.js +1 -1
  13. package/dataflow/graph/df-helper.d.ts +2 -2
  14. package/dataflow/graph/df-helper.js +1 -1
  15. package/dataflow/graph/graph-helper.d.ts +1 -0
  16. package/dataflow/graph/graph-helper.js +1 -0
  17. package/dataflow/graph/vertex.d.ts +5 -0
  18. package/dataflow/graph/vertex.js +5 -0
  19. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  20. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +8 -2
  21. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +1 -1
  22. package/dataflow/internal/process/functions/call/deferred.d.ts +7 -0
  23. package/dataflow/internal/process/functions/call/deferred.js +22 -0
  24. package/dataflow/internal/process/functions/call/nse.d.ts +1 -0
  25. package/dataflow/internal/process/functions/call/nse.js +1 -0
  26. package/dataflow/internal/process/functions/call/quoted.d.ts +1 -0
  27. package/dataflow/internal/process/functions/call/quoted.js +5 -2
  28. package/documentation/wiki-dataflow-graph.js +8 -0
  29. package/linter/linter-format.d.ts +1 -0
  30. package/linter/linter-format.js +1 -0
  31. package/package.json +1 -1
  32. package/queries/catalog/absint-query/absint-query-format.js +1 -1
  33. package/queries/catalog/does-call-query/does-call-query-format.js +2 -1
  34. package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -1
  35. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -1
  36. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -1
  37. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
  38. package/queries/catalog/location-map-query/location-map-query-format.js +1 -1
  39. package/queries/catalog/origin-query/origin-query-format.js +1 -1
  40. package/queries/catalog/provenance-query/provenance-query-format.js +1 -1
  41. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
  42. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  43. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  44. package/slicing/criterion/parse.d.ts +1 -0
  45. package/slicing/criterion/parse.js +1 -0
  46. package/util/r-version.d.ts +2 -0
  47. package/util/r-version.js +2 -0
  48. package/util/record.d.ts +1 -0
  49. package/util/record.js +1 -0
  50. package/util/version.js +1 -1
package/README.md CHANGED
@@ -43,7 +43,7 @@ It offers a wide variety of features, for example:
43
43
 
44
44
  ```shell
45
45
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
46
- flowR repl v2.13.14, R grammar v14 (tree-sitter engine)
46
+ flowR repl v2.13.15, R grammar v14 (tree-sitter engine)
47
47
  R> :query @linter "read.csv(\"/root/x.txt\")"
48
48
  ```
49
49
 
@@ -52,17 +52,11 @@ It offers a wide variety of features, for example:
52
52
 
53
53
 
54
54
  ```text
55
- Query: linter (11 ms)
55
+ Query: linter (5 ms)
56
56
  ╰ Deprecated Functions (deprecated-functions): no findings
57
- ╰ File Path Validity (file-path-validity):
58
- ╰ certain:
59
- ╰ Path `/root/x.txt` at 1.1-23
60
- ╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 1, processTimeMs: 0
57
+ ╰ File Path Validity (file-path-validity): no findings
61
58
  ╰ Seeded Randomness (seeded-randomness): no findings
62
- ╰ Absolute Paths (absolute-file-paths):
63
- ╰ certain:
64
- ╰ Path `/root/x.txt` at 1.1-23
65
- ╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0
59
+ ╰ Absolute Paths (absolute-file-paths): no findings
66
60
  ╰ Unused Definitions (unused-definitions): no findings
67
61
  ╰ Network Functions (network-functions): no findings
68
62
  ╰ Dataframe Access Validation (dataframe-access-validation): no findings
@@ -73,7 +67,7 @@ It offers a wide variety of features, for example:
73
67
  ╰ Roxygen Arguments (roxygen-arguments): no findings
74
68
  ╰ No Leaked Credentials (no-leaked-credentials): no findings
75
69
  ╰ Undefined Symbol (undefined-symbol): no findings
76
- All queries together required ≈11 ms (1ms accuracy, total 11 ms)
70
+ All queries together required ≈5 ms (1ms accuracy, total 5 ms)
77
71
  ```
78
72
 
79
73
 
@@ -95,17 +89,17 @@ It offers a wide variety of features, for example:
95
89
 
96
90
  _Results (prettified and summarized):_
97
91
 
98
- Query: **linter** (3550 ms)\
92
+ Query: **linter** (7 ms)\
99
93
     ╰ **Deprecated Functions** (deprecated-functions): _no findings_\
100
94
     ╰ **File Path Validity** (file-path-validity):\
101
95
         ╰ certain:\
102
96
             ╰ Path `/root/x.txt` at 1.1-23\
103
-        ╰ _Metadata_: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 4, processTimeMs: 1\
97
+        ╰ _Metadata_: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 1, processTimeMs: 1\
104
98
     ╰ **Seeded Randomness** (seeded-randomness): _no findings_\
105
99
     ╰ **Absolute Paths** (absolute-file-paths):\
106
100
         ╰ certain:\
107
101
             ╰ Path `/root/x.txt` at 1.1-23\
108
-        ╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0\
102
+        ╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0\
109
103
     ╰ **Unused Definitions** (unused-definitions): _no findings_\
110
104
     ╰ **Network Functions** (network-functions): _no findings_\
111
105
     ╰ **Dataframe Access Validation** (dataframe-access-validation): _no findings_\
@@ -116,11 +110,11 @@ It offers a wide variety of features, for example:
116
110
     ╰ **Roxygen Arguments** (roxygen-arguments): _no findings_\
117
111
     ╰ **No Leaked Credentials** (no-leaked-credentials): _no findings_\
118
112
     ╰ **Undefined Symbol** (undefined-symbol): _no findings_\
119
- _All queries together required ≈3550 ms (1ms accuracy, total 3552 ms)_
113
+ _All queries together required ≈7 ms (1ms accuracy, total 8 ms)_
120
114
 
121
115
  <details> <summary style="color:gray">Show Detailed Results as Json</summary>
122
116
 
123
- The analysis required _3551.6 ms_ (including parsing and normalization and the query) within the generation environment.
117
+ The analysis required _8.3 ms_ (including parsing and normalization and the query) within the generation environment.
124
118
 
125
119
  In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
126
120
  Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
@@ -137,8 +131,8 @@ It offers a wide variety of features, for example:
137
131
  ".meta": {
138
132
  "totalCalls": 0,
139
133
  "totalFunctionDefinitions": 0,
140
- "searchTimeMs": 3,
141
- "processTimeMs": 3514
134
+ "searchTimeMs": 1,
135
+ "processTimeMs": 1
142
136
  }
143
137
  },
144
138
  "file-path-validity": {
@@ -160,7 +154,7 @@ It offers a wide variety of features, for example:
160
154
  "totalUnknown": 0,
161
155
  "totalWritesBeforeAlways": 0,
162
156
  "totalValid": 0,
163
- "searchTimeMs": 4,
157
+ "searchTimeMs": 1,
164
158
  "processTimeMs": 1
165
159
  }
166
160
  },
@@ -172,7 +166,7 @@ It offers a wide variety of features, for example:
172
166
  "callsWithAssignmentProducers": 0,
173
167
  "callsWithNonConstantProducers": 0,
174
168
  "callsWithOtherBranchProducers": 0,
175
- "searchTimeMs": 2,
169
+ "searchTimeMs": 0,
176
170
  "processTimeMs": 0
177
171
  }
178
172
  },
@@ -192,7 +186,7 @@ It offers a wide variety of features, for example:
192
186
  ".meta": {
193
187
  "totalConsidered": 1,
194
188
  "totalUnknown": 0,
195
- "searchTimeMs": 1,
189
+ "searchTimeMs": 0,
196
190
  "processTimeMs": 0
197
191
  }
198
192
  },
@@ -201,7 +195,7 @@ It offers a wide variety of features, for example:
201
195
  ".meta": {
202
196
  "totalConsidered": 0,
203
197
  "searchTimeMs": 0,
204
- "processTimeMs": 1
198
+ "processTimeMs": 0
205
199
  }
206
200
  },
207
201
  "network-functions": {
@@ -209,7 +203,7 @@ It offers a wide variety of features, for example:
209
203
  ".meta": {
210
204
  "totalCalls": 0,
211
205
  "totalFunctionDefinitions": 0,
212
- "searchTimeMs": 1,
206
+ "searchTimeMs": 0,
213
207
  "processTimeMs": 1
214
208
  }
215
209
  },
@@ -220,13 +214,13 @@ It offers a wide variety of features, for example:
220
214
  "numAccesses": 0,
221
215
  "totalAccessed": 0,
222
216
  "searchTimeMs": 0,
223
- "processTimeMs": 2
217
+ "processTimeMs": 0
224
218
  }
225
219
  },
226
220
  "dead-code": {
227
221
  "results": [],
228
222
  ".meta": {
229
- "searchTimeMs": 1,
223
+ "searchTimeMs": 0,
230
224
  "processTimeMs": 0
231
225
  }
232
226
  },
@@ -241,7 +235,7 @@ It offers a wide variety of features, for example:
241
235
  "problematic-inputs": {
242
236
  "results": [],
243
237
  ".meta": {
244
- "searchTimeMs": 1,
238
+ "searchTimeMs": 0,
245
239
  "processTimeMs": 0
246
240
  }
247
241
  },
@@ -281,16 +275,16 @@ It offers a wide variety of features, for example:
281
275
  "subscript": 0
282
276
  },
283
277
  "searchTimeMs": 0,
284
- "processTimeMs": 18
278
+ "processTimeMs": 1
285
279
  }
286
280
  }
287
281
  },
288
282
  ".meta": {
289
- "timing": 3550
283
+ "timing": 7
290
284
  }
291
285
  },
292
286
  ".meta": {
293
- "timing": 3550
287
+ "timing": 7
294
288
  }
295
289
  }
296
290
  ```
@@ -354,7 +348,7 @@ It offers a wide variety of features, for example:
354
348
 
355
349
  ```shell
356
350
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
357
- flowR repl v2.13.14, R grammar v14 (tree-sitter engine)
351
+ flowR repl v2.13.15, R grammar v14 (tree-sitter engine)
358
352
  R> :query @static-slice (11@sum) file://test/testfiles/example.R
359
353
  ```
360
354
 
@@ -368,7 +362,7 @@ It offers a wide variety of features, for example:
368
362
  N <- 10
369
363
  for(i in 1:(N-1)) sum <- sum + i + w
370
364
  sum
371
- All queries together required ≈10 ms (1ms accuracy, total 10 ms)
365
+ All queries together required ≈2 ms (1ms accuracy, total 2 ms)
372
366
  ```
373
367
 
374
368
 
@@ -383,7 +377,7 @@ It offers a wide variety of features, for example:
383
377
  </details>
384
378
 
385
379
  * 🚀 **fast call-graph, data-, and control-flow graphs**\
386
- Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">76.2 ms</span></i> (as of Aug 11, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
380
+ Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">78.5 ms</span></i> (as of Aug 14, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
387
381
  _flowR_ can analyze the data- and control-flow of the average real-world R&nbsp;script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
388
382
  and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph#perspectives-cg).
389
383
 
@@ -419,7 +413,7 @@ It offers a wide variety of features, for example:
419
413
 
420
414
  ```shell
421
415
  $ docker run -it --rm eagleoutice/flowr # or npm run flowr
422
- flowR repl v2.13.14, R grammar v14 (tree-sitter engine)
416
+ flowR repl v2.13.15, R grammar v14 (tree-sitter engine)
423
417
  R> :dataflow* test/testfiles/example.R
424
418
  ```
425
419
 
@@ -692,7 +686,7 @@ It offers a wide variety of features, for example:
692
686
  ```
693
687
 
694
688
 
695
- (The analysis required _1.8 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment. No [signature database](https://github.com/flowr-analysis/flowr/wiki/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`).)
689
+ (The analysis required _1.7 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment. No [signature database](https://github.com/flowr-analysis/flowr/wiki/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`).)
696
690
 
697
691
 
698
692
 
@@ -4,6 +4,7 @@ import { type DataflowGraphVertexArgument } from '../dataflow/graph/vertex';
4
4
  * Helper for unsupported functions that may change the environment.
5
5
  */
6
6
  export declare const UnsupportedFunctions: {
7
+ name: string;
7
8
  /**
8
9
  * Checks whether a data flow graph vertex represents an unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...)
9
10
  */
@@ -41,6 +41,7 @@ const UnsupportedFunctionsList = unsupportedFunctions({
41
41
  * Helper for unsupported functions that may change the environment.
42
42
  */
43
43
  exports.UnsupportedFunctions = {
44
+ name: 'UnsupportedFunctions',
44
45
  /**
45
46
  * Checks whether a data flow graph vertex represents an unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...)
46
47
  */
@@ -142,6 +142,7 @@ async function processQueryArgs(output, analyzer, remainingArgs) {
142
142
  parsedQuery = [{ type: 'call-context', callName: query }];
143
143
  }
144
144
  if (input) {
145
+ input = unquoteWhole(input);
145
146
  input = (0, path_input_1.handlePathLikeInput)(output, input, analyzer.flowrConfig);
146
147
  // reuse a prior analysis (e.g. a dataflow from :df#) when the target is unchanged
147
148
  if (!analyzerHasTarget(analyzer, input)) {
@@ -171,12 +172,46 @@ function parseArgs(line) {
171
172
  const [, name, rest] = configMatch;
172
173
  return { rCode: undefined, remaining: rest === undefined ? [name] : [name, rest] };
173
174
  }
174
- const args = (0, args_1.splitAtEscapeSensitive)(line);
175
+ const [query, rest] = splitQueryFromRest(line);
175
176
  return {
176
177
  rCode: undefined,
177
- remaining: args
178
+ /* the rest keeps its quotes: they belong to the R code, where dropping them turns a string into a symbol */
179
+ remaining: [query, ...(0, args_1.splitAtEscapeSensitive)(rest, false)]
178
180
  };
179
181
  }
182
+ /**
183
+ * Undoes a wrapping of the whole code in quotes, as `:query \@dependencies "library(x)"` writes it. A quote the
184
+ * code itself contains ends the wrapping early, so it is left alone.
185
+ */
186
+ function unquoteWhole(code) {
187
+ const quote = code[0];
188
+ if ((quote !== '"' && quote !== '\'') || code.length < 2 || code[code.length - 1] !== quote) {
189
+ return code;
190
+ }
191
+ for (let i = 1; i < code.length - 1; i++) {
192
+ if (code[i] === quote && code[i - 1] !== '\\') {
193
+ return code;
194
+ }
195
+ }
196
+ return code.slice(1, -1);
197
+ }
198
+ /**
199
+ * Separates the query from everything after it. The query is either a bare token (`@static-slice`) or the
200
+ * quoted JSON form (`"[{\"type\": ...}]"`), whose escapes are undone; the rest is handed on verbatim.
201
+ */
202
+ function splitQueryFromRest(line) {
203
+ const trimmed = line.trimStart();
204
+ const quote = trimmed[0];
205
+ if (quote !== '"' && quote !== '\'') {
206
+ const space = trimmed.indexOf(' ');
207
+ return space < 0 ? [trimmed, ''] : [trimmed.slice(0, space), trimmed.slice(space + 1)];
208
+ }
209
+ let end = 1;
210
+ while (end < trimmed.length && !(trimmed[end] === quote && trimmed[end - 1] !== '\\')) {
211
+ end++;
212
+ }
213
+ return [trimmed.slice(1, end).replace(/\\(.)/g, '$1'), trimmed.slice(end + 1).trimStart()];
214
+ }
180
215
  exports.queryCommand = {
181
216
  description: 'Query the given R code (use \'help\' for more information)',
182
217
  isCodeCommand: true,
package/cli/repl/core.js CHANGED
@@ -165,8 +165,11 @@ function completionSuggestion(line, config) {
165
165
  }
166
166
  function replQueryCompleter(splitLine, startingNewArg, config) {
167
167
  const nonEmpty = splitLine.slice(1).map(s => s.trim()).filter(s => s.length > 0);
168
- const queryShorts = ['help'].concat(Object.keys(query_1.SupportedQueries).map(q => `@${q}`));
169
- if (nonEmpty.length === 0 || (nonEmpty.length === 1 && queryShorts.some(q => q.startsWith(nonEmpty[0]) && nonEmpty[0] !== q && !startingNewArg))) {
168
+ /* `?<type>` documents a query instead of running it, and completes to the same names */
169
+ const asking = !startingNewArg && nonEmpty.length === 1 && nonEmpty[0].startsWith('?');
170
+ const queryShorts = asking ? Object.keys(query_1.SupportedQueries).map(q => `?${q}`)
171
+ : ['help'].concat(Object.keys(query_1.SupportedQueries).map(q => `@${q}`));
172
+ if (asking || nonEmpty.length === 0 || (nonEmpty.length === 1 && queryShorts.some(q => q.startsWith(nonEmpty[0]) && nonEmpty[0] !== q && !startingNewArg))) {
170
173
  return { completions: queryShorts.map(q => `${q} `) };
171
174
  }
172
175
  else {
@@ -68,6 +68,7 @@ export type CfgVertex = CfgStatementVertex | CfgExpressionVertex | CfgBasicBlock
68
68
  * Helper object for {@link CfgVertex} - a vertex in the {@link ControlFlowGraph} that may have markers attached to it (e.g., for function calls).
69
69
  */
70
70
  export declare const CfgVertex: {
71
+ readonly name: "CfgVertex";
71
72
  /**
72
73
  * Create a new expression vertex with the given id, children, call targets, and markers.
73
74
  * @param id - the id of the vertex, which should directly relate to the AST node
@@ -309,6 +310,7 @@ export type CfgEdge = CfgFlowDependencyEdge | CfgControlDependencyEdge;
309
310
  * Helper object for {@link CfgEdge} - an edge in the {@link ControlFlowGraph}.
310
311
  */
311
312
  export declare const CfgEdge: {
313
+ readonly name: "CfgEdge";
312
314
  /**
313
315
  * Check whether the given edge is a flow dependency edge.
314
316
  */
@@ -36,6 +36,7 @@ var CfgVertexType;
36
36
  * Helper object for {@link CfgVertex} - a vertex in the {@link ControlFlowGraph} that may have markers attached to it (e.g., for function calls).
37
37
  */
38
38
  exports.CfgVertex = {
39
+ name: 'CfgVertex',
39
40
  /**
40
41
  * Create a new expression vertex with the given id, children, call targets, and markers.
41
42
  * @param id - the id of the vertex, which should directly relate to the AST node
@@ -400,6 +401,7 @@ exports.CfgVertex = {
400
401
  * Helper object for {@link CfgEdge} - an edge in the {@link ControlFlowGraph}.
401
402
  */
402
403
  exports.CfgEdge = {
404
+ name: 'CfgEdge',
403
405
  /**
404
406
  * Check whether the given edge is a flow dependency edge.
405
407
  */
@@ -82,6 +82,9 @@ function valueFromRNodeConstant(a) {
82
82
  else if (a.type === type_1.RType.Logical) {
83
83
  return a.content.valueOf() ? logical_constants_1.ValueLogicalTrue : logical_constants_1.ValueLogicalFalse;
84
84
  }
85
+ else if (a.type === type_1.RType.FunctionDefinition) {
86
+ return { type: 'function-definition' };
87
+ }
85
88
  return r_value_1.Top;
86
89
  }
87
90
  //# sourceMappingURL=general.js.map
@@ -1,4 +1,4 @@
1
- import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
1
+ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
2
2
  import type { DataflowGraph } from '../graph/graph';
3
3
  import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-analyzer-context';
4
4
  /**
@@ -1,6 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.isFunctionHigherOrder = isFunctionHigherOrder;
4
+ const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
5
+ const resolve_by_name_1 = require("../environments/resolve-by-name");
6
+ const identifier_1 = require("../environments/identifier");
4
7
  const vertex_1 = require("../graph/vertex");
5
8
  const assert_1 = require("../../util/assert");
6
9
  const edge_1 = require("../graph/edge");
@@ -31,6 +34,22 @@ function isAnyReturnAFunction(def, graph) {
31
34
  }
32
35
  return false;
33
36
  }
37
+ /**
38
+ * Whether the argument hands over a built-in function (`f(print)`), which has no definition in the graph and
39
+ * hence no `function-definition` value to resolve to.
40
+ */
41
+ function readsBuiltInFunction(id, graph, ctx) {
42
+ for (const [target, edge] of graph.outgoingEdges(id) ?? []) {
43
+ if (!edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads) || !node_id_1.NodeId.isBuiltIn(target)) {
44
+ continue;
45
+ }
46
+ const defs = (0, resolve_by_name_1.resolveByName)(node_id_1.NodeId.fromBuiltIn(target), ctx.env.makeCleanEnv(), identifier_1.ReferenceType.Function);
47
+ if (defs?.some(d => (0, identifier_1.isReferenceType)(d.type, identifier_1.ReferenceType.BuiltInFunction))) {
48
+ return true;
49
+ }
50
+ }
51
+ return false;
52
+ }
34
53
  function inspectCallSitesArgumentsFns(def, graph, ctx, invertedGraph) {
35
54
  const callSites = invertedGraph?.outgoingEdges(def.id) ?? graph.ingoingEdges(def.id);
36
55
  for (const [callerId, e] of callSites ?? []) {
@@ -46,7 +65,7 @@ function inspectCallSitesArgumentsFns(def, graph, ctx, invertedGraph) {
46
65
  continue;
47
66
  }
48
67
  const value = node_value_1.NodeValue.inGraph.setOf(arg.nodeId, graph, ctx, { resolve: config_1.VariableResolve.Alias });
49
- if (value?.elements.some(e => e.type === 'function-definition')) {
68
+ if (value?.elements.some(e => e.type === 'function-definition') || readsBuiltInFunction(arg.nodeId, graph, ctx)) {
50
69
  return true;
51
70
  }
52
71
  }
@@ -20,6 +20,7 @@ export interface State {
20
20
  * @see {@link CallGraph}
21
21
  */
22
22
  export declare const CallGraph: {
23
+ readonly name: "CallGraph";
23
24
  /**
24
25
  * Extracts the sub call graph from the given call graph, starting from the given entry points.
25
26
  */
@@ -60,5 +61,4 @@ export declare const CallGraph: {
60
61
  readonly invertGraph: <G extends DataflowGraph>(this: void, graph: G, cleanEnv: REnvironmentInformation) => G;
61
62
  readonly resolveGraphCriteria: <G extends DataflowGraph>(graph: G, ctx: import("../../project/context/flowr-analyzer-context").ReadOnlyFlowrAnalyzerContext, idMap?: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").AstIdMap) => G;
62
63
  readonly reaches: <G extends DataflowGraph>(this: void, from: NodeId, to: NodeId, graph: G, knownReachability?: DefaultMap<NodeId, Set<NodeId>>) => boolean;
63
- readonly name: "CallGraph";
64
64
  };
@@ -233,8 +233,8 @@ function mayRunAnyway(graph, reached) {
233
233
  * @see {@link CallGraph}
234
234
  */
235
235
  exports.CallGraph = {
236
- name: 'CallGraph',
237
236
  ...graph_helper_1.GraphHelper,
237
+ name: 'CallGraph',
238
238
  /**
239
239
  * Extracts the sub call graph from the given call graph, starting from the given entry points.
240
240
  */
@@ -20,6 +20,7 @@ import { Identifier } from '../environments/identifier';
20
20
  * - {@link Dataflow.valueIsUsed}/{@link Dataflow.hasComputedArguments} - for what a call does with, and gets as, values,
21
21
  */
22
22
  export declare const Dataflow: {
23
+ readonly name: "Dataflow";
23
24
  /**
24
25
  * Maps to flowR's dataflow edge helper to work with the edges in the dataflow graph
25
26
  */
@@ -47,6 +48,7 @@ export declare const Dataflow: {
47
48
  * Maps to flowR's helper object for the call-graph
48
49
  */
49
50
  readonly callGraph: {
51
+ readonly name: "CallGraph";
50
52
  readonly computeSubCallGraph: (this: void, graph: CallGraph, entryPoints: Set<NodeId>) => CallGraph;
51
53
  readonly entryPoints: (this: void, graph: CallGraph) => Set<NodeId>;
52
54
  readonly unreachableCalls: (this: void, graph: CallGraph) => NodeId[];
@@ -70,7 +72,6 @@ export declare const Dataflow: {
70
72
  readonly invertGraph: <G extends DataflowGraph>(this: void, graph: G, cleanEnv: REnvironmentInformation) => G;
71
73
  readonly resolveGraphCriteria: <G extends DataflowGraph>(graph: G, ctx: import("../../project/context/flowr-analyzer-context").ReadOnlyFlowrAnalyzerContext, idMap?: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").AstIdMap) => G;
72
74
  readonly reaches: <G extends DataflowGraph>(this: void, from: NodeId, to: NodeId, graph: G, knownReachability?: import("../../util/collections/defaultmap").DefaultMap<NodeId, Set<NodeId>>) => boolean;
73
- readonly name: "CallGraph";
74
75
  };
75
76
  };
76
77
  /**
@@ -227,7 +228,6 @@ export declare const Dataflow: {
227
228
  readonly invertGraph: <G extends DataflowGraph>(this: void, graph: G, cleanEnv: REnvironmentInformation) => G;
228
229
  readonly resolveGraphCriteria: <G extends DataflowGraph>(graph: G, ctx: import("../../project/context/flowr-analyzer-context").ReadOnlyFlowrAnalyzerContext, idMap?: import("../../r-bridge/lang-4.x/ast/model/processing/decorate").AstIdMap) => G;
229
230
  readonly reaches: <G extends DataflowGraph>(this: void, from: NodeId, to: NodeId, graph: G, knownReachability?: import("../../util/collections/defaultmap").DefaultMap<NodeId, Set<NodeId>>) => boolean;
230
- readonly name: "Dataflow";
231
231
  /**
232
232
  * Maps to flowR's main graph object to store and manipulate the dataflow graph
233
233
  * @see {@link DataflowGraph}
@@ -26,13 +26,13 @@ const r_base_packages_1 = require("../../util/r-base-packages");
26
26
  * - {@link Dataflow.valueIsUsed}/{@link Dataflow.hasComputedArguments} - for what a call does with, and gets as, values,
27
27
  */
28
28
  exports.Dataflow = {
29
- name: 'Dataflow',
30
29
  /**
31
30
  * Maps to flowR's main graph object to store and manipulate the dataflow graph
32
31
  * @see {@link DataflowGraph}
33
32
  */
34
33
  graph: graph_1.DataflowGraph,
35
34
  ...graph_helper_1.GraphHelper,
35
+ name: 'Dataflow',
36
36
  /**
37
37
  * Maps to flowR's dataflow edge helper to work with the edges in the dataflow graph
38
38
  */
@@ -15,6 +15,7 @@ import { DefaultMap } from '../../util/collections/defaultmap';
15
15
  * - {@link CallGraph}
16
16
  */
17
17
  export declare const GraphHelper: {
18
+ readonly name: "GraphHelper";
18
19
  /** Maps to the mermaid-centric visualization helper for dataflow graphs and their views */
19
20
  readonly visualize: {
20
21
  /**
@@ -17,6 +17,7 @@ const defaultmap_1 = require("../../util/collections/defaultmap");
17
17
  * - {@link CallGraph}
18
18
  */
19
19
  exports.GraphHelper = {
20
+ name: 'GraphHelper',
20
21
  /** Maps to the mermaid-centric visualization helper for dataflow graphs and their views */
21
22
  visualize: {
22
23
  /**
@@ -178,16 +178,19 @@ export type DataflowGraphVertexInfo = Required<DataflowGraphVertexArgument>;
178
178
  export type DataflowGraphVertices<Vertex extends DataflowGraphVertexInfo = DataflowGraphVertexInfo> = Map<NodeId, Vertex>;
179
179
  /** Helpers for {@link DataflowGraphVertexValue} vertices. */
180
180
  export declare const ValueVertex: {
181
+ name: string;
181
182
  /** Whether the given vertex is a value vertex. */
182
183
  is(this: void, vertex?: DataflowGraphVertexBase): vertex is DataflowGraphVertexValue;
183
184
  };
184
185
  /** Helpers for {@link DataflowGraphVertexUse} vertices. */
185
186
  export declare const UseVertex: {
187
+ name: string;
186
188
  /** Whether the given vertex is a use vertex. */
187
189
  is(this: void, vertex?: DataflowGraphVertexBase): vertex is DataflowGraphVertexUse;
188
190
  };
189
191
  /** Helpers for {@link DataflowGraphVertexFunctionCall} vertices. */
190
192
  export declare const FunctionCallVertex: {
193
+ name: string;
191
194
  /** Whether the given vertex is a function call vertex. */
192
195
  is(this: void, vertex?: DataflowGraphVertexBase): vertex is DataflowGraphVertexFunctionCall;
193
196
  /** Whether the given vertex is a function call carrying the given origin. */
@@ -195,11 +198,13 @@ export declare const FunctionCallVertex: {
195
198
  };
196
199
  /** Helpers for {@link DataflowGraphVertexVariableDefinition} vertices. */
197
200
  export declare const VariableDefinitionVertex: {
201
+ name: string;
198
202
  /** Whether the given vertex is a variable definition vertex. */
199
203
  is(this: void, vertex?: DataflowGraphVertexBase): vertex is DataflowGraphVertexVariableDefinition;
200
204
  };
201
205
  /** Helpers for {@link DataflowGraphVertexFunctionDefinition} vertices. */
202
206
  export declare const FunctionDefinitionVertex: {
207
+ name: string;
203
208
  /** Whether the given vertex is a function definition vertex. */
204
209
  is(this: void, vertex?: DataflowGraphVertexBase): vertex is DataflowGraphVertexFunctionDefinition;
205
210
  };
@@ -13,6 +13,7 @@ exports.ValidVertexTypes = new Set(Object.values(VertexType));
13
13
  exports.ValidVertexTypeReverse = Object.fromEntries(Object.entries(VertexType).map(([k, v]) => [v, k]));
14
14
  /** Helpers for {@link DataflowGraphVertexValue} vertices. */
15
15
  exports.ValueVertex = {
16
+ name: 'ValueVertex',
16
17
  /** Whether the given vertex is a value vertex. */
17
18
  is(vertex) {
18
19
  return vertex?.tag === VertexType.Value;
@@ -20,6 +21,7 @@ exports.ValueVertex = {
20
21
  };
21
22
  /** Helpers for {@link DataflowGraphVertexUse} vertices. */
22
23
  exports.UseVertex = {
24
+ name: 'UseVertex',
23
25
  /** Whether the given vertex is a use vertex. */
24
26
  is(vertex) {
25
27
  return vertex?.tag === VertexType.Use;
@@ -27,6 +29,7 @@ exports.UseVertex = {
27
29
  };
28
30
  /** Helpers for {@link DataflowGraphVertexFunctionCall} vertices. */
29
31
  exports.FunctionCallVertex = {
32
+ name: 'FunctionCallVertex',
30
33
  /** Whether the given vertex is a function call vertex. */
31
34
  is(vertex) {
32
35
  return vertex?.tag === VertexType.FunctionCall;
@@ -38,6 +41,7 @@ exports.FunctionCallVertex = {
38
41
  };
39
42
  /** Helpers for {@link DataflowGraphVertexVariableDefinition} vertices. */
40
43
  exports.VariableDefinitionVertex = {
44
+ name: 'VariableDefinitionVertex',
41
45
  /** Whether the given vertex is a variable definition vertex. */
42
46
  is(vertex) {
43
47
  return vertex?.tag === VertexType.VariableDefinition;
@@ -45,6 +49,7 @@ exports.VariableDefinitionVertex = {
45
49
  };
46
50
  /** Helpers for {@link DataflowGraphVertexFunctionDefinition} vertices. */
47
51
  exports.FunctionDefinitionVertex = {
52
+ name: 'FunctionDefinitionVertex',
48
53
  /** Whether the given vertex is a function definition vertex. */
49
54
  is(vertex) {
50
55
  return vertex?.tag === VertexType.FunctionDefinition;
@@ -45,7 +45,7 @@ export declare function processSourceCall<OtherInfo>(name: RSymbol<OtherInfo & P
45
45
  * Processes a source request with the given dataflow processor information and existing dataflow information
46
46
  * Otherwise, this can be an {@link RProjectFile} representing a standalone source file
47
47
  */
48
- export declare function sourceRequest<OtherInfo>(rootId: NodeId, request: RParseRequest | RProjectFile<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, information: DataflowInformation, makeMaybe: boolean, getId?: IdGenerator<NoInfo>): DataflowInformation;
48
+ export declare function sourceRequest<OtherInfo>(rootId: NodeId, request: RParseRequest | RProjectFile<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, information: DataflowInformation, makeMaybe: boolean, getId?: IdGenerator<NoInfo>, evaluatedByRoot?: boolean): DataflowInformation;
49
49
  /**
50
50
  * Processes a standalone source file (i.e., not from a source function call)
51
51
  */
@@ -193,7 +193,7 @@ function processSourceCall(name, args, rootId, data, config) {
193
193
  * Processes a source request with the given dataflow processor information and existing dataflow information
194
194
  * Otherwise, this can be an {@link RProjectFile} representing a standalone source file
195
195
  */
196
- function sourceRequest(rootId, request, data, information, makeMaybe, getId) {
196
+ function sourceRequest(rootId, request, data, information, makeMaybe, getId, evaluatedByRoot = false) {
197
197
  // parse, normalize and dataflow the sourced file
198
198
  let dataflow;
199
199
  let fst;
@@ -261,7 +261,13 @@ function sourceRequest(rootId, request, data, information, makeMaybe, getId) {
261
261
  }
262
262
  // take the entry point as well as all the written references, and give them a control dependency to the source call to show that they are conditional
263
263
  if (!String(rootId).startsWith('file-')) {
264
- if (makeMaybe) {
264
+ if (evaluatedByRoot) {
265
+ /* the call evaluates the code and builds its result from it, so the value flows into the call */
266
+ for (const exit of dataflow.exitPoints) {
267
+ dataflow.graph.addEdge(rootId, exit.nodeId, edge_1.EdgeType.Reads);
268
+ }
269
+ }
270
+ else if (makeMaybe) {
265
271
  if (dataflow.graph.hasVertex(dataflow.entryPoint)) {
266
272
  dataflow.graph.addControlDependency(dataflow.entryPoint, rootId, true);
267
273
  }
@@ -94,7 +94,7 @@ function processStringTemplate(name, args, rootId, data, config) {
94
94
  const template = arg.value;
95
95
  for (const code of interpolationsOf(template.content.str, open, close, config.markup)) {
96
96
  const generator = (0, decorate_1.sourcedDeterministicCountingIdGenerator)(`${name.lexeme}::${template.info.id}`, template.location);
97
- const result = (0, built_in_source_1.sourceRequest)(rootId, (0, retriever_1.requestFromInput)(code), data, information, false, generator);
97
+ const result = (0, built_in_source_1.sourceRequest)(rootId, (0, retriever_1.requestFromInput)(code), data, information, false, generator, true);
98
98
  /* the template stands where the call does, so what it leaves open resolves against the bindings here */
99
99
  (0, linker_1.linkInputs)([...result.in, ...result.unknownReferences], data.environment, [], result.graph, false);
100
100
  results.push(result);
@@ -24,6 +24,7 @@ interface NameIndex {
24
24
  * really depending on it, can be missed.
25
25
  */
26
26
  export declare const Deferred: {
27
+ readonly name: "Deferred";
27
28
  /** Where each name is bound and read, built once and shared by every deferred expression in the graph. */
28
29
  readonly indexOf: <Info>(this: void, graph: DataflowGraph, idMap: AstIdMap<Info & ParentInformation>) => NameIndex;
29
30
  /**
@@ -31,6 +32,12 @@ export declare const Deferred: {
31
32
  * since an earlier read would already have forced it and cached the value.
32
33
  */
33
34
  readonly forcedAt: (this: void, graph: DataflowGraph, binding: NodeId, cfg: ControlFlowGraph) => readonly NodeId[];
35
+ /**
36
+ * Links the writes an expression performs to the uses that may observe them, for a call evaluating the
37
+ * expression at a point control flow can pin down (`eval`). The reads are settled by the evaluating call
38
+ * itself, against the environment in effect there, so only this direction is left open.
39
+ */
40
+ readonly publish: <Info>(this: void, graph: DataflowGraph, expr: NodeId, index: NameIndex, idMap: AstIdMap<Info & ParentInformation>, at: NodeId, cfg?: ControlFlowGraph) => void;
34
41
  /**
35
42
  * Links the expression rooted at `expr` to the bindings it may meet when it is evaluated. Given the reads
36
43
  * that may force it, control flow rules out what no force can reach; without them every binding stays a
@@ -58,6 +58,7 @@ function namesWithin(expr, graph, idMap) {
58
58
  * really depending on it, can be missed.
59
59
  */
60
60
  exports.Deferred = {
61
+ name: 'Deferred',
61
62
  /** Where each name is bound and read, built once and shared by every deferred expression in the graph. */
62
63
  indexOf(graph, idMap) {
63
64
  const definitions = new Map();
@@ -85,6 +86,27 @@ exports.Deferred = {
85
86
  }
86
87
  return reads.filter(r => !reads.some(other => other !== r && (0, happens_before_1.happensBefore)(cfg, other, r) === logic_1.Ternary.Always));
87
88
  },
89
+ /**
90
+ * Links the writes an expression performs to the uses that may observe them, for a call evaluating the
91
+ * expression at a point control flow can pin down (`eval`). The reads are settled by the evaluating call
92
+ * itself, against the environment in effect there, so only this direction is left open.
93
+ */
94
+ publish(graph, expr, index, idMap, at, cfg) {
95
+ const within = namesWithin(expr, graph, idMap);
96
+ const own = new Set(within.map(([id]) => id));
97
+ for (const [node, name, writes] of within) {
98
+ if (!writes) {
99
+ continue;
100
+ }
101
+ for (const use of index.uses.get(name) ?? []) {
102
+ /* only a use the evaluation may reach can see what it wrote */
103
+ if (own.has(use) || (cfg !== undefined && (0, happens_before_1.happensBefore)(cfg, at, use) === logic_1.Ternary.Never)) {
104
+ continue;
105
+ }
106
+ graph.addEdge(use, node, edge_1.EdgeType.Reads);
107
+ }
108
+ }
109
+ },
88
110
  /**
89
111
  * Links the expression rooted at `expr` to the bindings it may meet when it is evaluated. Given the reads
90
112
  * that may force it, control flow rules out what no force can reach; without them every binding stays a
@@ -15,6 +15,7 @@ export declare enum Unquote {
15
15
  }
16
16
  /** The parts of a call R does not evaluate the standard way. */
17
17
  export declare const Nse: {
18
+ readonly name: "Nse";
18
19
  /** The ids an {@link Unquote} escape hands back to standard evaluation, the markers themselves excluded. */
19
20
  readonly unquoted: <Info extends ParentInformation>(this: void, root: RNode<Info> | undefined, style: Unquote) => ReadonlySet<NodeId> | undefined;
20
21
  /** Whether everything below `node` is unquoted. */
@@ -41,6 +41,7 @@ function isNegation(node) {
41
41
  }
42
42
  /** The parts of a call R does not evaluate the standard way. */
43
43
  exports.Nse = {
44
+ name: 'Nse',
44
45
  /** The ids an {@link Unquote} escape hands back to standard evaluation, the markers themselves excluded. */
45
46
  unquoted(root, style) {
46
47
  if (root === undefined || style === Unquote.None) {
@@ -8,6 +8,7 @@ import { linkExpressionIn } from '../../../linker';
8
8
  * in effect there. Working on the finished graph makes assignments, branches, loops, and calls one traversal.
9
9
  */
10
10
  export declare const Quoted: {
11
+ readonly name: "Quoted";
11
12
  /** The expression a capturing call holds on to. */
12
13
  readonly capturedBy: (this: void, graph: DataflowGraph, id: NodeId) => NodeId | undefined;
13
14
  /** Every expression the value at `id` may hold, with the call that captured it. Several is normal. */
@@ -28,6 +28,7 @@ function hasOrigin(vertex, of) {
28
28
  * in effect there. Working on the finished graph makes assignments, branches, loops, and calls one traversal.
29
29
  */
30
30
  exports.Quoted = {
31
+ name: 'Quoted',
31
32
  /** The expression a capturing call holds on to. */
32
33
  capturedBy(graph, id) {
33
34
  const vertex = graph.getVertex(id);
@@ -78,7 +79,8 @@ exports.Quoted = {
78
79
  }
79
80
  }
80
81
  else if (vertex.environment !== undefined && hasOrigin(vertex, EvaluatingProcessors) && !evaluatesElsewhere(idMap.get(id))) {
81
- resolveEvaluation(graph, vertex, vertex.environment, idMap);
82
+ names ??= deferred_1.Deferred.indexOf(graph, idMap);
83
+ resolveEvaluation(graph, vertex, vertex.environment, idMap, names, cfgOnce());
82
84
  }
83
85
  else {
84
86
  for (const escaped of escapingArguments(graph, id)) {
@@ -108,7 +110,7 @@ function capturedArgumentOf(graph, id) {
108
110
  return undefined;
109
111
  }
110
112
  /** Links a capture handed to an evaluating call, in that call's scope. */
111
- function resolveEvaluation(graph, call, environment, idMap) {
113
+ function resolveEvaluation(graph, call, environment, idMap, names, cfg) {
112
114
  const id = call.id;
113
115
  const argument = call.args.find(a => !graph_1.FunctionArgument.isEmpty(a));
114
116
  const reference = argument === undefined ? undefined : unwrapArgument(graph_1.FunctionArgument.getReference(argument), idMap);
@@ -121,6 +123,7 @@ function resolveEvaluation(graph, call, environment, idMap) {
121
123
  (0, linker_1.linkInputs)(open, enclosing, [], graph, false);
122
124
  }
123
125
  graph.addEdge(id, expr, edge_1.EdgeType.Returns);
126
+ deferred_1.Deferred.publish(graph, expr, names, idMap, id, cfg);
124
127
  /* the capture said "not evaluated here", and being handed to `eval` settles that it is */
125
128
  nse_1.Nse.unmark(graph, at);
126
129
  }
@@ -5,6 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.WikiDataflowGraph = void 0;
7
7
  const graph_1 = require("../dataflow/graph/graph");
8
+ const quoted_1 = require("../dataflow/internal/process/functions/call/quoted");
9
+ const nse_1 = require("../dataflow/internal/process/functions/call/nse");
10
+ const deferred_1 = require("../dataflow/internal/process/functions/call/deferred");
8
11
  const doc_query_1 = require("./doc-util/doc-query");
9
12
  const vertex_1 = require("../dataflow/graph/vertex");
10
13
  const edge_1 = require("../dataflow/graph/edge");
@@ -714,6 +717,11 @@ some that may appear to be counter-intuitive. For example, a for-loop body, as i
714
717
 
715
718
  ${(0, doc_structure_1.details)('Example: For-Loop Body', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'for(i in v) b', { mark: new Set([2, '4->2']), ctx }))}
716
719
  ${(0, doc_structure_1.details)('Example: While-Loop Body', await (0, doc_dfg_1.printDfGraphForCode)(parser, 'while(TRUE) b', { mark: new Set([1, '3->1']), ctx }))}
720
+
721
+ Three helpers decide what such a mark means once the graph is complete:
722
+ ${ctx.link(quoted_1.Quoted.name, undefined, { type: 'variable' })} settles what a capture reaches when it is handed to \`eval\` (see ${ctx.linkO(quoted_1.Quoted, 'finalize')}),
723
+ ${ctx.link(nse_1.Nse.name, undefined, { type: 'variable' })} models the escapes a quoting function offers (rlang's \`!!\` and \`bquote\`'s \`.(x)\`), and
724
+ ${ctx.link(deferred_1.Deferred.name, undefined, { type: 'variable' })} links an expression R evaluates at a moment we cannot pin down, as \`delayedAssign\` binds one.
717
725
  `
718
726
  })}
719
727
  `,
@@ -137,6 +137,7 @@ export type LintingResults<Name extends LintingRuleNames> = LintingResultsSucces
137
137
  * Helper functions for working with {@link LintingResults}.
138
138
  */
139
139
  export declare const LintingResults: {
140
+ readonly name: "LintingResults";
140
141
  /**
141
142
  * Checks whether the given linting results represent an error.
142
143
  * @see {@link LintingResultsError}
@@ -6,6 +6,7 @@ const assert_1 = require("../util/assert");
6
6
  * Helper functions for working with {@link LintingResults}.
7
7
  */
8
8
  exports.LintingResults = {
9
+ name: 'LintingResults',
9
10
  /**
10
11
  * Checks whether the given linting results represent an error.
11
12
  * @see {@link LintingResultsError}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagleoutice/flowr",
3
- "version": "2.13.15",
3
+ "version": "2.13.16",
4
4
  "description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
5
5
  "engines": {
6
6
  "node": ">=22"
@@ -50,7 +50,7 @@ function absintQueryLineParser(output, line, _config) {
50
50
  output.stderr(output.formatter.format(`Invalid slicing criteria "${line[1]}"`, { color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }));
51
51
  return { query: [] };
52
52
  }
53
- const code = criteria ? line[2] : line[1];
53
+ const code = (0, slice_query_parser_1.queryLineCode)(line, criteria ? 2 : 1);
54
54
  return {
55
55
  query: {
56
56
  type: 'absint',
@@ -10,6 +10,7 @@ const does_call_query_executor_1 = require("./does-call-query-executor");
10
10
  const args_1 = require("../../../util/text/args");
11
11
  const strings_1 = require("../../../util/text/strings");
12
12
  const range_1 = require("../../../util/range");
13
+ const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
13
14
  const FormatError = 'Invalid constraint format, expected format "(left:$id/"regex")"';
14
15
  /**
15
16
  * Parses a constraint from a string argument.
@@ -64,7 +65,7 @@ function doesCallQueryLineParser(output, line, _config) {
64
65
  calls: constraint.constraint,
65
66
  }
66
67
  ],
67
- rCode: line[1]
68
+ rCode: (0, slice_query_parser_1.queryLineCode)(line)
68
69
  };
69
70
  }
70
71
  exports.DoesCallQueryDefinition = {
@@ -59,7 +59,7 @@ function inputSourcesQueryLineParser(output, line, _config) {
59
59
  return { query: [{
60
60
  type: 'input-sources',
61
61
  criterion: criterion[0],
62
- }], rCode: line[1] };
62
+ }], rCode: (0, slice_query_parser_1.queryLineCode)(line) };
63
63
  }
64
64
  exports.InputSourcesDefinition = {
65
65
  title: 'Input Sources Query',
@@ -18,7 +18,7 @@ function inspectExceptionLineParser(_output, line, _config) {
18
18
  type: 'inspect-exception',
19
19
  filter: criteria
20
20
  },
21
- rCode: criteria ? line[1] : line[0]
21
+ rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
22
22
  };
23
23
  }
24
24
  exports.InspectExceptionQueryDefinition = {
@@ -17,7 +17,7 @@ function inspectHoLineParser(_output, line, _config) {
17
17
  type: 'inspect-higher-order',
18
18
  filter: criteria
19
19
  },
20
- rCode: criteria ? line[1] : line[0]
20
+ rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
21
21
  };
22
22
  }
23
23
  exports.InspectHigherOrderQueryDefinition = {
@@ -17,7 +17,7 @@ function inspectRecLineParser(output, line, _config) {
17
17
  type: 'inspect-recursion',
18
18
  filter: criteria
19
19
  },
20
- rCode: criteria ? line[1] : line[0]
20
+ rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
21
21
  };
22
22
  }
23
23
  exports.InspectRecursionQueryDefinition = {
@@ -33,7 +33,7 @@ function locationMapLineParser(_output, line, _config) {
33
33
  ids: criteria,
34
34
  ...(span ? { span } : {})
35
35
  },
36
- rCode: span ? rest[1] : rest[0]
36
+ rCode: (0, slice_query_parser_1.queryLineCode)(rest, span ? 1 : 0)
37
37
  };
38
38
  }
39
39
  exports.LocationMapQueryDefinition = {
@@ -20,7 +20,7 @@ function originQueryLineParser(output, line, _config) {
20
20
  type: 'origin',
21
21
  criterion: criterion
22
22
  },
23
- rCode: line[1]
23
+ rCode: (0, slice_query_parser_1.queryLineCode)(line)
24
24
  };
25
25
  }
26
26
  exports.OriginQueryDefinition = {
@@ -29,7 +29,7 @@ function provenanceQueryLineParser(output, line, _config) {
29
29
  type: 'provenance',
30
30
  criterion: criterion[0],
31
31
  restrictFdef: stopFdef
32
- }], rCode: line[1] };
32
+ }], rCode: (0, slice_query_parser_1.queryLineCode)(line) };
33
33
  }
34
34
  exports.ProvenanceQueryDefinition = {
35
35
  title: 'Provenance Query',
@@ -23,7 +23,7 @@ function resolveValueLineParser(output, line, _config) {
23
23
  criteria: criteria,
24
24
  }
25
25
  ],
26
- rCode: line[1]
26
+ rCode: (0, slice_query_parser_1.queryLineCode)(line)
27
27
  };
28
28
  }
29
29
  exports.ResolveValueQueryDefinition = {
@@ -15,6 +15,7 @@ export interface RDelimiter extends MergeableRecord, Location {
15
15
  * Helper for working with {@link RDelimiter} AST nodes.
16
16
  */
17
17
  export declare const RDelimiter: {
18
+ readonly name: "RDelimiter";
18
19
  /**
19
20
  * Type guard for {@link RDelimiter} nodes.
20
21
  */
@@ -6,6 +6,7 @@ const type_1 = require("../../type");
6
6
  * Helper for working with {@link RDelimiter} AST nodes.
7
7
  */
8
8
  exports.RDelimiter = {
9
+ name: 'RDelimiter',
9
10
  /**
10
11
  * Type guard for {@link RDelimiter} nodes.
11
12
  */
@@ -44,6 +44,7 @@ export type DecodedCriteria = ReadonlyArray<DecodedCriterion>;
44
44
  * The helper object associated with {@link SlicingCriteria} which makes it easy to parse, validate and resolve slicing criteria.
45
45
  */
46
46
  export declare const SlicingCriteria: {
47
+ readonly name: "SlicingCriteria";
47
48
  /**
48
49
  * Decodes all slicing criteria to their corresponding node ids
49
50
  * @throws CriteriaParseError if any of the criteria can not be resolved
@@ -92,6 +92,7 @@ exports.SlicingCriterion = {
92
92
  * The helper object associated with {@link SlicingCriteria} which makes it easy to parse, validate and resolve slicing criteria.
93
93
  */
94
94
  exports.SlicingCriteria = {
95
+ name: 'SlicingCriteria',
95
96
  /**
96
97
  * Decodes all slicing criteria to their corresponding node ids
97
98
  * @throws CriteriaParseError if any of the criteria can not be resolved
@@ -11,6 +11,7 @@ export type RVersion = SemVer & {
11
11
  };
12
12
  /** Helpers for R package versions (`1.2-3` style), which are freer than SemVer. */
13
13
  export declare const RVersion: {
14
+ readonly name: "RVersion";
14
15
  /**
15
16
  * Parse an R version string into a {@link SemVer}, normalizing R's freer scheme (e.g. `0.4-9`). Unlike
16
17
  * `new SemVer(version)` this coerces where needed; the original string is available via `.str`. Returns
@@ -37,6 +38,7 @@ export declare const RVersion: {
37
38
  export declare function rReleaseDate(version: string): Date | undefined;
38
39
  /** Helpers for R package version ranges (DESCRIPTION constraints like `>= 0.4-9`). */
39
40
  export declare const RRange: {
41
+ readonly name: "RRange";
40
42
  /**
41
43
  * Parse an R version range string into a {@link Range}, normalizing R's freer scheme. The original range
42
44
  * string is available via `.str`.
package/util/r-version.js CHANGED
@@ -80,6 +80,7 @@ function makeRange(range, original) {
80
80
  }
81
81
  /** Helpers for R package versions (`1.2-3` style), which are freer than SemVer. */
82
82
  exports.RVersion = {
83
+ name: 'RVersion',
83
84
  /**
84
85
  * Parse an R version string into a {@link SemVer}, normalizing R's freer scheme (e.g. `0.4-9`). Unlike
85
86
  * `new SemVer(version)` this coerces where needed; the original string is available via `.str`. Returns
@@ -159,6 +160,7 @@ function rReleaseDate(version) {
159
160
  }
160
161
  /** Helpers for R package version ranges (DESCRIPTION constraints like `>= 0.4-9`). */
161
162
  exports.RRange = {
163
+ name: 'RRange',
162
164
  /**
163
165
  * Parse an R version range string into a {@link Range}, normalizing R's freer scheme. The original range
164
166
  * string is available via `.str`.
package/util/record.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  * Helper for transforming records.
3
3
  */
4
4
  export declare const Record: {
5
+ readonly name: "Record";
5
6
  /**
6
7
  * Returns an array of the names of the properties of a record.
7
8
  * @param object - The record to get the property names from.
package/util/record.js CHANGED
@@ -5,6 +5,7 @@ exports.Record = void 0;
5
5
  * Helper for transforming records.
6
6
  */
7
7
  exports.Record = {
8
+ name: 'Record',
8
9
  /**
9
10
  * Returns an array of the names of the properties of a record.
10
11
  * @param object - The record to get the property names from.
package/util/version.js CHANGED
@@ -42,7 +42,7 @@ const assert_1 = require("./assert");
42
42
  const sigdb_download_1 = require("../project/sigdb/sigdb-download");
43
43
  const doc_files_1 = require("../documentation/doc-util/doc-files");
44
44
  // this is automatically replaced with the current version by release-it
45
- const version = '2.13.15';
45
+ const version = '2.13.16';
46
46
  // this is automatically replaced with the release date by release-it (regex-bumper, see package.json)
47
47
  const versionDate = '2026-07-15T07:13:44Z';
48
48
  /**