@eagleoutice/flowr 2.13.15 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -37
- package/abstract-interpretation/absint-visitor.js +1 -1
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
- package/abstract-interpretation/data-frame/mappers/arguments.js +7 -4
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +18 -17
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +6 -6
- package/abstract-interpretation/data-frame/resolve-args.d.ts +9 -4
- package/abstract-interpretation/data-frame/resolve-args.js +10 -5
- package/abstract-interpretation/unsupported-functions.d.ts +1 -0
- package/abstract-interpretation/unsupported-functions.js +1 -0
- package/benchmark/calibration.d.ts +12 -5
- package/benchmark/calibration.js +42 -14
- package/benchmark/slicer.d.ts +1 -1
- package/benchmark/slicer.js +5 -4
- package/benchmark/stats/size-of.js +1 -1
- package/benchmark/summarizer/first-phase/process.d.ts +2 -0
- package/benchmark/summarizer/first-phase/process.js +2 -0
- package/cli/common/options.d.ts +0 -31
- package/cli/common/options.js +1 -8
- package/cli/common/scripts-info.d.ts +0 -38
- package/cli/common/scripts-info.js +0 -8
- package/cli/repl/commands/repl-query.js +37 -2
- package/cli/repl/core.js +6 -3
- package/cli/repl/parser/slice-query-parser.js +1 -1
- package/cli/repl/print-version.js +2 -2
- package/config.d.ts +16 -0
- package/config.js +79 -0
- package/control-flow/control-flow-graph.d.ts +2 -0
- package/control-flow/control-flow-graph.js +2 -0
- package/control-flow/extract-cfg.js +1 -1
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +1 -1
- package/control-flow/useless-loop.js +1 -1
- package/core/print/slice-diff-ansi.js +1 -1
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/dataflow/cluster.js +2 -2
- package/dataflow/environments/built-in-props.d.ts +8 -1
- package/dataflow/environments/built-in-props.js +18 -0
- package/dataflow/environments/built-in.d.ts +7 -1
- package/dataflow/environments/built-in.js +42 -3
- package/dataflow/environments/default-builtin-config.d.ts +442 -10
- package/dataflow/environments/default-builtin-config.js +188 -18
- package/dataflow/environments/environment.d.ts +1 -1
- package/dataflow/environments/identifier.d.ts +7 -2
- package/dataflow/environments/identifier.js +6 -1
- package/dataflow/environments/query-fn-props.js +2 -2
- package/dataflow/environments/reference-to-maybe.js +5 -5
- package/dataflow/environments/resolve-by-name.d.ts +3 -0
- package/dataflow/environments/resolve-by-name.js +30 -5
- package/dataflow/environments/resolve-helper.d.ts +6 -0
- package/dataflow/environments/resolve-helper.js +6 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +5 -0
- package/dataflow/eval/resolve/alias-tracking.js +21 -14
- package/dataflow/eval/resolve/node-value.d.ts +6 -0
- package/dataflow/eval/resolve/node-value.js +15 -9
- package/dataflow/eval/resolve/resolve-argument.js +2 -2
- package/dataflow/eval/resolve/resolve-numbers.js +2 -2
- package/dataflow/eval/resolve/resolve-operators.js +4 -3
- package/dataflow/eval/resolve/resolve-strings.js +3 -3
- package/dataflow/eval/resolve/resolve-working-directory.js +2 -1
- package/dataflow/eval/resolve/resolve.d.ts +5 -5
- package/dataflow/eval/resolve/resolve.js +10 -11
- package/dataflow/eval/values/general.d.ts +4 -1
- package/dataflow/eval/values/general.js +4 -1
- package/dataflow/extractor.js +2 -1
- package/dataflow/fn/exceptions-of-function.js +5 -4
- package/dataflow/fn/higher-order-function.d.ts +1 -1
- package/dataflow/fn/higher-order-function.js +22 -2
- package/dataflow/graph/call-graph.d.ts +1 -1
- package/dataflow/graph/call-graph.js +15 -15
- package/dataflow/graph/df-helper.d.ts +17 -2
- package/dataflow/graph/df-helper.js +11 -5
- package/dataflow/graph/diff-dataflow-graph.js +6 -6
- package/dataflow/graph/edge.d.ts +27 -0
- package/dataflow/graph/edge.js +33 -0
- package/dataflow/graph/graph-helper.d.ts +4 -4
- package/dataflow/graph/graph-helper.js +5 -5
- package/dataflow/graph/graph.d.ts +11 -1
- package/dataflow/graph/graph.js +16 -5
- package/dataflow/graph/vertex.d.ts +47 -6
- package/dataflow/graph/vertex.js +47 -6
- package/dataflow/internal/linker.d.ts +1 -0
- package/dataflow/internal/linker.js +11 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +19 -18
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +8 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +15 -12
- package/dataflow/internal/process/functions/call/common.d.ts +9 -1
- package/dataflow/internal/process/functions/call/common.js +17 -6
- package/dataflow/internal/process/functions/call/deferred.d.ts +7 -0
- package/dataflow/internal/process/functions/call/deferred.js +24 -1
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +6 -3
- package/dataflow/internal/process/functions/call/named-call-handling.js +44 -12
- package/dataflow/internal/process/functions/call/nse.d.ts +34 -5
- package/dataflow/internal/process/functions/call/nse.js +114 -6
- package/dataflow/internal/process/functions/call/quoted.d.ts +6 -0
- package/dataflow/internal/process/functions/call/quoted.js +26 -11
- package/dataflow/origin/dfg-get-origin.d.ts +1 -0
- package/dataflow/origin/dfg-get-origin.js +9 -6
- package/documentation/data/faq/faqs.js +88 -88
- package/documentation/data/faq/recommended-configs.js +1 -1
- package/documentation/data/faq/wiki-faq-store.js +1 -1
- package/documentation/doc-capabilities.js +1 -1
- package/documentation/doc-readme.js +1 -1
- package/documentation/doc-util/doc-auto-gen.js +6 -2
- package/documentation/doc-util/doc-functions.js +1 -1
- package/documentation/wiki-cfg.js +2 -2
- package/documentation/wiki-create-linting-rules.js +45 -45
- package/documentation/wiki-dataflow-graph.js +25 -18
- package/documentation/wiki-linting-and-testing.js +93 -5
- package/documentation/wiki-mk/doc-maker.js +1 -1
- package/documentation/wiki-overview.js +12 -1
- package/documentation/wiki-signature-database.js +3 -0
- package/linter/linter-format.d.ts +1 -0
- package/linter/linter-format.js +1 -0
- package/linter/rules/file-path-validity.js +1 -1
- package/linter/rules/function-finder-util.js +1 -1
- package/linter/rules/naming-convention.js +1 -1
- package/linter/rules/no-leaked-credentials.js +2 -1
- package/linter/rules/stop-with-call-arg.js +4 -4
- package/linter/rules/undefined-symbol-util.d.ts +1 -1
- package/linter/rules/undefined-symbol-util.js +5 -4
- package/linter/rules/undefined-symbol.js +3 -3
- package/linter/rules/unused-definition.js +2 -1
- package/package.json +35 -45
- package/project/context/flowr-analyzer-environment-context.d.ts +23 -0
- package/project/context/flowr-analyzer-environment-context.js +25 -0
- package/project/dependency-version-space.js +1 -2
- package/project/flowr-analyzer.js +1 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +3 -3
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +3 -1
- package/project/sigdb/build.js +16 -16
- package/project/sigdb/codec.d.ts +1 -1
- package/project/sigdb/codec.js +13 -13
- package/project/sigdb/decompress.d.ts +1 -1
- package/project/sigdb/decompress.js +33 -33
- package/project/sigdb/index-format.js +2 -2
- package/project/sigdb/manifest.js +21 -21
- package/project/sigdb/memory-source.d.ts +64 -0
- package/project/sigdb/memory-source.js +133 -0
- package/project/sigdb/reader.js +13 -13
- package/queries/catalog/absint-query/absint-query-format.js +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
- package/queries/catalog/dependencies-query/link-devices.js +2 -2
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
- package/queries/catalog/does-call-query/does-call-query-format.js +2 -1
- package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.js +4 -4
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -1
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +2 -2
- package/queries/catalog/origin-query/origin-query-format.js +1 -1
- package/queries/catalog/provenance-query/provenance-query-format.js +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -0
- package/queries/catalog/signature-query/signature-query-executor.js +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
- package/r-bridge/retriever.d.ts +2 -1
- package/r-bridge/retriever.js +3 -2
- package/r-bridge/roxygen2/documentation-provider.d.ts +1 -0
- package/r-bridge/roxygen2/documentation-provider.js +1 -0
- package/r-bridge/roxygen2/roxygen-parse.d.ts +1 -1
- package/r-bridge/roxygen2/roxygen-parse.js +1 -1
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-filters.js +2 -2
- package/search/search-executor/search-enrichers.js +4 -4
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/parse.d.ts +1 -0
- package/slicing/criterion/parse.js +4 -3
- package/slicing/static/slice-call.d.ts +1 -1
- package/slicing/static/slice-call.js +2 -2
- package/slicing/static/static-slicer.js +4 -3
- package/util/assert.js +1 -1
- package/util/log.d.ts +4 -1
- package/util/log.js +15 -2
- package/util/logic.js +2 -2
- package/util/mermaid/cfg.js +1 -1
- package/util/mermaid/dfg.js +6 -6
- package/util/mermaid/mermaid.js +3 -1
- package/util/quads.js +19 -6
- package/util/r-version.d.ts +2 -0
- package/util/r-version.js +2 -0
- package/util/record.d.ts +1 -0
- package/util/record.js +1 -0
- package/util/schema.js +2 -2
- package/util/text/ansi.d.ts +2 -0
- package/util/text/ansi.js +8 -0
- package/util/text/name-rank.d.ts +29 -0
- package/util/text/name-rank.js +39 -0
- package/util/text/url-encoding.d.ts +15 -0
- package/util/text/url-encoding.js +59 -0
- package/util/version.js +1 -1
- package/cli/export-quads-app.d.ts +0 -7
- package/cli/export-quads-app.js +0 -44
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[](https://
|
|
1
|
+
[](https://flowr-analysis.github.io/flowr/)\
|
|
2
2
|
[](https://github.com/flowr-analysis/flowr/actions/workflows/qa.yaml)
|
|
3
3
|
[](https://codecov.io/gh/flowr-analysis/flowr)
|
|
4
4
|
[](https://hub.docker.com/r/eagleoutice/flowr)
|
|
@@ -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.
|
|
46
|
+
flowR repl v2.13.16, 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 (
|
|
55
|
+
Query: linter (66 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 ≈
|
|
70
|
+
All queries together required ≈66 ms (1ms accuracy, total 67 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** (
|
|
92
|
+
Query: **linter** (473 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:
|
|
97
|
+
╰ _Metadata_: totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 5, processTimeMs: 2\
|
|
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:
|
|
102
|
+
╰ _Metadata_: totalConsidered: 1, totalUnknown: 0, searchTimeMs: 2, 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 ≈
|
|
113
|
+
_All queries together required ≈473 ms (1ms accuracy, total 479 ms)_
|
|
120
114
|
|
|
121
115
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
122
116
|
|
|
123
|
-
The analysis required
|
|
117
|
+
The analysis required _479.0 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":
|
|
141
|
-
"processTimeMs":
|
|
134
|
+
"searchTimeMs": 112,
|
|
135
|
+
"processTimeMs": 293
|
|
142
136
|
}
|
|
143
137
|
},
|
|
144
138
|
"file-path-validity": {
|
|
@@ -160,8 +154,8 @@ It offers a wide variety of features, for example:
|
|
|
160
154
|
"totalUnknown": 0,
|
|
161
155
|
"totalWritesBeforeAlways": 0,
|
|
162
156
|
"totalValid": 0,
|
|
163
|
-
"searchTimeMs":
|
|
164
|
-
"processTimeMs":
|
|
157
|
+
"searchTimeMs": 5,
|
|
158
|
+
"processTimeMs": 2
|
|
165
159
|
}
|
|
166
160
|
},
|
|
167
161
|
"seeded-randomness": {
|
|
@@ -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":
|
|
169
|
+
"searchTimeMs": 1,
|
|
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":
|
|
189
|
+
"searchTimeMs": 2,
|
|
196
190
|
"processTimeMs": 0
|
|
197
191
|
}
|
|
198
192
|
},
|
|
@@ -210,7 +204,7 @@ It offers a wide variety of features, for example:
|
|
|
210
204
|
"totalCalls": 0,
|
|
211
205
|
"totalFunctionDefinitions": 0,
|
|
212
206
|
"searchTimeMs": 1,
|
|
213
|
-
"processTimeMs":
|
|
207
|
+
"processTimeMs": 2
|
|
214
208
|
}
|
|
215
209
|
},
|
|
216
210
|
"dataframe-access-validation": {
|
|
@@ -220,7 +214,7 @@ It offers a wide variety of features, for example:
|
|
|
220
214
|
"numAccesses": 0,
|
|
221
215
|
"totalAccessed": 0,
|
|
222
216
|
"searchTimeMs": 0,
|
|
223
|
-
"processTimeMs":
|
|
217
|
+
"processTimeMs": 7
|
|
224
218
|
}
|
|
225
219
|
},
|
|
226
220
|
"dead-code": {
|
|
@@ -234,15 +228,15 @@ It offers a wide variety of features, for example:
|
|
|
234
228
|
"results": [],
|
|
235
229
|
".meta": {
|
|
236
230
|
"numOfUselessLoops": 0,
|
|
237
|
-
"searchTimeMs":
|
|
231
|
+
"searchTimeMs": 1,
|
|
238
232
|
"processTimeMs": 0
|
|
239
233
|
}
|
|
240
234
|
},
|
|
241
235
|
"problematic-inputs": {
|
|
242
236
|
"results": [],
|
|
243
237
|
".meta": {
|
|
244
|
-
"searchTimeMs":
|
|
245
|
-
"processTimeMs":
|
|
238
|
+
"searchTimeMs": 0,
|
|
239
|
+
"processTimeMs": 1
|
|
246
240
|
}
|
|
247
241
|
},
|
|
248
242
|
"stop-call": {
|
|
@@ -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":
|
|
278
|
+
"processTimeMs": 40
|
|
285
279
|
}
|
|
286
280
|
}
|
|
287
281
|
},
|
|
288
282
|
".meta": {
|
|
289
|
-
"timing":
|
|
283
|
+
"timing": 473
|
|
290
284
|
}
|
|
291
285
|
},
|
|
292
286
|
".meta": {
|
|
293
|
-
"timing":
|
|
287
|
+
"timing": 473
|
|
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.
|
|
351
|
+
flowR repl v2.13.16, 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 ≈
|
|
365
|
+
All queries together required ≈30 ms (1ms accuracy, total 31 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!">
|
|
380
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">105.6 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 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.
|
|
416
|
+
flowR repl v2.13.16, 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
|
|
689
|
+
(The analysis required _4.4 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
|
|
|
@@ -895,6 +889,6 @@ and received an unrestricted gift from [Posit](https://posit.co/), the open-sour
|
|
|
895
889
|
|
|
896
890
|
### Generation Notice
|
|
897
891
|
|
|
898
|
-
Please notice that this file was generated automatically using the file [
|
|
892
|
+
Please notice that this file was generated automatically using the file [doc-readme.ts](https://github.com/flowr-analysis/flowr/tree/main/src/documentation/doc-readme.ts "src/documentation/doc-readme.ts") as a source.\
|
|
899
893
|
If you want to make changes please edit the source file (the CI will take care of the rest).
|
|
900
894
|
In fact, many files in the [wiki](https://github.com/flowr-analysis/flowr/wiki) are generated, so make sure to check for the source file if you want to make changes.
|
|
@@ -300,7 +300,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
300
300
|
return true;
|
|
301
301
|
}
|
|
302
302
|
const dataflowVertex = this.getDataflowGraph(nodeId);
|
|
303
|
-
if (
|
|
303
|
+
if (!vertex_1.FunctionCallVertex.is(dataflowVertex) || !Array.isArray(dataflowVertex.origin)) {
|
|
304
304
|
return false;
|
|
305
305
|
}
|
|
306
306
|
const origin = dataflowVertex.origin;
|
|
@@ -6,8 +6,8 @@ const config_1 = require("../../../config");
|
|
|
6
6
|
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
7
7
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
8
8
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
9
|
-
const resolve_args_1 = require("../resolve-args");
|
|
10
9
|
const arguments_1 = require("./arguments");
|
|
10
|
+
const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
|
|
11
11
|
/**
|
|
12
12
|
* Maps a concrete data frame access operation to abstract data frame operations.
|
|
13
13
|
* @param node - The R node of the access
|
|
@@ -33,7 +33,7 @@ function mapDataFrameNamedColumnAccess(access, inference, info) {
|
|
|
33
33
|
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
const colname =
|
|
36
|
+
const colname = resolve_helper_1.Resolve.argument.symbolName(access.access[0], info);
|
|
37
37
|
return [{
|
|
38
38
|
operation: 'accessCols',
|
|
39
39
|
operand: dataFrame.info.id,
|
|
@@ -57,7 +57,7 @@ function mapDataFrameIndexColRowAccess(access, inference, info) {
|
|
|
57
57
|
let rows = undefined;
|
|
58
58
|
let columns = undefined;
|
|
59
59
|
if (rowArg !== undefined && rowArg !== r_function_call_1.EmptyArgument) {
|
|
60
|
-
const rowValue =
|
|
60
|
+
const rowValue = resolve_helper_1.Resolve.argument.value(rowArg, info);
|
|
61
61
|
if (typeof rowValue === 'number') {
|
|
62
62
|
rows = [rowValue];
|
|
63
63
|
}
|
|
@@ -71,7 +71,7 @@ function mapDataFrameIndexColRowAccess(access, inference, info) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
if (colArg !== undefined && colArg !== r_function_call_1.EmptyArgument) {
|
|
74
|
-
const colValue =
|
|
74
|
+
const colValue = resolve_helper_1.Resolve.argument.value(colArg, info);
|
|
75
75
|
if (typeof colValue === 'number') {
|
|
76
76
|
columns = [colValue];
|
|
77
77
|
}
|
|
@@ -24,6 +24,8 @@ const assert_1 = require("../../../util/assert");
|
|
|
24
24
|
const files_1 = require("../../../util/files");
|
|
25
25
|
const resolve_args_1 = require("../resolve-args");
|
|
26
26
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
27
|
+
const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
|
|
28
|
+
const nse_1 = require("../../../dataflow/internal/process/functions/call/nse");
|
|
27
29
|
/** Regular expression representing valid columns names, e.g. for `data.frame` */
|
|
28
30
|
const ColNamesRegex = /^[A-Za-z.][A-Za-z0-9_.]*$/;
|
|
29
31
|
/** Regular expression representing line terminations (LF, CRLF, CR) */
|
|
@@ -82,7 +84,7 @@ function filterValidNames(colnames, checkNames, noDupNames, noEmptyNames, collap
|
|
|
82
84
|
function getArgumentValue(args, argument, info) {
|
|
83
85
|
const arg = getFunctionArgument(args, argument, info);
|
|
84
86
|
const defaultValue = typeof argument !== 'string' ? argument.default : undefined;
|
|
85
|
-
return arg !== undefined ?
|
|
87
|
+
return arg !== undefined ? resolve_helper_1.Resolve.argument.value(arg, info) : defaultValue;
|
|
86
88
|
}
|
|
87
89
|
/**
|
|
88
90
|
* Gets all effective argument from a list of arguments by removing all arguments whose names should be excluded.
|
|
@@ -105,7 +107,7 @@ function getFunctionArgument(args, argument, info) {
|
|
|
105
107
|
const name = typeof argument !== 'string' ? argument.name : argument;
|
|
106
108
|
let arg = undefined;
|
|
107
109
|
if (name !== undefined) {
|
|
108
|
-
arg = args.find(arg =>
|
|
110
|
+
arg = args.find(arg => resolve_helper_1.Resolve.argument.toName(arg, info) === name);
|
|
109
111
|
}
|
|
110
112
|
const hasArgPos = arg === undefined && pos >= 0 && pos < args.length && args[pos] !== r_function_call_1.EmptyArgument && args[pos].name === undefined;
|
|
111
113
|
if (hasArgPos) {
|
|
@@ -145,7 +147,8 @@ function getUnresolvedSymbolsInExpression(expression, dfg) {
|
|
|
145
147
|
const vertex = dfg.get(node.info.id);
|
|
146
148
|
const symbolName = identifier_1.Identifier.mapName(node.content, resolve_args_1.unquoteArgument);
|
|
147
149
|
// ignore symbols named ".", as they are used as argument placeholder in magrittr pipe operations
|
|
148
|
-
|
|
150
|
+
/* the mask read the dataflow adds to a column keeps the name a column, so ask the mark rather than the edges */
|
|
151
|
+
if (vertex_1.UseVertex.is(vertex?.[0]) && symbolName !== '.' && (vertex[1].size === 0 || nse_1.Nse.maskedName(dfg, node.info.id))) {
|
|
149
152
|
unresolvedSymbols.push(symbolName);
|
|
150
153
|
}
|
|
151
154
|
}
|
|
@@ -166,7 +169,7 @@ function hasCriticalArgument(args, critical, info) {
|
|
|
166
169
|
continue;
|
|
167
170
|
}
|
|
168
171
|
else if (typeof param !== 'string' && param.default !== undefined) {
|
|
169
|
-
const value =
|
|
172
|
+
const value = resolve_helper_1.Resolve.argument.value(arg, info);
|
|
170
173
|
if (value !== undefined && value === param.default) {
|
|
171
174
|
continue;
|
|
172
175
|
}
|
|
@@ -14,6 +14,7 @@ const semantics_1 = require("../semantics");
|
|
|
14
14
|
const arguments_1 = require("./arguments");
|
|
15
15
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
16
16
|
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
17
|
+
const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
|
|
17
18
|
/**
|
|
18
19
|
* Represents the different types of data frames in R
|
|
19
20
|
*/
|
|
@@ -594,8 +595,8 @@ function mapDataFrameCreate(args, params, inference, info) {
|
|
|
594
595
|
const checkNames = (0, arguments_1.getArgumentValue)(args, params.checkNames, info);
|
|
595
596
|
const noDupNames = (0, arguments_1.getArgumentValue)(args, params.noDupNames, info);
|
|
596
597
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
597
|
-
const argNames = args.map(arg =>
|
|
598
|
-
const argLengths = args.map(arg =>
|
|
598
|
+
const argNames = args.map(arg => resolve_helper_1.Resolve.argument.toName(arg, info));
|
|
599
|
+
const argLengths = args.map(arg => resolve_helper_1.Resolve.argument.vectorLength(arg, info));
|
|
599
600
|
const allVectors = argLengths.every(assert_1.isNotUndefined);
|
|
600
601
|
const rows = allVectors ? Math.max(...argLengths, 0) : undefined;
|
|
601
602
|
let colnames = argNames;
|
|
@@ -704,8 +705,8 @@ function mapDataFrameColBind(args, params, inference, info) {
|
|
|
704
705
|
operand = undefined;
|
|
705
706
|
// added columns are top if argument cannot be resolved to constant (vector-like) value
|
|
706
707
|
}
|
|
707
|
-
else if (
|
|
708
|
-
const colname =
|
|
708
|
+
else if (resolve_helper_1.Resolve.argument.value(arg, info) !== undefined) {
|
|
709
|
+
const colname = resolve_helper_1.Resolve.argument.toName(arg, info);
|
|
709
710
|
colnames?.push(colname);
|
|
710
711
|
}
|
|
711
712
|
else {
|
|
@@ -746,7 +747,7 @@ function mapDataFrameRowBind(args, params, inference, info) {
|
|
|
746
747
|
operand = undefined;
|
|
747
748
|
// number of added rows is top if arguments cannot be resolved to constant (vector-like) value
|
|
748
749
|
}
|
|
749
|
-
else if (
|
|
750
|
+
else if (resolve_helper_1.Resolve.argument.value(arg, info) !== undefined) {
|
|
750
751
|
rows = rows !== undefined ? rows + 1 : undefined;
|
|
751
752
|
}
|
|
752
753
|
else {
|
|
@@ -804,7 +805,7 @@ function mapDataFrameSubset(args, params, inference, info) {
|
|
|
804
805
|
const result = [];
|
|
805
806
|
let operand = dataFrame.value;
|
|
806
807
|
const filterArg = (0, arguments_1.getFunctionArgument)(args, params.subset, info);
|
|
807
|
-
const filterValue =
|
|
808
|
+
const filterValue = resolve_helper_1.Resolve.argument.value(filterArg, info);
|
|
808
809
|
const selectArg = (0, arguments_1.getFunctionArgument)(args, params.select, info);
|
|
809
810
|
const dropArg = (0, arguments_1.getFunctionArgument)(args, params.drop, info);
|
|
810
811
|
const condition = typeof filterValue === 'boolean' ? filterValue : undefined;
|
|
@@ -868,9 +869,9 @@ function mapDataFrameFilter(args, params, inference, info) {
|
|
|
868
869
|
}
|
|
869
870
|
const result = [];
|
|
870
871
|
const filterArgs = args.filter(arg => arg !== dataFrame);
|
|
871
|
-
const filterValues = filterArgs.map(arg =>
|
|
872
|
+
const filterValues = filterArgs.map(arg => resolve_helper_1.Resolve.argument.value(arg, info));
|
|
872
873
|
const accessedNames = filterArgs.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph).map(identifier_1.Identifier.getName));
|
|
873
|
-
const condition = filterValues.every(value => typeof value === 'boolean') ? filterValues.every(
|
|
874
|
+
const condition = filterValues.every(value => typeof value === 'boolean') ? filterValues.every(Boolean) : undefined;
|
|
874
875
|
if (accessedNames.length > 0) {
|
|
875
876
|
result.push({
|
|
876
877
|
operation: 'accessCols',
|
|
@@ -952,10 +953,10 @@ function mapDataFrameMutate(args, params, inference, info) {
|
|
|
952
953
|
const mutateArgs = args.filter(arg => arg !== dataFrame);
|
|
953
954
|
let deletedCols = mutateArgs
|
|
954
955
|
.filter(arguments_1.isRNull)
|
|
955
|
-
.map(arg =>
|
|
956
|
+
.map(arg => resolve_helper_1.Resolve.argument.toName(arg, info));
|
|
956
957
|
let mutatedCols = mutateArgs
|
|
957
958
|
.filter(arg => !(0, arguments_1.isRNull)(arg))
|
|
958
|
-
.map(arg =>
|
|
959
|
+
.map(arg => resolve_helper_1.Resolve.argument.toName(arg, info));
|
|
959
960
|
// only column names that are not created by mutation are preconditions on the operand
|
|
960
961
|
const accessedNames = mutateArgs
|
|
961
962
|
.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph).map(identifier_1.Identifier.toString))
|
|
@@ -1001,7 +1002,7 @@ function mapDataFrameGroupBy(args, params, inference, info) {
|
|
|
1001
1002
|
const result = [];
|
|
1002
1003
|
const byArgs = args.filter(arg => arg !== dataFrame);
|
|
1003
1004
|
const accessedNames = byArgs.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph)).map(identifier_1.Identifier.toString);
|
|
1004
|
-
const byNames = byArgs.map(arg => r_argument_1.RArgument.isNamed(arg) ?
|
|
1005
|
+
const byNames = byArgs.map(arg => r_argument_1.RArgument.isNamed(arg) ? resolve_helper_1.Resolve.argument.toName(arg, info) : resolve_helper_1.Resolve.argument.symbolName(arg, info));
|
|
1005
1006
|
const mutatedCols = byArgs.some(r_argument_1.RArgument.isNamed) || byNames.some(assert_1.isUndefined);
|
|
1006
1007
|
if (accessedNames.length > 0) {
|
|
1007
1008
|
result.push({
|
|
@@ -1026,7 +1027,7 @@ function mapDataFrameSummarize(args, params, inference, info) {
|
|
|
1026
1027
|
}
|
|
1027
1028
|
const result = [];
|
|
1028
1029
|
const summarizeArgs = args.filter(arg => arg !== dataFrame);
|
|
1029
|
-
const summarizedCols = summarizeArgs.map(arg =>
|
|
1030
|
+
const summarizedCols = summarizeArgs.map(arg => resolve_helper_1.Resolve.argument.toName(arg, info));
|
|
1030
1031
|
// only column names that are not created by summarize are preconditions on the operand
|
|
1031
1032
|
const accessedNames = summarizeArgs
|
|
1032
1033
|
.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph).map(identifier_1.Identifier.toString))
|
|
@@ -1066,7 +1067,7 @@ function mapDataFrameJoin(args, params, inference, info) {
|
|
|
1066
1067
|
let byCols;
|
|
1067
1068
|
const joinType = getJoinType(joinAll, joinLeft, joinRight);
|
|
1068
1069
|
if (byArg !== undefined) {
|
|
1069
|
-
const byValue =
|
|
1070
|
+
const byValue = resolve_helper_1.Resolve.argument.value(byArg, info);
|
|
1070
1071
|
if (typeof byValue === 'string' || typeof byValue === 'number') {
|
|
1071
1072
|
byCols = [byValue];
|
|
1072
1073
|
}
|
|
@@ -1132,7 +1133,7 @@ function getRequestFromRead(fileNameArg, textArg, params, info) {
|
|
|
1132
1133
|
let source;
|
|
1133
1134
|
let request;
|
|
1134
1135
|
if (fileNameArg !== undefined && fileNameArg !== r_function_call_1.EmptyArgument) {
|
|
1135
|
-
const fileName =
|
|
1136
|
+
const fileName = resolve_helper_1.Resolve.argument.value(fileNameArg, info);
|
|
1136
1137
|
if (typeof fileName === 'string') {
|
|
1137
1138
|
const text = (0, resolve_args_1.unescapeSpecialChars)(fileName);
|
|
1138
1139
|
source = fileName;
|
|
@@ -1150,7 +1151,7 @@ function getRequestFromRead(fileNameArg, textArg, params, info) {
|
|
|
1150
1151
|
}
|
|
1151
1152
|
}
|
|
1152
1153
|
else if (textArg !== undefined && textArg !== r_function_call_1.EmptyArgument) {
|
|
1153
|
-
const text =
|
|
1154
|
+
const text = resolve_helper_1.Resolve.argument.value(textArg, info);
|
|
1154
1155
|
if (typeof text === 'string') {
|
|
1155
1156
|
request = (0, retriever_1.requestFromInput)((0, resolve_args_1.unescapeSpecialChars)(text));
|
|
1156
1157
|
}
|
|
@@ -1203,7 +1204,7 @@ function getSelectedColumns(args, info) {
|
|
|
1203
1204
|
unselectedCols = joinColumns(unselectedCols, result.selectedCols);
|
|
1204
1205
|
}
|
|
1205
1206
|
else if (arg.value?.type === type_1.RType.BinaryOp && arg.value.operator === ':' && info.idMap !== undefined) {
|
|
1206
|
-
const values =
|
|
1207
|
+
const values = resolve_helper_1.Resolve.argument.value((0, make_argument_1.toUnnamedArgument)(arg.value, info.idMap), { ...info, resolve: config_1.VariableResolve.Disabled });
|
|
1207
1208
|
if (Array.isArray(values) && values.every(value => typeof value === 'number')) {
|
|
1208
1209
|
selectedCols = joinColumns(selectedCols, values.filter(value => value >= 0));
|
|
1209
1210
|
unselectedCols = joinColumns(unselectedCols, values.filter(value => value < 0).map(Math.abs));
|
|
@@ -1213,7 +1214,7 @@ function getSelectedColumns(args, info) {
|
|
|
1213
1214
|
}
|
|
1214
1215
|
}
|
|
1215
1216
|
else if (arg.value?.type === type_1.RType.Symbol || arg.value?.type === type_1.RType.String) {
|
|
1216
|
-
selectedCols?.push(
|
|
1217
|
+
selectedCols?.push(resolve_helper_1.Resolve.argument.symbolName(arg, info));
|
|
1217
1218
|
}
|
|
1218
1219
|
else if (arg.value?.type === type_1.RType.Number) {
|
|
1219
1220
|
selectedCols?.push(arg.value.content.num);
|
|
@@ -7,12 +7,12 @@ const make_argument_1 = require("../../../dataflow/internal/process/functions/ca
|
|
|
7
7
|
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
8
8
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
9
9
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
10
|
-
const resolve_args_1 = require("../resolve-args");
|
|
11
10
|
const semantics_1 = require("../semantics");
|
|
12
11
|
const access_mapper_1 = require("./access-mapper");
|
|
13
12
|
const arguments_1 = require("./arguments");
|
|
14
13
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
15
14
|
const built_in_proc_name_1 = require("../../../dataflow/environments/built-in-proc-name");
|
|
15
|
+
const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
|
|
16
16
|
/** Mapper for mapping the supported data frame replacement functions to mapper functions */
|
|
17
17
|
const DataFrameReplacementFunctionMapper = {
|
|
18
18
|
'colnames': mapDataFrameColNamesAssignment,
|
|
@@ -60,7 +60,7 @@ function isDataFrameReplacement(functionName) {
|
|
|
60
60
|
}
|
|
61
61
|
function hasParentReplacement(node, dfg) {
|
|
62
62
|
const parentVertex = node.info.parent ? dfg.getVertex(node.info.parent) : undefined;
|
|
63
|
-
return vertex_1.FunctionCallVertex.
|
|
63
|
+
return vertex_1.FunctionCallVertex.hasOrigin(parentVertex, built_in_proc_name_1.BuiltInProcName.Replacement);
|
|
64
64
|
}
|
|
65
65
|
function mapDataFrameContentAssignment(access, expression, inference) {
|
|
66
66
|
const dataFrame = access.accessed;
|
|
@@ -88,7 +88,7 @@ function mapDataFrameNamedColumnAssignment(access, expression, inference, info)
|
|
|
88
88
|
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
-
const colname =
|
|
91
|
+
const colname = resolve_helper_1.Resolve.argument.symbolName(access.access[0], info);
|
|
92
92
|
if ((0, arguments_1.isRNull)(expression)) {
|
|
93
93
|
return [{
|
|
94
94
|
operation: 'removeCols',
|
|
@@ -116,7 +116,7 @@ function mapDataFrameIndexColRowAssignment(access, expression, inference, info)
|
|
|
116
116
|
const rowArg = args.length < 2 ? undefined : args[0];
|
|
117
117
|
const colArg = args.length < 2 ? args[0] : args[1];
|
|
118
118
|
if (rowArg !== undefined && rowArg !== r_function_call_1.EmptyArgument) {
|
|
119
|
-
const rowValue =
|
|
119
|
+
const rowValue = resolve_helper_1.Resolve.argument.value(rowArg, info);
|
|
120
120
|
let rows = undefined;
|
|
121
121
|
if (typeof rowValue === 'number') {
|
|
122
122
|
rows = [rowValue];
|
|
@@ -131,7 +131,7 @@ function mapDataFrameIndexColRowAssignment(access, expression, inference, info)
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
if (colArg !== undefined && colArg !== r_function_call_1.EmptyArgument) {
|
|
134
|
-
const colValue =
|
|
134
|
+
const colValue = resolve_helper_1.Resolve.argument.value(colArg, info);
|
|
135
135
|
let columns = undefined;
|
|
136
136
|
if (typeof colValue === 'string') {
|
|
137
137
|
columns = [colValue];
|
|
@@ -166,7 +166,7 @@ function mapDataFrameColNamesAssignment(operand, expression, inference, info, pa
|
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
const argument = info.idMap !== undefined ? (0, make_argument_1.toUnnamedArgument)(expression, info.idMap) : r_function_call_1.EmptyArgument;
|
|
169
|
-
const assignedNames =
|
|
169
|
+
const assignedNames = resolve_helper_1.Resolve.argument.stringVector(argument, info);
|
|
170
170
|
return [{
|
|
171
171
|
operation: 'setColNames',
|
|
172
172
|
operand: operand.value?.info.id,
|
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ResolveInfo } from '../../dataflow/eval/resolve/alias-tracking';
|
|
2
2
|
import type { RArgument } from '../../r-bridge/lang-4.x/ast/model/nodes/r-argument';
|
|
3
3
|
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
5
5
|
/**
|
|
6
6
|
* Returns the argument name of a function argument
|
|
7
|
+
* @useInstead {@link Resolve.argument.toName}
|
|
7
8
|
*/
|
|
8
9
|
export declare function resolveIdToArgName(id: NodeId | RArgument<ParentInformation> | undefined, info: ResolveInfo): string | undefined;
|
|
9
10
|
/**
|
|
10
|
-
* Resolves the value of a function argument as string, number, boolean, or vector using {@link
|
|
11
|
+
* Resolves the value of a function argument as string, number, boolean, or vector using {@link Resolve.toValue}
|
|
12
|
+
* @useInstead {@link Resolve.argument.value}
|
|
11
13
|
*/
|
|
12
14
|
export declare function resolveIdToArgValue(id: NodeId | RArgument<ParentInformation> | undefined, info: ResolveInfo): string | number | boolean | (string | number | boolean)[] | undefined;
|
|
13
15
|
/**
|
|
14
|
-
* Resolves the value of a function argument to a string vector using {@link
|
|
16
|
+
* Resolves the value of a function argument to a string vector using {@link Resolve.toValue} and {@link unwrapRValueToString}
|
|
17
|
+
* @useInstead {@link Resolve.argument.stringVector}
|
|
15
18
|
*/
|
|
16
19
|
export declare function resolveIdToArgStringVector(id: NodeId | RArgument<ParentInformation> | undefined, info: ResolveInfo): string[] | undefined;
|
|
17
20
|
/**
|
|
18
21
|
* Returns the symbol name or string value of the value of a function argument
|
|
22
|
+
* @useInstead {@link Resolve.argument.symbolName}
|
|
19
23
|
*/
|
|
20
24
|
export declare function resolveIdToArgValueSymbolName(id: NodeId | RArgument<ParentInformation> | undefined, info: ResolveInfo): string | undefined;
|
|
21
25
|
/**
|
|
22
|
-
* Resolves the vector length of the value of a function argument using {@link
|
|
26
|
+
* Resolves the vector length of the value of a function argument using {@link Resolve.toValue}
|
|
27
|
+
* @useInstead {@link Resolve.argument.vectorLength}
|
|
23
28
|
*/
|
|
24
29
|
export declare function resolveIdToArgVectorLength(id: NodeId | RArgument<ParentInformation> | undefined, info: ResolveInfo): number | undefined;
|
|
25
30
|
/**
|
|
@@ -8,21 +8,23 @@ exports.resolveIdToArgVectorLength = resolveIdToArgVectorLength;
|
|
|
8
8
|
exports.unquoteArgument = unquoteArgument;
|
|
9
9
|
exports.unescapeQuotes = unescapeQuotes;
|
|
10
10
|
exports.unescapeSpecialChars = unescapeSpecialChars;
|
|
11
|
-
const alias_tracking_1 = require("../../dataflow/eval/resolve/alias-tracking");
|
|
12
11
|
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
13
12
|
const assert_1 = require("../../util/assert");
|
|
14
13
|
const r_value_1 = require("../../util/r-value");
|
|
15
14
|
const strings_1 = require("../../util/text/strings");
|
|
16
15
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
16
|
+
const resolve_helper_1 = require("../../dataflow/environments/resolve-helper");
|
|
17
17
|
/**
|
|
18
18
|
* Returns the argument name of a function argument
|
|
19
|
+
* @useInstead {@link Resolve.argument.toName}
|
|
19
20
|
*/
|
|
20
21
|
function resolveIdToArgName(id, info) {
|
|
21
22
|
const node = resolveIdToArgument(id, info);
|
|
22
23
|
return unquoteArgument(node?.name?.content);
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
|
-
* Resolves the value of a function argument as string, number, boolean, or vector using {@link
|
|
26
|
+
* Resolves the value of a function argument as string, number, boolean, or vector using {@link Resolve.toValue}
|
|
27
|
+
* @useInstead {@link Resolve.argument.value}
|
|
26
28
|
*/
|
|
27
29
|
function resolveIdToArgValue(id, info) {
|
|
28
30
|
const unliftedValue = resolveArgToUnlifted(id, info);
|
|
@@ -37,7 +39,8 @@ function resolveIdToArgValue(id, info) {
|
|
|
37
39
|
return undefined;
|
|
38
40
|
}
|
|
39
41
|
/**
|
|
40
|
-
* Resolves the value of a function argument to a string vector using {@link
|
|
42
|
+
* Resolves the value of a function argument to a string vector using {@link Resolve.toValue} and {@link unwrapRValueToString}
|
|
43
|
+
* @useInstead {@link Resolve.argument.stringVector}
|
|
41
44
|
*/
|
|
42
45
|
function resolveIdToArgStringVector(id, info) {
|
|
43
46
|
const unliftedValue = resolveArgToUnlifted(id, info);
|
|
@@ -55,6 +58,7 @@ function resolveIdToArgStringVector(id, info) {
|
|
|
55
58
|
}
|
|
56
59
|
/**
|
|
57
60
|
* Returns the symbol name or string value of the value of a function argument
|
|
61
|
+
* @useInstead {@link Resolve.argument.symbolName}
|
|
58
62
|
*/
|
|
59
63
|
function resolveIdToArgValueSymbolName(id, info) {
|
|
60
64
|
const node = resolveIdToArgument(id, info);
|
|
@@ -67,7 +71,8 @@ function resolveIdToArgValueSymbolName(id, info) {
|
|
|
67
71
|
return undefined;
|
|
68
72
|
}
|
|
69
73
|
/**
|
|
70
|
-
* Resolves the vector length of the value of a function argument using {@link
|
|
74
|
+
* Resolves the vector length of the value of a function argument using {@link Resolve.toValue}
|
|
75
|
+
* @useInstead {@link Resolve.argument.vectorLength}
|
|
71
76
|
*/
|
|
72
77
|
function resolveIdToArgVectorLength(id, info) {
|
|
73
78
|
const unliftedValue = resolveArgToUnlifted(id, info);
|
|
@@ -84,7 +89,7 @@ function resolveIdToArgVectorLength(id, info) {
|
|
|
84
89
|
/** The unlifted value of a function argument, `undefined` if the argument carries no value. */
|
|
85
90
|
function resolveArgToUnlifted(id, info) {
|
|
86
91
|
const node = resolveIdToArgument(id, info);
|
|
87
|
-
return node?.value !== undefined ? (0, r_value_1.unliftRValue)(
|
|
92
|
+
return node?.value !== undefined ? (0, r_value_1.unliftRValue)(resolve_helper_1.Resolve.toValue(node.value, info)) : undefined;
|
|
88
93
|
}
|
|
89
94
|
function resolveIdToArgument(id, { graph, idMap }) {
|
|
90
95
|
idMap ??= graph?.idMap;
|
|
@@ -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
|
*/
|