@eagleoutice/flowr 2.2.14 → 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 +3 -3
- 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 +5 -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 +27 -43
- package/control-flow/basic-cfg-guided-visitor.d.ts +3 -3
- package/control-flow/cfg-dead-code.d.ts +4 -0
- package/control-flow/cfg-dead-code.js +124 -0
- package/control-flow/cfg-simplification.d.ts +19 -6
- package/control-flow/cfg-simplification.js +23 -19
- package/control-flow/control-flow-graph.d.ts +3 -1
- package/control-flow/control-flow-graph.js +5 -0
- package/control-flow/dfg-cfg-guided-visitor.d.ts +9 -7
- package/control-flow/dfg-cfg-guided-visitor.js +16 -5
- package/control-flow/extract-cfg.d.ts +4 -2
- package/control-flow/extract-cfg.js +63 -59
- package/control-flow/semantic-cfg-guided-visitor.d.ts +36 -9
- package/control-flow/semantic-cfg-guided-visitor.js +73 -20
- package/control-flow/simple-visitor.d.ts +4 -0
- package/control-flow/simple-visitor.js +14 -0
- package/control-flow/syntax-cfg-guided-visitor.d.ts +2 -2
- 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 +4 -3
- package/dataflow/environments/built-in.d.ts +16 -1
- package/dataflow/environments/built-in.js +11 -5
- package/dataflow/environments/default-builtin-config.js +5 -3
- 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/environments/resolve-by-name.d.ts +0 -36
- package/dataflow/environments/resolve-by-name.js +0 -240
- package/dataflow/eval/resolve/alias-tracking.d.ts +92 -0
- package/dataflow/eval/resolve/alias-tracking.js +352 -0
- 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 +37 -0
- package/dataflow/eval/resolve/resolve.js +95 -0
- package/dataflow/eval/values/general.d.ts +27 -0
- package/dataflow/eval/values/general.js +73 -0
- package/dataflow/eval/values/intervals/interval-constants.d.ts +4 -0
- package/dataflow/eval/values/intervals/interval-constants.js +27 -0
- package/dataflow/eval/values/logical/logical-constants.d.ts +7 -0
- package/dataflow/eval/values/logical/logical-constants.js +31 -0
- package/dataflow/eval/values/r-value.d.ts +58 -0
- package/dataflow/eval/values/r-value.js +90 -0
- package/dataflow/eval/values/scalar/scalar-consatnts.d.ts +15 -0
- package/dataflow/eval/values/scalar/scalar-consatnts.js +35 -0
- package/dataflow/eval/values/sets/set-constants.d.ts +7 -0
- package/dataflow/eval/values/sets/set-constants.js +34 -0
- package/dataflow/eval/values/string/string-constants.d.ts +8 -0
- package/dataflow/eval/values/string/string-constants.js +45 -0
- package/dataflow/eval/values/vectors/vector-constants.d.ts +14 -0
- package/dataflow/eval/values/vectors/vector-constants.js +35 -0
- package/dataflow/extractor.d.ts +2 -1
- package/dataflow/extractor.js +2 -1
- package/dataflow/graph/unknown-replacement.d.ts +11 -0
- package/dataflow/graph/unknown-replacement.js +12 -0
- package/dataflow/graph/unknown-side-effect.d.ts +7 -0
- package/dataflow/graph/unknown-side-effect.js +13 -0
- 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 +8 -5
- 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 +15 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +20 -18
- 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 +5 -4
- 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 +11 -5
- 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 +26 -29
- 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 +23 -0
- package/dataflow/internal/process/functions/call/common.js +1 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -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.d.ts +6 -3
- package/documentation/doc-util/doc-query.js +6 -3
- 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 +10 -11
- package/documentation/print-core-wiki.js +5 -5
- package/documentation/print-dataflow-graph-wiki.js +14 -13
- package/documentation/print-engines-wiki.js +2 -3
- 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 +81 -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 +3 -0
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +20 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +81 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.js +34 -0
- 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 -115
- 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 +17 -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 +4 -4
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +3 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -22
- 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 +75 -15
- 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 +18 -9
- 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 +32 -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/criterion/parse.d.ts +8 -0
- package/slicing/criterion/parse.js +20 -0
- 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
|
@@ -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
|
}
|
|
@@ -27,6 +27,7 @@ export interface BuiltInFunctionDefinition<BuiltInProcessor extends BuiltInMappi
|
|
|
27
27
|
readonly type: 'function';
|
|
28
28
|
readonly processor: BuiltInProcessor;
|
|
29
29
|
readonly config?: ConfigOfBuiltInMappingName<BuiltInProcessor>;
|
|
30
|
+
readonly evalHandler?: string;
|
|
30
31
|
}
|
|
31
32
|
/**
|
|
32
33
|
* Define a built-in replacement (like `[` or `$`) and the processor to use.
|
|
@@ -34,7 +35,7 @@ export interface BuiltInFunctionDefinition<BuiltInProcessor extends BuiltInMappi
|
|
|
34
35
|
*/
|
|
35
36
|
export interface BuiltInReplacementDefinition extends BaseBuiltInDefinition {
|
|
36
37
|
readonly type: 'replacement';
|
|
37
|
-
readonly suffixes:
|
|
38
|
+
readonly suffixes: ('<<-' | '<-')[];
|
|
38
39
|
readonly config: {
|
|
39
40
|
readIndices: boolean;
|
|
40
41
|
};
|
|
@@ -43,7 +44,7 @@ export type BuiltInDefinition = BuiltInConstantDefinition<any> | BuiltInFunction
|
|
|
43
44
|
/**
|
|
44
45
|
* @see DefaultBuiltinConfig
|
|
45
46
|
*/
|
|
46
|
-
export type BuiltInDefinitions =
|
|
47
|
+
export type BuiltInDefinitions = BuiltInDefinition[];
|
|
47
48
|
export declare function registerBuiltInFunctions<BuiltInProcessor extends BuiltInMappingName>({ names, processor, config, assumePrimitive }: BuiltInFunctionDefinition<BuiltInProcessor>): void;
|
|
48
49
|
export declare function registerReplacementFunctions({ names, suffixes, assumePrimitive, config }: BuiltInReplacementDefinition): void;
|
|
49
50
|
export declare function registerBuiltInDefinition(definition: BuiltInDefinition): void;
|
|
@@ -15,7 +15,7 @@ import { processQuote } from '../internal/process/functions/call/built-in/built-
|
|
|
15
15
|
import { processFunctionDefinition } from '../internal/process/functions/call/built-in/built-in-function-definition';
|
|
16
16
|
import { processExpressionList } from '../internal/process/functions/call/built-in/built-in-expression-list';
|
|
17
17
|
import { processGet } from '../internal/process/functions/call/built-in/built-in-get';
|
|
18
|
-
import type { ParentInformation } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
18
|
+
import type { AstIdMap, ParentInformation, RNodeWithParent } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
19
19
|
import type { RFunctionArgument } from '../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
20
20
|
import type { RSymbol } from '../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
21
21
|
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
@@ -28,6 +28,11 @@ import { processList } from '../internal/process/functions/call/built-in/built-i
|
|
|
28
28
|
import { processVector } from '../internal/process/functions/call/built-in/built-in-vector';
|
|
29
29
|
import { processRm } from '../internal/process/functions/call/built-in/built-in-rm';
|
|
30
30
|
import { processEvalCall } from '../internal/process/functions/call/built-in/built-in-eval';
|
|
31
|
+
import type { REnvironmentInformation } from './environment';
|
|
32
|
+
import type { Value } from '../eval/values/r-value';
|
|
33
|
+
import { resolveAsVector } from '../eval/resolve/resolve';
|
|
34
|
+
import type { DataflowGraph } from '../graph/graph';
|
|
35
|
+
import type { VariableResolve } from '../../config';
|
|
31
36
|
export type BuiltIn = `built-in:${string}`;
|
|
32
37
|
export declare function builtInId(name: string): BuiltIn;
|
|
33
38
|
export declare function isBuiltIn(name: NodeId | string): name is BuiltIn;
|
|
@@ -44,6 +49,7 @@ export interface BuiltInIdentifierConstant<T = unknown> extends IdentifierRefere
|
|
|
44
49
|
definedAt: BuiltIn;
|
|
45
50
|
value: T;
|
|
46
51
|
}
|
|
52
|
+
export type UseAsProcessors = 'builtin:default' | 'builtin:return' | 'builtin:stop';
|
|
47
53
|
export interface DefaultBuiltInProcessorConfiguration extends ForceArguments {
|
|
48
54
|
readonly returnsNthArgument?: number | 'last';
|
|
49
55
|
readonly cfg?: ExitPointType;
|
|
@@ -51,7 +57,12 @@ export interface DefaultBuiltInProcessorConfiguration extends ForceArguments {
|
|
|
51
57
|
readonly hasUnknownSideEffects?: boolean | LinkTo<RegExp | string>;
|
|
52
58
|
/** record mapping the actual function name called to the arguments that should be treated as function calls */
|
|
53
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;
|
|
54
64
|
}
|
|
65
|
+
export type BuiltInEvalHandler = (resolve: VariableResolve, a: RNodeWithParent, env: REnvironmentInformation, graph?: DataflowGraph, map?: AstIdMap) => Value;
|
|
55
66
|
declare function defaultBuiltInProcessor<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: DefaultBuiltInProcessorConfiguration): DataflowInformation;
|
|
56
67
|
export declare function registerBuiltInFunctions<Config extends object, Proc extends BuiltInIdentifierProcessorWithConfig<Config>>(both: boolean, names: readonly Identifier[], processor: Proc, config: Config): void;
|
|
57
68
|
export declare const BuiltInProcessorMapper: {
|
|
@@ -77,6 +88,10 @@ export declare const BuiltInProcessorMapper: {
|
|
|
77
88
|
readonly 'builtin:list': typeof processList;
|
|
78
89
|
readonly 'builtin:vector': typeof processVector;
|
|
79
90
|
};
|
|
91
|
+
export declare const BuiltInEvalHandlerMapper: {
|
|
92
|
+
readonly 'built-in:c': typeof resolveAsVector;
|
|
93
|
+
readonly 'builtin:vector': typeof resolveAsVector;
|
|
94
|
+
};
|
|
80
95
|
export type BuiltInMappingName = keyof typeof BuiltInProcessorMapper;
|
|
81
96
|
export type ConfigOfBuiltInMappingName<N extends BuiltInMappingName> = Parameters<typeof BuiltInProcessorMapper[N]>[4];
|
|
82
97
|
export declare const BuiltInMemory: Map<Identifier, IdentifierDefinition[]>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EmptyBuiltInMemory = exports.BuiltInMemory = exports.BuiltInProcessorMapper = void 0;
|
|
3
|
+
exports.EmptyBuiltInMemory = exports.BuiltInMemory = exports.BuiltInEvalHandlerMapper = exports.BuiltInProcessorMapper = void 0;
|
|
4
4
|
exports.builtInId = builtInId;
|
|
5
5
|
exports.isBuiltIn = isBuiltIn;
|
|
6
6
|
exports.registerBuiltInFunctions = registerBuiltInFunctions;
|
|
@@ -33,6 +33,8 @@ const built_in_rm_1 = require("../internal/process/functions/call/built-in/built
|
|
|
33
33
|
const built_in_eval_1 = require("../internal/process/functions/call/built-in/built-in-eval");
|
|
34
34
|
const vertex_1 = require("../graph/vertex");
|
|
35
35
|
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
36
|
+
const unknown_side_effect_1 = require("../graph/unknown-side-effect");
|
|
37
|
+
const resolve_1 = require("../eval/resolve/resolve");
|
|
36
38
|
function builtInId(name) {
|
|
37
39
|
return `built-in:${name}`;
|
|
38
40
|
}
|
|
@@ -40,7 +42,7 @@ function isBuiltIn(name) {
|
|
|
40
42
|
return String(name).startsWith('built-in:');
|
|
41
43
|
}
|
|
42
44
|
function defaultBuiltInProcessor(name, args, rootId, data, config) {
|
|
43
|
-
const { information: res, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: 'builtin:default' });
|
|
45
|
+
const { information: res, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: config.useAsProcessor ?? 'builtin:default' });
|
|
44
46
|
if (config.returnsNthArgument !== undefined) {
|
|
45
47
|
const arg = config.returnsNthArgument === 'last' ? processedArguments[args.length - 1] : processedArguments[config.returnsNthArgument];
|
|
46
48
|
if (arg !== undefined) {
|
|
@@ -56,10 +58,10 @@ function defaultBuiltInProcessor(name, args, rootId, data, config) {
|
|
|
56
58
|
}
|
|
57
59
|
if (config.hasUnknownSideEffects) {
|
|
58
60
|
if (typeof config.hasUnknownSideEffects !== 'boolean') {
|
|
59
|
-
res.graph.
|
|
61
|
+
(0, unknown_side_effect_1.handleUnknownSideEffect)(res.graph, res.environment, rootId, config.hasUnknownSideEffects);
|
|
60
62
|
}
|
|
61
63
|
else {
|
|
62
|
-
res.graph.
|
|
64
|
+
(0, unknown_side_effect_1.handleUnknownSideEffect)(res.graph, res.environment, rootId);
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
const fnCallNames = config.treatAsFnCall?.[name.content];
|
|
@@ -88,7 +90,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, config) {
|
|
|
88
90
|
environment: data.environment,
|
|
89
91
|
onlyBuiltin: false,
|
|
90
92
|
cds: data.controlDependencies,
|
|
91
|
-
origin: ['builtin:default']
|
|
93
|
+
origin: [config.useAsProcessor ?? 'builtin:default']
|
|
92
94
|
});
|
|
93
95
|
}
|
|
94
96
|
}
|
|
@@ -140,6 +142,10 @@ exports.BuiltInProcessorMapper = {
|
|
|
140
142
|
'builtin:list': built_in_list_1.processList,
|
|
141
143
|
'builtin:vector': built_in_vector_1.processVector,
|
|
142
144
|
};
|
|
145
|
+
exports.BuiltInEvalHandlerMapper = {
|
|
146
|
+
'built-in:c': resolve_1.resolveAsVector,
|
|
147
|
+
'builtin:vector': resolve_1.resolveAsVector
|
|
148
|
+
};
|
|
143
149
|
exports.BuiltInMemory = new Map();
|
|
144
150
|
exports.EmptyBuiltInMemory = new Map();
|
|
145
151
|
(0, built_in_config_1.registerBuiltInDefinitions)(default_builtin_config_1.DefaultBuiltinConfig);
|
|
@@ -102,7 +102,7 @@ exports.DefaultBuiltinConfig = [
|
|
|
102
102
|
'~', '+', '-', '*', '/', '^', '!', '?', '**', '==', '!=', '>', '<', '>=', '<=', '%%', '%/%', '%*%', '%in%', ':',
|
|
103
103
|
'rep', 'seq', 'seq_len', 'seq_along', 'seq.int', 'gsub', 'which', 'class', 'dimnames', 'min', 'max',
|
|
104
104
|
'intersect', 'subset', 'match', 'sqrt', 'abs', 'round', 'floor', 'ceiling', 'signif', 'trunc', 'log', 'log10', 'log2', 'sum', 'mean',
|
|
105
|
-
'unique', 'paste', 'paste0', 'read.csv', '
|
|
105
|
+
'unique', 'paste', 'paste0', 'read.csv', 'is.null', 'numeric', 'as.character', 'as.integer', 'as.logical', 'as.numeric', 'as.matrix',
|
|
106
106
|
'rbind', 'nrow', 'ncol', 'tryCatch', 'expression', 'factor',
|
|
107
107
|
'missing', 'as.data.frame', 'data.frame', 'na.omit', 'rownames', 'names', 'order', 'length', 'any', 'dim', 'matrix', 'cbind', 'nchar',
|
|
108
108
|
'pdf', 'jpeg', 'png', 'windows', 'postscript', 'xfig', 'bitmap', 'pictex', 'cairo_pdf', 'svg', 'bmp', 'tiff', 'X11', 'quartz',
|
|
@@ -215,7 +215,9 @@ exports.DefaultBuiltinConfig = [
|
|
|
215
215
|
{ type: 'function', names: ['eval'], processor: 'builtin:eval', config: { includeFunctionCall: true }, assumePrimitive: true },
|
|
216
216
|
{ type: 'function', names: ['cat'], processor: 'builtin:default', config: { forceArgs: 'all', hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ } }, assumePrimitive: false },
|
|
217
217
|
{ type: 'function', names: ['switch'], processor: 'builtin:default', config: { forceArgs: [true] }, assumePrimitive: false },
|
|
218
|
-
{ type: 'function', names: ['return'], processor: 'builtin:default', config: { returnsNthArgument: 0, cfg: 1 /* ExitPointType.Return
|
|
218
|
+
{ type: 'function', names: ['return'], processor: 'builtin:default', config: { returnsNthArgument: 0, cfg: 1 /* ExitPointType.Return */, useAsProcessor: 'builtin:return' }, assumePrimitive: false },
|
|
219
|
+
{ type: 'function', names: ['stop'], processor: 'builtin:default', config: { useAsProcessor: 'builtin:stop' }, assumePrimitive: false },
|
|
220
|
+
{ type: 'function', names: ['stopifnot'], processor: 'builtin:default', config: { useAsProcessor: 'builtin:stopifnot' }, assumePrimitive: false },
|
|
219
221
|
{ type: 'function', names: ['break'], processor: 'builtin:default', config: { cfg: 2 /* ExitPointType.Break */ }, assumePrimitive: false },
|
|
220
222
|
{ type: 'function', names: ['next'], processor: 'builtin:default', config: { cfg: 3 /* ExitPointType.Next */ }, assumePrimitive: false },
|
|
221
223
|
{ type: 'function', names: ['{'], processor: 'builtin:expression-list', config: {}, assumePrimitive: true },
|
|
@@ -245,7 +247,7 @@ exports.DefaultBuiltinConfig = [
|
|
|
245
247
|
{ type: 'function', names: ['interference'], processor: 'builtin:apply', config: { unquoteFunction: true, nameOfFunctionArgument: 'propensity_integrand' }, assumePrimitive: false },
|
|
246
248
|
{ type: 'function', names: ['ddply'], processor: 'builtin:apply', config: { unquoteFunction: true, indexOfFunction: 2, nameOfFunctionArgument: '.fun' }, assumePrimitive: false },
|
|
247
249
|
{ type: 'function', names: ['list'], processor: 'builtin:list', config: {}, assumePrimitive: true },
|
|
248
|
-
{ type: 'function', names: ['c'], processor: 'builtin:vector', config: {}, assumePrimitive: true },
|
|
250
|
+
{ type: 'function', names: ['c'], processor: 'builtin:vector', config: {}, assumePrimitive: true, evalHandler: 'builtin:c' },
|
|
249
251
|
{
|
|
250
252
|
type: 'function',
|
|
251
253
|
names: ['setnames', 'setNames', 'setkey', 'setkeyv', 'setindex', 'setindexv', 'setattr'],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { REnvironmentInformation } from './environment';
|
|
2
2
|
import type { IdentifierDefinition, InGraphIdentifierDefinition } from './identifier';
|
|
3
|
+
import type { FlowrConfigOptions } from '../../config';
|
|
3
4
|
/**
|
|
4
5
|
* assumes: existing is not undefined, the overwrite has indices
|
|
5
6
|
*/
|
|
@@ -8,4 +9,4 @@ export declare function mergeDefinitions(existing: readonly IdentifierDefinition
|
|
|
8
9
|
* Insert the given `definition` --- defined within the given scope --- into the passed along `environments` will take care of propagation.
|
|
9
10
|
* Does not modify the passed along `environments` in-place! It returns the new reference.
|
|
10
11
|
*/
|
|
11
|
-
export declare function define(definition: IdentifierDefinition, superAssign: boolean | undefined, environment: REnvironmentInformation): REnvironmentInformation;
|
|
12
|
+
export declare function define(definition: IdentifierDefinition, superAssign: boolean | undefined, environment: REnvironmentInformation, config: FlowrConfigOptions): REnvironmentInformation;
|
|
@@ -6,12 +6,11 @@ const assert_1 = require("../../util/assert");
|
|
|
6
6
|
const environment_1 = require("./environment");
|
|
7
7
|
const clone_1 = require("./clone");
|
|
8
8
|
const vertex_1 = require("../graph/vertex");
|
|
9
|
-
|
|
10
|
-
function defInEnv(newEnvironments, name, definition) {
|
|
9
|
+
function defInEnv(newEnvironments, name, definition, config) {
|
|
11
10
|
const existing = newEnvironments.memory.get(name);
|
|
12
11
|
// When there are defined indices, merge the definitions
|
|
13
12
|
const inGraphDefinition = definition;
|
|
14
|
-
if (
|
|
13
|
+
if (config.solver.pointerTracking &&
|
|
15
14
|
existing !== undefined &&
|
|
16
15
|
inGraphDefinition.controlDependencies === undefined) {
|
|
17
16
|
if (inGraphDefinition.indicesCollection !== undefined) {
|
|
@@ -122,7 +121,7 @@ function overwriteContainerIndices(existingIndices, overwriteIndex) {
|
|
|
122
121
|
* Insert the given `definition` --- defined within the given scope --- into the passed along `environments` will take care of propagation.
|
|
123
122
|
* Does not modify the passed along `environments` in-place! It returns the new reference.
|
|
124
123
|
*/
|
|
125
|
-
function define(definition, superAssign, environment) {
|
|
124
|
+
function define(definition, superAssign, environment, config) {
|
|
126
125
|
const name = definition.name;
|
|
127
126
|
(0, assert_1.guard)(name !== undefined, () => `Name must be defined, but isn't for ${JSON.stringify(definition)}`);
|
|
128
127
|
let newEnvironment;
|
|
@@ -147,7 +146,7 @@ function define(definition, superAssign, environment) {
|
|
|
147
146
|
}
|
|
148
147
|
else {
|
|
149
148
|
newEnvironment = (0, clone_1.cloneEnvironmentInformation)(environment, false);
|
|
150
|
-
defInEnv(newEnvironment.current, name, definition);
|
|
149
|
+
defInEnv(newEnvironment.current, name, definition, config);
|
|
151
150
|
}
|
|
152
151
|
return newEnvironment;
|
|
153
152
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { REnvironmentInformation } from './environment';
|
|
2
2
|
import type { Identifier } from './identifier';
|
|
3
|
+
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
4
|
/**
|
|
4
5
|
* Removes all definitions of a given name from the environment.
|
|
5
6
|
*/
|
|
6
7
|
export declare function remove(name: Identifier, environment: REnvironmentInformation): REnvironmentInformation;
|
|
8
|
+
/** Creates a copy of the original environment but without the definitions of the given ids */
|
|
9
|
+
export declare function removeAll(definitions: readonly {
|
|
10
|
+
nodeId: NodeId;
|
|
11
|
+
name: Identifier | undefined;
|
|
12
|
+
}[], environment: REnvironmentInformation): REnvironmentInformation;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.remove = remove;
|
|
4
|
+
exports.removeAll = removeAll;
|
|
4
5
|
const environment_1 = require("./environment");
|
|
5
6
|
const info_1 = require("../info");
|
|
7
|
+
const clone_1 = require("./clone");
|
|
6
8
|
/**
|
|
7
9
|
* Removes all definitions of a given name from the environment.
|
|
8
10
|
*/
|
|
@@ -21,4 +23,31 @@ function remove(name, environment) {
|
|
|
21
23
|
// we never remove built ins
|
|
22
24
|
return environment;
|
|
23
25
|
}
|
|
26
|
+
/** Creates a copy of the original environment but without the definitions of the given ids */
|
|
27
|
+
function removeAll(definitions, environment) {
|
|
28
|
+
environment = (0, clone_1.cloneEnvironmentInformation)(environment, true);
|
|
29
|
+
let current = environment.current;
|
|
30
|
+
do {
|
|
31
|
+
for (const { nodeId, name } of definitions) {
|
|
32
|
+
if (name) {
|
|
33
|
+
current.memory.delete(name);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
// remove all definitions for the node id
|
|
37
|
+
for (const [key, values] of current.memory) {
|
|
38
|
+
const res = values.filter(v => v.nodeId === nodeId);
|
|
39
|
+
if (res.length > 0) {
|
|
40
|
+
current.memory.set(key, values);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
current.memory.delete(key);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
current = current.parent;
|
|
49
|
+
} while (current.id !== environment_1.BuiltInEnvironment.id);
|
|
50
|
+
// we never remove built ins so we can stop one early
|
|
51
|
+
return environment;
|
|
52
|
+
}
|
|
24
53
|
//# sourceMappingURL=remove.js.map
|