@eagleoutice/flowr 2.9.10 → 2.9.12
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 +48 -50
- package/abstract-interpretation/absint-visitor.js +2 -1
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
- package/abstract-interpretation/domains/set-range-domain.js +1 -1
- package/abstract-interpretation/normalized-ast-fold.d.ts +2 -2
- package/abstract-interpretation/normalized-ast-fold.js +4 -3
- package/benchmark/slicer.js +5 -5
- package/benchmark/summarizer/first-phase/process.js +4 -4
- package/cli/repl/commands/repl-normalize.js +2 -2
- package/cli/repl/core.js +2 -2
- package/config.js +1 -1
- package/control-flow/control-flow-graph.d.ts +1 -1
- package/control-flow/control-flow-graph.js +1 -2
- package/control-flow/extract-cfg.js +4 -3
- package/dataflow/cluster.js +12 -8
- package/dataflow/environments/built-in.d.ts +2 -15
- package/dataflow/environments/built-in.js +11 -31
- package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
- package/dataflow/eval/resolve/alias-tracking.js +2 -1
- package/dataflow/eval/resolve/resolve.js +4 -3
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +2 -1
- package/dataflow/graph/call-graph.d.ts +1 -1
- package/dataflow/graph/call-graph.js +4 -3
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +21 -21
- package/dataflow/graph/graph.d.ts +4 -4
- package/dataflow/graph/graph.js +27 -22
- package/dataflow/graph/quads.js +4 -7
- package/dataflow/internal/linker.d.ts +2 -2
- package/dataflow/internal/linker.js +15 -14
- package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +2 -1
- package/dataflow/internal/process/functions/call/argument/make-argument.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -1
- 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-s-three-dispatch.js +3 -3
- package/dataflow/internal/process/functions/call/common.d.ts +1 -1
- package/dataflow/internal/process/functions/call/common.js +43 -35
- package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/process-argument.js +3 -3
- package/dataflow/internal/process/functions/process-parameter.js +2 -2
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-origin.js +2 -2
- package/documentation/doc-util/doc-types.js +1 -1
- package/documentation/wiki-cfg.js +3 -3
- package/documentation/wiki-dataflow-graph.js +86 -31
- package/documentation/wiki-engine.js +18 -0
- package/documentation/wiki-mk/doc-context.d.ts +52 -11
- package/documentation/wiki-mk/doc-context.js +20 -13
- package/documentation/wiki-normalized-ast.d.ts +1 -1
- package/documentation/wiki-normalized-ast.js +9 -6
- package/linter/linter-format.d.ts +10 -0
- package/linter/linter-format.js +15 -0
- package/linter/rules/absolute-path.js +3 -3
- package/linter/rules/file-path-validity.js +1 -1
- package/package.json +1 -1
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +5 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +8 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +4 -5
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +6 -5
- package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +9 -1
- package/queries/catalog/dependencies-query/function-info/write-functions.js +1 -0
- package/queries/catalog/does-call-query/does-call-query-executor.js +3 -3
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +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.d.ts +1 -1
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
- package/queries/query-print.d.ts +1 -1
- package/queries/query-print.js +4 -3
- package/r-bridge/lang-4.x/ast/model/model.d.ts +151 -4
- package/r-bridge/lang-4.x/ast/model/model.js +249 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +13 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +19 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +26 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +36 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +48 -13
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +21 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +8 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +11 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +23 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +32 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +19 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +26 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +12 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +20 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +26 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +12 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +8 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +11 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +17 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +22 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +22 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +45 -8
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +57 -16
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +12 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +15 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +21 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +21 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +22 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +21 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +11 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +14 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +39 -2
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +52 -9
- package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +8 -7
- package/r-bridge/lang-4.x/ast/model/processing/visitor.js +6 -13
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +4 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +2 -2
- package/r-bridge/lang-4.x/convert-values.d.ts +14 -5
- package/r-bridge/lang-4.x/convert-values.js +76 -72
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +2 -2
- package/r-bridge/roxygen2/roxygen-parse.js +1 -1
- package/r-bridge/shell-executor.js +1 -1
- package/reconstruct/auto-select/magic-comments.js +4 -4
- package/reconstruct/reconstruct.js +2 -1
- package/search/search-executor/search-generators.js +2 -2
- package/slicing/criterion/filters/all-variables.js +1 -1
- package/slicing/criterion/parse.d.ts +1 -1
- package/slicing/criterion/parse.js +5 -3
- package/slicing/static/slice-call.d.ts +1 -1
- package/slicing/static/slice-call.js +2 -2
- package/statistics/features/supported/assignments/assignments.js +2 -2
- package/statistics/features/supported/control-flow/control-flow.js +2 -2
- package/statistics/features/supported/data-access/data-access.js +4 -3
- package/statistics/features/supported/defined-functions/defined-functions.js +9 -8
- package/statistics/features/supported/expression-list/statistics-expression-list.js +2 -2
- package/statistics/features/supported/loops/loops.js +6 -5
- package/statistics/features/supported/used-functions/used-functions.js +2 -2
- package/statistics/features/supported/variables/variables.js +8 -8
- package/util/mermaid/ast.js +2 -2
- package/util/mermaid/cfg.js +3 -4
- package/util/mermaid/dfg.d.ts +9 -1
- package/util/mermaid/dfg.js +13 -9
- package/util/quads.js +14 -6
- package/util/range.d.ts +3 -0
- package/util/range.js +3 -0
- package/util/simple-df/dfg-ascii.js +1 -1
- package/util/version.js +1 -1
- package/r-bridge/lang-4.x/ast/model/collect.d.ts +0 -10
- package/r-bridge/lang-4.x/ast/model/collect.js +0 -25
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.9.
|
|
27
|
+
flowR repl using flowR v2.9.11, R grammar v14 (tree-sitter engine)
|
|
28
28
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
29
29
|
```
|
|
30
30
|
|
|
@@ -33,7 +33,7 @@ It offers a wide variety of features, for example:
|
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
```text
|
|
36
|
-
Query: linter (
|
|
36
|
+
Query: linter (2 ms)
|
|
37
37
|
╰ Deprecated Functions (deprecated-functions):
|
|
38
38
|
╰ Metadata: totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0
|
|
39
39
|
╰ File Path Validity (file-path-validity):
|
|
@@ -45,7 +45,7 @@ It offers a wide variety of features, for example:
|
|
|
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,12 +53,12 @@ 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
|
-
╰ Metadata: consideredNodes: 5, searchTimeMs:
|
|
58
|
+
╰ Metadata: consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0
|
|
59
59
|
╰ Useless Loops (useless-loop):
|
|
60
60
|
╰ Metadata: numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0
|
|
61
|
-
All queries together required ≈
|
|
61
|
+
All queries together required ≈2 ms (1ms accuracy, total 2 ms)
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
|
|
@@ -80,19 +80,19 @@ It offers a wide variety of features, for example:
|
|
|
80
80
|
|
|
81
81
|
_Results (prettified and summarized):_
|
|
82
82
|
|
|
83
|
-
Query: **linter** (
|
|
83
|
+
Query: **linter** (2 ms)\
|
|
84
84
|
╰ **Deprecated Functions** (deprecated-functions):\
|
|
85
85
|
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
86
86
|
╰ **File Path Validity** (file-path-validity):\
|
|
87
87
|
╰ certain:\
|
|
88
88
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
89
|
-
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs:
|
|
89
|
+
╰ _Metadata_: <code>totalReads: 1, totalUnknown: 0, totalWritesBeforeAlways: 0, totalValid: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
90
90
|
╰ **Seeded Randomness** (seeded-randomness):\
|
|
91
91
|
╰ _Metadata_: <code>consumerCalls: 0, callsWithFunctionProducers: 0, callsWithAssignmentProducers: 0, callsWithNonConstantProducers: 0, callsWithOtherBranchProducers: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
92
92
|
╰ **Absolute Paths** (absolute-file-paths):\
|
|
93
93
|
╰ certain:\
|
|
94
94
|
╰ Path `/root/x.txt` at 1.1-23\
|
|
95
|
-
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs:
|
|
95
|
+
╰ _Metadata_: <code>totalConsidered: 1, totalUnknown: 0, searchTimeMs: 1, processTimeMs: 0</code>\
|
|
96
96
|
╰ **Unused Definitions** (unused-definitions):\
|
|
97
97
|
╰ _Metadata_: <code>totalConsidered: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
98
98
|
╰ **Naming Convention** (naming-convention):\
|
|
@@ -100,16 +100,16 @@ It offers a wide variety of features, for example:
|
|
|
100
100
|
╰ **Network Functions** (network-functions):\
|
|
101
101
|
╰ _Metadata_: <code>totalCalls: 0, totalFunctionDefinitions: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
102
102
|
╰ **Dataframe Access Validation** (dataframe-access-validation):\
|
|
103
|
-
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs:
|
|
103
|
+
╰ _Metadata_: <code>numOperations: 0, numAccesses: 0, totalAccessed: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
104
104
|
╰ **Dead Code** (dead-code):\
|
|
105
105
|
╰ _Metadata_: <code>consideredNodes: 5, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
106
106
|
╰ **Useless Loops** (useless-loop):\
|
|
107
107
|
╰ _Metadata_: <code>numOfUselessLoops: 0, searchTimeMs: 0, processTimeMs: 0</code>\
|
|
108
|
-
_All queries together required ≈
|
|
108
|
+
_All queries together required ≈2 ms (1ms accuracy, total 2 ms)_
|
|
109
109
|
|
|
110
110
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
111
111
|
|
|
112
|
-
The analysis required
|
|
112
|
+
The analysis required _2.2 ms_ (including parsing and normalization and the query) within the generation environment.
|
|
113
113
|
|
|
114
114
|
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.
|
|
115
115
|
Please consult the [Interface](https://github.com/flowr-analysis/flowr/wiki/Interface) wiki page for more information on how to get those.
|
|
@@ -149,7 +149,7 @@ It offers a wide variety of features, for example:
|
|
|
149
149
|
"totalUnknown": 0,
|
|
150
150
|
"totalWritesBeforeAlways": 0,
|
|
151
151
|
"totalValid": 0,
|
|
152
|
-
"searchTimeMs":
|
|
152
|
+
"searchTimeMs": 0,
|
|
153
153
|
"processTimeMs": 0
|
|
154
154
|
}
|
|
155
155
|
},
|
|
@@ -181,7 +181,7 @@ It offers a wide variety of features, for example:
|
|
|
181
181
|
".meta": {
|
|
182
182
|
"totalConsidered": 1,
|
|
183
183
|
"totalUnknown": 0,
|
|
184
|
-
"searchTimeMs":
|
|
184
|
+
"searchTimeMs": 1,
|
|
185
185
|
"processTimeMs": 0
|
|
186
186
|
}
|
|
187
187
|
},
|
|
@@ -217,7 +217,7 @@ It offers a wide variety of features, for example:
|
|
|
217
217
|
"numOperations": 0,
|
|
218
218
|
"numAccesses": 0,
|
|
219
219
|
"totalAccessed": 0,
|
|
220
|
-
"searchTimeMs":
|
|
220
|
+
"searchTimeMs": 0,
|
|
221
221
|
"processTimeMs": 0
|
|
222
222
|
}
|
|
223
223
|
},
|
|
@@ -239,11 +239,11 @@ It offers a wide variety of features, for example:
|
|
|
239
239
|
}
|
|
240
240
|
},
|
|
241
241
|
".meta": {
|
|
242
|
-
"timing":
|
|
242
|
+
"timing": 2
|
|
243
243
|
}
|
|
244
244
|
},
|
|
245
245
|
".meta": {
|
|
246
|
-
"timing":
|
|
246
|
+
"timing": 2
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
249
|
```
|
|
@@ -308,7 +308,7 @@ It offers a wide variety of features, for example:
|
|
|
308
308
|
|
|
309
309
|
```shell
|
|
310
310
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
311
|
-
flowR repl using flowR v2.9.
|
|
311
|
+
flowR repl using flowR v2.9.11, R grammar v14 (tree-sitter engine)
|
|
312
312
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
313
313
|
```
|
|
314
314
|
|
|
@@ -322,7 +322,7 @@ It offers a wide variety of features, for example:
|
|
|
322
322
|
N <- 10
|
|
323
323
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
324
324
|
sum
|
|
325
|
-
All queries together required ≈
|
|
325
|
+
All queries together required ≈2 ms (1ms accuracy, total 2 ms)
|
|
326
326
|
```
|
|
327
327
|
|
|
328
328
|
|
|
@@ -356,7 +356,7 @@ It offers a wide variety of features, for example:
|
|
|
356
356
|
|
|
357
357
|
|
|
358
358
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
359
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
359
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">98.9 ms</span></i> (as of Feb 18, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
360
360
|
_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,
|
|
361
361
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/wiki/dataflow-graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/wiki/dataflow-graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/wiki/dataflow-graph#perspectives-cg).
|
|
362
362
|
|
|
@@ -392,7 +392,7 @@ It offers a wide variety of features, for example:
|
|
|
392
392
|
|
|
393
393
|
```shell
|
|
394
394
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
395
|
-
flowR repl using flowR v2.9.
|
|
395
|
+
flowR repl using flowR v2.9.11, R grammar v14 (tree-sitter engine)
|
|
396
396
|
R> :dataflow* test/testfiles/example.R
|
|
397
397
|
```
|
|
398
398
|
|
|
@@ -485,9 +485,6 @@ It offers a wide variety of features, for example:
|
|
|
485
485
|
(19)
|
|
486
486
|
*6.13*
|
|
487
487
|
(18)`"]]
|
|
488
|
-
built-in:_["`Built-In:
|
|
489
|
-
(`"]
|
|
490
|
-
style built-in:_ stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
|
|
491
488
|
20[["`#91;RBinaryOp#93; #58;
|
|
492
489
|
(20)
|
|
493
490
|
*6.11-17*
|
|
@@ -505,6 +502,9 @@ It offers a wide variety of features, for example:
|
|
|
505
502
|
(26, :may:36+)
|
|
506
503
|
*7.10-16*
|
|
507
504
|
(24, 25)`"]]
|
|
505
|
+
built-in:_["`Built-In:
|
|
506
|
+
#43;`"]
|
|
507
|
+
style built-in:_ stroke:gray,fill:gray,stroke-width:2px,opacity:.8;
|
|
508
508
|
27(["`#91;RSymbol#93; w
|
|
509
509
|
(27, :may:36+)
|
|
510
510
|
*7.20*`"])
|
|
@@ -613,96 +613,94 @@ It offers a wide variety of features, for example:
|
|
|
613
613
|
18 -.->|"reads, calls"| built-in:-
|
|
614
614
|
linkStyle 24 stroke:gray;
|
|
615
615
|
19 -->|"returns, argument"| 18
|
|
616
|
-
19 -.->|"reads"| built-in:_
|
|
617
|
-
linkStyle 26 stroke:gray;
|
|
618
616
|
20 -->|"reads, argument"| 13
|
|
619
617
|
20 -->|"reads, argument"| 19
|
|
620
618
|
20 -.->|"reads, calls"| built-in::
|
|
621
|
-
linkStyle
|
|
619
|
+
linkStyle 28 stroke:gray;
|
|
622
620
|
24 -->|"reads"| 0
|
|
623
621
|
24 -->|"reads"| 23
|
|
624
622
|
24 -->|"CD-True"| 36
|
|
625
|
-
linkStyle
|
|
623
|
+
linkStyle 31 stroke:gray,color:gray;
|
|
626
624
|
25 -->|"reads"| 12
|
|
627
625
|
25 -->|"CD-True"| 36
|
|
628
|
-
linkStyle
|
|
626
|
+
linkStyle 33 stroke:gray,color:gray;
|
|
629
627
|
26 -->|"reads, argument"| 24
|
|
630
628
|
26 -->|"reads, argument"| 25
|
|
631
629
|
26 -.->|"reads, calls"| built-in:_
|
|
632
|
-
linkStyle
|
|
630
|
+
linkStyle 36 stroke:gray;
|
|
633
631
|
26 -->|"CD-True"| 36
|
|
634
|
-
linkStyle
|
|
632
|
+
linkStyle 37 stroke:gray,color:gray;
|
|
635
633
|
27 -->|"reads"| 6
|
|
636
634
|
27 -->|"CD-True"| 36
|
|
637
|
-
linkStyle
|
|
635
|
+
linkStyle 39 stroke:gray,color:gray;
|
|
638
636
|
28 -->|"reads, argument"| 26
|
|
639
637
|
28 -->|"reads, argument"| 27
|
|
640
638
|
28 -.->|"reads, calls"| built-in:_
|
|
641
|
-
linkStyle
|
|
639
|
+
linkStyle 42 stroke:gray;
|
|
642
640
|
28 -->|"CD-True"| 36
|
|
643
|
-
linkStyle
|
|
641
|
+
linkStyle 43 stroke:gray,color:gray;
|
|
644
642
|
23 -->|"defined-by"| 28
|
|
645
643
|
23 -->|"defined-by"| 29
|
|
646
644
|
23 -->|"CD-True"| 36
|
|
647
|
-
linkStyle
|
|
645
|
+
linkStyle 46 stroke:gray,color:gray;
|
|
648
646
|
29 -->|"reads, argument"| 28
|
|
649
647
|
29 -->|"returns, argument"| 23
|
|
650
648
|
29 -.->|"reads, calls"| built-in:_-
|
|
651
|
-
linkStyle
|
|
649
|
+
linkStyle 49 stroke:gray;
|
|
652
650
|
29 -->|"CD-True"| 36
|
|
653
|
-
linkStyle
|
|
651
|
+
linkStyle 50 stroke:gray,color:gray;
|
|
654
652
|
31 -->|"reads"| 3
|
|
655
653
|
31 -->|"reads"| 30
|
|
656
654
|
31 -->|"CD-True"| 36
|
|
657
|
-
linkStyle
|
|
655
|
+
linkStyle 53 stroke:gray,color:gray;
|
|
658
656
|
32 -->|"reads"| 12
|
|
659
657
|
32 -->|"CD-True"| 36
|
|
660
|
-
linkStyle
|
|
658
|
+
linkStyle 55 stroke:gray,color:gray;
|
|
661
659
|
33 -->|"reads, argument"| 31
|
|
662
660
|
33 -->|"reads, argument"| 32
|
|
663
661
|
33 -.->|"reads, calls"| built-in:_
|
|
664
|
-
linkStyle
|
|
662
|
+
linkStyle 58 stroke:gray;
|
|
665
663
|
33 -->|"CD-True"| 36
|
|
666
|
-
linkStyle
|
|
664
|
+
linkStyle 59 stroke:gray,color:gray;
|
|
667
665
|
30 -->|"defined-by"| 33
|
|
668
666
|
30 -->|"defined-by"| 34
|
|
669
667
|
30 -->|"CD-True"| 36
|
|
670
|
-
linkStyle
|
|
668
|
+
linkStyle 62 stroke:gray,color:gray;
|
|
671
669
|
34 -->|"reads, argument"| 33
|
|
672
670
|
34 -->|"returns, argument"| 30
|
|
673
671
|
34 -.->|"reads, calls"| built-in:_-
|
|
674
|
-
linkStyle
|
|
672
|
+
linkStyle 65 stroke:gray;
|
|
675
673
|
34 -->|"CD-True"| 36
|
|
676
|
-
linkStyle
|
|
674
|
+
linkStyle 66 stroke:gray,color:gray;
|
|
677
675
|
35 -->|"argument"| 29
|
|
678
676
|
35 -->|"returns, argument"| 34
|
|
679
677
|
35 -.->|"reads, calls"| built-in:_
|
|
680
|
-
linkStyle
|
|
678
|
+
linkStyle 69 stroke:gray;
|
|
681
679
|
35 -->|"CD-True"| 36
|
|
682
|
-
linkStyle
|
|
680
|
+
linkStyle 70 stroke:gray,color:gray;
|
|
683
681
|
36 -->|"argument"| 12
|
|
684
682
|
36 -->|"reads, argument"| 20
|
|
685
683
|
36 -->|"argument, non-standard-evaluation"| 35
|
|
686
684
|
36 -.->|"reads, calls"| built-in:for
|
|
687
|
-
linkStyle
|
|
685
|
+
linkStyle 74 stroke:gray;
|
|
688
686
|
40 -->|"reads"| 0
|
|
689
687
|
40 -->|"reads"| 23
|
|
690
688
|
44 -->|"argument"| 38
|
|
691
689
|
44 -->|"reads, argument"| 40
|
|
692
690
|
44 -->|"argument"| 42
|
|
693
691
|
44 -.->|"reads, calls"| built-in:cat
|
|
694
|
-
linkStyle
|
|
692
|
+
linkStyle 80 stroke:gray;
|
|
695
693
|
48 -->|"reads"| 3
|
|
696
694
|
48 -->|"reads"| 30
|
|
697
695
|
52 -->|"argument"| 46
|
|
698
696
|
52 -->|"reads, argument"| 48
|
|
699
697
|
52 -->|"argument"| 50
|
|
700
698
|
52 -.->|"reads, calls"| built-in:cat
|
|
701
|
-
linkStyle
|
|
699
|
+
linkStyle 86 stroke:gray;
|
|
702
700
|
```
|
|
703
701
|
|
|
704
702
|
|
|
705
|
-
(The analysis required _1.
|
|
703
|
+
(The analysis required _1.6 ms_ (including parse and normalize, using the [tree-sitter](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
706
704
|
|
|
707
705
|
|
|
708
706
|
|
|
@@ -6,6 +6,7 @@ const semantic_cfg_guided_visitor_1 = require("../control-flow/semantic-cfg-guid
|
|
|
6
6
|
const built_in_1 = require("../dataflow/environments/built-in");
|
|
7
7
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
8
8
|
const dfg_get_origin_1 = require("../dataflow/origin/dfg-get-origin");
|
|
9
|
+
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
9
10
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
10
11
|
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
11
12
|
const assert_1 = require("../util/assert");
|
|
@@ -284,7 +285,7 @@ class AbstractInterpretationVisitor extends semantic_cfg_guided_visitor_1.Semant
|
|
|
284
285
|
return false;
|
|
285
286
|
}
|
|
286
287
|
const node = this.getNormalizedAst(nodeId);
|
|
287
|
-
if (
|
|
288
|
+
if (model_1.RLoopConstructs.is(node)) {
|
|
288
289
|
return true;
|
|
289
290
|
}
|
|
290
291
|
const dataflowVertex = this.getDataflowGraph(nodeId);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ResolveInfo } from '../../../dataflow/eval/resolve/alias-tracking';
|
|
2
2
|
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
3
|
-
import
|
|
3
|
+
import { RNode } from '../../../r-bridge/lang-4.x/ast/model/model';
|
|
4
4
|
import type { RArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-argument';
|
|
5
5
|
import { type RFunctionArgument, type RFunctionCall, EmptyArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
6
6
|
import type { RSymbol } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
@@ -15,8 +15,8 @@ exports.isValidColName = isValidColName;
|
|
|
15
15
|
exports.parseRequestContent = parseRequestContent;
|
|
16
16
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
17
17
|
const make_argument_1 = require("../../../dataflow/internal/process/functions/call/argument/make-argument");
|
|
18
|
+
const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
|
|
18
19
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
19
|
-
const visitor_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
20
20
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
21
21
|
const convert_values_1 = require("../../../r-bridge/lang-4.x/convert-values");
|
|
22
22
|
const assert_1 = require("../../../util/assert");
|
|
@@ -133,7 +133,7 @@ function getUnresolvedSymbolsInExpression(expression, dfg) {
|
|
|
133
133
|
return [];
|
|
134
134
|
}
|
|
135
135
|
const unresolvedSymbols = [];
|
|
136
|
-
|
|
136
|
+
model_1.RNode.visitAst(expression, node => {
|
|
137
137
|
if (node.type === type_1.RType.Symbol) {
|
|
138
138
|
const vertex = dfg.get(node.info.id);
|
|
139
139
|
if ((0, vertex_1.isUseVertex)(vertex?.[0]) && vertex[1].size === 0) {
|
|
@@ -61,7 +61,7 @@ class SetRangeDomain extends abstract_domain_1.AbstractDomain {
|
|
|
61
61
|
if (this.value === lattice_1.Bottom) {
|
|
62
62
|
return lattice_1.Bottom;
|
|
63
63
|
}
|
|
64
|
-
else if (this.value.range
|
|
64
|
+
else if (this.value.range === lattice_1.Top) {
|
|
65
65
|
return lattice_1.Top;
|
|
66
66
|
}
|
|
67
67
|
return this.value.min.union(this.value.range);
|
|
@@ -12,7 +12,7 @@ import type { RPipe } from '../r-bridge/lang-4.x/ast/model/nodes/r-pipe';
|
|
|
12
12
|
import type { RUnaryOp } from '../r-bridge/lang-4.x/ast/model/nodes/r-unary-op';
|
|
13
13
|
import type { RParameter } from '../r-bridge/lang-4.x/ast/model/nodes/r-parameter';
|
|
14
14
|
import type { RArgument } from '../r-bridge/lang-4.x/ast/model/nodes/r-argument';
|
|
15
|
-
import
|
|
15
|
+
import { RAccess } from '../r-bridge/lang-4.x/ast/model/nodes/r-access';
|
|
16
16
|
import type { RLogical } from '../r-bridge/lang-4.x/ast/model/nodes/r-logical';
|
|
17
17
|
import type { RBreak } from '../r-bridge/lang-4.x/ast/model/nodes/r-break';
|
|
18
18
|
import type { RComment } from '../r-bridge/lang-4.x/ast/model/nodes/r-comment';
|
|
@@ -21,7 +21,7 @@ import type { RNumber } from '../r-bridge/lang-4.x/ast/model/nodes/r-number';
|
|
|
21
21
|
import type { RLineDirective } from '../r-bridge/lang-4.x/ast/model/nodes/r-line-directive';
|
|
22
22
|
import type { RString } from '../r-bridge/lang-4.x/ast/model/nodes/r-string';
|
|
23
23
|
import type { RSymbol } from '../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
24
|
-
import
|
|
24
|
+
import { RProject } from '../r-bridge/lang-4.x/ast/model/nodes/r-project';
|
|
25
25
|
type FoldOfType<T extends RType, Returns = void, Info = NoInfo> = (node: Extract<RNode<Info>, {
|
|
26
26
|
type: T;
|
|
27
27
|
}>) => Returns;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DefaultNormalizedAstFold = void 0;
|
|
4
4
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
5
5
|
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
6
|
+
const r_access_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-access");
|
|
6
7
|
const r_project_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-project");
|
|
7
8
|
/**
|
|
8
9
|
* Default implementation of a fold over the normalized AST (using the classic fold traversal).
|
|
@@ -65,12 +66,12 @@ class DefaultNormalizedAstFold {
|
|
|
65
66
|
if (Array.isArray(nodes)) {
|
|
66
67
|
const n = nodes;
|
|
67
68
|
return this.concatAll(n.filter(n => n && n !== r_function_call_1.EmptyArgument)
|
|
68
|
-
.map(node =>
|
|
69
|
+
.map(node => r_project_1.RProject.is(node) ?
|
|
69
70
|
this.concatAll(node.files.map(f => this.foldSingle(f.root))) :
|
|
70
71
|
this.foldSingle(node)));
|
|
71
72
|
}
|
|
72
73
|
else if (nodes) {
|
|
73
|
-
if (
|
|
74
|
+
if (r_project_1.RProject.is(nodes)) {
|
|
74
75
|
return this.concatAll(nodes.files.map(f => this.foldSingle(f.root)));
|
|
75
76
|
}
|
|
76
77
|
return this.foldSingle(nodes);
|
|
@@ -87,7 +88,7 @@ class DefaultNormalizedAstFold {
|
|
|
87
88
|
}
|
|
88
89
|
foldRAccess(access) {
|
|
89
90
|
let accessed = this.foldSingle(access.accessed);
|
|
90
|
-
if (
|
|
91
|
+
if (r_access_1.RAccess.isIndex(access)) {
|
|
91
92
|
accessed = this.concat(accessed, this.fold(access.access));
|
|
92
93
|
}
|
|
93
94
|
return accessed;
|
package/benchmark/slicer.js
CHANGED
|
@@ -16,8 +16,6 @@ const strings_1 = require("../util/text/strings");
|
|
|
16
16
|
const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
|
|
17
17
|
const retriever_1 = require("../r-bridge/retriever");
|
|
18
18
|
const collect_all_1 = require("../slicing/criterion/collect-all");
|
|
19
|
-
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
20
|
-
const visitor_1 = require("../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
21
19
|
const size_of_1 = require("./stats/size-of");
|
|
22
20
|
const shell_1 = require("../r-bridge/shell");
|
|
23
21
|
const tree_sitter_types_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-types");
|
|
@@ -31,6 +29,8 @@ const lattice_1 = require("../abstract-interpretation/domains/lattice");
|
|
|
31
29
|
const set_range_domain_1 = require("../abstract-interpretation/domains/set-range-domain");
|
|
32
30
|
const fs_1 = __importDefault(require("fs"));
|
|
33
31
|
const flowr_analyzer_context_1 = require("../project/context/flowr-analyzer-context");
|
|
32
|
+
const r_project_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-project");
|
|
33
|
+
const r_comment_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-comment");
|
|
34
34
|
/**
|
|
35
35
|
* The logger to be used for benchmarking as a global object.
|
|
36
36
|
*/
|
|
@@ -127,9 +127,9 @@ class BenchmarkSlicer {
|
|
|
127
127
|
let nodesNoComments = 0;
|
|
128
128
|
let commentChars = 0;
|
|
129
129
|
let commentCharsNoWhitespace = 0;
|
|
130
|
-
|
|
130
|
+
r_project_1.RProject.visitAst(this.normalizedAst.ast, t => {
|
|
131
131
|
nodes++;
|
|
132
|
-
const comments = t.info.adToks?.filter(
|
|
132
|
+
const comments = t.info.adToks?.filter(r_comment_1.RComment.is);
|
|
133
133
|
if (comments && comments.length > 0) {
|
|
134
134
|
const content = comments.map(c => c.lexeme ?? '').join('');
|
|
135
135
|
commentChars += content.length;
|
|
@@ -271,7 +271,7 @@ class BenchmarkSlicer {
|
|
|
271
271
|
stats.numberOfResultingValues++;
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
|
|
274
|
+
r_project_1.RProject.visitAst(this.normalizedAst.ast, node => {
|
|
275
275
|
const operations = inference.getAbstractOperations(node.info.id);
|
|
276
276
|
const value = inference.getAbstractValue(node.info.id);
|
|
277
277
|
// Only store per-node information for nodes representing expressions or nodes with abstract values
|
|
@@ -50,10 +50,10 @@ const summarizer_1 = require("../../../util/summarizer");
|
|
|
50
50
|
const assert_1 = require("../../../util/assert");
|
|
51
51
|
const shell_1 = require("../../../r-bridge/shell");
|
|
52
52
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
53
|
-
const visitor_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
54
|
-
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
55
53
|
const arrays_1 = require("../../../util/collections/arrays");
|
|
56
54
|
const semantics_1 = require("../../../abstract-interpretation/data-frame/semantics");
|
|
55
|
+
const r_project_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-project");
|
|
56
|
+
const r_comment_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-comment");
|
|
57
57
|
const tempfile = (() => {
|
|
58
58
|
let _tempfile = undefined;
|
|
59
59
|
return () => {
|
|
@@ -159,9 +159,9 @@ async function summarizeSlicerStats(stats, report = () => {
|
|
|
159
159
|
let numberOfNormalizedTokensNoComments = 0;
|
|
160
160
|
let commentChars = 0;
|
|
161
161
|
let commentCharsNoWhitespace = 0;
|
|
162
|
-
|
|
162
|
+
r_project_1.RProject.visitAst(reParsed.ast, t => {
|
|
163
163
|
numberOfNormalizedTokens++;
|
|
164
|
-
const comments = t.info.adToks?.filter(
|
|
164
|
+
const comments = t.info.adToks?.filter(r_comment_1.RComment.is);
|
|
165
165
|
if (comments && comments.length > 0) {
|
|
166
166
|
const content = comments.map(c => c.lexeme ?? '').join('');
|
|
167
167
|
commentChars += content.length;
|
|
@@ -39,7 +39,7 @@ const ast_1 = require("../../../util/mermaid/ast");
|
|
|
39
39
|
const ansi_1 = require("../../../util/text/ansi");
|
|
40
40
|
const core_1 = require("../core");
|
|
41
41
|
const defaultmap_1 = require("../../../util/collections/defaultmap");
|
|
42
|
-
const
|
|
42
|
+
const r_project_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-project");
|
|
43
43
|
function formatInfo(out, type, meta) {
|
|
44
44
|
return out.formatter.format(`Copied ${type} to clipboard (normalize: ${meta['.meta'].timing + 'ms'}).`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
45
45
|
}
|
|
@@ -93,7 +93,7 @@ exports.normalizeHashCommand = {
|
|
|
93
93
|
const counts = new defaultmap_1.DefaultMap(() => 0);
|
|
94
94
|
let total = 0;
|
|
95
95
|
const files = result.ast.files.length;
|
|
96
|
-
|
|
96
|
+
r_project_1.RProject.visitAst(result.ast, n => {
|
|
97
97
|
counts.set(n.type, counts.get(n.type) + 1);
|
|
98
98
|
total++;
|
|
99
99
|
});
|
package/cli/repl/core.js
CHANGED
|
@@ -110,7 +110,7 @@ function replCompleter(line, config) {
|
|
|
110
110
|
function replQueryCompleter(splitLine, startingNewArg, config) {
|
|
111
111
|
const nonEmpty = splitLine.slice(1).map(s => s.trim()).filter(s => s.length > 0);
|
|
112
112
|
const queryShorts = Object.keys(query_1.SupportedQueries).map(q => `@${q}`).concat(['help']);
|
|
113
|
-
if (nonEmpty.length
|
|
113
|
+
if (nonEmpty.length === 0 || (nonEmpty.length === 1 && queryShorts.some(q => q.startsWith(nonEmpty[0]) && nonEmpty[0] !== q && !startingNewArg))) {
|
|
114
114
|
return { completions: queryShorts.map(q => `${q} `) };
|
|
115
115
|
}
|
|
116
116
|
else {
|
|
@@ -141,7 +141,7 @@ function makeDefaultReplReadline(config) {
|
|
|
141
141
|
*/
|
|
142
142
|
function handleString(code) {
|
|
143
143
|
return {
|
|
144
|
-
rCode: code.length
|
|
144
|
+
rCode: code.length === 0 ? undefined : (0, strings_1.startAndEndsWith)(code, '"') ? JSON.parse(code) : code,
|
|
145
145
|
remaining: []
|
|
146
146
|
};
|
|
147
147
|
}
|
package/config.js
CHANGED
|
@@ -213,7 +213,7 @@ function getEngineConfig(config, engine) {
|
|
|
213
213
|
return defaultEngineConfigs[engine];
|
|
214
214
|
}
|
|
215
215
|
else {
|
|
216
|
-
return engines.find(e => e.type
|
|
216
|
+
return engines.find(e => e.type === engine);
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
function loadConfigFromFile(configFile, workingDirectory) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
2
|
import type { MergeableRecord } from '../util/objects';
|
|
3
3
|
import { RFalse, RTrue } from '../r-bridge/lang-4.x/convert-values';
|
|
4
4
|
/**
|
|
@@ -343,7 +343,7 @@ exports.CfgVertex = {
|
|
|
343
343
|
*/
|
|
344
344
|
fromExitId(exitId) {
|
|
345
345
|
if (typeof exitId === 'string' && exitId.endsWith('-e')) {
|
|
346
|
-
return
|
|
346
|
+
return node_id_1.NodeId.normalize(exitId.slice(0, -2));
|
|
347
347
|
}
|
|
348
348
|
else {
|
|
349
349
|
return exitId;
|
|
@@ -564,7 +564,6 @@ class ControlFlowGraph {
|
|
|
564
564
|
*/
|
|
565
565
|
addVertex(vertex, rootVertex = true) {
|
|
566
566
|
const vid = exports.CfgVertex.getId(vertex);
|
|
567
|
-
(0, assert_1.guard)(!this.vtxInfos.has(vid), `Node with id ${vid} already exists`);
|
|
568
567
|
if (exports.CfgVertex.isBlock(vertex)) {
|
|
569
568
|
this._mayBB = true;
|
|
570
569
|
const elems = exports.CfgVertex.getBasicBlockElements(vertex);
|
|
@@ -6,6 +6,7 @@ exports.extractCfgQuick = extractCfgQuick;
|
|
|
6
6
|
exports.getCallsInCfg = getCallsInCfg;
|
|
7
7
|
exports.cfg2quads = cfg2quads;
|
|
8
8
|
const quads_1 = require("../util/quads");
|
|
9
|
+
const r_function_definition_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
9
10
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
10
11
|
const linker_1 = require("../dataflow/internal/linker");
|
|
11
12
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
@@ -14,13 +15,13 @@ const cfg_simplification_1 = require("./cfg-simplification");
|
|
|
14
15
|
const assert_1 = require("../util/assert");
|
|
15
16
|
const built_in_1 = require("../dataflow/environments/built-in");
|
|
16
17
|
const stateful_fold_1 = require("../r-bridge/lang-4.x/ast/model/processing/stateful-fold");
|
|
17
|
-
const
|
|
18
|
+
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
18
19
|
const cfgFolds = {
|
|
19
20
|
down: (n, down) => {
|
|
20
|
-
if (
|
|
21
|
+
if (r_function_definition_1.RFunctionDefinition.is(n)) {
|
|
21
22
|
return [down[0], true];
|
|
22
23
|
}
|
|
23
|
-
else if (
|
|
24
|
+
else if (model_1.RLoopConstructs.is(n)) {
|
|
24
25
|
return [true, down[1]];
|
|
25
26
|
}
|
|
26
27
|
return down;
|
package/dataflow/cluster.js
CHANGED
|
@@ -30,18 +30,22 @@ function makeCluster(graph, from, notReached) {
|
|
|
30
30
|
if (info.tag === vertex_1.VertexType.FunctionDefinition) {
|
|
31
31
|
for (const { nodeId } of info.exitPoints) {
|
|
32
32
|
if (notReached.delete(nodeId)) {
|
|
33
|
-
makeCluster(graph, nodeId, notReached)
|
|
33
|
+
for (const m of makeCluster(graph, nodeId, notReached)) {
|
|
34
|
+
nodes.add(m);
|
|
35
|
+
}
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
// cluster adjacent edges
|
|
38
|
-
for (const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
40
|
+
for (const edges of [graph.outgoingEdges(from), graph.ingoingEdges(from)]) {
|
|
41
|
+
for (const [dest, e] of edges ?? []) {
|
|
42
|
+
// don't cluster for function content if it isn't returned
|
|
43
|
+
if (edge_1.DfEdge.doesNotIncludeType(e, edge_1.EdgeType.Returns) && info.onlyBuiltin && info.name === '{') {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (notReached.delete(dest)) {
|
|
47
|
+
makeCluster(graph, dest, notReached).forEach(n => nodes.add(n));
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
50
|
}
|
|
47
51
|
return nodes;
|