@eagleoutice/flowr 2.2.15 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +226 -6
- package/abstract-interpretation/data-frame/absint-info.d.ts +109 -0
- package/abstract-interpretation/data-frame/absint-info.js +31 -0
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +59 -0
- package/abstract-interpretation/data-frame/absint-visitor.js +173 -0
- package/abstract-interpretation/data-frame/domain.d.ts +107 -0
- package/abstract-interpretation/data-frame/domain.js +315 -0
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +17 -0
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +166 -0
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +117 -0
- package/abstract-interpretation/data-frame/mappers/arguments.js +188 -0
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +20 -0
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +34 -0
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +261 -0
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +1219 -0
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +12 -0
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +206 -0
- package/abstract-interpretation/data-frame/resolve-args.d.ts +42 -0
- package/abstract-interpretation/data-frame/resolve-args.js +118 -0
- package/abstract-interpretation/data-frame/semantics.d.ts +213 -0
- package/abstract-interpretation/data-frame/semantics.js +366 -0
- package/abstract-interpretation/data-frame/shape-inference.d.ts +38 -0
- package/abstract-interpretation/data-frame/shape-inference.js +117 -0
- package/benchmark/slicer.d.ts +18 -2
- package/benchmark/slicer.js +143 -5
- package/benchmark/stats/print.js +123 -45
- package/benchmark/stats/size-of.d.ts +7 -0
- package/benchmark/stats/size-of.js +1 -0
- package/benchmark/stats/stats.d.ts +30 -1
- package/benchmark/stats/stats.js +4 -2
- package/benchmark/summarizer/data.d.ts +33 -2
- package/benchmark/summarizer/first-phase/input.js +5 -1
- package/benchmark/summarizer/first-phase/process.d.ts +2 -1
- package/benchmark/summarizer/first-phase/process.js +49 -3
- package/benchmark/summarizer/second-phase/process.js +101 -3
- package/cli/benchmark-app.d.ts +2 -0
- package/cli/benchmark-app.js +5 -1
- package/cli/benchmark-helper-app.d.ts +2 -0
- package/cli/benchmark-helper-app.js +13 -8
- package/cli/common/options.js +4 -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 +43 -10
- package/config.js +47 -43
- 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 +2 -0
- package/control-flow/control-flow-graph.js +8 -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 +20 -2
- package/control-flow/semantic-cfg-guided-visitor.js +24 -4
- 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 +11 -3
- package/dataflow/environments/built-in.js +5 -3
- 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 +11 -8
- 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 +65 -18
- package/dataflow/eval/resolve/resolve.js +144 -48
- 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 +6 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +19 -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 +13 -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 +12 -2
- package/documentation/print-linter-issue.d.ts +1 -0
- package/documentation/print-linter-issue.js +71 -0
- package/documentation/print-linter-wiki.js +223 -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 +18 -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 +178 -16
- package/linter/linter-rules.js +14 -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/dataframe-access-validation.d.ts +53 -0
- package/linter/rules/dataframe-access-validation.js +116 -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 +168 -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 +5 -2
- 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/df-shape-query/df-shape-query-executor.d.ts +3 -0
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +46 -0
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +72 -0
- package/queries/catalog/df-shape-query/df-shape-query-format.js +31 -0
- 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 +76 -16
- package/queries/query.js +2 -0
- 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/files.d.ts +8 -2
- package/util/files.js +22 -4
- package/util/objects.d.ts +5 -4
- package/util/r-value.d.ts +23 -0
- package/util/r-value.js +113 -0
- 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
- package/util/cfg/cfg.d.ts +0 -0
- package/util/cfg/cfg.js +0 -2
|
@@ -35,7 +35,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
35
35
|
* A helper function to get the normalized AST node for the given id or fail if it does not exist.
|
|
36
36
|
*/
|
|
37
37
|
getNormalizedAst(id) {
|
|
38
|
-
return this.config.normalizedAst.idMap.get(id);
|
|
38
|
+
return id !== undefined ? this.config.normalizedAst.idMap.get(id) : undefined;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* See {@link DataflowAwareCfgGuidedVisitor#visitValue} for the base implementation.
|
|
@@ -52,8 +52,15 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
52
52
|
case type_1.RType.Number: return this.onNumberConstant({ vertex: val, node: astNode });
|
|
53
53
|
case type_1.RType.Logical: return this.onLogicalConstant({ vertex: val, node: astNode });
|
|
54
54
|
case type_1.RType.Symbol:
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
if (astNode.lexeme === 'NULL') {
|
|
56
|
+
return this.onNullConstant({
|
|
57
|
+
vertex: val,
|
|
58
|
+
node: astNode
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
return this.onSymbolConstant({ vertex: val, node: astNode });
|
|
63
|
+
}
|
|
57
64
|
}
|
|
58
65
|
(0, assert_1.guard)(false, `Unexpected value type ${astNode.type} for value ${astNode.lexeme}`);
|
|
59
66
|
}
|
|
@@ -266,7 +273,11 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
266
273
|
getOrigins(id) {
|
|
267
274
|
return (0, dfg_get_origin_1.getOriginInDfg)(this.config.dfg, id);
|
|
268
275
|
}
|
|
269
|
-
/**
|
|
276
|
+
/**
|
|
277
|
+
* Called for every occurrence of a `NULL` in the program.
|
|
278
|
+
*
|
|
279
|
+
* For other symbols that are not referenced as a variable, see {@link SemanticCfgGuidedVisitor#onSymbolConstant|`onSymbolConstant`}.
|
|
280
|
+
*/
|
|
270
281
|
onNullConstant(_data) { }
|
|
271
282
|
/**
|
|
272
283
|
* Called for every constant string value in the program.
|
|
@@ -286,6 +297,15 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
286
297
|
* For example, `TRUE` in `if(TRUE) { ... }`.
|
|
287
298
|
*/
|
|
288
299
|
onLogicalConstant(_data) { }
|
|
300
|
+
/**
|
|
301
|
+
* Called for every constant symbol value in the program.
|
|
302
|
+
*
|
|
303
|
+
* For example, `foo` in `library(foo)` or `a` in `l$a`. This most likely happens as part of non-standard-evaluation, i.e., the symbol is not evaluated to a value,
|
|
304
|
+
* but used as a symbol in and of itself.
|
|
305
|
+
*
|
|
306
|
+
* Please note, that due to its special behaviors, `NULL` is handled in {@link SemanticCfgGuidedVisitor#onNullConstant|`onNullConstant`} and not here.
|
|
307
|
+
*/
|
|
308
|
+
onSymbolConstant(_data) { }
|
|
289
309
|
/**
|
|
290
310
|
* Called for every variable that is read within the program.
|
|
291
311
|
* You can use {@link getOrigins} to get the origins of the variable.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { PipelineStepName } from './steps/pipeline-step';
|
|
2
2
|
import { PipelineStepStage } from './steps/pipeline-step';
|
|
3
3
|
import type { Pipeline, PipelineInput, PipelineOutput, PipelinePerRequestInput, PipelineStepOutputWithName } from './steps/pipeline/pipeline';
|
|
4
|
+
import type { FlowrConfigOptions } from '../config';
|
|
4
5
|
/**
|
|
5
6
|
* The pipeline executor allows to execute arbitrary {@link Pipeline|pipelines} in a step-by-step fashion.
|
|
6
7
|
* If you are not yet in the possession of a {@link Pipeline|pipeline}, you can use the {@link createPipeline} function
|
|
@@ -91,6 +92,7 @@ export declare class PipelineExecutor<P extends Pipeline> {
|
|
|
91
92
|
private output;
|
|
92
93
|
private currentExecutionStage;
|
|
93
94
|
private stepCounter;
|
|
95
|
+
private readonly flowrConfig;
|
|
94
96
|
/**
|
|
95
97
|
* Construct a new pipeline executor.
|
|
96
98
|
* The required additional input is specified by the {@link IPipelineStep#requiredInput|required input configuration} of each step in the `pipeline`.
|
|
@@ -99,8 +101,9 @@ export declare class PipelineExecutor<P extends Pipeline> {
|
|
|
99
101
|
*
|
|
100
102
|
* @param pipeline - The {@link Pipeline} to execute, probably created with {@link createPipeline}.
|
|
101
103
|
* @param input - External {@link PipelineInput|configuration and input} required to execute the given pipeline.
|
|
104
|
+
* @param flowrConfig - The flowr config containing the built-in definitions
|
|
102
105
|
*/
|
|
103
|
-
constructor(pipeline: P, input: PipelineInput<P
|
|
106
|
+
constructor(pipeline: P, input: PipelineInput<P>, flowrConfig: FlowrConfigOptions);
|
|
104
107
|
/**
|
|
105
108
|
* Retrieve the {@link Pipeline|pipeline} that is currently being.
|
|
106
109
|
*/
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PipelineExecutor = void 0;
|
|
4
4
|
const assert_1 = require("../util/assert");
|
|
5
|
-
const config_1 = require("../config");
|
|
6
5
|
const built_in_1 = require("../dataflow/environments/built-in");
|
|
7
6
|
const built_in_config_1 = require("../dataflow/environments/built-in-config");
|
|
8
7
|
/**
|
|
@@ -95,6 +94,7 @@ class PipelineExecutor {
|
|
|
95
94
|
output = {};
|
|
96
95
|
currentExecutionStage = 0 /* PipelineStepStage.OncePerFile */;
|
|
97
96
|
stepCounter = 0;
|
|
97
|
+
flowrConfig;
|
|
98
98
|
/**
|
|
99
99
|
* Construct a new pipeline executor.
|
|
100
100
|
* The required additional input is specified by the {@link IPipelineStep#requiredInput|required input configuration} of each step in the `pipeline`.
|
|
@@ -103,13 +103,14 @@ class PipelineExecutor {
|
|
|
103
103
|
*
|
|
104
104
|
* @param pipeline - The {@link Pipeline} to execute, probably created with {@link createPipeline}.
|
|
105
105
|
* @param input - External {@link PipelineInput|configuration and input} required to execute the given pipeline.
|
|
106
|
+
* @param flowrConfig - The flowr config containing the built-in definitions
|
|
106
107
|
*/
|
|
107
|
-
constructor(pipeline, input) {
|
|
108
|
+
constructor(pipeline, input, flowrConfig) {
|
|
108
109
|
this.pipeline = pipeline;
|
|
109
110
|
this.length = pipeline.order.length;
|
|
110
111
|
this.input = input;
|
|
111
|
-
|
|
112
|
-
const builtIns =
|
|
112
|
+
this.flowrConfig = flowrConfig;
|
|
113
|
+
const builtIns = flowrConfig.semantics.environment.overwriteBuiltIns;
|
|
113
114
|
if (!builtIns.loadDefaults) {
|
|
114
115
|
built_in_1.BuiltInMemory.clear();
|
|
115
116
|
built_in_1.EmptyBuiltInMemory.clear();
|
|
@@ -190,7 +191,7 @@ class PipelineExecutor {
|
|
|
190
191
|
if (expectedStepName !== undefined) {
|
|
191
192
|
(0, assert_1.guard)(step.name === expectedStepName, () => `Cannot execute next step, expected step ${JSON.stringify(expectedStepName)} but got ${step.name}.`);
|
|
192
193
|
}
|
|
193
|
-
return [step.name, step.processor(this.output, this.input)];
|
|
194
|
+
return [step.name, step.processor(this.output, this.input, this.flowrConfig)];
|
|
194
195
|
}
|
|
195
196
|
/**
|
|
196
197
|
* This only makes sense if you have already run a request and want to re-use the per-file results for a new one.
|
|
@@ -9,6 +9,8 @@ export interface NormalizeRequiredInput {
|
|
|
9
9
|
/** This id generator is only necessary if you want to retrieve a dataflow from the parsed R AST, it determines the id generator to use and by default uses the {@link deterministicCountingIdGenerator}*/
|
|
10
10
|
readonly getId?: IdGenerator<NoInfo>;
|
|
11
11
|
readonly request: RParseRequests;
|
|
12
|
+
/** assume the input stems from a file and use the given path as the file path for the AST */
|
|
13
|
+
readonly overwriteFilePath?: string;
|
|
12
14
|
}
|
|
13
15
|
export declare function getCurrentRequestFile(request: RParseRequests | undefined): string | undefined;
|
|
14
16
|
declare function processor(results: {
|
|
@@ -17,7 +17,7 @@ function getCurrentRequestFile(request) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
function processor(results, input) {
|
|
20
|
-
return (0, parser_1.normalize)(results.parse, input.getId, getCurrentRequestFile(input.request));
|
|
20
|
+
return (0, parser_1.normalize)(results.parse, input.getId, input.overwriteFilePath ?? getCurrentRequestFile(input.request));
|
|
21
21
|
}
|
|
22
22
|
exports.NORMALIZE = {
|
|
23
23
|
name: 'normalize',
|
|
@@ -3,9 +3,10 @@ import { normalizedAstToJson, normalizedAstToQuads, printNormalizedAstToMermaid,
|
|
|
3
3
|
import { PipelineStepStage } from '../../pipeline-step';
|
|
4
4
|
import type { NormalizeRequiredInput } from './10-normalize';
|
|
5
5
|
import type { ParseStepOutputTS } from './01-parse-tree-sitter';
|
|
6
|
+
import type { FlowrConfigOptions } from '../../../../config';
|
|
6
7
|
declare function processor(results: {
|
|
7
8
|
'parse'?: ParseStepOutputTS;
|
|
8
|
-
}, input: Partial<NormalizeRequiredInput
|
|
9
|
+
}, input: Partial<NormalizeRequiredInput>, config: FlowrConfigOptions): import("../../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
9
10
|
export declare const NORMALIZE_TREE_SITTER: {
|
|
10
11
|
readonly name: "normalize";
|
|
11
12
|
readonly humanReadableName: "normalize tree-sitter tree";
|
|
@@ -5,8 +5,8 @@ const print_1 = require("../../../print/print");
|
|
|
5
5
|
const normalize_printer_1 = require("../../../print/normalize-printer");
|
|
6
6
|
const parser_1 = require("../../../../r-bridge/lang-4.x/ast/parser/json/parser");
|
|
7
7
|
const _10_normalize_1 = require("./10-normalize");
|
|
8
|
-
function processor(results, input) {
|
|
9
|
-
return (0, parser_1.normalizeTreeSitter)(results['parse'], input.getId, (0, _10_normalize_1.getCurrentRequestFile)(input.request));
|
|
8
|
+
function processor(results, input, config) {
|
|
9
|
+
return (0, parser_1.normalizeTreeSitter)(results['parse'], input.getId, config, input.overwriteFilePath ?? (0, _10_normalize_1.getCurrentRequestFile)(input.request));
|
|
10
10
|
}
|
|
11
11
|
exports.NORMALIZE_TREE_SITTER = {
|
|
12
12
|
name: 'normalize',
|
|
@@ -4,12 +4,13 @@ import { dataflowGraphToJson, dataflowGraphToMermaid, dataflowGraphToMermaidUrl,
|
|
|
4
4
|
import type { NormalizedAst } from '../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
5
|
import type { RParseRequests } from '../../../../r-bridge/retriever';
|
|
6
6
|
import type { KnownParserType, Parser } from '../../../../r-bridge/parser';
|
|
7
|
+
import type { FlowrConfigOptions } from '../../../../config';
|
|
7
8
|
declare function processor(results: {
|
|
8
9
|
normalize?: NormalizedAst;
|
|
9
10
|
}, input: {
|
|
10
11
|
request?: RParseRequests;
|
|
11
12
|
parser?: Parser<KnownParserType>;
|
|
12
|
-
}): import("../../../../dataflow/info").DataflowInformation;
|
|
13
|
+
}, config: FlowrConfigOptions): import("../../../../dataflow/info").DataflowInformation;
|
|
13
14
|
export declare const STATIC_DATAFLOW: {
|
|
14
15
|
readonly humanReadableName: "dataflow";
|
|
15
16
|
readonly processor: typeof processor;
|
|
@@ -17,8 +17,8 @@ const staticDataflowCommon = {
|
|
|
17
17
|
},
|
|
18
18
|
dependencies: ['normalize'],
|
|
19
19
|
};
|
|
20
|
-
function processor(results, input) {
|
|
21
|
-
return (0, extractor_1.produceDataFlowGraph)(input.parser, input.request, results.normalize);
|
|
20
|
+
function processor(results, input, config) {
|
|
21
|
+
return (0, extractor_1.produceDataFlowGraph)(input.parser, input.request, results.normalize, config);
|
|
22
22
|
}
|
|
23
23
|
exports.STATIC_DATAFLOW = {
|
|
24
24
|
...staticDataflowCommon,
|
|
@@ -3,6 +3,7 @@ import { PipelineStepStage } from '../../pipeline-step';
|
|
|
3
3
|
import type { DataflowInformation } from '../../../../dataflow/info';
|
|
4
4
|
import type { SlicingCriteria } from '../../../../slicing/criterion/parse';
|
|
5
5
|
import type { NormalizedAst } from '../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
|
+
import type { FlowrConfigOptions } from '../../../../config';
|
|
6
7
|
export interface SliceRequiredInput {
|
|
7
8
|
/** The slicing criterion is only of interest if you actually want to slice the R code */
|
|
8
9
|
readonly criterion: SlicingCriteria;
|
|
@@ -12,7 +13,7 @@ export interface SliceRequiredInput {
|
|
|
12
13
|
declare function processor(results: {
|
|
13
14
|
dataflow?: DataflowInformation;
|
|
14
15
|
normalize?: NormalizedAst;
|
|
15
|
-
}, input: Partial<SliceRequiredInput
|
|
16
|
+
}, input: Partial<SliceRequiredInput>, config: FlowrConfigOptions): Readonly<import("../../../../slicing/static/slicer-types").SliceResult>;
|
|
16
17
|
export declare const STATIC_SLICE: {
|
|
17
18
|
readonly name: "slice";
|
|
18
19
|
readonly humanReadableName: "static slice";
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.STATIC_SLICE = void 0;
|
|
4
4
|
const print_1 = require("../../../print/print");
|
|
5
5
|
const static_slicer_1 = require("../../../../slicing/static/static-slicer");
|
|
6
|
-
function processor(results, input) {
|
|
7
|
-
return (0, static_slicer_1.staticSlicing)(results.dataflow.graph, results.normalize, input.criterion, input.threshold);
|
|
6
|
+
function processor(results, input, config) {
|
|
7
|
+
return (0, static_slicer_1.staticSlicing)(results.dataflow.graph, results.normalize, input.criterion, input.threshold ?? config.solver.slicer?.threshold);
|
|
8
8
|
}
|
|
9
9
|
exports.STATIC_SLICE = {
|
|
10
10
|
name: 'slice',
|
|
@@ -6,6 +6,7 @@ import type { KnownParser, Parser } from '../../../r-bridge/parser';
|
|
|
6
6
|
import { PipelineExecutor } from '../../pipeline-executor';
|
|
7
7
|
import type { RShell } from '../../../r-bridge/shell';
|
|
8
8
|
import type { TreeSitterExecutor } from '../../../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor';
|
|
9
|
+
import type { FlowrConfigOptions } from '../../../config';
|
|
9
10
|
export declare const DEFAULT_SLICING_PIPELINE: import("./pipeline").Pipeline<{
|
|
10
11
|
readonly name: "parse";
|
|
11
12
|
readonly humanReadableName: "parse with R shell";
|
|
@@ -46,7 +47,7 @@ export declare const DEFAULT_SLICING_PIPELINE: import("./pipeline").Pipeline<{
|
|
|
46
47
|
}, input: {
|
|
47
48
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
48
49
|
parser?: Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
49
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
50
|
+
}, config: FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
50
51
|
readonly requiredInput: {};
|
|
51
52
|
readonly name: "dataflow";
|
|
52
53
|
readonly description: "Construct the dataflow graph";
|
|
@@ -66,7 +67,7 @@ export declare const DEFAULT_SLICING_PIPELINE: import("./pipeline").Pipeline<{
|
|
|
66
67
|
readonly processor: (results: {
|
|
67
68
|
dataflow?: import("../../../dataflow/info").DataflowInformation;
|
|
68
69
|
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
69
|
-
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput
|
|
70
|
+
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
|
|
70
71
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
|
|
71
72
|
readonly printer: {
|
|
72
73
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -128,7 +129,7 @@ export declare const DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipeline"
|
|
|
128
129
|
}, input: {
|
|
129
130
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
130
131
|
parser?: Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
131
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
132
|
+
}, config: FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
132
133
|
readonly requiredInput: {};
|
|
133
134
|
readonly name: "dataflow";
|
|
134
135
|
readonly description: "Construct the dataflow graph";
|
|
@@ -148,7 +149,7 @@ export declare const DEFAULT_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipeline"
|
|
|
148
149
|
readonly processor: (results: {
|
|
149
150
|
dataflow?: import("../../../dataflow/info").DataflowInformation;
|
|
150
151
|
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
151
|
-
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput
|
|
152
|
+
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
|
|
152
153
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
|
|
153
154
|
readonly printer: {
|
|
154
155
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -210,7 +211,7 @@ export declare const DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./pipel
|
|
|
210
211
|
}, input: {
|
|
211
212
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
212
213
|
parser?: Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
213
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
214
|
+
}, config: FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
214
215
|
readonly requiredInput: {};
|
|
215
216
|
readonly name: "dataflow";
|
|
216
217
|
readonly description: "Construct the dataflow graph";
|
|
@@ -230,7 +231,7 @@ export declare const DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./pipel
|
|
|
230
231
|
readonly processor: (results: {
|
|
231
232
|
dataflow?: import("../../../dataflow/info").DataflowInformation;
|
|
232
233
|
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
233
|
-
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput
|
|
234
|
+
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
|
|
234
235
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
|
|
235
236
|
readonly printer: {
|
|
236
237
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -245,7 +246,7 @@ export declare const TREE_SITTER_SLICING_PIPELINE: import("./pipeline").Pipeline
|
|
|
245
246
|
}, input: {
|
|
246
247
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
247
248
|
parser?: Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
248
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
249
|
+
}, config: FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
249
250
|
readonly requiredInput: {};
|
|
250
251
|
readonly name: "dataflow";
|
|
251
252
|
readonly description: "Construct the dataflow graph";
|
|
@@ -265,7 +266,7 @@ export declare const TREE_SITTER_SLICING_PIPELINE: import("./pipeline").Pipeline
|
|
|
265
266
|
readonly processor: (results: {
|
|
266
267
|
dataflow?: import("../../../dataflow/info").DataflowInformation;
|
|
267
268
|
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
268
|
-
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput
|
|
269
|
+
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
|
|
269
270
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
|
|
270
271
|
readonly printer: {
|
|
271
272
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -307,7 +308,7 @@ export declare const TREE_SITTER_SLICING_PIPELINE: import("./pipeline").Pipeline
|
|
|
307
308
|
readonly description: "Normalize the AST to flowR's AST";
|
|
308
309
|
readonly processor: (results: {
|
|
309
310
|
"parse"?: import("../all/core/01-parse-tree-sitter").ParseStepOutputTS;
|
|
310
|
-
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput
|
|
311
|
+
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput>, config: FlowrConfigOptions) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
311
312
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerFile;
|
|
312
313
|
readonly printer: {
|
|
313
314
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -326,7 +327,7 @@ export declare const TREE_SITTER_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipel
|
|
|
326
327
|
}, input: {
|
|
327
328
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
328
329
|
parser?: Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
329
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
330
|
+
}, config: FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
330
331
|
readonly requiredInput: {};
|
|
331
332
|
readonly name: "dataflow";
|
|
332
333
|
readonly description: "Construct the dataflow graph";
|
|
@@ -346,7 +347,7 @@ export declare const TREE_SITTER_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipel
|
|
|
346
347
|
readonly processor: (results: {
|
|
347
348
|
dataflow?: import("../../../dataflow/info").DataflowInformation;
|
|
348
349
|
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
349
|
-
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput
|
|
350
|
+
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
|
|
350
351
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
|
|
351
352
|
readonly printer: {
|
|
352
353
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -388,7 +389,7 @@ export declare const TREE_SITTER_SLICE_AND_RECONSTRUCT_PIPELINE: import("./pipel
|
|
|
388
389
|
readonly description: "Normalize the AST to flowR's AST";
|
|
389
390
|
readonly processor: (results: {
|
|
390
391
|
"parse"?: import("../all/core/01-parse-tree-sitter").ParseStepOutputTS;
|
|
391
|
-
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput
|
|
392
|
+
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput>, config: FlowrConfigOptions) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
392
393
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerFile;
|
|
393
394
|
readonly printer: {
|
|
394
395
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -407,7 +408,7 @@ export declare const TREE_SITTER_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./p
|
|
|
407
408
|
}, input: {
|
|
408
409
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
409
410
|
parser?: Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
410
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
411
|
+
}, config: FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
411
412
|
readonly requiredInput: {};
|
|
412
413
|
readonly name: "dataflow";
|
|
413
414
|
readonly description: "Construct the dataflow graph";
|
|
@@ -427,7 +428,7 @@ export declare const TREE_SITTER_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./p
|
|
|
427
428
|
readonly processor: (results: {
|
|
428
429
|
dataflow?: import("../../../dataflow/info").DataflowInformation;
|
|
429
430
|
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
430
|
-
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput
|
|
431
|
+
}, input: Partial<import("../all/static-slicing/00-slice").SliceRequiredInput>, config: FlowrConfigOptions) => Readonly<import("../../../slicing/static/slicer-types").SliceResult>;
|
|
431
432
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerRequest;
|
|
432
433
|
readonly printer: {
|
|
433
434
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -455,7 +456,7 @@ export declare const TREE_SITTER_SLICE_WITHOUT_RECONSTRUCT_PIPELINE: import("./p
|
|
|
455
456
|
readonly description: "Normalize the AST to flowR's AST";
|
|
456
457
|
readonly processor: (results: {
|
|
457
458
|
"parse"?: import("../all/core/01-parse-tree-sitter").ParseStepOutputTS;
|
|
458
|
-
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput
|
|
459
|
+
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput>, config: FlowrConfigOptions) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
459
460
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerFile;
|
|
460
461
|
readonly printer: {
|
|
461
462
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -512,7 +513,7 @@ export declare const DEFAULT_DATAFLOW_PIPELINE: import("./pipeline").Pipeline<{
|
|
|
512
513
|
}, input: {
|
|
513
514
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
514
515
|
parser?: Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
515
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
516
|
+
}, config: FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
516
517
|
readonly requiredInput: {};
|
|
517
518
|
readonly name: "dataflow";
|
|
518
519
|
readonly description: "Construct the dataflow graph";
|
|
@@ -533,7 +534,7 @@ export declare const TREE_SITTER_DATAFLOW_PIPELINE: import("./pipeline").Pipelin
|
|
|
533
534
|
}, input: {
|
|
534
535
|
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
535
536
|
parser?: Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
536
|
-
}) => import("../../../dataflow/info").DataflowInformation;
|
|
537
|
+
}, config: FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
537
538
|
readonly requiredInput: {};
|
|
538
539
|
readonly name: "dataflow";
|
|
539
540
|
readonly description: "Construct the dataflow graph";
|
|
@@ -567,7 +568,7 @@ export declare const TREE_SITTER_DATAFLOW_PIPELINE: import("./pipeline").Pipelin
|
|
|
567
568
|
readonly description: "Normalize the AST to flowR's AST";
|
|
568
569
|
readonly processor: (results: {
|
|
569
570
|
"parse"?: import("../all/core/01-parse-tree-sitter").ParseStepOutputTS;
|
|
570
|
-
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput
|
|
571
|
+
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput>, config: FlowrConfigOptions) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
571
572
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerFile;
|
|
572
573
|
readonly printer: {
|
|
573
574
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -635,7 +636,7 @@ export declare const TREE_SITTER_NORMALIZE_PIPELINE: import("./pipeline").Pipeli
|
|
|
635
636
|
readonly description: "Normalize the AST to flowR's AST";
|
|
636
637
|
readonly processor: (results: {
|
|
637
638
|
"parse"?: import("../all/core/01-parse-tree-sitter").ParseStepOutputTS;
|
|
638
|
-
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput
|
|
639
|
+
}, input: Partial<import("../all/core/10-normalize").NormalizeRequiredInput>, config: FlowrConfigOptions) => import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation, import("../../../r-bridge/lang-4.x/ast/model/model").RNode<import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").ParentInformation>>;
|
|
639
640
|
readonly executed: import("../pipeline-step").PipelineStepStage.OncePerFile;
|
|
640
641
|
readonly printer: {
|
|
641
642
|
readonly 0: typeof import("../../print/print").internalPrinter;
|
|
@@ -680,15 +681,15 @@ export declare const TREE_SITTER_PARSE_PIPELINE: import("./pipeline").Pipeline<{
|
|
|
680
681
|
readonly dependencies: readonly [];
|
|
681
682
|
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<import("web-tree-sitter").Tree>;
|
|
682
683
|
}>;
|
|
683
|
-
export declare function createParsePipeline(parser: TreeSitterExecutor, inputs: Omit<PipelineInput<typeof DEFAULT_PARSE_PIPELINE>, 'parser'
|
|
684
|
-
export declare function createParsePipeline(parser: RShell, inputs: Omit<PipelineInput<typeof DEFAULT_PARSE_PIPELINE>, 'parser'
|
|
685
|
-
export declare function createParsePipeline(parser: KnownParser, inputs: Omit<PipelineInput<typeof DEFAULT_PARSE_PIPELINE>, 'parser'
|
|
686
|
-
export declare function createSlicePipeline(parser: TreeSitterExecutor, inputs: Omit<PipelineInput<typeof DEFAULT_SLICING_PIPELINE>, 'parser'
|
|
687
|
-
export declare function createSlicePipeline(parser: RShell, inputs: Omit<PipelineInput<typeof DEFAULT_SLICING_PIPELINE>, 'parser'
|
|
688
|
-
export declare function createSlicePipeline(parser: KnownParser, inputs: Omit<PipelineInput<typeof DEFAULT_SLICING_PIPELINE>, 'parser'
|
|
689
|
-
export declare function createNormalizePipeline(parser: TreeSitterExecutor, inputs: Omit<PipelineInput<typeof DEFAULT_NORMALIZE_PIPELINE>, 'parser'
|
|
690
|
-
export declare function createNormalizePipeline(parser: RShell, inputs: Omit<PipelineInput<typeof DEFAULT_NORMALIZE_PIPELINE>, 'parser'
|
|
691
|
-
export declare function createNormalizePipeline(parser: KnownParser, inputs: Omit<PipelineInput<typeof DEFAULT_NORMALIZE_PIPELINE>, 'parser'
|
|
692
|
-
export declare function createDataflowPipeline(parser: TreeSitterExecutor, inputs: Omit<PipelineInput<typeof DEFAULT_DATAFLOW_PIPELINE>, 'parser'
|
|
693
|
-
export declare function createDataflowPipeline(parser: RShell, inputs: Omit<PipelineInput<typeof DEFAULT_DATAFLOW_PIPELINE>, 'parser'
|
|
694
|
-
export declare function createDataflowPipeline(parser: KnownParser, inputs: Omit<PipelineInput<typeof DEFAULT_DATAFLOW_PIPELINE>, 'parser'
|
|
684
|
+
export declare function createParsePipeline(parser: TreeSitterExecutor, inputs: Omit<PipelineInput<typeof DEFAULT_PARSE_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof TREE_SITTER_PARSE_PIPELINE>;
|
|
685
|
+
export declare function createParsePipeline(parser: RShell, inputs: Omit<PipelineInput<typeof DEFAULT_PARSE_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof DEFAULT_PARSE_PIPELINE>;
|
|
686
|
+
export declare function createParsePipeline(parser: KnownParser, inputs: Omit<PipelineInput<typeof DEFAULT_PARSE_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof DEFAULT_PARSE_PIPELINE> | PipelineExecutor<typeof TREE_SITTER_PARSE_PIPELINE>;
|
|
687
|
+
export declare function createSlicePipeline(parser: TreeSitterExecutor, inputs: Omit<PipelineInput<typeof DEFAULT_SLICING_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof TREE_SITTER_SLICING_PIPELINE>;
|
|
688
|
+
export declare function createSlicePipeline(parser: RShell, inputs: Omit<PipelineInput<typeof DEFAULT_SLICING_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof DEFAULT_SLICING_PIPELINE>;
|
|
689
|
+
export declare function createSlicePipeline(parser: KnownParser, inputs: Omit<PipelineInput<typeof DEFAULT_SLICING_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof DEFAULT_SLICING_PIPELINE> | PipelineExecutor<typeof TREE_SITTER_SLICING_PIPELINE>;
|
|
690
|
+
export declare function createNormalizePipeline(parser: TreeSitterExecutor, inputs: Omit<PipelineInput<typeof DEFAULT_NORMALIZE_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof TREE_SITTER_NORMALIZE_PIPELINE>;
|
|
691
|
+
export declare function createNormalizePipeline(parser: RShell, inputs: Omit<PipelineInput<typeof DEFAULT_NORMALIZE_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof DEFAULT_NORMALIZE_PIPELINE>;
|
|
692
|
+
export declare function createNormalizePipeline(parser: KnownParser, inputs: Omit<PipelineInput<typeof DEFAULT_NORMALIZE_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof DEFAULT_NORMALIZE_PIPELINE> | PipelineExecutor<typeof TREE_SITTER_NORMALIZE_PIPELINE>;
|
|
693
|
+
export declare function createDataflowPipeline(parser: TreeSitterExecutor, inputs: Omit<PipelineInput<typeof DEFAULT_DATAFLOW_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof TREE_SITTER_DATAFLOW_PIPELINE>;
|
|
694
|
+
export declare function createDataflowPipeline(parser: RShell, inputs: Omit<PipelineInput<typeof DEFAULT_DATAFLOW_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof DEFAULT_DATAFLOW_PIPELINE>;
|
|
695
|
+
export declare function createDataflowPipeline(parser: KnownParser, inputs: Omit<PipelineInput<typeof DEFAULT_DATAFLOW_PIPELINE>, 'parser'>, config: FlowrConfigOptions): PipelineExecutor<typeof DEFAULT_DATAFLOW_PIPELINE> | PipelineExecutor<typeof TREE_SITTER_DATAFLOW_PIPELINE>;
|
|
@@ -37,36 +37,36 @@ exports.TREE_SITTER_PARSE_PIPELINE = (0, pipeline_1.createPipeline)(_01_parse_tr
|
|
|
37
37
|
*
|
|
38
38
|
* @see {@link createNormalizePipeline}, {@link createDataflowPipeline}, {@link createSlicePipeline}
|
|
39
39
|
*/
|
|
40
|
-
function createParsePipeline(parser, inputs) {
|
|
40
|
+
function createParsePipeline(parser, inputs, config) {
|
|
41
41
|
const base = parser.name === 'tree-sitter' ? exports.TREE_SITTER_PARSE_PIPELINE : exports.DEFAULT_PARSE_PIPELINE;
|
|
42
42
|
return new pipeline_executor_1.PipelineExecutor(base, {
|
|
43
43
|
parser: parser,
|
|
44
44
|
...inputs
|
|
45
|
-
});
|
|
45
|
+
}, config);
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Returns either a {@link DEFAULT_SLICING_PIPELINE} or a {@link TREE_SITTER_SLICING_PIPELINE} depending on the parser used.
|
|
49
49
|
*
|
|
50
50
|
* @see {@link createParsePipeline}, {@link createNormalizePipeline}, {@link createDataflowPipeline}
|
|
51
51
|
*/
|
|
52
|
-
function createSlicePipeline(parser, inputs) {
|
|
52
|
+
function createSlicePipeline(parser, inputs, config) {
|
|
53
53
|
const base = parser.name === 'tree-sitter' ? exports.TREE_SITTER_SLICING_PIPELINE : exports.DEFAULT_SLICING_PIPELINE;
|
|
54
54
|
return new pipeline_executor_1.PipelineExecutor(base, {
|
|
55
55
|
parser: parser,
|
|
56
56
|
...inputs
|
|
57
|
-
});
|
|
57
|
+
}, config);
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
60
|
* Returns either a {@link DEFAULT_NORMALIZE_PIPELINE} or a {@link TREE_SITTER_NORMALIZE_PIPELINE} depending on the parser used.
|
|
61
61
|
*
|
|
62
62
|
* @see {@link createParsePipeline}, {@link createDataflowPipeline}, {@link createSlicePipeline}
|
|
63
63
|
*/
|
|
64
|
-
function createNormalizePipeline(parser, inputs) {
|
|
64
|
+
function createNormalizePipeline(parser, inputs, config) {
|
|
65
65
|
const base = parser.name === 'tree-sitter' ? exports.TREE_SITTER_NORMALIZE_PIPELINE : exports.DEFAULT_NORMALIZE_PIPELINE;
|
|
66
66
|
return new pipeline_executor_1.PipelineExecutor(base, {
|
|
67
67
|
parser: parser,
|
|
68
68
|
...inputs
|
|
69
|
-
});
|
|
69
|
+
}, config);
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Returns either a {@link DEFAULT_DATAFLOW_PIPELINE} or a {@link TREE_SITTER_DATAFLOW_PIPELINE} depending on the parser used.
|
|
@@ -74,11 +74,11 @@ function createNormalizePipeline(parser, inputs) {
|
|
|
74
74
|
* @see {@link createParsePipeline}, {@link createNormalizePipeline}, {@link createSlicePipeline}
|
|
75
75
|
*
|
|
76
76
|
*/
|
|
77
|
-
function createDataflowPipeline(parser, inputs) {
|
|
77
|
+
function createDataflowPipeline(parser, inputs, config) {
|
|
78
78
|
const base = parser.name === 'tree-sitter' ? exports.TREE_SITTER_DATAFLOW_PIPELINE : exports.DEFAULT_DATAFLOW_PIPELINE;
|
|
79
79
|
return new pipeline_executor_1.PipelineExecutor(base, {
|
|
80
80
|
parser: parser,
|
|
81
81
|
...inputs
|
|
82
|
-
});
|
|
82
|
+
}, config);
|
|
83
83
|
}
|
|
84
84
|
//# sourceMappingURL=default-pipelines.js.map
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { MergeableRecord } from '../../util/objects';
|
|
7
7
|
import type { InternalStepPrinter, IPipelineStepPrinter, StepOutputFormat } from '../print/print';
|
|
8
|
+
import type { FlowrConfigOptions } from '../../config';
|
|
8
9
|
/**
|
|
9
10
|
* This represents the format of a step processor which retrieves two things:
|
|
10
11
|
*
|
|
@@ -16,7 +17,7 @@ import type { InternalStepPrinter, IPipelineStepPrinter, StepOutputFormat } from
|
|
|
16
17
|
* list all steps that you require as your {@link IPipelineStepOrder#dependencies|dependencies}, even if they would be
|
|
17
18
|
* already covered transitively.
|
|
18
19
|
*/
|
|
19
|
-
export type StepProcessingFunction = (results: Record<string, unknown>, input: Record<string, unknown
|
|
20
|
+
export type StepProcessingFunction = (results: Record<string, unknown>, input: Record<string, unknown>, config: FlowrConfigOptions) => unknown;
|
|
20
21
|
/**
|
|
21
22
|
* This represents the required execution frequency of a step.
|
|
22
23
|
*/
|
|
@@ -4,7 +4,7 @@ export interface BaseBuiltInDefinition {
|
|
|
4
4
|
/** The type of the built-in configuration */
|
|
5
5
|
readonly type: string;
|
|
6
6
|
/** The function name to define to the given configuration */
|
|
7
|
-
readonly names:
|
|
7
|
+
readonly names: Identifier[];
|
|
8
8
|
/** Should we assume that the value is a primitive? */
|
|
9
9
|
readonly assumePrimitive?: boolean;
|
|
10
10
|
}
|
|
@@ -35,7 +35,7 @@ export interface BuiltInFunctionDefinition<BuiltInProcessor extends BuiltInMappi
|
|
|
35
35
|
*/
|
|
36
36
|
export interface BuiltInReplacementDefinition extends BaseBuiltInDefinition {
|
|
37
37
|
readonly type: 'replacement';
|
|
38
|
-
readonly suffixes:
|
|
38
|
+
readonly suffixes: ('<<-' | '<-')[];
|
|
39
39
|
readonly config: {
|
|
40
40
|
readIndices: boolean;
|
|
41
41
|
};
|
|
@@ -44,7 +44,7 @@ export type BuiltInDefinition = BuiltInConstantDefinition<any> | BuiltInFunction
|
|
|
44
44
|
/**
|
|
45
45
|
* @see DefaultBuiltinConfig
|
|
46
46
|
*/
|
|
47
|
-
export type BuiltInDefinitions =
|
|
47
|
+
export type BuiltInDefinitions = BuiltInDefinition[];
|
|
48
48
|
export declare function registerBuiltInFunctions<BuiltInProcessor extends BuiltInMappingName>({ names, processor, config, assumePrimitive }: BuiltInFunctionDefinition<BuiltInProcessor>): void;
|
|
49
49
|
export declare function registerReplacementFunctions({ names, suffixes, assumePrimitive, config }: BuiltInReplacementDefinition): void;
|
|
50
50
|
export declare function registerBuiltInDefinition(definition: BuiltInDefinition): void;
|
|
@@ -30,8 +30,9 @@ import { processRm } from '../internal/process/functions/call/built-in/built-in-
|
|
|
30
30
|
import { processEvalCall } from '../internal/process/functions/call/built-in/built-in-eval';
|
|
31
31
|
import type { REnvironmentInformation } from './environment';
|
|
32
32
|
import type { Value } from '../eval/values/r-value';
|
|
33
|
-
import { resolveAsVector } from '../eval/resolve/resolve';
|
|
33
|
+
import { resolveAsVector, resolveAsSeq, resolveAsMinus, resolveAsPlus } from '../eval/resolve/resolve';
|
|
34
34
|
import type { DataflowGraph } from '../graph/graph';
|
|
35
|
+
import type { VariableResolve } from '../../config';
|
|
35
36
|
export type BuiltIn = `built-in:${string}`;
|
|
36
37
|
export declare function builtInId(name: string): BuiltIn;
|
|
37
38
|
export declare function isBuiltIn(name: NodeId | string): name is BuiltIn;
|
|
@@ -48,6 +49,7 @@ export interface BuiltInIdentifierConstant<T = unknown> extends IdentifierRefere
|
|
|
48
49
|
definedAt: BuiltIn;
|
|
49
50
|
value: T;
|
|
50
51
|
}
|
|
52
|
+
export type UseAsProcessors = 'builtin:default' | 'builtin:return' | 'builtin:stop';
|
|
51
53
|
export interface DefaultBuiltInProcessorConfiguration extends ForceArguments {
|
|
52
54
|
readonly returnsNthArgument?: number | 'last';
|
|
53
55
|
readonly cfg?: ExitPointType;
|
|
@@ -55,8 +57,12 @@ export interface DefaultBuiltInProcessorConfiguration extends ForceArguments {
|
|
|
55
57
|
readonly hasUnknownSideEffects?: boolean | LinkTo<RegExp | string>;
|
|
56
58
|
/** record mapping the actual function name called to the arguments that should be treated as function calls */
|
|
57
59
|
readonly treatAsFnCall?: Record<string, readonly string[]>;
|
|
60
|
+
/** Name that should be used for the origin (useful when needing to differentiate between
|
|
61
|
+
* functions like 'return' that use the default builtin processor)
|
|
62
|
+
*/
|
|
63
|
+
readonly useAsProcessor?: UseAsProcessors;
|
|
58
64
|
}
|
|
59
|
-
export type BuiltInEvalHandler = (a: RNodeWithParent, env
|
|
65
|
+
export type BuiltInEvalHandler = (resolve: VariableResolve, a: RNodeWithParent, env?: REnvironmentInformation, graph?: DataflowGraph, map?: AstIdMap) => Value;
|
|
60
66
|
declare function defaultBuiltInProcessor<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: DefaultBuiltInProcessorConfiguration): DataflowInformation;
|
|
61
67
|
export declare function registerBuiltInFunctions<Config extends object, Proc extends BuiltInIdentifierProcessorWithConfig<Config>>(both: boolean, names: readonly Identifier[], processor: Proc, config: Config): void;
|
|
62
68
|
export declare const BuiltInProcessorMapper: {
|
|
@@ -84,7 +90,9 @@ export declare const BuiltInProcessorMapper: {
|
|
|
84
90
|
};
|
|
85
91
|
export declare const BuiltInEvalHandlerMapper: {
|
|
86
92
|
readonly 'built-in:c': typeof resolveAsVector;
|
|
87
|
-
readonly '
|
|
93
|
+
readonly 'built-in::': typeof resolveAsSeq;
|
|
94
|
+
readonly 'built-in:+': typeof resolveAsPlus;
|
|
95
|
+
readonly 'built-in:-': typeof resolveAsMinus;
|
|
88
96
|
};
|
|
89
97
|
export type BuiltInMappingName = keyof typeof BuiltInProcessorMapper;
|
|
90
98
|
export type ConfigOfBuiltInMappingName<N extends BuiltInMappingName> = Parameters<typeof BuiltInProcessorMapper[N]>[4];
|