@eagleoutice/flowr 2.10.1 → 2.10.3
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.
- package/README.md +31 -20
- package/abstract-interpretation/absint-visitor.d.ts +13 -8
- package/abstract-interpretation/absint-visitor.js +35 -26
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +1 -2
- package/abstract-interpretation/data-frame/dataframe-domain.js +14 -15
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +2 -15
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +11 -17
- package/abstract-interpretation/data-frame/mappers/arguments.js +18 -18
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +41 -15
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +74 -48
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -1
- package/abstract-interpretation/data-frame/semantics.d.ts +1 -1
- package/abstract-interpretation/data-frame/semantics.js +31 -35
- package/abstract-interpretation/data-frame/shape-inference.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +1 -0
- package/abstract-interpretation/domains/interval-domain.js +3 -0
- package/abstract-interpretation/domains/product-domain.d.ts +9 -0
- package/abstract-interpretation/domains/product-domain.js +26 -6
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +36 -22
- package/abstract-interpretation/domains/state-abstract-domain.js +169 -62
- package/abstract-interpretation/unsupported-functions.d.ts +10 -0
- package/abstract-interpretation/unsupported-functions.js +45 -0
- package/benchmark/slicer.js +10 -13
- package/cli/flowr.js +1 -1
- package/control-flow/control-flow-graph.js +13 -9
- package/control-flow/semantic-cfg-guided-visitor.d.ts +6 -0
- package/control-flow/semantic-cfg-guided-visitor.js +6 -0
- package/dataflow/environments/built-in-proc-name.d.ts +6 -0
- package/dataflow/environments/built-in-proc-name.js +6 -0
- package/dataflow/environments/built-in.d.ts +7 -5
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +442 -6
- package/dataflow/environments/default-builtin-config.js +158 -3
- package/dataflow/environments/overwrite.js +2 -5
- package/dataflow/graph/df-helper.d.ts +14 -4
- package/dataflow/graph/df-helper.js +36 -6
- package/dataflow/graph/graph.d.ts +10 -0
- package/dataflow/graph/graph.js +12 -0
- package/dataflow/instrument/instrument-dataflow-count.d.ts +10 -0
- package/dataflow/instrument/instrument-dataflow-count.js +10 -0
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -17
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +23 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +80 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +41 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +179 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +7 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +62 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +15 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/common.d.ts +2 -2
- package/dataflow/internal/process/functions/call/common.js +4 -3
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +2 -2
- package/documentation/wiki-absint.js +6 -5
- package/documentation/wiki-analyzer.js +0 -2
- package/documentation/wiki-cfg.js +3 -3
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-normalized-ast.js +7 -7
- package/documentation/wiki-query.js +29 -0
- package/linter/linter-rules.d.ts +24 -1
- package/linter/linter-rules.js +3 -1
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +3 -4
- package/linter/rules/roxygen-arguments.d.ts +35 -0
- package/linter/rules/roxygen-arguments.js +100 -0
- package/package.json +4 -5
- package/project/context/flowr-analyzer-context.d.ts +1 -8
- package/project/context/flowr-analyzer-context.js +1 -7
- package/project/context/flowr-analyzer-environment-context.d.ts +5 -0
- package/project/context/flowr-analyzer-environment-context.js +6 -0
- package/project/context/flowr-analyzer-files-context.d.ts +6 -0
- package/project/context/flowr-analyzer-files-context.js +4 -2
- package/project/flowr-analyzer-builder.js +1 -4
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +10 -5
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.js +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-format.js +7 -2
- package/queries/catalog/files-query/files-query-executor.js +0 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +2 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.js +5 -3
- package/r-bridge/data/data.d.ts +2 -2
- package/r-bridge/data/data.js +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +13 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +14 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +13 -0
- package/r-bridge/lang-4.x/ast/model/versions.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/versions.js +3 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +1 -1
- package/r-bridge/roxygen2/documentation-provider.js +15 -6
- package/r-bridge/roxygen2/roxygen-ast.d.ts +3 -1
- package/search/flowr-search-builder.js +3 -2
- package/util/mermaid/ast.js +2 -1
- package/util/record.d.ts +23 -0
- package/util/record.js +33 -0
- package/util/version.js +1 -1
- package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +0 -41
- package/abstract-interpretation/domains/mapped-abstract-domain.js +0 -213
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ It offers a wide variety of features, for example:
|
|
|
24
24
|
|
|
25
25
|
```shell
|
|
26
26
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
27
|
-
flowR repl using flowR v2.10.
|
|
27
|
+
flowR repl using flowR v2.10.2, R grammar v14 (tree-sitter engine)
|
|
28
28
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -35,17 +35,17 @@ It offers a wide variety of features, for example:
|
|
|
35
35
|
```text
|
|
36
36
|
Query: linter (2 ms)
|
|
37
37
|
╰ Deprecated Functions (deprecated-functions):
|
|
38
|
-
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs:
|
|
38
|
+
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0
|
|
39
39
|
╰ File Path Validity (file-path-validity):
|
|
40
40
|
╰ certain:
|
|
41
41
|
╰ Path `/root/x.txt` at 1.1-23
|
|
42
|
-
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
42
|
+
╰ Metadata: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 1, processTimeMs: 0
|
|
43
43
|
╰ Seeded Randomness (seeded-randomness):
|
|
44
44
|
╰ Metadata: consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs: 0, processTimeMs: 0
|
|
45
45
|
╰ Absolute Paths (absolute-file-paths):
|
|
46
46
|
╰ certain:
|
|
47
47
|
╰ Path `/root/x.txt` at 1.1-23
|
|
48
|
-
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
48
|
+
╰ Metadata: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0
|
|
49
49
|
╰ Unused Definitions (unused-definitions):
|
|
50
50
|
╰ Metadata: totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0
|
|
51
51
|
╰ Naming Convention (naming-convention):
|
|
@@ -53,7 +53,7 @@ It offers a wide variety of features, for example:
|
|
|
53
53
|
╰ Network Functions (network-functions):
|
|
54
54
|
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0
|
|
55
55
|
╰ Dataframe Access Validation (dataframe-access-validation):
|
|
56
|
-
╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs:
|
|
56
|
+
╰ Metadata: numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 1
|
|
57
57
|
╰ Dead Code (dead-code):
|
|
58
58
|
╰ Metadata: consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0
|
|
59
59
|
╰ Useless Loops (useless-loop):
|
|
@@ -62,6 +62,8 @@ It offers a wide variety of features, for example:
|
|
|
62
62
|
╰ Metadata: searchTimeMs: 0, processTimeMs: 0
|
|
63
63
|
╰ Stop without call.=False argument (stop-call):
|
|
64
64
|
╰ Metadata: consideredNodes: 0, searchTimeMs: 0, processTimeMs: 0
|
|
65
|
+
╰ Roxygen Arguments (roxygen-arguments):
|
|
66
|
+
╰ Metadata: searchTimeMs: 0, processTimeMs: 0
|
|
65
67
|
All queries together required ≈2 ms (1ms accuracy, total 2 ms)
|
|
66
68
|
```
|
|
67
69
|
|
|
@@ -84,7 +86,7 @@ It offers a wide variety of features, for example:
|
|
|
84
86
|
|
|
85
87
|
_Results (prettified and summarized):_
|
|
86
88
|
|
|
87
|
-
Query: **linter** (
|
|
89
|
+
Query: **linter** (3 ms)\
|
|
88
90
|
╰ **Deprecated Functions** (deprecated-functions):\
|
|
89
91
|
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
90
92
|
╰ **File Path Validity** (file-path-validity):\
|
|
@@ -92,11 +94,11 @@ It offers a wide variety of features, for example:
|
|
|
92
94
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
93
95
|
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
94
96
|
╰ **Seeded Randomness** (seeded-randomness):\
|
|
95
|
-
╰ _Metadata_: <code>consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs:
|
|
97
|
+
╰ _Metadata_: <code>consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
96
98
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
97
99
|
╰ certain:\
|
|
98
100
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
99
|
-
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
101
|
+
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
100
102
|
╰ **Unused Definitions** (unused-definitions):\
|
|
101
103
|
╰ _Metadata_: <code>totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
102
104
|
╰ **Naming Convention** (naming-convention):\
|
|
@@ -106,18 +108,20 @@ It offers a wide variety of features, for example:
|
|
|
106
108
|
╰ **Dataframe Access Validation** (dataframe-access-validation):\
|
|
107
109
|
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
108
110
|
╰ **Dead Code** (dead-code):\
|
|
109
|
-
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs:
|
|
111
|
+
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
110
112
|
╰ **Useless Loops** (useless-loop):\
|
|
111
113
|
╰ _Metadata_: <code>numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
112
114
|
╰ **Problematic eval** (problematic-eval):\
|
|
113
115
|
╰ _Metadata_: <code>searchTimeMs: 0, processTimeMs: 0</code>\
|
|
114
116
|
╰ **Stop without call.=False argument** (stop-call):\
|
|
115
117
|
╰ _Metadata_: <code>consideredNodes: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
116
|
-
|
|
118
|
+
╰ **Roxygen Arguments** (roxygen-arguments):\
|
|
119
|
+
╰ _Metadata_: <code>searchTimeMs: 0, processTimeMs: 0</code>\
|
|
120
|
+
_All queries together required ≈3 ms (1ms accuracy, total 3 ms)_
|
|
117
121
|
|
|
118
122
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
119
123
|
|
|
120
|
-
The analysis required _2.
|
|
124
|
+
The analysis required _2.5 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
121
125
|
|
|
122
126
|
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.
|
|
123
127
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -169,7 +173,7 @@ It offers a wide variety of features, for example:
|
|
|
169
173
|
"callsWithAssignmentProducers": 0,
|
|
170
174
|
"callsWithNonConstantProducers": 0,
|
|
171
175
|
"callsWithOtherBranchProducers": 0,
|
|
172
|
-
"searchTimeMs":
|
|
176
|
+
"searchTimeMs": 1,
|
|
173
177
|
"processTimeMs": 0
|
|
174
178
|
}
|
|
175
179
|
},
|
|
@@ -189,7 +193,7 @@ It offers a wide variety of features, for example:
|
|
|
189
193
|
".meta": {
|
|
190
194
|
"totalConsidered": 1,
|
|
191
195
|
"totalUnknown": 0,
|
|
192
|
-
"searchTimeMs":
|
|
196
|
+
"searchTimeMs": 0,
|
|
193
197
|
"processTimeMs": 0
|
|
194
198
|
}
|
|
195
199
|
},
|
|
@@ -233,7 +237,7 @@ It offers a wide variety of features, for example:
|
|
|
233
237
|
"results": [],
|
|
234
238
|
".meta": {
|
|
235
239
|
"consideredNodes": 5,
|
|
236
|
-
"searchTimeMs":
|
|
240
|
+
"searchTimeMs": 1,
|
|
237
241
|
"processTimeMs": 0
|
|
238
242
|
}
|
|
239
243
|
},
|
|
@@ -259,14 +263,21 @@ It offers a wide variety of features, for example:
|
|
|
259
263
|
"searchTimeMs": 0,
|
|
260
264
|
"processTimeMs": 0
|
|
261
265
|
}
|
|
266
|
+
},
|
|
267
|
+
"roxygen-arguments": {
|
|
268
|
+
"results": [],
|
|
269
|
+
".meta": {
|
|
270
|
+
"searchTimeMs": 0,
|
|
271
|
+
"processTimeMs": 0
|
|
272
|
+
}
|
|
262
273
|
}
|
|
263
274
|
},
|
|
264
275
|
".meta": {
|
|
265
|
-
"timing":
|
|
276
|
+
"timing": 3
|
|
266
277
|
}
|
|
267
278
|
},
|
|
268
279
|
".meta": {
|
|
269
|
-
"timing":
|
|
280
|
+
"timing": 3
|
|
270
281
|
}
|
|
271
282
|
}
|
|
272
283
|
```
|
|
@@ -331,7 +342,7 @@ It offers a wide variety of features, for example:
|
|
|
331
342
|
|
|
332
343
|
```shell
|
|
333
344
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
334
|
-
flowR repl using flowR v2.10.
|
|
345
|
+
flowR repl using flowR v2.10.2, R grammar v14 (tree-sitter engine)
|
|
335
346
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
336
347
|
```
|
|
337
348
|
|
|
@@ -345,7 +356,7 @@ It offers a wide variety of features, for example:
|
|
|
345
356
|
N <- 10
|
|
346
357
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
347
358
|
sum
|
|
348
|
-
All queries together required ≈
|
|
359
|
+
All queries together required ≈3 ms (1ms accuracy, total 3 ms)
|
|
349
360
|
```
|
|
350
361
|
|
|
351
362
|
|
|
@@ -379,7 +390,7 @@ It offers a wide variety of features, for example:
|
|
|
379
390
|
|
|
380
391
|
|
|
381
392
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
382
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
393
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">100.4 ms</span></i> (as of Apr 2, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
383
394
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
384
395
|
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).
|
|
385
396
|
|
|
@@ -415,7 +426,7 @@ It offers a wide variety of features, for example:
|
|
|
415
426
|
|
|
416
427
|
```shell
|
|
417
428
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
418
|
-
flowR repl using flowR v2.10.
|
|
429
|
+
flowR repl using flowR v2.10.2, R grammar v14 (tree-sitter engine)
|
|
419
430
|
R> :dataflow* test/testfiles/example.R
|
|
420
431
|
```
|
|
421
432
|
|
|
@@ -2,6 +2,7 @@ import type { ControlFlowInformation } from '../control-flow/control-flow-graph'
|
|
|
2
2
|
import { CfgVertex } from '../control-flow/control-flow-graph';
|
|
3
3
|
import type { SemanticCfgGuidedVisitorConfiguration } from '../control-flow/semantic-cfg-guided-visitor';
|
|
4
4
|
import { SemanticCfgGuidedVisitor } from '../control-flow/semantic-cfg-guided-visitor';
|
|
5
|
+
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
5
6
|
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
6
7
|
import { type DataflowGraphVertexFunctionCall, type DataflowGraphVertexVariableDefinition } from '../dataflow/graph/vertex';
|
|
7
8
|
import type { NoInfo, RNode } from '../r-bridge/lang-4.x/ast/model/model';
|
|
@@ -9,8 +10,6 @@ import type { NormalizedAst, ParentInformation } from '../r-bridge/lang-4.x/ast/
|
|
|
9
10
|
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
10
11
|
import { type AnyAbstractDomain } from './domains/abstract-domain';
|
|
11
12
|
import type { StateAbstractDomain } from './domains/state-abstract-domain';
|
|
12
|
-
import { MutableStateAbstractDomain } from './domains/state-abstract-domain';
|
|
13
|
-
import { BuiltInProcName } from '../dataflow/environments/built-in-proc-name';
|
|
14
13
|
export type AbsintVisitorConfiguration = Omit<SemanticCfgGuidedVisitorConfiguration<NoInfo, ControlFlowInformation, NormalizedAst>, 'defaultVisitingOrder' | 'defaultVisitingType'>;
|
|
15
14
|
/**
|
|
16
15
|
* A control flow graph visitor to perform abstract interpretation.
|
|
@@ -24,20 +23,24 @@ export declare abstract class AbstractInterpretationVisitor<Domain extends AnyAb
|
|
|
24
23
|
/**
|
|
25
24
|
* The abstract trace of the abstract interpretation visitor mapping node IDs to the abstract state at the respective node.
|
|
26
25
|
*/
|
|
27
|
-
|
|
26
|
+
private readonly trace;
|
|
28
27
|
/**
|
|
29
28
|
* The current abstract state domain at the currently processed AST node.
|
|
30
29
|
*/
|
|
31
30
|
private _currentState;
|
|
32
|
-
/**
|
|
33
|
-
* A set of nodes representing variable definitions that have already been visited but whose assignment has not yet been processed.
|
|
34
|
-
*/
|
|
35
|
-
private readonly unassigned;
|
|
36
31
|
/**
|
|
37
32
|
* Whether the current abstract state has been copied/cloned and is save to modify in place.
|
|
38
33
|
*/
|
|
39
34
|
private stateCopied;
|
|
40
|
-
|
|
35
|
+
/**
|
|
36
|
+
* The current worklist stack of next vertex IDs to visit.
|
|
37
|
+
*/
|
|
38
|
+
private stack;
|
|
39
|
+
/**
|
|
40
|
+
* A set of nodes representing variable definitions that have already been visited but whose assignment has not yet been processed.
|
|
41
|
+
*/
|
|
42
|
+
private readonly unassigned;
|
|
43
|
+
constructor(config: Config, domain: Domain);
|
|
41
44
|
get currentState(): StateAbstractDomain<Domain>;
|
|
42
45
|
removeState(node: NodeId): void;
|
|
43
46
|
updateState(node: NodeId, value: Domain): void;
|
|
@@ -100,6 +103,8 @@ export declare abstract class AbstractInterpretationVisitor<Domain extends AnyAb
|
|
|
100
103
|
protected getPredecessorNodes(vertexId: NodeId): NodeId[];
|
|
101
104
|
/** Gets each variable origin that has already been visited and whose assignment has already been processed */
|
|
102
105
|
protected getVariableOrigins(nodeId: NodeId): NodeId[];
|
|
106
|
+
/** Checks whether a node represents a unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...) */
|
|
107
|
+
protected isUnsupportedFunctionCall(nodeId: NodeId): boolean;
|
|
103
108
|
/** We only perform widening at `for`, `while`, or `repeat` loops with more than one ingoing CFG edge */
|
|
104
109
|
protected isWideningPoint(nodeId: NodeId): boolean;
|
|
105
110
|
/**
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AbstractInterpretationVisitor = void 0;
|
|
4
4
|
const control_flow_graph_1 = require("../control-flow/control-flow-graph");
|
|
5
5
|
const semantic_cfg_guided_visitor_1 = require("../control-flow/semantic-cfg-guided-visitor");
|
|
6
|
+
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
7
|
+
const df_helper_1 = require("../dataflow/graph/df-helper");
|
|
6
8
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
7
9
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
8
10
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
@@ -10,8 +12,7 @@ const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
|
10
12
|
const assert_1 = require("../util/assert");
|
|
11
13
|
const abstract_domain_1 = require("./domains/abstract-domain");
|
|
12
14
|
const state_abstract_domain_1 = require("./domains/state-abstract-domain");
|
|
13
|
-
const
|
|
14
|
-
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
15
|
+
const unsupported_functions_1 = require("./unsupported-functions");
|
|
15
16
|
/**
|
|
16
17
|
* A control flow graph visitor to perform abstract interpretation.
|
|
17
18
|
*
|
|
@@ -26,17 +27,21 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
26
27
|
* The current abstract state domain at the currently processed AST node.
|
|
27
28
|
*/
|
|
28
29
|
_currentState;
|
|
29
|
-
/**
|
|
30
|
-
* A set of nodes representing variable definitions that have already been visited but whose assignment has not yet been processed.
|
|
31
|
-
*/
|
|
32
|
-
unassigned = new Set();
|
|
33
30
|
/**
|
|
34
31
|
* Whether the current abstract state has been copied/cloned and is save to modify in place.
|
|
35
32
|
*/
|
|
36
33
|
stateCopied = false;
|
|
37
|
-
|
|
34
|
+
/**
|
|
35
|
+
* The current worklist stack of next vertex IDs to visit.
|
|
36
|
+
*/
|
|
37
|
+
stack = [];
|
|
38
|
+
/**
|
|
39
|
+
* A set of nodes representing variable definitions that have already been visited but whose assignment has not yet been processed.
|
|
40
|
+
*/
|
|
41
|
+
unassigned = new Set();
|
|
42
|
+
constructor(config, domain) {
|
|
38
43
|
super({ ...config, defaultVisitingOrder: 'forward', defaultVisitingType: 'exit' });
|
|
39
|
-
this._currentState =
|
|
44
|
+
this._currentState = state_abstract_domain_1.MutableStateAbstractDomain.top(domain);
|
|
40
45
|
}
|
|
41
46
|
get currentState() {
|
|
42
47
|
return this._currentState;
|
|
@@ -125,7 +130,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
125
130
|
const exitPoints = this.config.controlFlow.exitPoints.map(id => this.getCfgVertex(id)).filter(assert_1.isNotUndefined);
|
|
126
131
|
const exitNodes = exitPoints.map(control_flow_graph_1.CfgVertex.getRootId).filter(assert_1.isNotUndefined);
|
|
127
132
|
const states = exitNodes.map(node => this.trace.get(node)).filter(assert_1.isNotUndefined);
|
|
128
|
-
return abstract_domain_1.AbstractDomain.joinAll(states, this._currentState.
|
|
133
|
+
return abstract_domain_1.AbstractDomain.joinAll(states, this._currentState.bottom());
|
|
129
134
|
}
|
|
130
135
|
/**
|
|
131
136
|
* Gets the inferred abstract trace mapping AST nodes to the inferred abstract state at the respective node.
|
|
@@ -140,15 +145,16 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
140
145
|
this.unassigned.clear();
|
|
141
146
|
}
|
|
142
147
|
startVisitor(start) {
|
|
143
|
-
|
|
144
|
-
while (stack.length > 0) {
|
|
145
|
-
const current = stack.pop();
|
|
148
|
+
this.stack = Array.from(start);
|
|
149
|
+
while (this.stack.length > 0) {
|
|
150
|
+
const current = this.stack.pop();
|
|
146
151
|
if (!this.visitNode(current)) {
|
|
147
152
|
continue;
|
|
148
153
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
154
|
+
const successors = this.config.controlFlow.graph.ingoingEdges(current)?.keys().toArray().reverse() ?? [];
|
|
155
|
+
for (const next of successors) {
|
|
156
|
+
if (!this.stack.includes(next)) { // prevent double entries in working list
|
|
157
|
+
this.stack.push(next);
|
|
152
158
|
}
|
|
153
159
|
}
|
|
154
160
|
}
|
|
@@ -162,18 +168,18 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
162
168
|
const predecessors = this.getPredecessorNodes(control_flow_graph_1.CfgVertex.getId(vertex));
|
|
163
169
|
const predecessorStates = predecessors.map(pred => this.trace.get(pred)).filter(assert_1.isNotUndefined);
|
|
164
170
|
// retrieve new abstract state by joining states of predecessor nodes
|
|
165
|
-
if (predecessorStates.length
|
|
166
|
-
this._currentState = predecessorStates[0];
|
|
171
|
+
if (predecessorStates.length <= 1) {
|
|
172
|
+
this._currentState = predecessorStates[0] ?? this._currentState.top();
|
|
167
173
|
}
|
|
168
174
|
else {
|
|
169
|
-
this._currentState = abstract_domain_1.AbstractDomain.joinAll(predecessorStates
|
|
175
|
+
this._currentState = abstract_domain_1.AbstractDomain.joinAll(predecessorStates);
|
|
170
176
|
this.stateCopied = true;
|
|
171
177
|
}
|
|
172
178
|
const nodeId = control_flow_graph_1.CfgVertex.getRootId(vertex);
|
|
173
179
|
// differentiate between widening points and other vertices
|
|
174
180
|
if (this.isWideningPoint(nodeId)) {
|
|
175
|
-
const oldState = this.trace.get(nodeId)
|
|
176
|
-
if (this.shouldWiden(vertex)) {
|
|
181
|
+
const oldState = this.trace.get(nodeId);
|
|
182
|
+
if (oldState !== undefined && this.shouldWiden(vertex)) {
|
|
177
183
|
this._currentState = oldState.widen(this._currentState);
|
|
178
184
|
this.stateCopied = true;
|
|
179
185
|
}
|
|
@@ -182,12 +188,12 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
182
188
|
const visitedCount = this.visited.get(nodeId) ?? 0;
|
|
183
189
|
this.visited.set(nodeId, visitedCount + 1);
|
|
184
190
|
// continue visiting after widening point if visited for the first time or the state changed
|
|
185
|
-
return visitedCount === 0 || !oldState
|
|
191
|
+
return visitedCount === 0 || !oldState?.equals(this._currentState);
|
|
186
192
|
}
|
|
187
193
|
else {
|
|
188
194
|
this.onVisitNode(vertexId);
|
|
189
|
-
// discard the inferred abstract state when encountering
|
|
190
|
-
if (this.
|
|
195
|
+
// discard the inferred abstract state when encountering unsupported function calls
|
|
196
|
+
if (this.isUnsupportedFunctionCall(nodeId)) {
|
|
191
197
|
this._currentState = this._currentState.top();
|
|
192
198
|
this.stateCopied = true;
|
|
193
199
|
}
|
|
@@ -197,7 +203,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
197
203
|
const visitedCount = this.visited.get(nodeId) ?? 0;
|
|
198
204
|
this.visited.set(nodeId, visitedCount + 1);
|
|
199
205
|
// continue visiting if vertex is not a join vertex or number of visits of predecessors is the same
|
|
200
|
-
return predecessors.length <= 1 || predecessorVisits.every(visits => visits === predecessorVisits[0]);
|
|
206
|
+
return predecessors.length <= 1 || this.stack.length === 0 || predecessorVisits.every(visits => visits === predecessorVisits[0]);
|
|
201
207
|
}
|
|
202
208
|
}
|
|
203
209
|
onDispatchFunctionCallOrigin(call, origin) {
|
|
@@ -278,14 +284,17 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
278
284
|
.map(origin => origin.id)
|
|
279
285
|
.filter(origin => this.trace.has(origin) && !this.unassigned.has(origin)) ?? [];
|
|
280
286
|
}
|
|
287
|
+
/** Checks whether a node represents a unsupported (environment-changing) function call (e.g. `eval`, `load`, `attach`, `rm`, ...) */
|
|
288
|
+
isUnsupportedFunctionCall(nodeId) {
|
|
289
|
+
return unsupported_functions_1.UnsupportedFunctions.isUnsupportedCall(this.getDataflowGraph(nodeId));
|
|
290
|
+
}
|
|
281
291
|
/** We only perform widening at `for`, `while`, or `repeat` loops with more than one ingoing CFG edge */
|
|
282
292
|
isWideningPoint(nodeId) {
|
|
283
293
|
const ingoingEdges = this.config.controlFlow.graph.outgoingEdges(nodeId)?.size; // outgoing dependency edges are ingoing CFG edges
|
|
284
294
|
if (ingoingEdges === undefined || ingoingEdges <= 1) {
|
|
285
295
|
return false;
|
|
286
296
|
}
|
|
287
|
-
|
|
288
|
-
if (model_1.RLoopConstructs.is(node)) {
|
|
297
|
+
else if (model_1.RLoopConstructs.is(this.getNormalizedAst(nodeId))) {
|
|
289
298
|
return true;
|
|
290
299
|
}
|
|
291
300
|
const dataflowVertex = this.getDataflowGraph(nodeId);
|
|
@@ -14,7 +14,6 @@ export type DataFrameShapeProperty<Property extends keyof AbstractDataFrameShape
|
|
|
14
14
|
* The data frame abstract domain as product domain of a column names domain, column count domain, and row count domain.
|
|
15
15
|
*/
|
|
16
16
|
export declare class DataFrameDomain extends ProductDomain<AbstractDataFrameShape> {
|
|
17
|
-
constructor(value: AbstractDataFrameShape);
|
|
18
17
|
create(value: AbstractDataFrameShape): this;
|
|
19
18
|
/**
|
|
20
19
|
* The current abstract value of the column names domain.
|
|
@@ -30,5 +29,5 @@ export declare class DataFrameDomain extends ProductDomain<AbstractDataFrameShap
|
|
|
30
29
|
get rows(): AbstractDataFrameShape['rows'];
|
|
31
30
|
static bottom(maxColNames?: number): DataFrameDomain;
|
|
32
31
|
static top(maxColNames?: number): DataFrameDomain;
|
|
33
|
-
|
|
32
|
+
protected reduce(value: AbstractDataFrameShape): AbstractDataFrameShape;
|
|
34
33
|
}
|
|
@@ -8,13 +8,6 @@ const set_range_domain_1 = require("../domains/set-range-domain");
|
|
|
8
8
|
* The data frame abstract domain as product domain of a column names domain, column count domain, and row count domain.
|
|
9
9
|
*/
|
|
10
10
|
class DataFrameDomain extends product_domain_1.ProductDomain {
|
|
11
|
-
constructor(value) {
|
|
12
|
-
super(DataFrameDomain.refine({
|
|
13
|
-
colnames: value.colnames.create(value.colnames.value),
|
|
14
|
-
cols: value.cols.create(value.cols.value),
|
|
15
|
-
rows: value.rows.create(value.rows.value)
|
|
16
|
-
}));
|
|
17
|
-
}
|
|
18
11
|
create(value) {
|
|
19
12
|
return new DataFrameDomain(value);
|
|
20
13
|
}
|
|
@@ -50,17 +43,23 @@ class DataFrameDomain extends product_domain_1.ProductDomain {
|
|
|
50
43
|
rows: positive_interval_domain_1.PosIntervalDomain.top()
|
|
51
44
|
});
|
|
52
45
|
}
|
|
53
|
-
|
|
46
|
+
reduce(value) {
|
|
54
47
|
if (value.colnames.isValue() && value.cols.isValue()) {
|
|
55
48
|
if (value.colnames.value.min.size >= value.cols.value[1]) {
|
|
56
|
-
value
|
|
49
|
+
value = {
|
|
50
|
+
...value,
|
|
51
|
+
colnames: value.colnames.meet({ min: new Set(), range: value.colnames.value.min })
|
|
52
|
+
};
|
|
57
53
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
}
|
|
55
|
+
if (value.colnames.isValue() && value.cols.isValue()) {
|
|
56
|
+
const minColNames = value.colnames.value.min.size;
|
|
57
|
+
const maxColNames = value.colnames.isFinite() ? value.colnames.value.min.size + value.colnames.value.range.size : Infinity;
|
|
58
|
+
if (minColNames > value.cols.value[0] || maxColNames < value.cols.value[1]) {
|
|
59
|
+
value = {
|
|
60
|
+
...value,
|
|
61
|
+
cols: value.cols.meet([minColNames, maxColNames])
|
|
62
|
+
};
|
|
64
63
|
}
|
|
65
64
|
}
|
|
66
65
|
return value;
|
|
@@ -3,17 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.mapDataFrameAccess = mapDataFrameAccess;
|
|
4
4
|
exports.isStringBasedAccess = isStringBasedAccess;
|
|
5
5
|
const config_1 = require("../../../config");
|
|
6
|
+
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
6
7
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
7
8
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
9
|
const resolve_args_1 = require("../resolve-args");
|
|
9
10
|
const arguments_1 = require("./arguments");
|
|
10
|
-
/**
|
|
11
|
-
* Special named arguments of index-based access operators
|
|
12
|
-
*/
|
|
13
|
-
const SpecialAccessArgumentsMapper = {
|
|
14
|
-
'[': ['drop'],
|
|
15
|
-
'[[': ['exact']
|
|
16
|
-
};
|
|
17
11
|
/**
|
|
18
12
|
* Maps a concrete data frame access operation to abstract data frame operations.
|
|
19
13
|
* @param node - The R node of the access
|
|
@@ -50,7 +44,7 @@ function mapDataFrameIndexColRowAccess(access, inference, info) {
|
|
|
50
44
|
const dataFrame = access.accessed;
|
|
51
45
|
const drop = (0, arguments_1.getArgumentValue)(access.access, 'drop', info);
|
|
52
46
|
const exact = (0, arguments_1.getArgumentValue)(access.access, 'exact', info);
|
|
53
|
-
const args =
|
|
47
|
+
const args = access.access.filter(arg => r_argument_1.RArgument.isEmpty(arg) || r_argument_1.RArgument.isUnnamed(arg));
|
|
54
48
|
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
55
49
|
return;
|
|
56
50
|
}
|
|
@@ -147,13 +141,6 @@ function mapDataFrameIndexColRowAccess(access, inference, info) {
|
|
|
147
141
|
}
|
|
148
142
|
return result;
|
|
149
143
|
}
|
|
150
|
-
/**
|
|
151
|
-
* Removes all special named arguments from the arguments of an access operator (i.e. arguments like "drop" and "exact").
|
|
152
|
-
*/
|
|
153
|
-
function getAccessArgs(operator, args) {
|
|
154
|
-
const specialArgs = SpecialAccessArgumentsMapper[operator];
|
|
155
|
-
return args.filter(arg => arg === r_function_call_1.EmptyArgument || arg.name === undefined || !specialArgs.includes((0, resolve_args_1.unquoteArgument)(arg.name.content)));
|
|
156
|
-
}
|
|
157
144
|
/**
|
|
158
145
|
* Checks whether an access node represents a string-based access (`$` or `@`), and no index-based access (`[` or `[[`).
|
|
159
146
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ResolveInfo } from '../../../dataflow/eval/resolve/alias-tracking';
|
|
2
|
-
import type
|
|
2
|
+
import { type DataflowGraph } from '../../../dataflow/graph/graph';
|
|
3
3
|
import { RNode } from '../../../r-bridge/lang-4.x/ast/model/model';
|
|
4
|
-
import
|
|
5
|
-
import { type
|
|
6
|
-
import
|
|
4
|
+
import { RArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-argument';
|
|
5
|
+
import { type PotentiallyEmptyRArgument, type RFunctionCall, EmptyArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
6
|
+
import { RSymbol } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
7
7
|
import type { ParentInformation } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
8
8
|
import { RNull } from '../../../r-bridge/lang-4.x/convert-values';
|
|
9
9
|
import type { RParseRequest } from '../../../r-bridge/retriever';
|
|
@@ -44,14 +44,14 @@ export declare function filterValidNames(colnames: (string | undefined)[] | unde
|
|
|
44
44
|
* @param info - Argument resolve information
|
|
45
45
|
* @returns The resolved value of the argument or `undefined`
|
|
46
46
|
*/
|
|
47
|
-
export declare function getArgumentValue<T>(args: readonly
|
|
47
|
+
export declare function getArgumentValue<T>(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], argument: FunctionParameterLocation<T> | string, info: ResolveInfo): string | number | boolean | (string | number | boolean)[] | T | undefined;
|
|
48
48
|
/**
|
|
49
49
|
* Gets all effective argument from a list of arguments by removing all arguments whose names should be excluded.
|
|
50
50
|
* @param args - The list of arguments to filter
|
|
51
51
|
* @param excluded - The names of the arguments to exclude
|
|
52
52
|
* @returns The filtered list of arguments
|
|
53
53
|
*/
|
|
54
|
-
export declare function getEffectiveArgs(args: readonly
|
|
54
|
+
export declare function getEffectiveArgs(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], excluded: readonly string[]): readonly PotentiallyEmptyRArgument<ParentInformation>[];
|
|
55
55
|
/**
|
|
56
56
|
* Gets an argument specified as {@link FunctionParameterLocation} from a list of arguments.
|
|
57
57
|
* @param args - The arguments to get the requested argument from
|
|
@@ -59,14 +59,14 @@ export declare function getEffectiveArgs(args: readonly RFunctionArgument<Parent
|
|
|
59
59
|
* @param info - Argument resolve information
|
|
60
60
|
* @returns An argument matching the specified `argument` or `undefined`
|
|
61
61
|
*/
|
|
62
|
-
export declare function getFunctionArgument(args: readonly
|
|
62
|
+
export declare function getFunctionArgument(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], argument: FunctionParameterLocation<unknown> | string, info: ResolveInfo): PotentiallyEmptyRArgument<ParentInformation> | undefined;
|
|
63
63
|
/**
|
|
64
64
|
* Get all function arguments of a function call node in the data flow graph.
|
|
65
65
|
* @param node - The function call node to get the arguments for
|
|
66
66
|
* @param dfg - The data flow graph for retrieving the arguments
|
|
67
67
|
* @returns The arguments of the function call in the data flow graph
|
|
68
68
|
*/
|
|
69
|
-
export declare function getFunctionArguments(node: RFunctionCall<ParentInformation>, dfg: DataflowGraph): readonly
|
|
69
|
+
export declare function getFunctionArguments(node: RFunctionCall<ParentInformation>, dfg: DataflowGraph): readonly PotentiallyEmptyRArgument<ParentInformation>[];
|
|
70
70
|
/**
|
|
71
71
|
* Gets all nested symbols in an expression that have no outgoing edges in the data flow graph.
|
|
72
72
|
* @param expression - The expression to get the symbols from
|
|
@@ -81,7 +81,7 @@ export declare function getUnresolvedSymbolsInExpression(expression: RNode<Paren
|
|
|
81
81
|
* @param info - Argument resolve information
|
|
82
82
|
* @returns Whether the arguments contain any critical argument
|
|
83
83
|
*/
|
|
84
|
-
export declare function hasCriticalArgument(args: readonly
|
|
84
|
+
export declare function hasCriticalArgument(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], critical: (FunctionParameterLocation<unknown> | string)[] | undefined, info: ResolveInfo): boolean;
|
|
85
85
|
/**
|
|
86
86
|
* Checks if a given argument has an inferred data frame shape and therefore represents a data frame
|
|
87
87
|
* @param arg - The argument to check
|
|
@@ -89,20 +89,14 @@ export declare function hasCriticalArgument(args: readonly RFunctionArgument<Par
|
|
|
89
89
|
* @returns Whether the argument represents a data frame
|
|
90
90
|
*/
|
|
91
91
|
export declare function isDataFrameArgument(arg: RNode<ParentInformation> | undefined, inference: DataFrameShapeInferenceVisitor): arg is RNode<ParentInformation>;
|
|
92
|
-
export declare function isDataFrameArgument(arg:
|
|
92
|
+
export declare function isDataFrameArgument(arg: PotentiallyEmptyRArgument<ParentInformation> | undefined, inference: DataFrameShapeInferenceVisitor): arg is RArgument<ParentInformation> & {
|
|
93
93
|
value: RNode<ParentInformation>;
|
|
94
94
|
};
|
|
95
|
-
/**
|
|
96
|
-
* Checks whether a function argument is a names argument.
|
|
97
|
-
*/
|
|
98
|
-
export declare function isNamedArgument(arg: RFunctionArgument<ParentInformation> | undefined): arg is RArgument<ParentInformation> & {
|
|
99
|
-
name: RSymbol<ParentInformation>;
|
|
100
|
-
};
|
|
101
95
|
/**
|
|
102
96
|
* Checks whether a node is `NULL` in R (represents a `NULL` symbol).
|
|
103
97
|
*/
|
|
104
98
|
export declare function isRNull(node: RNode<ParentInformation> | undefined): node is RSymbol<ParentInformation, typeof RNull>;
|
|
105
|
-
export declare function isRNull(node:
|
|
99
|
+
export declare function isRNull(node: PotentiallyEmptyRArgument<ParentInformation> | undefined): node is RArgument<ParentInformation> & {
|
|
106
100
|
value: RSymbol<ParentInformation, typeof RNull>;
|
|
107
101
|
};
|
|
108
102
|
/**
|