@eagleoutice/flowr 2.10.4 → 2.10.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -14
- package/abstract-interpretation/absint-visitor.d.ts +17 -22
- package/abstract-interpretation/absint-visitor.js +47 -48
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +0 -3
- package/abstract-interpretation/data-frame/shape-inference.d.ts +2 -1
- package/abstract-interpretation/data-frame/shape-inference.js +5 -4
- package/abstract-interpretation/domains/abstract-domain.d.ts +17 -16
- package/abstract-interpretation/domains/abstract-domain.js +25 -27
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
- package/abstract-interpretation/domains/multi-value-state-domain.d.ts +32 -0
- package/abstract-interpretation/domains/multi-value-state-domain.js +60 -0
- package/abstract-interpretation/domains/partial-product-domain.d.ts +43 -0
- package/abstract-interpretation/domains/partial-product-domain.js +163 -0
- package/abstract-interpretation/domains/product-domain.d.ts +2 -29
- package/abstract-interpretation/domains/product-domain.js +6 -123
- package/abstract-interpretation/domains/set-range-domain.js +3 -3
- package/abstract-interpretation/domains/set-upper-bound-domain.js +1 -1
- package/abstract-interpretation/domains/singleton-domain.js +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +13 -28
- package/abstract-interpretation/domains/state-abstract-domain.js +16 -38
- package/abstract-interpretation/domains/state-domain-like.d.ts +36 -0
- package/abstract-interpretation/domains/state-domain-like.js +3 -0
- package/cli/flowr.js +11 -1
- package/config.d.ts +13 -0
- package/config.js +24 -3
- package/control-flow/basic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.d.ts +4 -0
- package/control-flow/semantic-cfg-guided-visitor.js +23 -32
- package/dataflow/environments/built-in-proc-name.d.ts +7 -1
- package/dataflow/environments/built-in-proc-name.js +6 -0
- package/dataflow/environments/built-in.d.ts +6 -0
- package/dataflow/environments/built-in.js +6 -0
- package/dataflow/environments/default-builtin-config.d.ts +63 -1
- package/dataflow/environments/default-builtin-config.js +15 -4
- package/dataflow/environments/identifier.d.ts +14 -0
- package/dataflow/graph/vertex.d.ts +6 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +16 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +6 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +99 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +48 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +75 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +196 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +38 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +27 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +14 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.d.ts +27 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +97 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-with.d.ts +23 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +90 -0
- package/documentation/doc-readme.js +13 -2
- package/documentation/doc-util/doc-types.d.ts +11 -2
- package/documentation/doc-util/doc-types.js +31 -9
- package/documentation/wiki-absint.d.ts +17 -2
- package/documentation/wiki-absint.js +83 -24
- package/documentation/wiki-analyzer.js +3 -4
- package/documentation/wiki-interface.js +22 -16
- package/documentation/wiki-mk/doc-context.d.ts +14 -1
- package/documentation/wiki-mk/doc-context.js +6 -0
- package/documentation/wiki-normalized-ast.d.ts +0 -9
- package/documentation/wiki-normalized-ast.js +9 -60
- package/linter/linter-rules.d.ts +4 -3
- package/linter/rules/problematic-inputs.d.ts +13 -7
- package/linter/rules/problematic-inputs.js +109 -60
- package/package.json +3 -3
- package/project/flowr-analyzer-builder.d.ts +6 -3
- package/project/flowr-analyzer-builder.js +12 -5
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +4 -3
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +17 -4
- package/project/plugins/flowr-analyzer-plugin.d.ts +1 -1
- package/project/plugins/flowr-analyzer-plugin.js +1 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +2 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.js +1 -0
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +7 -0
- package/queries/catalog/input-sources-query/input-source-functions.js +56 -0
- package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +19 -53
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -1
- package/queries/catalog/input-sources-query/input-sources-query-format.js +28 -11
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +21 -42
- package/queries/catalog/input-sources-query/simple-input-classifier.js +168 -104
- package/r-bridge/data/data.d.ts +28 -2
- package/r-bridge/data/data.js +34 -2
- package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -6
- package/r-bridge/lang-4.x/ast/model/model.js +0 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +6 -6
- package/util/record.d.ts +18 -3
- package/util/record.js +22 -1
- package/util/version.js +1 -1
- package/abstract-interpretation/normalized-ast-fold.d.ts +0 -119
- package/abstract-interpretation/normalized-ast-fold.js +0 -181
- package/project/plugins/flowr-analyzer-plugin-defaults.d.ts +0 -5
- package/project/plugins/flowr-analyzer-plugin-defaults.js +0 -37
|
@@ -11,18 +11,106 @@ const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
|
11
11
|
const assert_1 = require("../../../util/assert");
|
|
12
12
|
const arrays_1 = require("../../../util/collections/arrays");
|
|
13
13
|
const built_in_proc_name_1 = require("../../../dataflow/environments/built-in-proc-name");
|
|
14
|
+
const record_1 = require("../../../util/record");
|
|
15
|
+
const r_number_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-number");
|
|
16
|
+
const r_string_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
17
|
+
const r_logical_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-logical");
|
|
18
|
+
const r_symbol_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
|
|
19
|
+
const convert_values_1 = require("../../../r-bridge/lang-4.x/convert-values");
|
|
20
|
+
function isConstantLike(type) {
|
|
21
|
+
return type === InputType.Constant || type === InputType.DerivedConstant;
|
|
22
|
+
}
|
|
23
|
+
/** Returns the common value shared by all defined entries, or `undefined` if they disagree or all are `undefined`. */
|
|
24
|
+
function singleValue(values) {
|
|
25
|
+
let result;
|
|
26
|
+
let seen = false;
|
|
27
|
+
for (const v of values) {
|
|
28
|
+
if (v === undefined) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
if (!seen) {
|
|
32
|
+
result = v;
|
|
33
|
+
seen = true;
|
|
34
|
+
}
|
|
35
|
+
else if (v !== result) {
|
|
36
|
+
return undefined;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Accumulates types, control-dependency types, values, and purity while traversing origin
|
|
43
|
+
* chains. Call {@link build} to produce the resulting {@link InputSource}.
|
|
44
|
+
*/
|
|
45
|
+
class ClassificationAccumulator {
|
|
46
|
+
types = [];
|
|
47
|
+
cds = [];
|
|
48
|
+
values = [];
|
|
49
|
+
allPure = true;
|
|
50
|
+
merge(c) {
|
|
51
|
+
this.types.push(...c.types);
|
|
52
|
+
this.values.push(c.value);
|
|
53
|
+
if (c.cds) {
|
|
54
|
+
this.cds.push(...c.cds);
|
|
55
|
+
}
|
|
56
|
+
if (c.trace !== InputTraceType.Pure) {
|
|
57
|
+
this.allPure = false;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
pushUnknown() {
|
|
61
|
+
this.types.push(InputType.Unknown);
|
|
62
|
+
this.values.push(undefined);
|
|
63
|
+
}
|
|
64
|
+
build(id) {
|
|
65
|
+
const types = this.types.length === 0 ? [InputType.Unknown] : (0, arrays_1.uniqueArray)(this.types);
|
|
66
|
+
const trace = this.allPure ? InputTraceType.Pure : InputTraceType.Alias;
|
|
67
|
+
const src = { id, types, trace };
|
|
68
|
+
const cds = this.cds.length === 0 ? undefined : (0, arrays_1.uniqueArray)(this.cds);
|
|
69
|
+
if (cds) {
|
|
70
|
+
src.cds = cds;
|
|
71
|
+
}
|
|
72
|
+
if (types.every(isConstantLike)) {
|
|
73
|
+
const v = singleValue(this.values);
|
|
74
|
+
if (v !== undefined) {
|
|
75
|
+
src.value = v;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return src;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
14
81
|
class InputClassifier {
|
|
15
82
|
dfg;
|
|
16
83
|
config;
|
|
17
84
|
cache = new Map();
|
|
18
|
-
|
|
85
|
+
fullDfg;
|
|
86
|
+
constructor(dfg, config, fullDfg) {
|
|
19
87
|
this.dfg = dfg;
|
|
20
88
|
this.config = config;
|
|
89
|
+
this.fullDfg = fullDfg;
|
|
21
90
|
}
|
|
22
91
|
isDefinedByOnCall(id) {
|
|
23
|
-
const out = (this.
|
|
92
|
+
const out = (this.fullDfg ?? this.dfg).outgoingEdges(id) ?? new Map();
|
|
24
93
|
return out.values().some(e => edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedByOnCall));
|
|
25
94
|
}
|
|
95
|
+
extractConstantValue(id) {
|
|
96
|
+
const node = this.dfg.idMap?.get(id);
|
|
97
|
+
if (node === undefined) {
|
|
98
|
+
return undefined;
|
|
99
|
+
}
|
|
100
|
+
if (r_number_1.RNumber.is(node)) {
|
|
101
|
+
return node.content.num;
|
|
102
|
+
}
|
|
103
|
+
if (r_string_1.RString.is(node)) {
|
|
104
|
+
return node.content.str;
|
|
105
|
+
}
|
|
106
|
+
if (r_logical_1.RLogical.is(node)) {
|
|
107
|
+
return node.content;
|
|
108
|
+
}
|
|
109
|
+
if (r_symbol_1.RSymbol.is(node) && node.content === convert_values_1.RNull) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return undefined;
|
|
113
|
+
}
|
|
26
114
|
classifyEntry(vertex) {
|
|
27
115
|
const cached = this.cache.get(vertex.id);
|
|
28
116
|
if (cached) {
|
|
@@ -31,8 +119,14 @@ class InputClassifier {
|
|
|
31
119
|
// insert temporary unknown to break cycles
|
|
32
120
|
this.cache.set(vertex.id, { id: vertex.id, types: [InputType.Unknown], trace: InputTraceType.Unknown });
|
|
33
121
|
switch (vertex.tag) {
|
|
34
|
-
case vertex_1.VertexType.Value:
|
|
35
|
-
|
|
122
|
+
case vertex_1.VertexType.Value: {
|
|
123
|
+
const src = { id: vertex.id, types: [InputType.Constant], trace: InputTraceType.Unknown };
|
|
124
|
+
const v = this.extractConstantValue(vertex.id);
|
|
125
|
+
if (v !== undefined) {
|
|
126
|
+
src.value = v;
|
|
127
|
+
}
|
|
128
|
+
return this.classifyCdsAndReturn(vertex, src);
|
|
129
|
+
}
|
|
36
130
|
case vertex_1.VertexType.FunctionCall:
|
|
37
131
|
return this.classifyFunctionCall(vertex);
|
|
38
132
|
case vertex_1.VertexType.VariableDefinition:
|
|
@@ -62,32 +156,18 @@ class InputClassifier {
|
|
|
62
156
|
}
|
|
63
157
|
}
|
|
64
158
|
}
|
|
65
|
-
if (!matchesList(call, this.config.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
}
|
|
72
|
-
else if (matchesList(call, this.config.randomFns)) {
|
|
73
|
-
return this.classifyCdsAndReturn(call, { id: call.id, types: [InputType.Random], trace: InputTraceType.Unknown });
|
|
74
|
-
}
|
|
75
|
-
else if (matchesList(call, this.config.systemFns)) {
|
|
76
|
-
return this.classifyCdsAndReturn(call, { id: call.id, types: [InputType.System], trace: InputTraceType.Unknown });
|
|
77
|
-
}
|
|
78
|
-
else if (matchesList(call, this.config.ffiFns)) {
|
|
79
|
-
return this.classifyCdsAndReturn(call, { id: call.id, types: [InputType.Ffi], trace: InputTraceType.Unknown });
|
|
80
|
-
}
|
|
81
|
-
else if (matchesList(call, this.config.langFns)) {
|
|
82
|
-
return this.classifyCdsAndReturn(call, { id: call.id, types: [InputType.Lang], trace: InputTraceType.Unknown });
|
|
83
|
-
}
|
|
84
|
-
else if (matchesList(call, this.config.optionsFns)) {
|
|
85
|
-
return this.classifyCdsAndReturn(call, { id: call.id, types: [InputType.Options], trace: InputTraceType.Unknown });
|
|
159
|
+
if (!matchesList(call, this.config.pure)) {
|
|
160
|
+
const types = [];
|
|
161
|
+
for (const [type, entry] of record_1.Record.entries(this.config)) {
|
|
162
|
+
if (record_1.Record.values(InputType).includes(type) && matchesList(call, entry)) {
|
|
163
|
+
types.push(type);
|
|
164
|
+
}
|
|
86
165
|
}
|
|
87
|
-
|
|
166
|
+
if (types.length === 0) {
|
|
88
167
|
// if it is not pure, we cannot classify based on the inputs, in that case we do not know!
|
|
89
|
-
|
|
168
|
+
types.push(InputType.Unknown);
|
|
90
169
|
}
|
|
170
|
+
return this.classifyCdsAndReturn(call, { id: call.id, types, trace: InputTraceType.Unknown });
|
|
91
171
|
}
|
|
92
172
|
// Otherwise, classify by arguments; pure functions get Known/Pure handling
|
|
93
173
|
const argTypes = [];
|
|
@@ -115,7 +195,7 @@ class InputClassifier {
|
|
|
115
195
|
}
|
|
116
196
|
const cds = cdTypes.length > 0 ? (0, arrays_1.uniqueArray)(cdTypes) : undefined;
|
|
117
197
|
// all arguments only contain constant-like types -> derived constant
|
|
118
|
-
const allConstLike = argTypes.length > 0 && argTypes.every(
|
|
198
|
+
const allConstLike = argTypes.length > 0 && argTypes.every(isConstantLike);
|
|
119
199
|
if (allConstLike) {
|
|
120
200
|
return this.classifyCdsAndReturn(call, (0, objects_1.compactRecord)({ id: call.id, types: [InputType.DerivedConstant], trace: InputTraceType.Pure, cds }));
|
|
121
201
|
}
|
|
@@ -127,65 +207,57 @@ class InputClassifier {
|
|
|
127
207
|
if (origins === undefined) {
|
|
128
208
|
return this.classifyCdsAndReturn(vtx, { id: vtx.id, types: this.isDefinedByOnCall(vtx.id) ? [InputType.Scope] : [InputType.Unknown], trace: InputTraceType.Unknown });
|
|
129
209
|
}
|
|
130
|
-
const
|
|
131
|
-
const cds = [];
|
|
132
|
-
let allPure = true;
|
|
210
|
+
const acc = new ClassificationAccumulator();
|
|
133
211
|
for (const o of origins) {
|
|
134
212
|
if (o.type === 4 /* OriginType.ConstantOrigin */) {
|
|
135
|
-
types.push(InputType.DerivedConstant);
|
|
136
|
-
|
|
213
|
+
acc.types.push(InputType.DerivedConstant);
|
|
214
|
+
acc.values.push(this.extractConstantValue(o.id));
|
|
137
215
|
}
|
|
138
|
-
if (o.type === 0 /* OriginType.ReadVariableOrigin */ || o.type === 1 /* OriginType.WriteVariableOrigin */) {
|
|
139
|
-
|
|
140
|
-
if (v) {
|
|
141
|
-
// if the referenced definition is linked via defined-by-on-call to another
|
|
142
|
-
// id (e.g., a parameter linked to a caller argument), mark it as a Scope origin
|
|
143
|
-
if (this.isDefinedByOnCall(v.id)) {
|
|
144
|
-
types.push(InputType.Scope);
|
|
145
|
-
allPure = false;
|
|
146
|
-
}
|
|
147
|
-
// if this is a variable definition that is a parameter, classify as Parameter
|
|
148
|
-
if (v.tag === vertex_1.VertexType.VariableDefinition && this.dfg.idMap?.get(v.id)?.info.role === "param-n" /* RoleInParent.ParameterName */) {
|
|
149
|
-
types.push(InputType.Parameter);
|
|
150
|
-
continue;
|
|
151
|
-
}
|
|
152
|
-
const c = this.classifyEntry(v);
|
|
153
|
-
types.push(...c.types);
|
|
154
|
-
if (c.cds) {
|
|
155
|
-
cds.push(...c.cds);
|
|
156
|
-
}
|
|
157
|
-
if (c.trace !== InputTraceType.Pure) {
|
|
158
|
-
allPure = false;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
types.push(InputType.Unknown);
|
|
163
|
-
}
|
|
164
|
-
continue;
|
|
216
|
+
else if (o.type === 0 /* OriginType.ReadVariableOrigin */ || o.type === 1 /* OriginType.WriteVariableOrigin */) {
|
|
217
|
+
this.classifyVariableOrigin(o.id, acc);
|
|
165
218
|
}
|
|
166
|
-
if (o.type === 2 /* OriginType.FunctionCallOrigin */ || o.type === 3 /* OriginType.BuiltInFunctionOrigin */) {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (c.cds) {
|
|
172
|
-
cds.push(...c.cds);
|
|
173
|
-
}
|
|
174
|
-
if (c.trace !== InputTraceType.Pure) {
|
|
175
|
-
allPure = false;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
types.push(InputType.Unknown);
|
|
180
|
-
}
|
|
181
|
-
continue;
|
|
219
|
+
else if (o.type === 2 /* OriginType.FunctionCallOrigin */ || o.type === 3 /* OriginType.BuiltInFunctionOrigin */) {
|
|
220
|
+
this.classifyByVertex(o.id, acc);
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
acc.pushUnknown();
|
|
182
224
|
}
|
|
183
|
-
// unknown origin type
|
|
184
|
-
types.push(InputType.Unknown);
|
|
185
225
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
226
|
+
return this.classifyCdsAndReturn(vtx, acc.build(vtx.id));
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Resolves a variable definition or use origin, handling the special cases of
|
|
230
|
+
* scope-escaped variables (DefinedByOnCall) and parameter definitions.
|
|
231
|
+
*/
|
|
232
|
+
classifyVariableOrigin(definitionId, acc) {
|
|
233
|
+
const v = this.dfg.getVertex(definitionId);
|
|
234
|
+
if (!v) {
|
|
235
|
+
acc.pushUnknown();
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
// if the referenced definition is linked via defined-by-on-call to another
|
|
239
|
+
// id (e.g., a parameter linked to a caller argument), mark it as a Scope origin
|
|
240
|
+
if (this.isDefinedByOnCall(v.id)) {
|
|
241
|
+
acc.types.push(InputType.Scope);
|
|
242
|
+
acc.values.push(undefined);
|
|
243
|
+
acc.allPure = false;
|
|
244
|
+
}
|
|
245
|
+
// if this is a variable definition that is a parameter, classify as Parameter
|
|
246
|
+
if (v.tag === vertex_1.VertexType.VariableDefinition && this.dfg.idMap?.get(v.id)?.info.role === "param-n" /* RoleInParent.ParameterName */) {
|
|
247
|
+
acc.types.push(InputType.Parameter);
|
|
248
|
+
acc.values.push(undefined);
|
|
249
|
+
return;
|
|
250
|
+
}
|
|
251
|
+
acc.merge(this.classifyEntry(v));
|
|
252
|
+
}
|
|
253
|
+
classifyByVertex(id, acc) {
|
|
254
|
+
const v = this.dfg.getVertex(id);
|
|
255
|
+
if (v) {
|
|
256
|
+
acc.merge(this.classifyEntry(v));
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
acc.pushUnknown();
|
|
260
|
+
}
|
|
189
261
|
}
|
|
190
262
|
classifyVariableDefinition(vtx) {
|
|
191
263
|
// parameter definitions are classified as Parameter
|
|
@@ -197,28 +269,17 @@ class InputClassifier {
|
|
|
197
269
|
// fallback to unknown if we cannot find the value
|
|
198
270
|
return this.classifyCdsAndReturn(vtx, { id: vtx.id, types: [InputType.Unknown], trace: InputTraceType.Unknown });
|
|
199
271
|
}
|
|
200
|
-
const
|
|
201
|
-
const cds = [];
|
|
202
|
-
let allPure = true;
|
|
272
|
+
const acc = new ClassificationAccumulator();
|
|
203
273
|
for (const tid of sources) {
|
|
204
274
|
const tv = this.dfg.getVertex(tid);
|
|
205
275
|
if (tv) {
|
|
206
|
-
|
|
207
|
-
types.push(...c.types);
|
|
208
|
-
if (c.cds) {
|
|
209
|
-
cds.push(...c.cds);
|
|
210
|
-
}
|
|
211
|
-
if (c.trace !== InputTraceType.Pure) {
|
|
212
|
-
allPure = false;
|
|
213
|
-
}
|
|
276
|
+
acc.merge(this.classifyEntry(tv));
|
|
214
277
|
}
|
|
215
278
|
else {
|
|
216
|
-
|
|
279
|
+
acc.pushUnknown();
|
|
217
280
|
}
|
|
218
281
|
}
|
|
219
|
-
|
|
220
|
-
const trace = allPure ? InputTraceType.Pure : InputTraceType.Alias;
|
|
221
|
-
return this.classifyCdsAndReturn(vtx, { id: vtx.id, types: t, trace, cds: cds.length === 0 ? undefined : (0, arrays_1.uniqueArray)(cds) });
|
|
282
|
+
return this.classifyCdsAndReturn(vtx, acc.build(vtx.id));
|
|
222
283
|
}
|
|
223
284
|
classifyCdsAndReturn(vtx, src) {
|
|
224
285
|
if (vtx.cds) {
|
|
@@ -249,7 +310,7 @@ class InputClassifier {
|
|
|
249
310
|
*```
|
|
250
311
|
* [ Unknown ]
|
|
251
312
|
* |
|
|
252
|
-
* [Param] [File] [Net], ...
|
|
313
|
+
* [Param] [File] [Net] [User], ...
|
|
253
314
|
* |
|
|
254
315
|
* [ DerivedConstant ]
|
|
255
316
|
* |
|
|
@@ -265,12 +326,14 @@ var InputType;
|
|
|
265
326
|
InputType["Random"] = "rand";
|
|
266
327
|
/** Calls to system/system2 and similar */
|
|
267
328
|
InputType["System"] = "system";
|
|
268
|
-
/** Calls to .C / Fortran interfaces */
|
|
329
|
+
/** Calls to .C / Fortran interfaces (foreign function interfaces) */
|
|
269
330
|
InputType["Ffi"] = "ffi";
|
|
270
331
|
/** Language objects (quote/substitute/etc.) */
|
|
271
332
|
InputType["Lang"] = "lang";
|
|
272
333
|
/** Global options / option accessors (options, getOption) */
|
|
273
334
|
InputType["Options"] = "options";
|
|
335
|
+
/** Interactive user input (file choosers, prompts, dialogs, menu selections) */
|
|
336
|
+
InputType["User"] = "user";
|
|
274
337
|
InputType["Constant"] = "const";
|
|
275
338
|
/** Read from environment/call scope */
|
|
276
339
|
InputType["Scope"] = "scope";
|
|
@@ -290,11 +353,11 @@ var InputTraceType;
|
|
|
290
353
|
InputTraceType["Unknown"] = "unknown";
|
|
291
354
|
})(InputTraceType || (exports.InputTraceType = InputTraceType = {}));
|
|
292
355
|
function matchesList(fn, list) {
|
|
293
|
-
if (
|
|
356
|
+
if (list === undefined || list.length === 0) {
|
|
294
357
|
return false;
|
|
295
358
|
}
|
|
296
359
|
for (const id of list) {
|
|
297
|
-
if (fn.id === id || identifier_1.Identifier.matches(id, fn.name)) {
|
|
360
|
+
if (fn.id === id || (identifier_1.Identifier.is(id) && identifier_1.Identifier.matches(id, fn.name))) {
|
|
298
361
|
return true;
|
|
299
362
|
}
|
|
300
363
|
}
|
|
@@ -303,16 +366,17 @@ function matchesList(fn, list) {
|
|
|
303
366
|
/**
|
|
304
367
|
* Takes the given id which is expected to either be:
|
|
305
368
|
* - a function call - in this case all arguments are considered to be inputs (additionally to all read edges from the function call in the dataflow graph)
|
|
306
|
-
* - anything else - in that case the node itself is considered as an "input" - please note that in these scenarios the *return* value will only contain one mapping - that for the id you
|
|
369
|
+
* - anything else - in that case the node itself is considered as an "input" - please note that in these scenarios the *return* value will only contain one mapping - that for the id you passed in.
|
|
307
370
|
*
|
|
308
|
-
* This method traces the dependencies in the dataflow graph using the specification of functions passed in
|
|
371
|
+
* This method traces the dependencies in the dataflow graph using the specification of functions passed in.
|
|
372
|
+
* For the scope escape analysis, pass on the full, non-reduced DFG as `fullDfg`.
|
|
309
373
|
*/
|
|
310
|
-
function classifyInput(id, dfg, config) {
|
|
374
|
+
function classifyInput(id, dfg, config, fullDfg) {
|
|
311
375
|
const vtx = dfg.getVertex(id);
|
|
312
376
|
if (!vtx) {
|
|
313
377
|
return [];
|
|
314
378
|
}
|
|
315
|
-
const c = new InputClassifier(dfg, config);
|
|
379
|
+
const c = new InputClassifier(dfg, config, fullDfg);
|
|
316
380
|
if (vtx.tag === vertex_1.VertexType.FunctionCall) {
|
|
317
381
|
const ret = [];
|
|
318
382
|
const args = vtx.args;
|
package/r-bridge/data/data.d.ts
CHANGED
|
@@ -71,8 +71,34 @@ export declare const flowrCapabilities: {
|
|
|
71
71
|
}, {
|
|
72
72
|
readonly name: "Dynamic Environment Resolution";
|
|
73
73
|
readonly id: "dynamic-environment-resolution";
|
|
74
|
-
readonly supported: "
|
|
75
|
-
readonly description: "_For example, using `new.env` and
|
|
74
|
+
readonly supported: "partially";
|
|
75
|
+
readonly description: "_For example, using `new.env` and friends. Supports `new.env`/`new.environment`/`rlang::new_environment`, `assign`/`get`/`local` with `envir=`, dollar-sign access (`e$x`), `attach`, `with`/`within`, and env-variable aliasing (`alias <- e`). Static parent-argument resolution (`parent = e`, `parent = emptyenv()`) is supported._";
|
|
76
|
+
readonly capabilities: readonly [{
|
|
77
|
+
readonly name: "Environment in Conditionals";
|
|
78
|
+
readonly id: "environment-in-conditionals";
|
|
79
|
+
readonly supported: "partially";
|
|
80
|
+
readonly description: "_Tracking environment assignments and reads across if-then-else branches. flowR propagates envState through branch merging, but cross-branch name resolution inside the env is not guaranteed._";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "Environment in Loops";
|
|
83
|
+
readonly id: "environment-in-loops";
|
|
84
|
+
readonly supported: "partially";
|
|
85
|
+
readonly description: "_Tracking environment assignments inside loop constructs (for, while, repeat). The env variable is correctly attributed in each iteration body, but dynamic key generation (e.g., `paste0`) prevents static name resolution._";
|
|
86
|
+
}, {
|
|
87
|
+
readonly name: "Environment Parent";
|
|
88
|
+
readonly id: "environment-parent";
|
|
89
|
+
readonly supported: "partially";
|
|
90
|
+
readonly description: "_Specifying a parent for a newly-created environment (`new.env(parent = e)`, `new.env(parent = emptyenv())`). Tracked-env-variable parents and `emptyenv()`/`NULL` are resolved statically; dynamic or unknown parents fall back to the default (`parent.frame()`)._";
|
|
91
|
+
}, {
|
|
92
|
+
readonly name: "Environment Alias";
|
|
93
|
+
readonly id: "environment-alias";
|
|
94
|
+
readonly supported: "partially";
|
|
95
|
+
readonly description: "_Aliasing a tracked environment variable (`alias <- e`). The `envState` snapshot at assignment time is propagated, so assigns made BEFORE the alias are visible through it. Assigns made AFTER the alias to the original variable are not reflected._";
|
|
96
|
+
}, {
|
|
97
|
+
readonly name: "With / Within";
|
|
98
|
+
readonly id: "environment-with";
|
|
99
|
+
readonly supported: "partially";
|
|
100
|
+
readonly description: "_Evaluating an expression inside a named environment with `with(data, expr)` or `within(data, expr)`. When `data` is a tracked env variable, reads of names defined in that env resolve correctly. Writes inside `expr` are ephemeral (not persisted back to the env)._";
|
|
101
|
+
}];
|
|
76
102
|
}, {
|
|
77
103
|
readonly name: "Environment Sharing";
|
|
78
104
|
readonly id: "environment-sharing";
|
package/r-bridge/data/data.js
CHANGED
|
@@ -104,8 +104,40 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { simplified: true })}
|
|
|
104
104
|
{
|
|
105
105
|
name: 'Dynamic Environment Resolution',
|
|
106
106
|
id: 'dynamic-environment-resolution',
|
|
107
|
-
supported: '
|
|
108
|
-
description: '_For example, using `new.env` and
|
|
107
|
+
supported: 'partially',
|
|
108
|
+
description: '_For example, using `new.env` and friends. Supports `new.env`/`new.environment`/`rlang::new_environment`, `assign`/`get`/`local` with `envir=`, dollar-sign access (`e$x`), `attach`, `with`/`within`, and env-variable aliasing (`alias <- e`). Static parent-argument resolution (`parent = e`, `parent = emptyenv()`) is supported._',
|
|
109
|
+
capabilities: [
|
|
110
|
+
{
|
|
111
|
+
name: 'Environment in Conditionals',
|
|
112
|
+
id: 'environment-in-conditionals',
|
|
113
|
+
supported: 'partially',
|
|
114
|
+
description: '_Tracking environment assignments and reads across if-then-else branches. flowR propagates envState through branch merging, but cross-branch name resolution inside the env is not guaranteed._'
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'Environment in Loops',
|
|
118
|
+
id: 'environment-in-loops',
|
|
119
|
+
supported: 'partially',
|
|
120
|
+
description: '_Tracking environment assignments inside loop constructs (for, while, repeat). The env variable is correctly attributed in each iteration body, but dynamic key generation (e.g., `paste0`) prevents static name resolution._'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'Environment Parent',
|
|
124
|
+
id: 'environment-parent',
|
|
125
|
+
supported: 'partially',
|
|
126
|
+
description: '_Specifying a parent for a newly-created environment (`new.env(parent = e)`, `new.env(parent = emptyenv())`). Tracked-env-variable parents and `emptyenv()`/`NULL` are resolved statically; dynamic or unknown parents fall back to the default (`parent.frame()`)._'
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'Environment Alias',
|
|
130
|
+
id: 'environment-alias',
|
|
131
|
+
supported: 'partially',
|
|
132
|
+
description: '_Aliasing a tracked environment variable (`alias <- e`). The `envState` snapshot at assignment time is propagated, so assigns made BEFORE the alias are visible through it. Assigns made AFTER the alias to the original variable are not reflected._'
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'With / Within',
|
|
136
|
+
id: 'environment-with',
|
|
137
|
+
supported: 'partially',
|
|
138
|
+
description: '_Evaluating an expression inside a named environment with `with(data, expr)` or `within(data, expr)`. When `data` is a tracked env variable, reads of names defined in that env resolve correctly. Writes inside `expr` are ephemeral (not persisted back to the env)._'
|
|
139
|
+
}
|
|
140
|
+
]
|
|
109
141
|
},
|
|
110
142
|
{
|
|
111
143
|
name: 'Environment Sharing',
|
|
@@ -24,11 +24,11 @@ import type { RUnaryOp } from './nodes/r-unary-op';
|
|
|
24
24
|
import type { RBinaryOp } from './nodes/r-binary-op';
|
|
25
25
|
import type { RPipe } from './nodes/r-pipe';
|
|
26
26
|
import type { RDelimiter } from './nodes/info/r-delimiter';
|
|
27
|
-
import type { ParentInformation } from './processing/decorate';
|
|
27
|
+
import type { AstIdMap, ParentInformation } from './processing/decorate';
|
|
28
28
|
import type { NodeId } from './processing/node-id';
|
|
29
29
|
import type { OnEnter, OnExit } from './processing/visitor';
|
|
30
|
-
import type { SingleOrArrayOrNothing } from '../../../../abstract-interpretation/normalized-ast-fold';
|
|
31
30
|
import { getDocumentationOf } from '../../../roxygen2/documentation-provider';
|
|
31
|
+
export type SingleOrArrayOrNothing<T> = T | readonly (T | null | undefined)[] | null | undefined;
|
|
32
32
|
/** Simply an empty type constraint used to say that there are additional decorations (see {@link RAstNodeBase}). */
|
|
33
33
|
export type NoInfo = object;
|
|
34
34
|
/**
|
|
@@ -222,7 +222,6 @@ export type RNode<Info = NoInfo> = RExpressionList<Info> | RFunctions<Info> | RO
|
|
|
222
222
|
* For the individual type checks, please consult the individual vertices, e.g. {@link RPipe.is}.
|
|
223
223
|
* Some vertices also have a {@link RPipe.availableFromRVersion} property that indicates from which R version they are available,
|
|
224
224
|
* so you can check for that as well if needed.
|
|
225
|
-
* @see {@link DefaultNormalizedAstFold} - for a more powerful way to traverse the normalized AST
|
|
226
225
|
*/
|
|
227
226
|
export declare const RNode: {
|
|
228
227
|
readonly name: "RNode";
|
|
@@ -264,16 +263,16 @@ export declare const RNode: {
|
|
|
264
263
|
* linear chain of parents leading to the root node.
|
|
265
264
|
* @see {@link iterateParents} - to get all parents of a node
|
|
266
265
|
*/
|
|
267
|
-
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap:
|
|
266
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: AstIdMap<OtherInfo & ParentInformation>) => RNode<OtherInfo & ParentInformation> | undefined;
|
|
268
267
|
/**
|
|
269
268
|
* Returns an iterable of all parents of a node, starting with the direct parent and ending with the root node.
|
|
270
269
|
*/
|
|
271
|
-
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation> | undefined, idMap:
|
|
270
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation> | undefined, idMap: AstIdMap<OtherInfo & ParentInformation>) => Generator<RNode<OtherInfo & ParentInformation>>;
|
|
272
271
|
/**
|
|
273
272
|
* In contrast to the nesting stored in the {@link RNode} structure,
|
|
274
273
|
* this function calculates the depth of a node by counting the number of parents until the root node is reached.
|
|
275
274
|
*/
|
|
276
|
-
readonly depth: (this: void, node: RNode<ParentInformation>, idMap:
|
|
275
|
+
readonly depth: (this: void, node: RNode<ParentInformation>, idMap: AstIdMap<ParentInformation>) => number;
|
|
277
276
|
/**
|
|
278
277
|
* Collects all node ids within a tree given by a respective root node, but stops collecting at nodes where the given `stop` function returns `true`.
|
|
279
278
|
* <p>
|
|
@@ -123,7 +123,6 @@ exports.ROther = {
|
|
|
123
123
|
* For the individual type checks, please consult the individual vertices, e.g. {@link RPipe.is}.
|
|
124
124
|
* Some vertices also have a {@link RPipe.availableFromRVersion} property that indicates from which R version they are available,
|
|
125
125
|
* so you can check for that as well if needed.
|
|
126
|
-
* @see {@link DefaultNormalizedAstFold} - for a more powerful way to traverse the normalized AST
|
|
127
126
|
*/
|
|
128
127
|
exports.RNode = {
|
|
129
128
|
name: 'RNode',
|
|
@@ -46,13 +46,13 @@ export declare const RAccess: {
|
|
|
46
46
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
47
47
|
readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
|
|
48
48
|
readonly getType: (this: void, node: RNode) => RType;
|
|
49
|
-
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("
|
|
50
|
-
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("
|
|
49
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
50
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
|
|
51
51
|
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof EmptyArgument)[];
|
|
52
|
-
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap:
|
|
53
|
-
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap:
|
|
54
|
-
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap:
|
|
55
|
-
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("
|
|
52
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
|
|
53
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
|
|
54
|
+
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<import("../processing/decorate").ParentInformation>) => number;
|
|
55
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
|
|
56
56
|
readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
57
57
|
lexeme: string;
|
|
58
58
|
} ? string : string | undefined;
|
|
@@ -65,13 +65,13 @@ export declare const RArgument: {
|
|
|
65
65
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
66
66
|
readonly getId: (this: void, node: RNode<ParentInformation>) => NodeId;
|
|
67
67
|
readonly getType: (this: void, node: RNode) => RType;
|
|
68
|
-
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("
|
|
69
|
-
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("
|
|
68
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
69
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo & ParentInformation>>) => Set<NodeId>;
|
|
70
70
|
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof EmptyArgument)[];
|
|
71
|
-
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap:
|
|
72
|
-
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation> | undefined, idMap:
|
|
73
|
-
readonly depth: (this: void, node: RNode<ParentInformation>, idMap:
|
|
74
|
-
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("
|
|
71
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & ParentInformation>) => RNode<OtherInfo & ParentInformation> | undefined;
|
|
72
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation> | undefined, idMap: import("../processing/decorate").AstIdMap<OtherInfo & ParentInformation>) => Generator<RNode<OtherInfo & ParentInformation>>;
|
|
73
|
+
readonly depth: (this: void, node: RNode<ParentInformation>, idMap: import("../processing/decorate").AstIdMap<ParentInformation>) => number;
|
|
74
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo & ParentInformation>>, stop: (node: RNode<OtherInfo & ParentInformation>) => boolean) => Set<NodeId>;
|
|
75
75
|
readonly lexeme: <R extends RNode<ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
76
76
|
lexeme: string;
|
|
77
77
|
} ? string : string | undefined;
|
|
@@ -27,13 +27,13 @@ export declare const RBinaryOp: {
|
|
|
27
27
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
28
28
|
readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
|
|
29
29
|
readonly getType: (this: void, node: RNode) => RType;
|
|
30
|
-
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("
|
|
31
|
-
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("
|
|
30
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
31
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
|
|
32
32
|
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
|
|
33
|
-
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap:
|
|
34
|
-
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap:
|
|
35
|
-
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap:
|
|
36
|
-
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("
|
|
33
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
|
|
34
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
|
|
35
|
+
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<import("../processing/decorate").ParentInformation>) => number;
|
|
36
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
|
|
37
37
|
readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
38
38
|
lexeme: string;
|
|
39
39
|
} ? string : string | undefined;
|
|
@@ -19,13 +19,13 @@ export declare const RBreak: {
|
|
|
19
19
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
20
20
|
readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
|
|
21
21
|
readonly getType: (this: void, node: RNode) => RType;
|
|
22
|
-
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("
|
|
23
|
-
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("
|
|
22
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
23
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
|
|
24
24
|
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
|
|
25
|
-
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap:
|
|
26
|
-
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap:
|
|
27
|
-
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap:
|
|
28
|
-
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("
|
|
25
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
|
|
26
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: import("../processing/decorate").AstIdMap<OtherInfo & import("../processing/decorate").ParentInformation>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
|
|
27
|
+
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: import("../processing/decorate").AstIdMap<import("../processing/decorate").ParentInformation>) => number;
|
|
28
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../model").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
|
|
29
29
|
readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
30
30
|
lexeme: string;
|
|
31
31
|
} ? string : string | undefined;
|