@eagleoutice/flowr 2.9.13 → 2.10.1
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 +52 -28
- package/abstract-interpretation/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/absint-visitor.js +20 -20
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -2
- package/benchmark/slicer.d.ts +1 -1
- package/benchmark/slicer.js +7 -5
- package/benchmark/stats/stats.d.ts +2 -2
- package/cli/repl/commands/repl-dataflow.js +5 -5
- package/cli/repl/parser/slice-query-parser.d.ts +3 -3
- package/cli/repl/parser/slice-query-parser.js +2 -2
- package/cli/repl/server/connection.js +2 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/repl/server/messages/message-slice.js +2 -2
- package/config.d.ts +12 -8
- package/config.js +5 -3
- package/control-flow/extract-cfg.js +2 -2
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +43 -43
- package/control-flow/useless-loop.d.ts +1 -1
- package/control-flow/useless-loop.js +3 -3
- package/core/print/dataflow-printer.d.ts +0 -14
- package/core/print/dataflow-printer.js +0 -21
- package/core/steps/all/core/20-dataflow.d.ts +3 -3
- package/core/steps/all/core/20-dataflow.js +3 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +2 -5
- package/core/steps/all/static-slicing/00-slice.js +6 -8
- package/core/steps/pipeline/default-pipelines.d.ts +89 -89
- package/dataflow/environments/built-in-proc-name.d.ts +83 -0
- package/dataflow/environments/built-in-proc-name.js +88 -0
- package/dataflow/environments/built-in.d.ts +1 -83
- package/dataflow/environments/built-in.js +37 -120
- package/dataflow/environments/default-builtin-config.d.ts +1 -1
- package/dataflow/environments/default-builtin-config.js +75 -75
- package/dataflow/environments/identifier.d.ts +5 -0
- package/dataflow/environments/identifier.js +18 -0
- package/dataflow/eval/resolve/resolve.js +2 -2
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +2 -2
- package/dataflow/graph/call-graph.d.ts +46 -19
- package/dataflow/graph/call-graph.js +95 -114
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/df-helper.d.ts +133 -0
- package/dataflow/graph/df-helper.js +138 -0
- package/dataflow/graph/diff-dataflow-graph.d.ts +5 -10
- package/dataflow/graph/diff-dataflow-graph.js +3 -28
- package/dataflow/graph/edge.d.ts +1 -0
- package/dataflow/graph/edge.js +1 -0
- package/dataflow/graph/graph-helper.d.ts +60 -0
- package/dataflow/graph/graph-helper.js +128 -0
- package/dataflow/graph/graph.d.ts +19 -3
- package/dataflow/graph/graph.js +32 -5
- package/dataflow/graph/vertex.d.ts +3 -1
- package/dataflow/info.d.ts +14 -4
- package/dataflow/info.js +28 -16
- package/dataflow/internal/linker.d.ts +14 -10
- package/dataflow/internal/linker.js +29 -32
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +8 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +2 -2
- 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.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
- 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 +5 -4
- 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-dispatch.js +3 -3
- 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.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +7 -7
- 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 +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +6 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +2 -2
- package/dataflow/internal/process/functions/call/common.js +2 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.d.ts +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -1
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.js +6 -6
- package/documentation/doc-readme.js +2 -1
- package/documentation/doc-util/doc-dfg.d.ts +3 -0
- package/documentation/doc-util/doc-dfg.js +5 -7
- package/documentation/doc-util/doc-normalized-ast.d.ts +0 -6
- package/documentation/doc-util/doc-normalized-ast.js +0 -23
- package/documentation/doc-util/doc-structure.js +3 -3
- package/documentation/doc-util/doc-types.js +3 -3
- package/documentation/wiki-core.js +5 -4
- package/documentation/wiki-dataflow-graph.js +14 -12
- package/documentation/wiki-interface.js +3 -3
- package/documentation/wiki-linter.js +6 -0
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/linter/linter-rules.d.ts +49 -1
- package/linter/linter-rules.js +5 -1
- package/linter/rules/problematic-eval.d.ts +44 -0
- package/linter/rules/problematic-eval.js +83 -0
- package/linter/rules/seeded-randomness.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +35 -0
- package/linter/rules/stop-with-call-arg.js +72 -0
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +7 -7
- package/project/cache/flowr-analyzer-cache.d.ts +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/flowr-analyzer-builder.d.ts +3 -0
- package/project/flowr-analyzer.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +2 -2
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +3 -3
- package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +6 -0
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +66 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +36 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +63 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +90 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.js +308 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +2 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +3 -3
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +6 -0
- package/queries/catalog/provenance-query/provenance-query-executor.js +34 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +35 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +62 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
- package/queries/query.d.ts +17 -1
- package/queries/query.js +4 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/model.js +10 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +2 -0
- 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 +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +29 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +29 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +2 -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 +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +2 -0
- 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 +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +2 -0
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-printer.js +3 -3
- package/search/search-executor/search-enrichers.js +2 -2
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/parse.d.ts +43 -18
- package/slicing/criterion/parse.js +68 -63
- package/slicing/static/slicer-types.d.ts +2 -3
- package/slicing/static/static-slicer.d.ts +3 -4
- package/slicing/static/static-slicer.js +32 -12
- package/util/collections/arrays.d.ts +4 -0
- package/util/collections/arrays.js +7 -0
- package/util/diff.d.ts +2 -2
- package/util/mermaid/ast.js +4 -4
- package/util/mermaid/cfg.js +5 -5
- package/util/mermaid/dfg.d.ts +33 -18
- package/util/mermaid/dfg.js +47 -31
- package/util/mermaid/mermaid.d.ts +57 -12
- package/util/mermaid/mermaid.js +74 -67
- package/util/range.d.ts +8 -0
- package/util/range.js +13 -1
- package/util/slice-direction.d.ts +7 -0
- package/util/slice-direction.js +12 -0
- package/util/version.js +1 -1
- package/dataflow/graph/invert-dfg.d.ts +0 -6
- package/dataflow/graph/invert-dfg.js +0 -20
- package/dataflow/graph/resolve-graph.d.ts +0 -8
- package/dataflow/graph/resolve-graph.js +0 -59
|
@@ -3,8 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.findNonLocalReads = findNonLocalReads;
|
|
4
4
|
exports.produceNameSharedIdMap = produceNameSharedIdMap;
|
|
5
5
|
exports.linkArgumentsOnCall = linkArgumentsOnCall;
|
|
6
|
-
exports.getAllIdsWithTarget = getAllIdsWithTarget;
|
|
7
|
-
exports.invertArgumentMap = invertArgumentMap;
|
|
8
6
|
exports.pMatch = pMatch;
|
|
9
7
|
exports.linkFunctionCallWithSingleTarget = linkFunctionCallWithSingleTarget;
|
|
10
8
|
exports.linkFunctionCalls = linkFunctionCalls;
|
|
@@ -25,10 +23,10 @@ const edge_1 = require("../graph/edge");
|
|
|
25
23
|
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
26
24
|
const vertex_1 = require("../graph/vertex");
|
|
27
25
|
const resolve_by_name_1 = require("../environments/resolve-by-name");
|
|
28
|
-
const built_in_1 = require("../environments/built-in");
|
|
29
26
|
const prefix_1 = require("../../util/prefix");
|
|
30
27
|
const info_1 = require("../info");
|
|
31
28
|
const unnamed_call_handling_1 = require("./process/functions/call/unnamed-call-handling");
|
|
29
|
+
const built_in_proc_name_1 = require("../environments/built-in-proc-name");
|
|
32
30
|
/**
|
|
33
31
|
* Find all reads within the graph that do not reference a local definition in the graph.
|
|
34
32
|
*/
|
|
@@ -137,38 +135,37 @@ function linkArgumentsOnCall(args, params, graph) {
|
|
|
137
135
|
}
|
|
138
136
|
return maps;
|
|
139
137
|
}
|
|
140
|
-
/**
|
|
141
|
-
* Returns all argument ids that map to the given target parameter id.
|
|
142
|
-
*/
|
|
143
|
-
function getAllIdsWithTarget(maps, target) {
|
|
144
|
-
return maps.entries().filter(([, v]) => v === target).map(([k]) => k).toArray();
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* Inverts the argument to parameter map to a parameter to argument map.
|
|
148
|
-
*/
|
|
149
|
-
function invertArgumentMap(maps) {
|
|
150
|
-
const inverted = new Map();
|
|
151
|
-
for (const [arg, param] of maps.entries()) {
|
|
152
|
-
const existing = inverted.get(param);
|
|
153
|
-
if (existing) {
|
|
154
|
-
existing.push(arg);
|
|
155
|
-
}
|
|
156
|
-
else {
|
|
157
|
-
inverted.set(param, [arg]);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return inverted;
|
|
161
|
-
}
|
|
162
138
|
/**
|
|
163
139
|
* Links the given arguments to the given parameters within the given graph by name only.
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* const parameterSpec = {
|
|
143
|
+
* 'paramName': 'paramId',
|
|
144
|
+
* 'anotherParamName': 'anotherParamId',
|
|
145
|
+
* // we recommend to always add '...' to your specification
|
|
146
|
+
* // this way you can collect all arguments that could not be matched!
|
|
147
|
+
* '...': '...'
|
|
148
|
+
* } as const;
|
|
149
|
+
*
|
|
150
|
+
* const match = pMatch(convertFnArguments(args), parameterSpec);
|
|
151
|
+
* const addParam = match.get('paramId');
|
|
152
|
+
* ```
|
|
164
153
|
* @note
|
|
165
154
|
* To obtain the arguments from a {@link RFunctionCall}[], either use {@link processAllArguments} (also available via {@link processKnownFunctionCall})
|
|
166
155
|
* or convert them with {@link convertFnArguments}.
|
|
167
|
-
* You can use {@link getAllIdsWithTarget} to get all argument ids that map to a given parameter.
|
|
168
156
|
*/
|
|
169
157
|
function pMatch(args, params) {
|
|
170
158
|
const nameArgMap = new Map(args.filter(graph_1.FunctionArgument.isNamed).map(a => [a.name, a]));
|
|
171
159
|
const maps = new Map();
|
|
160
|
+
function addToMaps(key, value) {
|
|
161
|
+
const e = maps.get(key);
|
|
162
|
+
if (e) {
|
|
163
|
+
e.push(value);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
maps.set(key, [value]);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
172
169
|
const sid = params['...'];
|
|
173
170
|
const paramNames = Object.keys(params);
|
|
174
171
|
// all parameters matched by name
|
|
@@ -178,11 +175,11 @@ function pMatch(args, params) {
|
|
|
178
175
|
const pmatchName = (0, prefix_1.findByPrefixIfUnique)(name, paramNames) ?? name;
|
|
179
176
|
const param = params[pmatchName];
|
|
180
177
|
if (param) {
|
|
181
|
-
|
|
178
|
+
addToMaps(param, argId);
|
|
182
179
|
matchedParameters.add(name);
|
|
183
180
|
}
|
|
184
181
|
else if (sid) {
|
|
185
|
-
|
|
182
|
+
addToMaps(sid, argId);
|
|
186
183
|
}
|
|
187
184
|
}
|
|
188
185
|
const remainingParameter = paramNames.filter(p => !matchedParameters.has(p));
|
|
@@ -195,13 +192,13 @@ function pMatch(args, params) {
|
|
|
195
192
|
const aid = arg.nodeId;
|
|
196
193
|
if (remainingParameter.length <= i) {
|
|
197
194
|
if (sid) {
|
|
198
|
-
|
|
195
|
+
addToMaps(sid, aid);
|
|
199
196
|
}
|
|
200
197
|
continue;
|
|
201
198
|
}
|
|
202
199
|
const param = params[remainingParameter[i]];
|
|
203
200
|
if (param) {
|
|
204
|
-
|
|
201
|
+
addToMaps(param, aid);
|
|
205
202
|
}
|
|
206
203
|
}
|
|
207
204
|
return maps;
|
|
@@ -342,8 +339,8 @@ function getAllFunctionCallTargets(call, graph, environment) {
|
|
|
342
339
|
}
|
|
343
340
|
if (environment !== undefined || info.environment !== undefined) {
|
|
344
341
|
let functionCallDefs = [];
|
|
345
|
-
const refType = info.origin.includes(
|
|
346
|
-
info.origin.includes(
|
|
342
|
+
const refType = info.origin.includes(built_in_proc_name_1.BuiltInProcName.S3Dispatch) ? identifier_1.ReferenceType.S3MethodPrefix :
|
|
343
|
+
info.origin.includes(built_in_proc_name_1.BuiltInProcName.S7Dispatch) ? identifier_1.ReferenceType.S7MethodPrefix : identifier_1.ReferenceType.Function;
|
|
347
344
|
if (info.name !== undefined && !identifier_1.Identifier.getName(info.name).startsWith(unnamed_call_handling_1.UnnamedFunctionCallPrefix)) {
|
|
348
345
|
functionCallDefs = (0, resolve_by_name_1.resolveByName)(info.name, environment ?? info.environment, refType)?.map(d => d.nodeId) ?? [];
|
|
349
346
|
}
|
|
@@ -8,13 +8,13 @@ const node_id_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/process
|
|
|
8
8
|
const logger_1 = require("../../../../../logger");
|
|
9
9
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
10
10
|
const edge_1 = require("../../../../../graph/edge");
|
|
11
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
12
11
|
const built_in_assignment_1 = require("./built-in-assignment");
|
|
13
12
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
14
13
|
const reference_to_maybe_1 = require("../../../../../environments/reference-to-maybe");
|
|
14
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
15
15
|
function tableAssignmentProcessor(name, args, rootId, data, outInfo) {
|
|
16
16
|
outInfo.definitionRootNodes.push(rootId);
|
|
17
|
-
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
17
|
+
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.TableAssignment }).information;
|
|
18
18
|
}
|
|
19
19
|
/**
|
|
20
20
|
* Processes different types of access operations.
|
|
@@ -36,7 +36,7 @@ function processAccess(name, args, rootId, data, config) {
|
|
|
36
36
|
let fnCall;
|
|
37
37
|
if (head === r_function_call_1.EmptyArgument) {
|
|
38
38
|
// in this case we may be within a pipe
|
|
39
|
-
fnCall = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin:
|
|
39
|
+
fnCall = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: built_in_proc_name_1.BuiltInProcName.Access });
|
|
40
40
|
}
|
|
41
41
|
else if (config.treatIndicesAsString) {
|
|
42
42
|
fnCall = processStringBasedAccess(args, data, name, rootId, config);
|
|
@@ -104,7 +104,7 @@ function processNumberBasedAccess(data, name, args, rootId, config, head) {
|
|
|
104
104
|
name: ':=',
|
|
105
105
|
nodeId: tableAssignId
|
|
106
106
|
}]);
|
|
107
|
-
const fnCall = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin:
|
|
107
|
+
const fnCall = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: built_in_proc_name_1.BuiltInProcName.Access });
|
|
108
108
|
/* recover the environment */
|
|
109
109
|
if (existing !== undefined) {
|
|
110
110
|
data.environment.current.memory.set(':=', existing);
|
|
@@ -156,7 +156,7 @@ function processStringBasedAccess(args, data, name, rootId, config) {
|
|
|
156
156
|
rootId,
|
|
157
157
|
data,
|
|
158
158
|
forceArgs: config.forceArgs,
|
|
159
|
-
origin:
|
|
159
|
+
origin: built_in_proc_name_1.BuiltInProcName.Access
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
//# sourceMappingURL=built-in-access.js.map
|
|
@@ -14,8 +14,8 @@ const general_1 = require("../../../../../eval/values/general");
|
|
|
14
14
|
const r_value_1 = require("../../../../../eval/values/r-value");
|
|
15
15
|
const log_1 = require("../../../../../../util/log");
|
|
16
16
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
17
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
18
17
|
const r_string_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
18
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
19
19
|
/**
|
|
20
20
|
* Process an apply call like `vapply` or `mapply`.
|
|
21
21
|
*/
|
|
@@ -25,7 +25,7 @@ function processApply(name, args, rootId, data, config) {
|
|
|
25
25
|
const forceArgsMask = new Array(indexOfFunction).fill(false);
|
|
26
26
|
forceArgsMask.push(true);
|
|
27
27
|
const resFn = (0, known_call_handling_1.processKnownFunctionCall)({
|
|
28
|
-
name, args, rootId, data, forceArgs: forceArgsMask, origin:
|
|
28
|
+
name, args, rootId, data, forceArgs: forceArgsMask, origin: built_in_proc_name_1.BuiltInProcName.Apply
|
|
29
29
|
});
|
|
30
30
|
let information = resFn.information;
|
|
31
31
|
const processedArguments = resFn.processedArguments;
|
|
@@ -98,6 +98,7 @@ function processApply(name, args, rootId, data, config) {
|
|
|
98
98
|
if (arg && counterpart !== r_function_call_1.EmptyArgument) {
|
|
99
99
|
return {
|
|
100
100
|
name: counterpart.name?.content,
|
|
101
|
+
valueId: counterpart.value?.info.id,
|
|
101
102
|
cds: data.cds,
|
|
102
103
|
type: identifier_1.ReferenceType.Argument,
|
|
103
104
|
nodeId: arg.entryPoint
|
|
@@ -119,7 +120,7 @@ function processApply(name, args, rootId, data, config) {
|
|
|
119
120
|
onlyBuiltin: false,
|
|
120
121
|
cds: data.cds,
|
|
121
122
|
args: allOtherArguments, // same reference
|
|
122
|
-
origin: [
|
|
123
|
+
origin: [built_in_proc_name_1.BuiltInProcName.Function]
|
|
123
124
|
}, data.ctx.env.makeCleanEnv());
|
|
124
125
|
information.graph.addEdge(rootId, rootFnId, edge_1.EdgeType.Calls | edge_1.EdgeType.Reads);
|
|
125
126
|
information.graph.addEdge(rootId, functionId, edge_1.EdgeType.Calls | edge_1.EdgeType.Argument);
|
|
@@ -168,7 +169,7 @@ function processApply(name, args, rootId, data, config) {
|
|
|
168
169
|
environment: resolveInEnvironment === 'global' ? undefined : data.environment,
|
|
169
170
|
onlyBuiltin: resolveInEnvironment === 'global',
|
|
170
171
|
cds: data.cds,
|
|
171
|
-
origin: [
|
|
172
|
+
origin: [built_in_proc_name_1.BuiltInProcName.Function]
|
|
172
173
|
});
|
|
173
174
|
}
|
|
174
175
|
for (const arg of processedArguments) {
|
|
@@ -23,6 +23,7 @@ const built_in_1 = require("../../../../../environments/built-in");
|
|
|
23
23
|
const unknown_side_effect_1 = require("../../../../../graph/unknown-side-effect");
|
|
24
24
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
25
25
|
const r_value_1 = require("../../../../../eval/values/r-value");
|
|
26
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
26
27
|
function toReplacementSymbol(target, prefix, superAssignment) {
|
|
27
28
|
return {
|
|
28
29
|
type: type_1.RType.Symbol,
|
|
@@ -54,7 +55,7 @@ function tryReplacement(rootId, functionName, data, name, args) {
|
|
|
54
55
|
if (resolved.length !== 1 || resolved[0].type !== identifier_1.ReferenceType.BuiltInFunction) {
|
|
55
56
|
return (0, process_named_call_1.processAsNamedCall)(functionName, data, name, args);
|
|
56
57
|
}
|
|
57
|
-
const info = built_in_1.BuiltInProcessorMapper[
|
|
58
|
+
const info = built_in_1.BuiltInProcessorMapper[built_in_proc_name_1.BuiltInProcName.Replacement]({
|
|
58
59
|
type: type_1.RType.Symbol,
|
|
59
60
|
info: functionName.info,
|
|
60
61
|
content: name,
|
|
@@ -119,7 +120,7 @@ args, rootId, data, config) {
|
|
|
119
120
|
data,
|
|
120
121
|
reverseOrder: !config.swapSourceAndTarget,
|
|
121
122
|
forceArgs: config.forceArgs,
|
|
122
|
-
origin:
|
|
123
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
123
124
|
});
|
|
124
125
|
return processAssignmentToSymbol({
|
|
125
126
|
...config,
|
|
@@ -145,7 +146,7 @@ args, rootId, data, config) {
|
|
|
145
146
|
data,
|
|
146
147
|
reverseOrder: !config.swapSourceAndTarget,
|
|
147
148
|
forceArgs: config.forceArgs,
|
|
148
|
-
origin:
|
|
149
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
149
150
|
});
|
|
150
151
|
return processAssignmentToSymbol({
|
|
151
152
|
...config,
|
|
@@ -183,7 +184,7 @@ args, rootId, data, config) {
|
|
|
183
184
|
data,
|
|
184
185
|
reverseOrder: !config.swapSourceAndTarget,
|
|
185
186
|
forceArgs: config.forceArgs,
|
|
186
|
-
origin:
|
|
187
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
187
188
|
});
|
|
188
189
|
return processAssignmentToSymbol({
|
|
189
190
|
...config,
|
|
@@ -203,7 +204,7 @@ args, rootId, data, config) {
|
|
|
203
204
|
logger_1.dataflowLogger.warn(`Assignment ${identifier_1.Identifier.toString(name.content)} has an unknown target type ${target.type} => unknown impact`);
|
|
204
205
|
const info = (0, known_call_handling_1.processKnownFunctionCall)({
|
|
205
206
|
name, args: effectiveArgs, rootId, data, forceArgs: config.forceArgs,
|
|
206
|
-
origin:
|
|
207
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
207
208
|
}).information;
|
|
208
209
|
(0, unknown_side_effect_1.handleUnknownSideEffect)(info.graph, info.environment, rootId);
|
|
209
210
|
return info;
|
|
@@ -252,7 +253,7 @@ function processAssignmentToString(target, args, name, rootId, data, config, sou
|
|
|
252
253
|
data,
|
|
253
254
|
reverseOrder: !config.swapSourceAndTarget,
|
|
254
255
|
forceArgs: config.forceArgs,
|
|
255
|
-
origin:
|
|
256
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
256
257
|
});
|
|
257
258
|
return processAssignmentToSymbol({
|
|
258
259
|
...config,
|
|
@@ -296,7 +297,7 @@ function checkTargetReferenceType(sourceInfo, fnModes) {
|
|
|
296
297
|
*/
|
|
297
298
|
function markAsAssignment(information, nodeToDefine, sourceIds, rootIdOfAssignment, data, assignmentConfig) {
|
|
298
299
|
information.environment = (0, define_1.define)(nodeToDefine, assignmentConfig?.superAssignment, information.environment);
|
|
299
|
-
information.graph.setDefinitionOfVertex(nodeToDefine);
|
|
300
|
+
information.graph.setDefinitionOfVertex(nodeToDefine, sourceIds);
|
|
300
301
|
const nid = nodeToDefine.nodeId;
|
|
301
302
|
if (!assignmentConfig?.quoteSource) {
|
|
302
303
|
for (const sourceId of sourceIds) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DataflowProcessorInformation } from '../../../../../processor';
|
|
2
|
-
import {
|
|
2
|
+
import { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import { type ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import { type RFunctionArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
@@ -18,8 +18,8 @@ const string_constants_1 = require("../../../../../eval/values/string/string-con
|
|
|
18
18
|
const unknown_side_effect_1 = require("../../../../../graph/unknown-side-effect");
|
|
19
19
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
20
20
|
const arrays_1 = require("../../../../../../util/collections/arrays");
|
|
21
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
22
21
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
22
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
23
23
|
/**
|
|
24
24
|
* Process a call to `eval()`, trying to resolve the code being evaluated if possible.
|
|
25
25
|
*/
|
|
@@ -29,8 +29,8 @@ function processEvalCall(name, args, rootId, data, config) {
|
|
|
29
29
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
|
|
30
30
|
}
|
|
31
31
|
const information = config.includeFunctionCall ?
|
|
32
|
-
(0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: [true], origin:
|
|
33
|
-
:
|
|
32
|
+
(0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: [true], origin: built_in_proc_name_1.BuiltInProcName.Eval }).information
|
|
33
|
+
: info_1.DataflowInformation.initialize(rootId, data);
|
|
34
34
|
const evalArgument = args[0];
|
|
35
35
|
if (config.includeFunctionCall) {
|
|
36
36
|
information.graph.addEdge(rootId, args[0].value.info.id, edge_1.EdgeType.Returns);
|
|
@@ -14,11 +14,11 @@ const resolve_by_name_1 = require("../../../../../environments/resolve-by-name")
|
|
|
14
14
|
const edge_1 = require("../../../../../graph/edge");
|
|
15
15
|
const vertex_1 = require("../../../../../graph/vertex");
|
|
16
16
|
const scoping_1 = require("../../../../../environments/scoping");
|
|
17
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
18
17
|
const overwrite_1 = require("../../../../../environments/overwrite");
|
|
19
18
|
const logger_1 = require("../../../../../logger");
|
|
20
19
|
const log_1 = require("../../../../../../util/log");
|
|
21
20
|
const reference_to_maybe_1 = require("../../../../../environments/reference-to-maybe");
|
|
21
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
22
22
|
function linkReadNameToWriteIfPossible(read, environments, listEnvironments, remainingRead, nextGraph) {
|
|
23
23
|
const readName = read.name && identifier_1.Identifier.isDotDotDotAccess(read.name) ? identifier_1.Identifier.dotdotdot() : read.name;
|
|
24
24
|
const probableTarget = readName ? (0, resolve_by_name_1.resolveByName)(readName, environments, read.type) : undefined;
|
|
@@ -178,7 +178,7 @@ function processExpressionList(name, args, rootId, data) {
|
|
|
178
178
|
name,
|
|
179
179
|
data,
|
|
180
180
|
argumentProcessResult: processedExpressions,
|
|
181
|
-
origin:
|
|
181
|
+
origin: built_in_proc_name_1.BuiltInProcName.ExpressionList
|
|
182
182
|
});
|
|
183
183
|
nextGraph.addEdge(rootId, node_id_1.NodeId.toBuiltIn('{'), edge_1.EdgeType.Reads | edge_1.EdgeType.Calls);
|
|
184
184
|
// process all exit points as potential returns:
|
|
@@ -15,7 +15,7 @@ const append_1 = require("../../../../../environments/append");
|
|
|
15
15
|
const edge_1 = require("../../../../../graph/edge");
|
|
16
16
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
17
17
|
const reference_to_maybe_1 = require("../../../../../environments/reference-to-maybe");
|
|
18
|
-
const
|
|
18
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
19
19
|
/**
|
|
20
20
|
* Processes a for-loop call: `for(<variable> in <vector>) <body>`
|
|
21
21
|
* desugared as:
|
|
@@ -60,7 +60,7 @@ function processForLoop(name, args, rootId, data) {
|
|
|
60
60
|
const nameIdShares = (0, linker_1.produceNameSharedIdMap)((0, linker_1.findNonLocalReads)(nextGraph, writtenIds));
|
|
61
61
|
for (const write of writtenVariable) {
|
|
62
62
|
nextGraph.addEdge(write.nodeId, vector.entryPoint, edge_1.EdgeType.DefinedBy);
|
|
63
|
-
nextGraph.setDefinitionOfVertex(write);
|
|
63
|
+
nextGraph.setDefinitionOfVertex(write, [vector.entryPoint]);
|
|
64
64
|
}
|
|
65
65
|
(0, reference_to_maybe_1.applyCdToReferences)(body.out, cd);
|
|
66
66
|
const outgoing = variable.out.concat(writtenVariable, body.out);
|
|
@@ -72,7 +72,7 @@ function processForLoop(name, args, rootId, data) {
|
|
|
72
72
|
name,
|
|
73
73
|
data: { ...data, cds: originalDependency },
|
|
74
74
|
argumentProcessResult: [variable, vector, body],
|
|
75
|
-
origin:
|
|
75
|
+
origin: built_in_proc_name_1.BuiltInProcName.ForLoop
|
|
76
76
|
});
|
|
77
77
|
/* mark the last argument as nse */
|
|
78
78
|
nextGraph.addEdge(rootId, body.entryPoint, edge_1.EdgeType.NonStandardEvaluation);
|
|
@@ -20,9 +20,9 @@ const scoping_1 = require("../../../../../environments/scoping");
|
|
|
20
20
|
const resolve_by_name_1 = require("../../../../../environments/resolve-by-name");
|
|
21
21
|
const edge_1 = require("../../../../../graph/edge");
|
|
22
22
|
const log_1 = require("../../../../../../util/log");
|
|
23
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
24
23
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
25
24
|
const hooks_1 = require("../../../../../hooks");
|
|
25
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
26
26
|
/**
|
|
27
27
|
* Process a function definition, i.e., `function(a, b) { ... }`
|
|
28
28
|
*/
|
|
@@ -99,10 +99,10 @@ function processFunctionDefinition(name, args, rootId, data) {
|
|
|
99
99
|
return r_function_call_1.EmptyArgument;
|
|
100
100
|
}
|
|
101
101
|
else if (!p.name && p.value && p.value.type === type_1.RType.Parameter) {
|
|
102
|
-
return { type: identifier_1.ReferenceType.Argument, cds: data.cds, nodeId: p.value.name.info.id, name: p.value.name.content };
|
|
102
|
+
return { type: identifier_1.ReferenceType.Argument, cds: data.cds, nodeId: p.value.name.info.id, name: p.value.name.content, valueId: p.value.defaultValue?.info.id };
|
|
103
103
|
}
|
|
104
104
|
else if (p.name) {
|
|
105
|
-
return { type: identifier_1.ReferenceType.Argument, cds: data.cds, nodeId: p.name.info.id, name: p.name.content };
|
|
105
|
+
return { type: identifier_1.ReferenceType.Argument, valueId: p.value?.info.id, cds: data.cds, nodeId: p.name.info.id, name: p.name.content };
|
|
106
106
|
}
|
|
107
107
|
else {
|
|
108
108
|
return r_function_call_1.EmptyArgument;
|
|
@@ -173,7 +173,7 @@ function retrieveActiveEnvironment(callerEnvironment, baseEnvironment, ctx) {
|
|
|
173
173
|
}
|
|
174
174
|
function updateDispatches(graph, myArgs) {
|
|
175
175
|
for (const [, info] of graph.vertices(false)) {
|
|
176
|
-
if (info.tag !== vertex_1.VertexType.FunctionCall || (!info.origin.includes(
|
|
176
|
+
if (info.tag !== vertex_1.VertexType.FunctionCall || (!info.origin.includes(built_in_proc_name_1.BuiltInProcName.S3Dispatch) && !info.origin.includes(built_in_proc_name_1.BuiltInProcName.S7Dispatch))) {
|
|
177
177
|
continue;
|
|
178
178
|
}
|
|
179
179
|
if (info.args.length === 0) {
|
|
@@ -247,7 +247,7 @@ function updateNestedFunctionCalls(graph, outEnvironment) {
|
|
|
247
247
|
}
|
|
248
248
|
const targets = new Set((0, linker_1.getAllFunctionCallTargets)(id, graph, effectiveEnvironment));
|
|
249
249
|
const collectedNextMethods = new Set();
|
|
250
|
-
const treatAsS3 = origin.includes(
|
|
250
|
+
const treatAsS3 = origin.includes(built_in_proc_name_1.BuiltInProcName.S3Dispatch);
|
|
251
251
|
for (const target of targets) {
|
|
252
252
|
if (node_id_1.NodeId.isBuiltIn(target)) {
|
|
253
253
|
graph.addEdge(id, target, edge_1.EdgeType.Calls);
|
|
@@ -274,7 +274,7 @@ function updateNestedFunctionCalls(graph, outEnvironment) {
|
|
|
274
274
|
// collect all next method calls to link them to the same targets!
|
|
275
275
|
for (const s of targetVertex.subflow.graph) {
|
|
276
276
|
const v = graph.getVertex(s);
|
|
277
|
-
if (v?.tag === vertex_1.VertexType.FunctionCall && v.origin.includes(
|
|
277
|
+
if (v?.tag === vertex_1.VertexType.FunctionCall && v.origin.includes(built_in_proc_name_1.BuiltInProcName.S3DispatchNext)) {
|
|
278
278
|
collectedNextMethods.add(v.id);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -8,8 +8,8 @@ const logger_1 = require("../../../../../logger");
|
|
|
8
8
|
const retriever_1 = require("../../../../../../r-bridge/retriever");
|
|
9
9
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
10
10
|
const edge_1 = require("../../../../../graph/edge");
|
|
11
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
12
11
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
12
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
13
13
|
/**
|
|
14
14
|
* Processes a built-in 'get' function call.
|
|
15
15
|
*/
|
|
@@ -35,7 +35,7 @@ function processGet(name, args, rootId, data) {
|
|
|
35
35
|
args: (0, make_argument_1.wrapArgumentsUnnamed)([treatTargetAsSymbol], data.completeAst.idMap),
|
|
36
36
|
rootId,
|
|
37
37
|
data,
|
|
38
|
-
origin:
|
|
38
|
+
origin: built_in_proc_name_1.BuiltInProcName.Get
|
|
39
39
|
});
|
|
40
40
|
const firstArg = processedArguments[0];
|
|
41
41
|
if (firstArg) {
|
|
@@ -14,8 +14,8 @@ const general_1 = require("../../../../../eval/values/general");
|
|
|
14
14
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
15
15
|
const reference_to_maybe_1 = require("../../../../../environments/reference-to-maybe");
|
|
16
16
|
const linker_1 = require("../../../../linker");
|
|
17
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
18
17
|
const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
18
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
19
19
|
function getArguments(config, args) {
|
|
20
20
|
let condArg;
|
|
21
21
|
let thenArg;
|
|
@@ -27,7 +27,7 @@ function getArguments(config, args) {
|
|
|
27
27
|
[config.args.no]: 'no',
|
|
28
28
|
'...': '...'
|
|
29
29
|
};
|
|
30
|
-
const argMaps = (0, linker_1.
|
|
30
|
+
const argMaps = (0, linker_1.pMatch)((0, common_1.convertFnArguments)(args), params);
|
|
31
31
|
condArg = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('cond')?.[0]));
|
|
32
32
|
thenArg = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('yes')?.[0]));
|
|
33
33
|
otherwiseArg = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('no')?.[0]));
|
|
@@ -113,7 +113,7 @@ function processIfThenElse(name, args, rootId, data, config) {
|
|
|
113
113
|
name,
|
|
114
114
|
data: { ...data, cds: originalDependency },
|
|
115
115
|
argumentProcessResult: [cond, then, otherwise],
|
|
116
|
-
origin:
|
|
116
|
+
origin: built_in_proc_name_1.BuiltInProcName.IfThenElse
|
|
117
117
|
});
|
|
118
118
|
// as an if always evaluates its condition, we add a 'reads'-edge
|
|
119
119
|
nextGraph.addEdge(rootId, cond.entryPoint, edge_1.EdgeType.Reads);
|
|
@@ -6,8 +6,8 @@ const logger_1 = require("../../../../../logger");
|
|
|
6
6
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
7
7
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
8
|
const make_argument_1 = require("../argument/make-argument");
|
|
9
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
10
9
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
10
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
11
11
|
/**
|
|
12
12
|
* Process a library call like `library` or `require`
|
|
13
13
|
*/
|
|
@@ -39,7 +39,7 @@ function processLibrary(name, args, rootId, data) {
|
|
|
39
39
|
return (0, known_call_handling_1.processKnownFunctionCall)({
|
|
40
40
|
name, args: (0, make_argument_1.wrapArgumentsUnnamed)([newArg], data.completeAst.idMap), rootId, data,
|
|
41
41
|
hasUnknownSideEffect: true,
|
|
42
|
-
origin:
|
|
42
|
+
origin: built_in_proc_name_1.BuiltInProcName.Library
|
|
43
43
|
}).information;
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=built-in-library.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processList = processList;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
|
-
const
|
|
5
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
6
6
|
/**
|
|
7
7
|
* Process a list call.
|
|
8
8
|
*
|
|
@@ -12,6 +12,6 @@ const built_in_1 = require("../../../../../environments/built-in");
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
function processList(name, args, rootId, data) {
|
|
15
|
-
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
15
|
+
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.List }).information;
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=built-in-list.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
|
-
import
|
|
2
|
+
import { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import type { RFunctionArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
@@ -8,9 +8,9 @@ const linker_1 = require("../../../../linker");
|
|
|
8
8
|
const common_1 = require("../common");
|
|
9
9
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
10
10
|
const scoping_1 = require("../../../../../environments/scoping");
|
|
11
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
12
11
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
13
12
|
const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
13
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
14
14
|
/**
|
|
15
15
|
* Processes a built-in 'local' function call.
|
|
16
16
|
*/
|
|
@@ -23,13 +23,13 @@ function processLocal(name, args, rootId, data, config) {
|
|
|
23
23
|
[config.args.env]: 'env',
|
|
24
24
|
'...': '...'
|
|
25
25
|
};
|
|
26
|
-
const argMaps = (0, linker_1.
|
|
26
|
+
const argMaps = (0, linker_1.pMatch)((0, common_1.convertFnArguments)(args), params);
|
|
27
27
|
const env = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('env')?.[0]));
|
|
28
28
|
const expr = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('expr')?.[0]));
|
|
29
29
|
if (!expr) {
|
|
30
30
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
|
|
31
31
|
}
|
|
32
|
-
const dfEnv = env ? (0, processor_1.processDataflowFor)(env, data) :
|
|
32
|
+
const dfEnv = env ? (0, processor_1.processDataflowFor)(env, data) : info_1.DataflowInformation.initialize(rootId, data);
|
|
33
33
|
if ((0, info_1.alwaysExits)(dfEnv)) {
|
|
34
34
|
(0, common_1.patchFunctionCall)({
|
|
35
35
|
nextGraph: dfEnv.graph,
|
|
@@ -37,7 +37,7 @@ function processLocal(name, args, rootId, data, config) {
|
|
|
37
37
|
name,
|
|
38
38
|
data,
|
|
39
39
|
argumentProcessResult: [dfEnv],
|
|
40
|
-
origin:
|
|
40
|
+
origin: built_in_proc_name_1.BuiltInProcName.Local
|
|
41
41
|
});
|
|
42
42
|
return dfEnv;
|
|
43
43
|
}
|
|
@@ -49,7 +49,7 @@ function processLocal(name, args, rootId, data, config) {
|
|
|
49
49
|
name,
|
|
50
50
|
data,
|
|
51
51
|
argumentProcessResult: [dfExpr, dfEnv],
|
|
52
|
-
origin:
|
|
52
|
+
origin: built_in_proc_name_1.BuiltInProcName.Local
|
|
53
53
|
});
|
|
54
54
|
const ingoing = dfEnv.in.concat(dfExpr.in, dfEnv.unknownReferences, dfExpr.unknownReferences);
|
|
55
55
|
ingoing.push({ nodeId: rootId, name: name.content, cds: data.cds, type: identifier_1.ReferenceType.Function });
|
|
@@ -9,12 +9,12 @@ const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
|
9
9
|
const vertex_1 = require("../../../../../graph/vertex");
|
|
10
10
|
const edge_1 = require("../../../../../graph/edge");
|
|
11
11
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
12
|
-
const
|
|
12
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
13
13
|
/**
|
|
14
14
|
* Suport for R's pipe functions like `|>`.
|
|
15
15
|
*/
|
|
16
16
|
function processPipe(name, args, rootId, data) {
|
|
17
|
-
const { information, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
17
|
+
const { information, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Pipe });
|
|
18
18
|
if (args.length !== 2) {
|
|
19
19
|
logger_1.dataflowLogger.warn(`Pipe ${identifier_1.Identifier.toString(name.content)} has something else than 2 arguments, skipping`);
|
|
20
20
|
return information;
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.processQuote = processQuote;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
5
|
const edge_1 = require("../../../../../graph/edge");
|
|
6
|
-
const
|
|
6
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
7
7
|
/**
|
|
8
8
|
* Process a call to `quote` or similar nse/substitution functions.
|
|
9
9
|
*/
|
|
10
10
|
function processQuote(name, args, rootId, data, config) {
|
|
11
11
|
const startEnv = data.environment;
|
|
12
|
-
const { information, processedArguments, fnRef } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin:
|
|
12
|
+
const { information, processedArguments, fnRef } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: built_in_proc_name_1.BuiltInProcName.Quote });
|
|
13
13
|
let inRefs = [fnRef];
|
|
14
14
|
let outRefs = [];
|
|
15
15
|
let unknownRefs = [];
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processRecall = processRecall;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
6
5
|
const log_1 = require("../../../../../../util/log");
|
|
7
6
|
const edge_1 = require("../../../../../graph/edge");
|
|
8
7
|
const vertex_1 = require("../../../../../graph/vertex");
|
|
9
8
|
const unnamed_call_handling_1 = require("../unnamed-call-handling");
|
|
10
9
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
10
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
11
11
|
/**
|
|
12
12
|
* Processes a built-in 'Recall' function call, linking
|
|
13
13
|
* the recall to the enveloping function closure.
|
|
@@ -18,7 +18,7 @@ function processRecall(name, args, rootId, data) {
|
|
|
18
18
|
args,
|
|
19
19
|
rootId,
|
|
20
20
|
data,
|
|
21
|
-
origin:
|
|
21
|
+
origin: built_in_proc_name_1.BuiltInProcName.Recall
|
|
22
22
|
});
|
|
23
23
|
let cur = data.environment.current;
|
|
24
24
|
let closure;
|