@eagleoutice/flowr 2.15.10 → 2.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -26
- package/abstract-interpretation/data-frame/arguments.js +11 -7
- package/control-flow/happens-before.d.ts +5 -0
- package/control-flow/happens-before.js +48 -34
- package/control-flow/useless-loop.d.ts +1 -1
- package/control-flow/useless-loop.js +29 -42
- package/dataflow/environments/built-in-props.d.ts +9 -0
- package/dataflow/environments/built-in-props.js +25 -19
- package/dataflow/environments/built-in.d.ts +2 -2
- package/dataflow/environments/built-in.js +41 -77
- package/dataflow/environments/default-builtin-config.d.ts +181 -29
- package/dataflow/environments/default-builtin-config.js +38 -24
- package/dataflow/environments/environment.d.ts +6 -4
- package/dataflow/environments/environment.js +54 -121
- package/dataflow/environments/identifier.d.ts +4 -2
- package/dataflow/environments/identifier.js +23 -69
- package/dataflow/environments/reference-to-maybe.d.ts +9 -0
- package/dataflow/environments/reference-to-maybe.js +23 -51
- package/dataflow/environments/resolve-by-name.js +37 -76
- package/dataflow/eval/resolve/resolve-argument.d.ts +3 -1
- package/dataflow/eval/resolve/resolve-argument.js +61 -64
- package/dataflow/eval/resolve/resolve-working-directory.d.ts +8 -2
- package/dataflow/eval/resolve/resolve-working-directory.js +12 -20
- package/dataflow/eval/resolve/resolve.d.ts +4 -0
- package/dataflow/eval/resolve/resolve.js +23 -14
- package/dataflow/extractor.js +176 -59
- package/dataflow/fn/class-declaration.d.ts +8 -2
- package/dataflow/fn/class-declaration.js +96 -97
- package/dataflow/fn/exceptions-of-function.js +68 -37
- package/dataflow/fn/frame-reflection.d.ts +12 -4
- package/dataflow/fn/frame-reflection.js +51 -41
- package/dataflow/fn/function-props.js +15 -33
- package/dataflow/fn/function-semantics.d.ts +11 -3
- package/dataflow/fn/function-semantics.js +6 -0
- package/dataflow/fn/higher-order-function.js +13 -17
- package/dataflow/fn/strict-function.d.ts +13 -0
- package/dataflow/fn/strict-function.js +285 -122
- package/dataflow/graph/call-graph.d.ts +7 -6
- package/dataflow/graph/call-graph.js +35 -46
- package/dataflow/graph/graph.d.ts +6 -1
- package/dataflow/graph/graph.js +57 -66
- package/dataflow/info.d.ts +8 -1
- package/dataflow/info.js +24 -30
- package/dataflow/internal/control-flow.d.ts +31 -4
- package/dataflow/internal/control-flow.js +61 -39
- package/dataflow/internal/linker.d.ts +15 -9
- package/dataflow/internal/linker.js +253 -241
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +80 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +446 -78
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +51 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +119 -185
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +7 -9
- 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 +122 -147
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +55 -25
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +289 -251
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +30 -32
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +68 -67
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +72 -126
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +1 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +10 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +9 -35
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +8 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +12 -28
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +40 -118
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +16 -24
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +93 -102
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +7 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +173 -114
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +1 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +22 -27
- package/dataflow/internal/process/functions/call/built-in/built-in-with.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +34 -9
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +119 -93
- package/dataflow/internal/process/functions/call/common.d.ts +1 -3
- package/dataflow/internal/process/functions/call/common.js +36 -76
- package/dataflow/internal/process/functions/call/deferred.d.ts +6 -2
- package/dataflow/internal/process/functions/call/deferred.js +54 -57
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +4 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +65 -68
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +3 -5
- package/dataflow/internal/process/functions/call/named-call-handling.js +35 -21
- package/dataflow/internal/process/functions/call/quoted.d.ts +2 -0
- package/dataflow/internal/process/functions/call/quoted.js +162 -172
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +17 -38
- package/dataflow/internal/process/functions/process-parameter.js +25 -32
- package/dataflow/internal/process/process-symbol.js +3 -6
- package/dataflow/internal/program-order.d.ts +26 -0
- package/dataflow/internal/program-order.js +49 -0
- package/documentation/wiki-setup.js +23 -0
- package/linter/linter-rules.d.ts +17 -8
- package/linter/rules/absolute-path.js +63 -87
- package/linter/rules/file-path-validity.d.ts +4 -2
- package/linter/rules/file-path-validity.js +114 -80
- package/linter/rules/namespace-access.js +21 -33
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +60 -48
- package/linter/rules/network-functions.js +11 -7
- package/linter/rules/no-leaked-credentials.js +15 -18
- package/linter/rules/problematic-inputs.d.ts +2 -1
- package/linter/rules/problematic-inputs.js +39 -59
- package/linter/rules/roxygen-arguments.d.ts +9 -4
- package/linter/rules/roxygen-arguments.js +29 -48
- package/linter/rules/seeded-randomness.d.ts +7 -4
- package/linter/rules/seeded-randomness.js +128 -89
- package/linter/rules/stop-with-call-arg.d.ts +4 -2
- package/linter/rules/stop-with-call-arg.js +25 -22
- package/linter/rules/unclosed-connection.js +31 -24
- package/linter/rules/undefined-symbol.d.ts +4 -6
- package/linter/rules/undefined-symbol.js +58 -75
- package/linter/rules/unescaped-arguments.js +18 -44
- package/linter/rules/unused-definition.d.ts +6 -0
- package/linter/rules/unused-definition.js +105 -145
- package/linter/rules/unused-import.d.ts +3 -0
- package/linter/rules/unused-import.js +25 -43
- package/package.json +5 -2
- package/project/flowr-analyzer.js +6 -2
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -2
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +8 -12
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +7 -5
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +34 -56
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +16 -41
- package/queries/base-query-format.js +1 -2
- package/queries/catalog/absint-query/absint-query-format.js +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +2 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.js +4 -7
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +50 -114
- package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +5 -9
- package/queries/catalog/dependencies-query/function-info/library-functions.js +6 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/write-functions.js +7 -3
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +4 -4
- package/queries/catalog/input-sources-query/simple-input-classifier.js +192 -301
- package/r-bridge/lang-4.x/ast/model/model.d.ts +3 -1
- package/r-bridge/lang-4.x/ast/model/model.js +19 -43
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +5 -12
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
- package/r-bridge/roxygen2/roxygen-parse.js +28 -42
- package/r-bridge/shell.js +6 -0
- package/search/search-executor/search-enrichers.js +25 -37
- package/slicing/static/slice-call.d.ts +4 -3
- package/slicing/static/slice-call.js +56 -88
- package/slicing/static/static-slicer.js +115 -79
- package/slicing/static/visiting-queue.d.ts +4 -6
- package/slicing/static/visiting-queue.js +9 -13
- package/util/proc.js +2 -1
- package/util/r-base-packages.d.ts +2 -0
- package/util/r-base-packages.js +23 -13
- package/util/text/playground-link.d.ts +12 -3
- package/util/text/playground-link.js +18 -27
- package/util/version.js +4 -10
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Quoted = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* `FunctionSemantics.call` is the entry point these members are reached through, and it is built on this file, so the backing
|
|
6
|
+
* functions are called directly here; going through `FunctionSemantics` would make `src/dataflow/fn/function-semantics.ts` import its own
|
|
7
|
+
* importers.
|
|
8
|
+
* @lintIgnore use-instead
|
|
9
|
+
*/
|
|
10
|
+
const model_1 = require("../../../../../r-bridge/lang-4.x/ast/model/model");
|
|
4
11
|
const r_function_call_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
5
12
|
const match_args_1 = require("../../../../graph/match-args");
|
|
6
13
|
const node_id_1 = require("../../../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
7
14
|
const identifier_1 = require("../../../../environments/identifier");
|
|
8
15
|
const resolve_helper_1 = require("../../../../environments/resolve-helper");
|
|
16
|
+
const program_order_1 = require("../../../program-order");
|
|
9
17
|
const r_symbol_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
|
|
10
18
|
const built_in_proc_name_1 = require("../../../../environments/built-in-proc-name");
|
|
11
19
|
const edge_1 = require("../../../../graph/edge");
|
|
@@ -16,19 +24,16 @@ const linker_1 = require("../../../linker");
|
|
|
16
24
|
const nse_1 = require("./nse");
|
|
17
25
|
const deferred_1 = require("./deferred");
|
|
18
26
|
const r_argument_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
19
|
-
const retriever_1 = require("../../../../../r-bridge/retriever");
|
|
20
27
|
const happens_before_1 = require("../../../../../control-flow/happens-before");
|
|
21
28
|
const query_fn_props_1 = require("../../../../environments/query-fn-props");
|
|
22
29
|
const built_in_props_1 = require("../../../../environments/built-in-props");
|
|
23
|
-
|
|
24
|
-
const
|
|
30
|
+
const frame_reflection_1 = require("../../../../fn/frame-reflection");
|
|
31
|
+
const defaultmap_1 = require("../../../../../util/collections/defaultmap");
|
|
25
32
|
/** Calls whose result is a language object although they read their arguments like any other call. */
|
|
26
33
|
const CapturingCalls = new Set(['expression']);
|
|
27
34
|
/** Calls capturing an expression as a promise, forced at some later read of the variable they bind. */
|
|
28
35
|
const DelayingCalls = new Set(['delayedAssign']);
|
|
29
36
|
const DelayedAssignFormals = ['x', 'value', 'eval.env', 'assign.env'];
|
|
30
|
-
/** Calls evaluating one. */
|
|
31
|
-
const EvaluatingProcessors = [built_in_proc_name_1.BuiltInProcName.Eval];
|
|
32
37
|
/** Calls evaluating their own unevaluated argument, in a frame of their own. */
|
|
33
38
|
const EvaluatingElsewhereCalls = new Set(['evalq']);
|
|
34
39
|
/**
|
|
@@ -36,9 +41,6 @@ const EvaluatingElsewhereCalls = new Set(['evalq']);
|
|
|
36
41
|
* counts because a call handing back one of them, a container included, must not hide the capture inside.
|
|
37
42
|
*/
|
|
38
43
|
const ValueFlow = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall | edge_1.EdgeType.Returns | edge_1.EdgeType.Argument;
|
|
39
|
-
function hasOrigin(vertex, of) {
|
|
40
|
-
return Array.isArray(vertex.origin) && vertex.origin.some(o => of.includes(o));
|
|
41
|
-
}
|
|
42
44
|
/**
|
|
43
45
|
* A language object reads nothing where it is written and everything where it reaches `eval`, with the bindings
|
|
44
46
|
* in effect there. Working on the finished graph makes assignments, branches, loops, and calls one traversal.
|
|
@@ -55,13 +57,8 @@ exports.Quoted = {
|
|
|
55
57
|
if (!vertex_1.DfgVertex.isFunctionCall(vertex)) {
|
|
56
58
|
return [];
|
|
57
59
|
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
else if (CapturingCalls.has(identifier_1.Identifier.getName(vertex.name))) {
|
|
62
|
-
return capturedArgumentsOf(graph, id, false);
|
|
63
|
-
}
|
|
64
|
-
return [];
|
|
60
|
+
const marked = vertex_1.DfgVertex.hasOrigin(vertex, built_in_proc_name_1.BuiltInProcName.Quote);
|
|
61
|
+
return marked || CapturingCalls.has(identifier_1.Identifier.getName(vertex.name)) ? capturedArgumentsOf(graph, id, marked) : [];
|
|
65
62
|
},
|
|
66
63
|
/** Every expression the value at `id` may hold, with the call that captured it. Several is normal. */
|
|
67
64
|
sourcesOf(graph, id) {
|
|
@@ -75,6 +72,18 @@ exports.Quoted = {
|
|
|
75
72
|
} });
|
|
76
73
|
return found;
|
|
77
74
|
},
|
|
75
|
+
/** What `id` within captured code needs to run at all: the capturing call and every call evaluating it (`eval`, `body(f) <- quote(...)`). */
|
|
76
|
+
evaluationDependencies(graph, id) {
|
|
77
|
+
const idMap = graph.idMap;
|
|
78
|
+
for (let parent = idMap?.get(id)?.info.parent; parent !== undefined; parent = idMap?.get(parent)?.info.parent) {
|
|
79
|
+
const captured = exports.Quoted.capturedBy(graph, parent);
|
|
80
|
+
if (captured.length > 0) {
|
|
81
|
+
const evaluating = captured.flatMap(expr => (0, frame_reflection_1.edgeSources)(graph, expr, edge_1.EdgeType.Returns | edge_1.EdgeType.Reads | edge_1.EdgeType.Calls));
|
|
82
|
+
return [parent, ...evaluating.filter(from => from !== parent)];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return [];
|
|
86
|
+
},
|
|
78
87
|
/** Links every name in `expr` against `environment` and hands back what stays unresolved. */
|
|
79
88
|
evaluateIn: linker_1.linkExpressionIn,
|
|
80
89
|
/**
|
|
@@ -85,85 +94,84 @@ exports.Quoted = {
|
|
|
85
94
|
finalize(graph, environment, idMap, controlFlow) {
|
|
86
95
|
/* lets the forces of a parameter be reused without counting its reads again while nothing touched them (see `forcesOf`) */
|
|
87
96
|
graph.trackIncomingReads(true);
|
|
88
|
-
let names
|
|
89
|
-
|
|
97
|
+
let names;
|
|
98
|
+
const namesOnce = () => names ??= deferred_1.Deferred.indexOf(graph, idMap);
|
|
99
|
+
let bindings;
|
|
90
100
|
let cfg = null;
|
|
91
101
|
const cfgOnce = () => (cfg === null ? (cfg = controlFlow()) : cfg);
|
|
92
102
|
const masking = [];
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
let installers
|
|
103
|
+
const evaluated = [];
|
|
104
|
+
let sideEffects;
|
|
105
|
+
let installers;
|
|
106
|
+
const installersOnce = () => installers ??= languageInstallersOf(graph, environment);
|
|
96
107
|
/* every call of a function forces its parameters at the same sites, so this pass works them out once */
|
|
97
108
|
const forcing = new Map();
|
|
98
109
|
/* evaluations within one function and forces of one parameter share their sites, and with them what reaches them */
|
|
99
|
-
const reaches = new
|
|
110
|
+
const reaches = new defaultmap_1.DefaultMap(() => ({}));
|
|
111
|
+
const reachOf = (sites) => reaches.get(sites.join('\0'));
|
|
100
112
|
let enclosing;
|
|
101
|
-
const reachOf = (sites) => {
|
|
102
|
-
const key = sites.join('\0');
|
|
103
|
-
let reach = reaches.get(key);
|
|
104
|
-
if (reach === undefined) {
|
|
105
|
-
reach = {};
|
|
106
|
-
reaches.set(key, reach);
|
|
107
|
-
}
|
|
108
|
-
return reach;
|
|
109
|
-
};
|
|
110
|
-
const installersOnce = () => installers ??= languageInstallersOf(graph, environment);
|
|
111
113
|
for (const [id, vertex] of graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
|
|
112
114
|
const masks = nse_1.Nse.dropResolvedMask(graph, id, vertex.name);
|
|
113
115
|
if (masks !== undefined) {
|
|
114
116
|
masking.push(masks);
|
|
115
117
|
}
|
|
116
118
|
for (const installed of installedLanguageOf(graph, id, installersOnce)) {
|
|
117
|
-
|
|
118
|
-
deferred_1.Deferred.link(graph, installed, names, idMap);
|
|
119
|
+
deferred_1.Deferred.link(graph, installed, namesOnce(), idMap);
|
|
119
120
|
graph.addEdge(id, installed, edge_1.EdgeType.Returns);
|
|
120
121
|
}
|
|
121
122
|
if (DelayingCalls.has(identifier_1.Identifier.getName(vertex.name))) {
|
|
122
123
|
const promise = capturedArgumentsOf(graph, id, true)[0];
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
124
|
+
if (promise === undefined) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
const promised = namesOnce();
|
|
128
|
+
const binding = boundBy(graph, id);
|
|
129
|
+
const flow = binding === undefined ? undefined : cfgOnce();
|
|
130
|
+
const sites = flow === undefined || binding === undefined ? undefined : deferred_1.Deferred.forcedAt(graph, binding, flow, true);
|
|
131
|
+
/* the promise runs in `eval.env`, so whatever that environment holds may be what it reads */
|
|
132
|
+
const call = idMap.get(id);
|
|
133
|
+
const evalEnv = r_function_call_1.RFunctionCall.is(call) ? match_args_1.MatchArgs.toNames(call.arguments, DelayedAssignFormals).get('eval.env')?.value : undefined;
|
|
134
|
+
const tracked = trackedEnvOf(vertex, evalEnv);
|
|
135
|
+
/* a tracked `eval.env` that binds every name the promise reads leaves no other binding in play, its writes still reach later reads */
|
|
136
|
+
const bound = tracked !== undefined && exports.Quoted.evaluateIn(graph, promise, tracked, idMap).length === 0;
|
|
137
|
+
const candidates = bound ? { definitions: new Map(), uses: promised.uses } : promised;
|
|
138
|
+
const forces = flow !== undefined && sites?.length && binding !== undefined ? { cfg: flow, sites, binding } : undefined;
|
|
139
|
+
deferred_1.Deferred.link(graph, promise, candidates, idMap, forces);
|
|
140
|
+
if (binding !== undefined) {
|
|
141
|
+
linkForcesToPromise(graph, binding, promise);
|
|
142
|
+
}
|
|
143
|
+
if (evalEnv !== undefined) {
|
|
144
|
+
graph.addEdge(promise, evalEnv.info.id, edge_1.EdgeType.Reads);
|
|
141
145
|
}
|
|
142
146
|
}
|
|
143
|
-
else if (hasOrigin(vertex,
|
|
144
|
-
|
|
145
|
-
bindings ??=
|
|
146
|
-
resolveEvaluation(graph, vertex, idMap, names, bindings, cfgOnce(), reachOf, enclosing ??= enclosingDefinitions(graph));
|
|
147
|
+
else if (vertex_1.DfgVertex.hasOrigin(vertex, built_in_proc_name_1.BuiltInProcName.Eval) || EvaluatingElsewhereCalls.has(identifier_1.Identifier.getName(vertex.name))) {
|
|
148
|
+
bindings ??= (0, deferred_1.verticesByName)(graph, vertex_1.VertexType.VariableDefinition, idMap);
|
|
149
|
+
resolveEvaluation(graph, vertex, idMap, namesOnce(), bindings, cfgOnce(), reachOf, enclosing ??= enclosingDefinitions(graph), evaluated);
|
|
147
150
|
}
|
|
148
151
|
else {
|
|
149
|
-
for (const escaped of escapingArguments(graph, id)) {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
+
for (const [escaped, closure] of escapingArguments(graph, id)) {
|
|
153
|
+
deferred_1.Deferred.link(graph, escaped, namesOnce(), idMap);
|
|
154
|
+
readAtForcingCalls(graph, id, escaped, closure, idMap);
|
|
152
155
|
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
156
|
+
sideEffects ??= callsWithSideEffects(graph);
|
|
157
|
+
const flow = sideEffects.has(id) ? cfgOnce() : undefined;
|
|
158
|
+
if (flow === undefined) {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
for (const parameter of df_helper_1.Dataflow.calleesOf(graph, id).flatMap(df_helper_1.Dataflow.parametersOf)) {
|
|
162
|
+
for (const argument of df_helper_1.Dataflow.argumentsBoundTo(graph, parameter)) {
|
|
163
|
+
const index = namesOnce();
|
|
164
|
+
const forces = forcesOf(graph, parameter, flow, forcing, reachOf);
|
|
165
|
+
if (forces !== undefined) {
|
|
166
|
+
deferred_1.Deferred.link(graph, argument, index, idMap, forces);
|
|
162
167
|
}
|
|
163
168
|
}
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
}
|
|
172
|
+
for (const at of evaluated) {
|
|
173
|
+
nse_1.Nse.unmark(graph, at);
|
|
174
|
+
}
|
|
167
175
|
graph.trackIncomingReads(false);
|
|
168
176
|
/* only once every mark has settled: the read a column gets makes it look bound from here on */
|
|
169
177
|
nse_1.Nse.linkMasksToData(graph, masking);
|
|
@@ -177,12 +185,7 @@ function forcesOf(graph, parameter, cfg, forcing, reachOf) {
|
|
|
177
185
|
return known.forces;
|
|
178
186
|
}
|
|
179
187
|
/* counting is only needed once something touched the reads, and the same count still means the same forces */
|
|
180
|
-
|
|
181
|
-
for (const [, edge] of graph.edgesTo(parameter)) {
|
|
182
|
-
if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads)) {
|
|
183
|
-
reads++;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
188
|
+
const reads = (0, frame_reflection_1.edgeSources)(graph, parameter, edge_1.EdgeType.Reads).length;
|
|
186
189
|
if (known?.reads === reads) {
|
|
187
190
|
forcing.set(parameter, { ...known, version });
|
|
188
191
|
return known.forces;
|
|
@@ -194,17 +197,12 @@ function forcesOf(graph, parameter, cfg, forcing, reachOf) {
|
|
|
194
197
|
}
|
|
195
198
|
/** The name a delaying call binds, which is the definition its reads have to go through. */
|
|
196
199
|
function boundBy(graph, id) {
|
|
197
|
-
|
|
198
|
-
if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedBy) && vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(target))) {
|
|
199
|
-
return target;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
return undefined;
|
|
200
|
+
return (0, frame_reflection_1.edgeSources)(graph, id, edge_1.EdgeType.DefinedBy).find(target => vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(target)));
|
|
203
201
|
}
|
|
204
202
|
/** Every read of the delayed name takes the promised expression's value, so all of them get the link, not just whichever forces it first. */
|
|
205
203
|
function linkForcesToPromise(graph, binding, promise) {
|
|
206
|
-
for (const
|
|
207
|
-
if (
|
|
204
|
+
for (const reader of (0, frame_reflection_1.edgeSources)(graph, binding, edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedByOnCall)) {
|
|
205
|
+
if (reader !== promise) {
|
|
208
206
|
graph.addEdge(reader, promise, edge_1.EdgeType.Reads);
|
|
209
207
|
}
|
|
210
208
|
}
|
|
@@ -216,16 +214,13 @@ function trackedEnvOf(call, evalEnv) {
|
|
|
216
214
|
return env?.current.globalEnv || env?.current.builtInEnv ? undefined : env;
|
|
217
215
|
}
|
|
218
216
|
function* installedLanguageOf(graph, id, installers) {
|
|
219
|
-
for (const
|
|
220
|
-
if (!
|
|
217
|
+
for (const definition of (0, frame_reflection_1.edgeTargets)(graph, id, edge_1.EdgeType.Reads)) {
|
|
218
|
+
if (!vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(definition))) {
|
|
221
219
|
continue;
|
|
222
220
|
}
|
|
223
221
|
let installs = false;
|
|
224
222
|
const captured = [];
|
|
225
|
-
for (const
|
|
226
|
-
if (!edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedBy)) {
|
|
227
|
-
continue;
|
|
228
|
-
}
|
|
223
|
+
for (const by of (0, frame_reflection_1.edgeTargets)(graph, definition, edge_1.EdgeType.DefinedBy)) {
|
|
229
224
|
const captures = capturedArgumentsOf(graph, by, true);
|
|
230
225
|
if (captures.length > 0) {
|
|
231
226
|
captured.push(...captures);
|
|
@@ -254,51 +249,31 @@ function languageInstallersOf(graph, environment) {
|
|
|
254
249
|
* and still hands back the language object they form, all of them.
|
|
255
250
|
*/
|
|
256
251
|
function capturedArgumentsOf(graph, id, marked) {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
captured.push(target);
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
return captured;
|
|
264
|
-
}
|
|
265
|
-
/** Every name a definition binds, the string-named ones an `assign` creates included. */
|
|
266
|
-
function bindingsOf(graph, idMap) {
|
|
267
|
-
const bindings = new Map();
|
|
268
|
-
for (const [id] of graph.verticesOfType(vertex_1.VertexType.VariableDefinition)) {
|
|
269
|
-
const name = node_id_1.NodeId.recoverName(id, idMap);
|
|
270
|
-
if (name === undefined) {
|
|
271
|
-
continue;
|
|
272
|
-
}
|
|
273
|
-
const key = identifier_1.Identifier.getName((0, retriever_1.removeRQuotes)(name));
|
|
274
|
-
const known = bindings.get(key);
|
|
275
|
-
if (known !== undefined) {
|
|
276
|
-
known.push(id);
|
|
277
|
-
}
|
|
278
|
-
else {
|
|
279
|
-
bindings.set(key, [id]);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return bindings;
|
|
252
|
+
return [...graph.edgesFrom(id)]
|
|
253
|
+
.filter(([, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Argument) && (!marked || edge_1.DfEdge.includesType(edge, edge_1.EdgeType.NonStandardEvaluation)))
|
|
254
|
+
.map(([target]) => target);
|
|
283
255
|
}
|
|
284
256
|
/**
|
|
285
257
|
* Where the evaluation happens: the call itself, or, for one inside a closure, every call of that closure (those
|
|
286
258
|
* are the points whose bindings the evaluation sees). `undefined` if a nesting closure is never seen called.
|
|
287
259
|
*/
|
|
288
260
|
function evaluationSites(graph, id, enclosing) {
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
261
|
+
if ((enclosing.get(id) ?? []).length === 0) {
|
|
262
|
+
return [id];
|
|
263
|
+
}
|
|
264
|
+
const sites = new Set();
|
|
265
|
+
const todo = [id];
|
|
266
|
+
for (let at = todo.pop(); at !== undefined; at = todo.pop()) {
|
|
267
|
+
for (const definition of enclosing.get(at) ?? []) {
|
|
268
|
+
for (const caller of (0, frame_reflection_1.edgeSources)(graph, definition, edge_1.EdgeType.Calls)) {
|
|
269
|
+
if (!sites.has(caller)) {
|
|
270
|
+
sites.add(caller);
|
|
271
|
+
todo.push(caller);
|
|
272
|
+
}
|
|
295
273
|
}
|
|
296
274
|
}
|
|
297
275
|
}
|
|
298
|
-
|
|
299
|
-
return [id];
|
|
300
|
-
}
|
|
301
|
-
return sites.length > 0 ? sites : undefined;
|
|
276
|
+
return sites.size > 0 ? [...sites] : undefined;
|
|
302
277
|
}
|
|
303
278
|
/** the function definitions each vertex sits in, built once per pass instead of searching them for every evaluation */
|
|
304
279
|
function enclosingDefinitions(graph) {
|
|
@@ -341,40 +316,25 @@ function linkAgainstAnyBinding(graph, open, bindings, sites, cfg, reach) {
|
|
|
341
316
|
}
|
|
342
317
|
}
|
|
343
318
|
function callsWithSideEffects(graph) {
|
|
344
|
-
|
|
345
|
-
for (const [id] of graph.vertices(true)) {
|
|
346
|
-
for (const [target, edge] of graph.edgesFrom(id)) {
|
|
347
|
-
if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.SideEffectOnCall)) {
|
|
348
|
-
calls.add(target);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
return calls;
|
|
353
|
-
}
|
|
354
|
-
function* forcedParameters(graph, id) {
|
|
355
|
-
for (const callee of df_helper_1.Dataflow.calleesOf(graph, id)) {
|
|
356
|
-
for (const parameter of df_helper_1.Dataflow.parametersOf(callee)) {
|
|
357
|
-
for (const argument of df_helper_1.Dataflow.argumentsBoundTo(graph, parameter)) {
|
|
358
|
-
yield [argument, parameter];
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
|
-
}
|
|
319
|
+
return new Set(graph.vertices(true).flatMap(([from]) => (0, frame_reflection_1.edgeTargets)(graph, from, edge_1.EdgeType.SideEffectOnCall)));
|
|
362
320
|
}
|
|
363
321
|
/** Links a capture handed to an evaluating call, in that call's scope. */
|
|
364
|
-
function resolveEvaluation(graph, call, idMap, names, bindings, cfg, reachOf, enclosing) {
|
|
322
|
+
function resolveEvaluation(graph, call, idMap, names, bindings, cfg, reachOf, enclosing, evaluated) {
|
|
365
323
|
const id = call.id;
|
|
366
324
|
const own = EvaluatingElsewhereCalls.has(identifier_1.Identifier.getName(call.name));
|
|
367
325
|
const sources = own ? capturedArgumentsOf(graph, id, true).map(expr => ({ expr, at: id })) : sourcesHandedTo(graph, call, idMap);
|
|
368
326
|
const environment = call.environment;
|
|
369
|
-
|
|
370
|
-
|
|
327
|
+
const node = idMap.get(id);
|
|
328
|
+
/* a frame of its own (`eval(expr, envir)` runs in the one it is given) says nothing about the bindings here,
|
|
329
|
+
so every one of them stays possible */
|
|
330
|
+
const elsewhere = own || environment === undefined || (r_function_call_1.RFunctionCall.isNamed(node) && node.arguments.length > 1);
|
|
371
331
|
const sites = sources.length > 0 ? evaluationSites(graph, id, enclosing) : undefined;
|
|
372
332
|
const reach = sites === undefined ? {} : reachOf(sites);
|
|
373
333
|
for (const { expr, at } of sources) {
|
|
374
334
|
if (elsewhere) {
|
|
375
335
|
const forces = cfg === undefined || sites === undefined ? undefined : { cfg, sites, binding: id, reach };
|
|
376
336
|
deferred_1.Deferred.link(graph, expr, { definitions: bindings, uses: names.uses }, idMap, forces);
|
|
377
|
-
deferred_1.Deferred.publish(graph, expr, names, idMap, id,
|
|
337
|
+
deferred_1.Deferred.publish(graph, expr, names, idMap, id, sites ?? []);
|
|
378
338
|
}
|
|
379
339
|
else {
|
|
380
340
|
const open = (0, linker_1.linkExpressionIn)(graph, expr, environment, idMap);
|
|
@@ -382,24 +342,24 @@ function resolveEvaluation(graph, call, idMap, names, bindings, cfg, reachOf, en
|
|
|
382
342
|
const enclosing = open.length > 0 ? graph.getVertex(at)?.environment : undefined;
|
|
383
343
|
const unbound = enclosing === undefined ? open : (0, linker_1.linkInputs)(open, enclosing, [], graph, false);
|
|
384
344
|
linkAgainstAnyBinding(graph, unbound, bindings, sites, cfg, reach);
|
|
385
|
-
deferred_1.Deferred.publish(graph, expr, names, idMap, id, cfg);
|
|
345
|
+
deferred_1.Deferred.publish(graph, expr, names, idMap, id, sites ?? [], cfg);
|
|
386
346
|
}
|
|
387
347
|
graph.addEdge(id, expr, edge_1.EdgeType.Returns);
|
|
388
348
|
/* the captured code only runs because this call evaluates it */
|
|
389
349
|
graph.addEdge(expr, id, edge_1.EdgeType.Reads);
|
|
390
350
|
if (!elsewhere) {
|
|
391
351
|
/* the capture said "not evaluated here", and being handed to `eval` settles that it is */
|
|
392
|
-
|
|
352
|
+
evaluated.push(at);
|
|
393
353
|
}
|
|
394
354
|
}
|
|
395
355
|
if (sources.length > 0 && !elsewhere) {
|
|
396
356
|
forgetUnknownSideEffect(graph, id);
|
|
397
357
|
}
|
|
398
358
|
if (sources.length > 0 && environment !== undefined && !sources.some(({ expr }) => mayConfigure(graph, expr, environment))) {
|
|
399
|
-
forgetStateWrites(graph, id);
|
|
359
|
+
forgetStateWrites(graph, id, new Set(sources.filter(({ at }) => model_1.RNode.findEnclosing(at, idMap, n => n.info.id === id) === undefined).map(({ expr }) => expr)));
|
|
400
360
|
}
|
|
401
361
|
}
|
|
402
|
-
/** Whether evaluating `expr` may change the options or
|
|
362
|
+
/** Whether evaluating `expr` may change the options, graphics, or RNG state: a call states {@link CallProp.Configures} or {@link SemanticCallTag.Random}, or is opaque. */
|
|
403
363
|
function mayConfigure(graph, expr, environment) {
|
|
404
364
|
const seen = new Set();
|
|
405
365
|
const todo = [expr];
|
|
@@ -412,7 +372,7 @@ function mayConfigure(graph, expr, environment) {
|
|
|
412
372
|
const vertex = graph.getVertex(id);
|
|
413
373
|
if (vertex_1.DfgVertex.isFunctionCall(vertex)) {
|
|
414
374
|
const builtIn = Array.isArray(vertex.origin) && vertex.origin.every(o => String(o).startsWith('builtin:') && o !== built_in_proc_name_1.BuiltInProcName.Function && o !== built_in_proc_name_1.BuiltInProcName.Eval);
|
|
415
|
-
if (!builtIn || built_in_props_1.CallProps.hasAny((0, query_fn_props_1.callFnProps)(id, { graph, environment }), built_in_props_1.CallProp.Configures)) {
|
|
375
|
+
if (!builtIn || built_in_props_1.CallProps.hasAny((0, query_fn_props_1.callFnProps)(id, { graph, environment }), [built_in_props_1.CallProp.Configures, built_in_props_1.SemanticCallTag.Random])) {
|
|
416
376
|
return true;
|
|
417
377
|
}
|
|
418
378
|
}
|
|
@@ -424,10 +384,13 @@ function mayConfigure(graph, expr, environment) {
|
|
|
424
384
|
}
|
|
425
385
|
return false;
|
|
426
386
|
}
|
|
427
|
-
/**
|
|
428
|
-
|
|
387
|
+
/**
|
|
388
|
+
* An evaluation is assumed to write the options and graphics state until we know what it evaluates (see `evaluatesCapturedCode`);
|
|
389
|
+
* a captured call then no longer needs the evaluation either, `eval(quote(x <- 1))` slices to `x <- 1`.
|
|
390
|
+
*/
|
|
391
|
+
function forgetStateWrites(graph, id, evaluatedElsewhere) {
|
|
429
392
|
for (const [from, edge] of graph.edgesTo(id)) {
|
|
430
|
-
if (edge_1.DfEdge.isOnlyType(edge, edge_1.EdgeType.Reads) && vertex_1.DfgVertex.isFunctionCall(graph.getVertex(from))) {
|
|
393
|
+
if (edge_1.DfEdge.isOnlyType(edge, edge_1.EdgeType.Reads) && vertex_1.DfgVertex.isFunctionCall(graph.getVertex(from)) && !evaluatedElsewhere.has(from)) {
|
|
431
394
|
graph.removeEdgeType(from, id, edge_1.EdgeType.Reads);
|
|
432
395
|
}
|
|
433
396
|
}
|
|
@@ -435,8 +398,10 @@ function forgetStateWrites(graph, id) {
|
|
|
435
398
|
/** The captures the first argument of an evaluating call may carry. */
|
|
436
399
|
function sourcesHandedTo(graph, call, idMap) {
|
|
437
400
|
const argument = call.args.find(a => !graph_1.FunctionArgument.isEmpty(a));
|
|
438
|
-
const reference = argument === undefined ? undefined :
|
|
439
|
-
|
|
401
|
+
const reference = argument === undefined ? undefined : graph_1.FunctionArgument.getReference(argument);
|
|
402
|
+
const node = reference === undefined ? undefined : idMap.get(reference);
|
|
403
|
+
const value = r_argument_1.RArgument.is(node) ? node.value?.info.id : reference;
|
|
404
|
+
return value === undefined ? [] : exports.Quoted.sourcesOf(graph, value);
|
|
440
405
|
}
|
|
441
406
|
/**
|
|
442
407
|
* The arguments of `id` whose promise outlives the call: the callee hands back a closure and never reads the
|
|
@@ -451,29 +416,54 @@ function* escapingArguments(graph, id) {
|
|
|
451
416
|
continue;
|
|
452
417
|
}
|
|
453
418
|
for (const parameter of df_helper_1.Dataflow.parametersOf(callee)) {
|
|
454
|
-
|
|
455
|
-
for (const [reader, edge] of graph.edgesTo(parameter)) {
|
|
456
|
-
if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads) && !closure.subflow.graph.has(reader)) {
|
|
457
|
-
escapes = false;
|
|
458
|
-
break;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
if (!escapes) {
|
|
419
|
+
if ((0, frame_reflection_1.edgeSources)(graph, parameter, edge_1.EdgeType.Reads).some(reader => !closure.subflow.graph.has(reader))) {
|
|
462
420
|
continue;
|
|
463
421
|
}
|
|
464
|
-
|
|
422
|
+
for (const argument of df_helper_1.Dataflow.argumentsBoundTo(graph, parameter)) {
|
|
423
|
+
yield [argument, closure.id];
|
|
424
|
+
}
|
|
465
425
|
}
|
|
466
426
|
}
|
|
467
427
|
}
|
|
468
428
|
}
|
|
469
|
-
/**
|
|
470
|
-
function
|
|
471
|
-
const
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
429
|
+
/** A promise only `closure` forces sees what is bound where it is called, so if each of its calls runs once, a definition none of them sees does not reach it. */
|
|
430
|
+
function readAtForcingCalls(graph, factoryCall, argument, closure, idMap) {
|
|
431
|
+
const environments = [];
|
|
432
|
+
for (const [binding, edge] of graph.edgesTo(factoryCall)) {
|
|
433
|
+
const via = graph.getVertex(binding);
|
|
434
|
+
if (!edge_1.DfEdge.includesType(edge, ~edge_1.ControlFlowEdgeTypes) || vertex_1.DfgVertex.hasOrigin(via, built_in_proc_name_1.BuiltInProcName.Assignment)) {
|
|
435
|
+
continue;
|
|
436
|
+
}
|
|
437
|
+
else if (!vertex_1.DfgVertex.isVariableDefinition(via) || !edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedBy)) {
|
|
438
|
+
return;
|
|
439
|
+
}
|
|
440
|
+
for (const reader of (0, frame_reflection_1.edgeSources)(graph, binding, edge_1.EdgeType.Reads)) {
|
|
441
|
+
const call = graph.getVertex(reader);
|
|
442
|
+
if (!vertex_1.DfgVertex.isFunctionCall(call) || !(0, frame_reflection_1.hasEdgeOfType)(graph, reader, closure, edge_1.EdgeType.Calls)
|
|
443
|
+
|| call.environment === undefined || program_order_1.ProgramOrder.runsOnceAt(reader, graph) === undefined) {
|
|
444
|
+
return;
|
|
445
|
+
}
|
|
446
|
+
environments.push(call.environment);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
if (environments.length === 0 || program_order_1.ProgramOrder.runsOnceAt(factoryCall, graph) === undefined) {
|
|
450
|
+
return;
|
|
451
|
+
}
|
|
452
|
+
model_1.RNode.visitAst(idMap.get(argument), node => {
|
|
453
|
+
/* what a function within the argument reads is read when that function runs, not when the promise is forced */
|
|
454
|
+
if (graph.hasVertex(node.info.id) && !graph.isRoot(node.info.id)) {
|
|
455
|
+
return true;
|
|
456
|
+
}
|
|
457
|
+
if (r_symbol_1.RSymbol.is(node)) {
|
|
458
|
+
const visible = new Set(environments.flatMap(env => resolve_helper_1.Resolve.byName(node.content, env) ?? []).map(d => d.nodeId));
|
|
459
|
+
for (const target of (0, frame_reflection_1.edgeTargets)(graph, node.info.id, edge_1.EdgeType.Reads)) {
|
|
460
|
+
if (vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(target)) && !visible.has(target)) {
|
|
461
|
+
graph.removeEdgeType(node.info.id, target, edge_1.EdgeType.Reads);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
return false;
|
|
466
|
+
});
|
|
477
467
|
}
|
|
478
468
|
/** Drops the marker the call carries while we cannot say what it evaluates. */
|
|
479
469
|
function forgetUnknownSideEffect(graph, id) {
|