@eagleoutice/flowr 2.2.15 → 2.2.16
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 +210 -6
- package/benchmark/slicer.d.ts +3 -1
- package/benchmark/slicer.js +8 -5
- package/benchmark/summarizer/first-phase/process.d.ts +2 -1
- package/benchmark/summarizer/first-phase/process.js +2 -2
- package/cli/benchmark-app.d.ts +1 -0
- package/cli/benchmark-app.js +4 -1
- package/cli/benchmark-helper-app.d.ts +1 -0
- package/cli/benchmark-helper-app.js +7 -8
- package/cli/common/options.js +2 -0
- package/cli/export-quads-app.js +2 -1
- package/cli/flowr.js +58 -57
- package/cli/repl/commands/repl-cfg.js +13 -13
- package/cli/repl/commands/repl-commands.js +2 -2
- package/cli/repl/commands/repl-dataflow.js +10 -10
- package/cli/repl/commands/repl-execute.d.ts +2 -3
- package/cli/repl/commands/repl-execute.js +4 -4
- package/cli/repl/commands/repl-lineage.js +4 -4
- package/cli/repl/commands/repl-main.d.ts +12 -1
- package/cli/repl/commands/repl-normalize.js +6 -6
- package/cli/repl/commands/repl-parse.js +2 -2
- package/cli/repl/commands/repl-query.js +9 -9
- package/cli/repl/commands/repl-version.js +1 -1
- package/cli/repl/core.d.ts +5 -2
- package/cli/repl/core.js +10 -8
- package/cli/repl/server/connection.d.ts +3 -1
- package/cli/repl/server/connection.js +7 -5
- package/cli/repl/server/server.d.ts +3 -2
- package/cli/repl/server/server.js +4 -2
- package/cli/script-core/statistics-core.d.ts +2 -1
- package/cli/script-core/statistics-core.js +2 -2
- package/cli/script-core/statistics-helper-core.d.ts +2 -1
- package/cli/script-core/statistics-helper-core.js +5 -4
- package/cli/slicer-app.js +4 -2
- package/cli/statistics-app.js +2 -1
- package/cli/statistics-helper-app.js +2 -1
- package/config.d.ts +12 -10
- package/config.js +26 -42
- package/control-flow/cfg-dead-code.js +45 -2
- package/control-flow/cfg-simplification.d.ts +2 -0
- package/control-flow/control-flow-graph.d.ts +1 -0
- package/control-flow/control-flow-graph.js +4 -0
- package/control-flow/dfg-cfg-guided-visitor.d.ts +5 -3
- package/control-flow/dfg-cfg-guided-visitor.js +15 -4
- package/control-flow/extract-cfg.d.ts +4 -2
- package/control-flow/extract-cfg.js +4 -3
- package/control-flow/semantic-cfg-guided-visitor.d.ts +19 -1
- package/control-flow/semantic-cfg-guided-visitor.js +23 -3
- package/core/pipeline-executor.d.ts +4 -1
- package/core/pipeline-executor.js +6 -5
- package/core/steps/all/core/10-normalize.d.ts +2 -0
- package/core/steps/all/core/10-normalize.js +1 -1
- package/core/steps/all/core/11-normalize-tree-sitter.d.ts +2 -1
- package/core/steps/all/core/11-normalize-tree-sitter.js +2 -2
- package/core/steps/all/core/20-dataflow.d.ts +2 -1
- package/core/steps/all/core/20-dataflow.js +2 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +2 -1
- package/core/steps/all/static-slicing/00-slice.js +2 -2
- package/core/steps/pipeline/default-pipelines.d.ts +32 -31
- package/core/steps/pipeline/default-pipelines.js +8 -8
- package/core/steps/pipeline-step.d.ts +2 -1
- package/dataflow/environments/built-in-config.d.ts +3 -3
- package/dataflow/environments/built-in.d.ts +7 -1
- package/dataflow/environments/built-in.js +2 -2
- package/dataflow/environments/default-builtin-config.js +4 -2
- package/dataflow/environments/define.d.ts +2 -1
- package/dataflow/environments/define.js +4 -5
- package/dataflow/environments/remove.d.ts +6 -0
- package/dataflow/environments/remove.js +29 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +7 -2
- package/dataflow/eval/resolve/alias-tracking.js +9 -6
- package/dataflow/eval/resolve/resolve-argument.d.ts +8 -0
- package/dataflow/eval/resolve/resolve-argument.js +118 -0
- package/dataflow/eval/resolve/resolve.d.ts +18 -15
- package/dataflow/eval/resolve/resolve.js +20 -18
- package/dataflow/eval/values/string/string-constants.d.ts +1 -1
- package/dataflow/eval/values/string/string-constants.js +7 -2
- package/dataflow/extractor.d.ts +2 -1
- package/dataflow/extractor.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +4 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +11 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +10 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +5 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +15 -15
- 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 +1 -1
- package/dataflow/internal/process/functions/call/common.js +1 -1
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +21 -0
- package/dataflow/origin/dfg-get-symbol-refs.js +50 -0
- package/dataflow/processor.d.ts +5 -0
- package/documentation/doc-util/doc-cfg.js +4 -3
- package/documentation/doc-util/doc-code.d.ts +1 -1
- package/documentation/doc-util/doc-dfg.js +3 -2
- package/documentation/doc-util/doc-functions.d.ts +24 -0
- package/documentation/doc-util/doc-functions.js +65 -0
- package/documentation/doc-util/doc-normalized-ast.js +3 -2
- package/documentation/doc-util/doc-print.d.ts +5 -0
- package/documentation/doc-util/doc-print.js +36 -0
- package/documentation/doc-util/doc-query.js +3 -2
- package/documentation/doc-util/doc-repl.js +2 -1
- package/documentation/doc-util/doc-search.js +3 -2
- package/documentation/doc-util/doc-types.d.ts +28 -6
- package/documentation/doc-util/doc-types.js +89 -45
- package/documentation/print-cfg-wiki.js +6 -7
- package/documentation/print-core-wiki.js +5 -5
- package/documentation/print-dataflow-graph-wiki.js +10 -10
- package/documentation/print-engines-wiki.js +1 -2
- package/documentation/print-faq-wiki.js +8 -2
- package/documentation/print-interface-wiki.js +1 -2
- package/documentation/print-linter-issue.d.ts +1 -0
- package/documentation/print-linter-issue.js +71 -0
- package/documentation/print-linter-wiki.js +219 -34
- package/documentation/print-linting-and-testing-wiki.js +2 -4
- package/documentation/print-normalized-ast-wiki.js +3 -3
- package/documentation/print-query-wiki.js +1 -2
- package/documentation/print-readme.js +24 -1
- package/documentation/print-search-wiki.js +1 -2
- package/linter/linter-executor.d.ts +3 -1
- package/linter/linter-executor.js +3 -2
- package/linter/linter-format.d.ts +67 -7
- package/linter/linter-format.js +12 -1
- package/linter/linter-rules.d.ts +155 -16
- package/linter/linter-rules.js +12 -4
- package/linter/linter-tags.d.ts +80 -0
- package/linter/linter-tags.js +85 -0
- package/linter/rules/absolute-path.d.ts +71 -0
- package/linter/rules/absolute-path.js +177 -0
- package/linter/rules/deprecated-functions.d.ts +43 -0
- package/linter/rules/deprecated-functions.js +58 -0
- package/linter/rules/{2-file-path-validity.d.ts → file-path-validity.d.ts} +16 -6
- package/linter/rules/{2-file-path-validity.js → file-path-validity.js} +21 -13
- package/linter/rules/naming-convention.d.ts +71 -0
- package/linter/rules/naming-convention.js +164 -0
- package/linter/rules/seeded-randomness.d.ts +65 -0
- package/linter/rules/seeded-randomness.js +122 -0
- package/linter/rules/unused-definition.d.ts +41 -0
- package/linter/rules/unused-definition.js +105 -0
- package/package.json +4 -1
- package/queries/base-query-format.d.ts +2 -0
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.js +2 -3
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -2
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -116
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-executor.js +2 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-format.js +16 -12
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
- package/queries/catalog/search-query/search-query-executor.js +2 -2
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/queries/query.d.ts +15 -15
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +4 -2
- package/r-bridge/lang-4.x/convert-values.js +2 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +3 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +4 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +7 -5
- package/r-bridge/shell.d.ts +3 -2
- package/r-bridge/shell.js +4 -5
- package/search/flowr-search-builder.d.ts +6 -2
- package/search/flowr-search-builder.js +7 -0
- package/search/flowr-search-filters.d.ts +32 -8
- package/search/flowr-search-filters.js +42 -15
- package/search/flowr-search.d.ts +4 -0
- package/search/search-executor/search-enrichers.d.ts +7 -3
- package/search/search-executor/search-enrichers.js +29 -20
- package/search/search-executor/search-generators.js +1 -1
- package/search/search-executor/search-transformer.d.ts +2 -0
- package/search/search-executor/search-transformer.js +10 -1
- package/slicing/static/static-slicer.d.ts +1 -1
- package/slicing/static/static-slicer.js +2 -3
- package/statistics/statistics.d.ts +3 -1
- package/statistics/statistics.js +5 -4
- package/util/containers.d.ts +12 -9
- package/util/containers.js +12 -9
- package/util/objects.d.ts +5 -4
- package/util/range.d.ts +5 -1
- package/util/range.js +11 -3
- package/util/text/strings.d.ts +6 -0
- package/util/text/strings.js +35 -0
- package/util/version.js +1 -1
- package/linter/rules/1-deprecated-functions.d.ts +0 -34
- package/linter/rules/1-deprecated-functions.js +0 -54
|
@@ -54,7 +54,7 @@ export declare const DataflowLensQueryDefinition: {
|
|
|
54
54
|
}, input: {
|
|
55
55
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
56
56
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
57
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
58
58
|
readonly requiredInput: {};
|
|
59
59
|
readonly name: "dataflow";
|
|
60
60
|
readonly description: "Construct the dataflow graph";
|
|
@@ -55,7 +55,7 @@ export declare const DataflowQueryDefinition: {
|
|
|
55
55
|
}, input: {
|
|
56
56
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
57
57
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
58
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
58
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
59
59
|
readonly requiredInput: {};
|
|
60
60
|
readonly name: "dataflow";
|
|
61
61
|
readonly description: "Construct the dataflow graph";
|
|
@@ -4,12 +4,9 @@ exports.executeDependenciesQuery = executeDependenciesQuery;
|
|
|
4
4
|
const query_1 = require("../../query");
|
|
5
5
|
const dependencies_query_format_1 = require("./dependencies-query-format");
|
|
6
6
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
7
|
-
const graph_1 = require("../../../dataflow/graph/graph");
|
|
8
7
|
const log_1 = require("../../../util/log");
|
|
9
8
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
10
|
-
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
11
9
|
const visitor_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
12
|
-
const assert_1 = require("../../../util/assert");
|
|
13
10
|
const objects_1 = require("../../../util/objects");
|
|
14
11
|
const library_functions_1 = require("./function-info/library-functions");
|
|
15
12
|
const source_functions_1 = require("./function-info/source-functions");
|
|
@@ -17,10 +14,7 @@ const read_functions_1 = require("./function-info/read-functions");
|
|
|
17
14
|
const write_functions_1 = require("./function-info/write-functions");
|
|
18
15
|
const function_info_1 = require("./function-info/function-info");
|
|
19
16
|
const identify_link_to_last_call_relation_1 = require("../call-context-query/identify-link-to-last-call-relation");
|
|
20
|
-
const
|
|
21
|
-
const general_1 = require("../../../dataflow/eval/values/general");
|
|
22
|
-
const alias_tracking_1 = require("../../../dataflow/eval/resolve/alias-tracking");
|
|
23
|
-
const string_constants_1 = require("../../../dataflow/eval/values/string/string-constants");
|
|
17
|
+
const resolve_argument_1 = require("../../../dataflow/eval/resolve/resolve-argument");
|
|
24
18
|
function collectNamespaceAccesses(data, libraries) {
|
|
25
19
|
/* for libraries, we have to additionally track all uses of `::` and `:::`, for this we currently simply traverse all uses */
|
|
26
20
|
(0, visitor_1.visitAst)(data.ast.ast, n => {
|
|
@@ -29,7 +23,7 @@ function collectNamespaceAccesses(data, libraries) {
|
|
|
29
23
|
libraries.push({
|
|
30
24
|
nodeId: n.info.id,
|
|
31
25
|
functionName: (n.info.fullLexeme ?? n.lexeme).includes(':::') ? ':::' : '::',
|
|
32
|
-
libraryName: n.namespace
|
|
26
|
+
libraryName: n.namespace,
|
|
33
27
|
});
|
|
34
28
|
}
|
|
35
29
|
});
|
|
@@ -119,7 +113,7 @@ function getResults(data, results, kind, functions, makeInfo) {
|
|
|
119
113
|
return kindEntries.flatMap(([name, results]) => results.flatMap(({ id, linkedIds }) => {
|
|
120
114
|
const vertex = data.dataflow.graph.getVertex(id);
|
|
121
115
|
const info = functions.find(f => f.name === name);
|
|
122
|
-
const args =
|
|
116
|
+
const args = (0, resolve_argument_1.getArgumentStringValue)(data.config.solver.variables, data.dataflow.graph, vertex, info.argIdx, info.argName, info.resolveValue);
|
|
123
117
|
const linkedArgs = collectValuesFromLinks(args, data, linkedIds);
|
|
124
118
|
const foundValues = linkedArgs ?? args;
|
|
125
119
|
if (!foundValues) {
|
|
@@ -161,7 +155,7 @@ function collectValuesFromLinks(args, data, linkedIds) {
|
|
|
161
155
|
if (vertex === undefined || vertex.tag !== vertex_1.VertexType.FunctionCall) {
|
|
162
156
|
continue;
|
|
163
157
|
}
|
|
164
|
-
const args =
|
|
158
|
+
const args = (0, resolve_argument_1.getArgumentStringValue)(data.config.solver.variables, data.dataflow.graph, vertex, info.argIdx, info.argName, info.resolveValue);
|
|
165
159
|
if (args === undefined) {
|
|
166
160
|
continue;
|
|
167
161
|
}
|
|
@@ -175,112 +169,6 @@ function collectValuesFromLinks(args, data, linkedIds) {
|
|
|
175
169
|
}
|
|
176
170
|
return map.size ? map : undefined;
|
|
177
171
|
}
|
|
178
|
-
function hasCharacterOnly(data, vertex, idMap) {
|
|
179
|
-
if (!vertex.args || vertex.args.length === 0 || !idMap) {
|
|
180
|
-
return false;
|
|
181
|
-
}
|
|
182
|
-
const treatAsChar = getArgumentValue(data, vertex, 5, 'character.only', true);
|
|
183
|
-
if (!treatAsChar) {
|
|
184
|
-
return false;
|
|
185
|
-
}
|
|
186
|
-
const hasTrue = [...treatAsChar.values()].some(set => set?.has('TRUE'));
|
|
187
|
-
const hasFalse = hasTrue ? [...treatAsChar.values()].some(set => set === undefined || set.has('FALSE')) : false;
|
|
188
|
-
if (hasTrue && hasFalse) {
|
|
189
|
-
return 'maybe';
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
return hasTrue;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
function resolveBasedOnConfig(data, vertex, argument, environment, idMap, resolveValue) {
|
|
196
|
-
let full = true;
|
|
197
|
-
if (!resolveValue) {
|
|
198
|
-
full = false;
|
|
199
|
-
}
|
|
200
|
-
if (resolveValue === 'library') {
|
|
201
|
-
const hasChar = hasCharacterOnly(data, vertex, idMap);
|
|
202
|
-
if (hasChar === false) {
|
|
203
|
-
if (argument.type === type_1.RType.Symbol) {
|
|
204
|
-
return [argument.lexeme];
|
|
205
|
-
}
|
|
206
|
-
full = false;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
full = true;
|
|
210
|
-
const resolved = (0, general_1.valueSetGuard)((0, alias_tracking_1.resolveIdToValue)(argument, { environment, graph: data.dataflow.graph, full: full }));
|
|
211
|
-
if (resolved) {
|
|
212
|
-
const values = [];
|
|
213
|
-
for (const value of resolved.elements) {
|
|
214
|
-
if (!(0, r_value_1.isValue)(value)) {
|
|
215
|
-
return undefined;
|
|
216
|
-
}
|
|
217
|
-
if (value.type === 'string' && (0, r_value_1.isValue)(value.value)) {
|
|
218
|
-
values.push(value.value.str);
|
|
219
|
-
}
|
|
220
|
-
else if (value.type === 'logical' && (0, r_value_1.isValue)(value.value)) {
|
|
221
|
-
values.push(value.value.valueOf() ? 'TRUE' : 'FALSE');
|
|
222
|
-
}
|
|
223
|
-
else if (value.type === 'vector' && (0, r_value_1.isValue)(value.elements)) {
|
|
224
|
-
const elements = (0, string_constants_1.collectStrings)(value.elements);
|
|
225
|
-
if (elements === undefined) {
|
|
226
|
-
return undefined;
|
|
227
|
-
}
|
|
228
|
-
values.push(...elements);
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
return undefined;
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
return values;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Get the values of all arguments matching the criteria.
|
|
239
|
-
*/
|
|
240
|
-
function getArgumentValue(data, vertex, argumentIndex, argumentName, resolveValue) {
|
|
241
|
-
const graph = data.dataflow.graph;
|
|
242
|
-
if (argumentName) {
|
|
243
|
-
const arg = vertex?.args.findIndex(arg => arg !== r_function_call_1.EmptyArgument && arg.name === argumentName);
|
|
244
|
-
if (arg >= 0) {
|
|
245
|
-
argumentIndex = arg;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
if (!vertex || argumentIndex === undefined) {
|
|
249
|
-
return undefined;
|
|
250
|
-
}
|
|
251
|
-
if (argumentIndex === 'unnamed') {
|
|
252
|
-
// return all unnamed arguments
|
|
253
|
-
const references = vertex.args.filter(arg => arg !== r_function_call_1.EmptyArgument && !arg.name).map(graph_1.getReferenceOfArgument).filter(assert_1.isNotUndefined);
|
|
254
|
-
const map = new Map();
|
|
255
|
-
for (const ref of references) {
|
|
256
|
-
let valueNode = graph.idMap?.get(ref);
|
|
257
|
-
if (valueNode?.type === type_1.RType.Argument) {
|
|
258
|
-
valueNode = valueNode.value;
|
|
259
|
-
}
|
|
260
|
-
if (valueNode) {
|
|
261
|
-
// this should be evaluated in the callee-context
|
|
262
|
-
const values = resolveBasedOnConfig(data, vertex, valueNode, vertex.environment, graph.idMap, resolveValue) ?? [dependencies_query_format_1.Unknown];
|
|
263
|
-
map.set(ref, new Set(values));
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
return map;
|
|
267
|
-
}
|
|
268
|
-
if (argumentIndex < vertex.args.length) {
|
|
269
|
-
const arg = (0, graph_1.getReferenceOfArgument)(vertex.args[argumentIndex]);
|
|
270
|
-
if (!arg) {
|
|
271
|
-
return undefined;
|
|
272
|
-
}
|
|
273
|
-
let valueNode = graph.idMap?.get(arg);
|
|
274
|
-
if (valueNode?.type === type_1.RType.Argument) {
|
|
275
|
-
valueNode = valueNode.value;
|
|
276
|
-
}
|
|
277
|
-
if (valueNode) {
|
|
278
|
-
const values = resolveBasedOnConfig(data, vertex, valueNode, vertex.environment, graph.idMap, resolveValue) ?? [dependencies_query_format_1.Unknown];
|
|
279
|
-
return new Map([[arg, new Set(values)]]);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
return undefined;
|
|
283
|
-
}
|
|
284
172
|
function getFunctionsToCheck(customFunctions, ignoreDefaultFunctions, defaultFunctions) {
|
|
285
173
|
let functions = ignoreDefaultFunctions ? [] : [...defaultFunctions];
|
|
286
174
|
if (customFunctions) {
|
|
@@ -79,7 +79,7 @@ export declare const DependenciesQueryDefinition: {
|
|
|
79
79
|
}, input: {
|
|
80
80
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
81
81
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
82
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
82
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
83
83
|
readonly requiredInput: {};
|
|
84
84
|
readonly name: "dataflow";
|
|
85
85
|
readonly description: "Construct the dataflow graph";
|
|
@@ -53,7 +53,7 @@ export declare const HappensBeforeQueryDefinition: {
|
|
|
53
53
|
}, input: {
|
|
54
54
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
55
55
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
56
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
56
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
57
57
|
readonly requiredInput: {};
|
|
58
58
|
readonly name: "dataflow";
|
|
59
59
|
readonly description: "Construct the dataflow graph";
|
|
@@ -50,7 +50,7 @@ export declare const IdMapQueryDefinition: {
|
|
|
50
50
|
}, input: {
|
|
51
51
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
52
52
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
53
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
53
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
54
54
|
readonly requiredInput: {};
|
|
55
55
|
readonly name: "dataflow";
|
|
56
56
|
readonly description: "Construct the dataflow graph";
|
|
@@ -56,7 +56,7 @@ export declare const LineageQueryDefinition: {
|
|
|
56
56
|
}, input: {
|
|
57
57
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
58
58
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
59
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
59
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
60
60
|
readonly requiredInput: {};
|
|
61
61
|
readonly name: "dataflow";
|
|
62
62
|
readonly description: "Construct the dataflow graph";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BasicQueryData } from '../../base-query-format';
|
|
2
2
|
import type { LinterQuery, LinterQueryResult } from './linter-query-format';
|
|
3
|
-
export declare function executeLinterQuery({ ast, dataflow }: BasicQueryData, queries: readonly LinterQuery[]): LinterQueryResult;
|
|
3
|
+
export declare function executeLinterQuery({ ast, dataflow, config }: BasicQueryData, queries: readonly LinterQuery[]): LinterQueryResult;
|
|
@@ -4,7 +4,7 @@ exports.executeLinterQuery = executeLinterQuery;
|
|
|
4
4
|
const linter_rules_1 = require("../../../linter/linter-rules");
|
|
5
5
|
const log_1 = require("../../../util/log");
|
|
6
6
|
const linter_executor_1 = require("../../../linter/linter-executor");
|
|
7
|
-
function executeLinterQuery({ ast, dataflow }, queries) {
|
|
7
|
+
function executeLinterQuery({ ast, dataflow, config }, queries) {
|
|
8
8
|
const flattened = queries.flatMap(q => q.rules ?? Object.keys(linter_rules_1.LintingRules));
|
|
9
9
|
const distinct = new Set(flattened);
|
|
10
10
|
if (distinct.size !== flattened.length) {
|
|
@@ -13,7 +13,7 @@ function executeLinterQuery({ ast, dataflow }, queries) {
|
|
|
13
13
|
}
|
|
14
14
|
const results = { results: {} };
|
|
15
15
|
const start = Date.now();
|
|
16
|
-
const input = { normalize: ast, dataflow };
|
|
16
|
+
const input = { normalize: ast, dataflow, config };
|
|
17
17
|
for (const entry of distinct) {
|
|
18
18
|
const ruleName = typeof entry === 'string' ? entry : entry.name;
|
|
19
19
|
results.results[ruleName] = (0, linter_executor_1.executeLintingRule)(ruleName, input, entry?.config);
|
|
@@ -61,7 +61,7 @@ export declare const LinterQueryDefinition: {
|
|
|
61
61
|
}, input: {
|
|
62
62
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
63
63
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
64
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
64
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
65
65
|
readonly requiredInput: {};
|
|
66
66
|
readonly name: "dataflow";
|
|
67
67
|
readonly description: "Construct the dataflow graph";
|
|
@@ -17,18 +17,7 @@ exports.LinterQueryDefinition = {
|
|
|
17
17
|
const out = queryResults;
|
|
18
18
|
result.push(`Query: ${(0, ansi_1.bold)('linter', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
19
19
|
for (const [ruleName, results] of Object.entries(out.results)) {
|
|
20
|
-
|
|
21
|
-
result.push(` ╰ ${ruleName}:`);
|
|
22
|
-
for (const certainty of [linter_format_1.LintingCertainty.Definitely, linter_format_1.LintingCertainty.Maybe]) {
|
|
23
|
-
const certaintyResults = results.results.filter(r => r.certainty === certainty);
|
|
24
|
-
if (certaintyResults.length) {
|
|
25
|
-
result.push(` ╰ ${certainty}:`);
|
|
26
|
-
for (const res of certaintyResults) {
|
|
27
|
-
result.push(` ╰ ${rule.prettyPrint(res)}`);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
result.push(` ╰ _Metadata_: ${(0, doc_code_1.codeInline)(JSON.stringify(results['.meta']))}`);
|
|
20
|
+
addLintingRuleResult(ruleName, results, result);
|
|
32
21
|
}
|
|
33
22
|
return true;
|
|
34
23
|
},
|
|
@@ -41,4 +30,19 @@ exports.LinterQueryDefinition = {
|
|
|
41
30
|
}).description('The linter query lints for the given set of rules and returns the result.'),
|
|
42
31
|
flattenInvolvedNodes: () => []
|
|
43
32
|
};
|
|
33
|
+
function addLintingRuleResult(ruleName, results, result) {
|
|
34
|
+
const rule = linter_rules_1.LintingRules[ruleName];
|
|
35
|
+
result.push(` ╰ **${rule.info.name}** (${ruleName}):`);
|
|
36
|
+
for (const certainty of [linter_format_1.LintingCertainty.Definitely, linter_format_1.LintingCertainty.Maybe]) {
|
|
37
|
+
const certaintyResults = results.results.filter(r => r.certainty === certainty);
|
|
38
|
+
if (certaintyResults.length) {
|
|
39
|
+
result.push(` ╰ ${certainty}:`);
|
|
40
|
+
for (const res of certaintyResults) {
|
|
41
|
+
const pretty = rule.prettyPrint[linter_format_1.LintingPrettyPrintContext.Query](res, results['.meta']);
|
|
42
|
+
result.push(` ╰ ${pretty}${res.quickFix ? ` (${res.quickFix.length} quick fix(es) available)` : ''}`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
result.push(` ╰ _Metadata_: ${(0, doc_code_1.codeInline)(JSON.stringify(results['.meta']))}`);
|
|
47
|
+
}
|
|
44
48
|
//# sourceMappingURL=linter-query-format.js.map
|
|
@@ -53,7 +53,7 @@ export declare const NormalizedAstQueryDefinition: {
|
|
|
53
53
|
}, input: {
|
|
54
54
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
55
55
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
56
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
56
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
57
57
|
readonly requiredInput: {};
|
|
58
58
|
readonly name: "dataflow";
|
|
59
59
|
readonly description: "Construct the dataflow graph";
|
|
@@ -54,7 +54,7 @@ export declare const OriginQueryDefinition: {
|
|
|
54
54
|
}, input: {
|
|
55
55
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
56
56
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
57
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
58
58
|
readonly requiredInput: {};
|
|
59
59
|
readonly name: "dataflow";
|
|
60
60
|
readonly description: "Construct the dataflow graph";
|
|
@@ -49,7 +49,7 @@ export declare const ProjectQueryDefinition: {
|
|
|
49
49
|
}, input: {
|
|
50
50
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
51
51
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
52
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
52
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
53
53
|
readonly requiredInput: {};
|
|
54
54
|
readonly name: "dataflow";
|
|
55
55
|
readonly description: "Construct the dataflow graph";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { ResolveValueQuery, ResolveValueQueryResult } from './resolve-value-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
3
|
export declare function fingerPrintOfQuery(query: ResolveValueQuery): string;
|
|
4
|
-
export declare function executeResolveValueQuery({ dataflow: { graph }, ast }: BasicQueryData, queries: readonly ResolveValueQuery[]): ResolveValueQueryResult;
|
|
4
|
+
export declare function executeResolveValueQuery({ dataflow: { graph }, ast, config }: BasicQueryData, queries: readonly ResolveValueQuery[]): ResolveValueQueryResult;
|
|
@@ -8,7 +8,7 @@ const alias_tracking_1 = require("../../../dataflow/eval/resolve/alias-tracking"
|
|
|
8
8
|
function fingerPrintOfQuery(query) {
|
|
9
9
|
return JSON.stringify(query);
|
|
10
10
|
}
|
|
11
|
-
function executeResolveValueQuery({ dataflow: { graph }, ast }, queries) {
|
|
11
|
+
function executeResolveValueQuery({ dataflow: { graph }, ast, config }, queries) {
|
|
12
12
|
const start = Date.now();
|
|
13
13
|
const results = {};
|
|
14
14
|
for (const query of queries) {
|
|
@@ -18,7 +18,7 @@ function executeResolveValueQuery({ dataflow: { graph }, ast }, queries) {
|
|
|
18
18
|
}
|
|
19
19
|
const values = query.criteria
|
|
20
20
|
.map(criteria => (0, parse_1.slicingCriterionToId)(criteria, ast.idMap))
|
|
21
|
-
.flatMap(ident => (0, alias_tracking_1.resolveIdToValue)(ident, { graph, full: true, idMap: ast.idMap }));
|
|
21
|
+
.flatMap(ident => (0, alias_tracking_1.resolveIdToValue)(ident, { graph, full: true, idMap: ast.idMap, resolve: config.solver.variables }));
|
|
22
22
|
results[key] = {
|
|
23
23
|
values: values
|
|
24
24
|
};
|
|
@@ -55,7 +55,7 @@ export declare const ResolveValueQueryDefinition: {
|
|
|
55
55
|
}, input: {
|
|
56
56
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
57
57
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
58
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
58
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
59
59
|
readonly requiredInput: {};
|
|
60
60
|
readonly name: "dataflow";
|
|
61
61
|
readonly description: "Construct the dataflow graph";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BasicQueryData } from '../../base-query-format';
|
|
2
2
|
import type { SearchQuery, SearchQueryResult } from './search-query-format';
|
|
3
|
-
export declare function executeSearch({ ast, dataflow }: BasicQueryData, queries: readonly SearchQuery[]): SearchQueryResult;
|
|
3
|
+
export declare function executeSearch({ ast, dataflow, config }: BasicQueryData, queries: readonly SearchQuery[]): SearchQueryResult;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeSearch = executeSearch;
|
|
4
4
|
const flowr_search_executor_1 = require("../../../search/flowr-search-executor");
|
|
5
|
-
function executeSearch({ ast, dataflow }, queries) {
|
|
5
|
+
function executeSearch({ ast, dataflow, config }, queries) {
|
|
6
6
|
const start = Date.now();
|
|
7
7
|
const results = [];
|
|
8
8
|
for (const query of queries) {
|
|
9
9
|
const { search } = query;
|
|
10
10
|
results.push({
|
|
11
|
-
ids: (0, flowr_search_executor_1.runSearch)(search, { normalize: ast, dataflow })
|
|
11
|
+
ids: (0, flowr_search_executor_1.runSearch)(search, { normalize: ast, dataflow, config })
|
|
12
12
|
.map(({ node }) => node.info.id),
|
|
13
13
|
search
|
|
14
14
|
});
|
|
@@ -55,7 +55,7 @@ export declare const SearchQueryDefinition: {
|
|
|
55
55
|
}, input: {
|
|
56
56
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
57
57
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
58
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
58
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
59
59
|
readonly requiredInput: {};
|
|
60
60
|
readonly name: "dataflow";
|
|
61
61
|
readonly description: "Construct the dataflow graph";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { StaticSliceQuery, StaticSliceQueryResult } from './static-slice-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
3
|
export declare function fingerPrintOfQuery(query: StaticSliceQuery): string;
|
|
4
|
-
export declare function executeStaticSliceQuery({ dataflow: { graph }, ast }: BasicQueryData, queries: readonly StaticSliceQuery[]): StaticSliceQueryResult;
|
|
4
|
+
export declare function executeStaticSliceQuery({ dataflow: { graph }, ast, config }: BasicQueryData, queries: readonly StaticSliceQuery[]): StaticSliceQueryResult;
|
|
@@ -10,7 +10,7 @@ const log_1 = require("../../../util/log");
|
|
|
10
10
|
function fingerPrintOfQuery(query) {
|
|
11
11
|
return JSON.stringify(query);
|
|
12
12
|
}
|
|
13
|
-
function executeStaticSliceQuery({ dataflow: { graph }, ast }, queries) {
|
|
13
|
+
function executeStaticSliceQuery({ dataflow: { graph }, ast, config }, queries) {
|
|
14
14
|
const start = Date.now();
|
|
15
15
|
const results = {};
|
|
16
16
|
for (const query of queries) {
|
|
@@ -20,7 +20,7 @@ function executeStaticSliceQuery({ dataflow: { graph }, ast }, queries) {
|
|
|
20
20
|
}
|
|
21
21
|
const { criteria, noReconstruction, noMagicComments } = query;
|
|
22
22
|
const sliceStart = Date.now();
|
|
23
|
-
const slice = (0, static_slicer_1.staticSlicing)(graph, ast, criteria);
|
|
23
|
+
const slice = (0, static_slicer_1.staticSlicing)(graph, ast, criteria, config.solver.slicer?.threshold);
|
|
24
24
|
const sliceEnd = Date.now();
|
|
25
25
|
if (noReconstruction) {
|
|
26
26
|
results[key] = { slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } } };
|
|
@@ -67,7 +67,7 @@ export declare const StaticSliceQueryDefinition: {
|
|
|
67
67
|
}, input: {
|
|
68
68
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
69
69
|
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
70
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
70
|
+
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
71
71
|
readonly requiredInput: {};
|
|
72
72
|
readonly name: "dataflow";
|
|
73
73
|
readonly description: "Construct the dataflow graph";
|
package/queries/query.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ export declare const SupportedQueries: {
|
|
|
97
97
|
}, input: {
|
|
98
98
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
99
99
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
100
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
100
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
101
101
|
readonly requiredInput: {};
|
|
102
102
|
readonly name: "dataflow";
|
|
103
103
|
readonly description: "Construct the dataflow graph";
|
|
@@ -156,7 +156,7 @@ export declare const SupportedQueries: {
|
|
|
156
156
|
}, input: {
|
|
157
157
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
158
158
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
159
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
159
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
160
160
|
readonly requiredInput: {};
|
|
161
161
|
readonly name: "dataflow";
|
|
162
162
|
readonly description: "Construct the dataflow graph";
|
|
@@ -215,7 +215,7 @@ export declare const SupportedQueries: {
|
|
|
215
215
|
}, input: {
|
|
216
216
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
217
217
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
218
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
218
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
219
219
|
readonly requiredInput: {};
|
|
220
220
|
readonly name: "dataflow";
|
|
221
221
|
readonly description: "Construct the dataflow graph";
|
|
@@ -274,7 +274,7 @@ export declare const SupportedQueries: {
|
|
|
274
274
|
}, input: {
|
|
275
275
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
276
276
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
277
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
277
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
278
278
|
readonly requiredInput: {};
|
|
279
279
|
readonly name: "dataflow";
|
|
280
280
|
readonly description: "Construct the dataflow graph";
|
|
@@ -333,7 +333,7 @@ export declare const SupportedQueries: {
|
|
|
333
333
|
}, input: {
|
|
334
334
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
335
335
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
336
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
336
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
337
337
|
readonly requiredInput: {};
|
|
338
338
|
readonly name: "dataflow";
|
|
339
339
|
readonly description: "Construct the dataflow graph";
|
|
@@ -392,7 +392,7 @@ export declare const SupportedQueries: {
|
|
|
392
392
|
}, input: {
|
|
393
393
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
394
394
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
395
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
395
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
396
396
|
readonly requiredInput: {};
|
|
397
397
|
readonly name: "dataflow";
|
|
398
398
|
readonly description: "Construct the dataflow graph";
|
|
@@ -451,7 +451,7 @@ export declare const SupportedQueries: {
|
|
|
451
451
|
}, input: {
|
|
452
452
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
453
453
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
454
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
454
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
455
455
|
readonly requiredInput: {};
|
|
456
456
|
readonly name: "dataflow";
|
|
457
457
|
readonly description: "Construct the dataflow graph";
|
|
@@ -510,7 +510,7 @@ export declare const SupportedQueries: {
|
|
|
510
510
|
}, input: {
|
|
511
511
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
512
512
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
513
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
513
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
514
514
|
readonly requiredInput: {};
|
|
515
515
|
readonly name: "dataflow";
|
|
516
516
|
readonly description: "Construct the dataflow graph";
|
|
@@ -569,7 +569,7 @@ export declare const SupportedQueries: {
|
|
|
569
569
|
}, input: {
|
|
570
570
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
571
571
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
572
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
572
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
573
573
|
readonly requiredInput: {};
|
|
574
574
|
readonly name: "dataflow";
|
|
575
575
|
readonly description: "Construct the dataflow graph";
|
|
@@ -634,7 +634,7 @@ export declare const SupportedQueries: {
|
|
|
634
634
|
}, input: {
|
|
635
635
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
636
636
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
637
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
637
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
638
638
|
readonly requiredInput: {};
|
|
639
639
|
readonly name: "dataflow";
|
|
640
640
|
readonly description: "Construct the dataflow graph";
|
|
@@ -693,7 +693,7 @@ export declare const SupportedQueries: {
|
|
|
693
693
|
}, input: {
|
|
694
694
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
695
695
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
696
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
696
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
697
697
|
readonly requiredInput: {};
|
|
698
698
|
readonly name: "dataflow";
|
|
699
699
|
readonly description: "Construct the dataflow graph";
|
|
@@ -752,7 +752,7 @@ export declare const SupportedQueries: {
|
|
|
752
752
|
}, input: {
|
|
753
753
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
754
754
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
755
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
755
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
756
756
|
readonly requiredInput: {};
|
|
757
757
|
readonly name: "dataflow";
|
|
758
758
|
readonly description: "Construct the dataflow graph";
|
|
@@ -811,7 +811,7 @@ export declare const SupportedQueries: {
|
|
|
811
811
|
}, input: {
|
|
812
812
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
813
813
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
814
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
814
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
815
815
|
readonly requiredInput: {};
|
|
816
816
|
readonly name: "dataflow";
|
|
817
817
|
readonly description: "Construct the dataflow graph";
|
|
@@ -870,7 +870,7 @@ export declare const SupportedQueries: {
|
|
|
870
870
|
}, input: {
|
|
871
871
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
872
872
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
873
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
873
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
874
874
|
readonly requiredInput: {};
|
|
875
875
|
readonly name: "dataflow";
|
|
876
876
|
readonly description: "Construct the dataflow graph";
|
|
@@ -929,7 +929,7 @@ export declare const SupportedQueries: {
|
|
|
929
929
|
}, input: {
|
|
930
930
|
request?: import("../r-bridge/retriever").RParseRequests;
|
|
931
931
|
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
932
|
-
}) => import("../dataflow/info").DataflowInformation;
|
|
932
|
+
}, config: import("../config").FlowrConfigOptions) => import("../dataflow/info").DataflowInformation;
|
|
933
933
|
readonly requiredInput: {};
|
|
934
934
|
readonly name: "dataflow";
|
|
935
935
|
readonly description: "Construct the dataflow graph";
|
|
@@ -2,6 +2,7 @@ import type { IdGenerator, NormalizedAst } from '../../model/processing/decorate
|
|
|
2
2
|
import type { NoInfo, RNode } from '../../model/model';
|
|
3
3
|
import type { ParseStepOutputTS } from '../../../../../core/steps/all/core/01-parse-tree-sitter';
|
|
4
4
|
import type { ParseStepOutput } from '../../../../parser';
|
|
5
|
+
import type { FlowrConfigOptions } from '../../../../../config';
|
|
5
6
|
export declare const parseLog: import("tslog").Logger<import("tslog").ILogObj>;
|
|
6
7
|
/**
|
|
7
8
|
* Take the output as produced by the parse step and normalize the AST from the R parser.
|
|
@@ -18,4 +19,4 @@ export declare function normalizeButNotDecorated({ parsed }: ParseStepOutput<str
|
|
|
18
19
|
/**
|
|
19
20
|
* Tree-Sitter pendant to {@link normalize}.
|
|
20
21
|
*/
|
|
21
|
-
export declare function normalizeTreeSitter({ parsed }: ParseStepOutputTS, getId
|
|
22
|
+
export declare function normalizeTreeSitter({ parsed }: ParseStepOutputTS, getId: IdGenerator<NoInfo> | undefined, config: FlowrConfigOptions, file?: string): NormalizedAst;
|
|
@@ -9,6 +9,7 @@ const log_1 = require("../../../../../util/log");
|
|
|
9
9
|
const decorate_1 = require("../../model/processing/decorate");
|
|
10
10
|
const normalize_root_1 = require("../main/internal/structure/normalize-root");
|
|
11
11
|
const tree_sitter_normalize_1 = require("../../../tree-sitter/tree-sitter-normalize");
|
|
12
|
+
const config_1 = require("../../../../../config");
|
|
12
13
|
exports.parseLog = log_1.log.getSubLogger({ name: 'ast-parser' });
|
|
13
14
|
/**
|
|
14
15
|
* Take the output as produced by the parse step and normalize the AST from the R parser.
|
|
@@ -31,8 +32,9 @@ function normalizeButNotDecorated({ parsed }) {
|
|
|
31
32
|
/**
|
|
32
33
|
* Tree-Sitter pendant to {@link normalize}.
|
|
33
34
|
*/
|
|
34
|
-
function normalizeTreeSitter({ parsed }, getId = (0, decorate_1.deterministicCountingIdGenerator)(0), file) {
|
|
35
|
-
const
|
|
35
|
+
function normalizeTreeSitter({ parsed }, getId = (0, decorate_1.deterministicCountingIdGenerator)(0), config, file) {
|
|
36
|
+
const lax = (0, config_1.getEngineConfig)(config, 'tree-sitter')?.lax;
|
|
37
|
+
const result = (0, decorate_1.decorateAst)((0, tree_sitter_normalize_1.normalizeTreeSitterTreeToAst)(parsed, lax), { getId, file });
|
|
36
38
|
result.hasError = parsed.rootNode.hasError;
|
|
37
39
|
return result;
|
|
38
40
|
}
|