@eagleoutice/flowr 2.2.12 → 2.2.14
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 +82 -20
- package/benchmark/slicer.js +2 -2
- package/benchmark/summarizer/first-phase/input.js +1 -1
- package/benchmark/summarizer/first-phase/process.js +3 -3
- package/benchmark/summarizer/second-phase/process.js +1 -1
- package/benchmark/summarizer/summarizer.js +1 -1
- package/cli/common/options.js +4 -4
- package/cli/common/script.js +1 -1
- package/cli/flowr.js +1 -1
- package/cli/repl/commands/repl-cfg.d.ts +2 -0
- package/cli/repl/commands/repl-cfg.js +38 -24
- package/cli/repl/commands/repl-commands.js +4 -2
- package/cli/repl/commands/repl-dataflow.js +3 -3
- package/cli/repl/commands/repl-execute.js +1 -1
- package/cli/repl/commands/repl-main.d.ts +1 -1
- package/cli/repl/commands/repl-main.js +1 -1
- package/cli/repl/commands/repl-normalize.js +1 -1
- package/cli/repl/commands/repl-query.js +2 -2
- package/cli/repl/core.js +1 -1
- package/cli/repl/prompt.js +1 -1
- package/cli/repl/server/connection.js +4 -4
- package/cli/repl/server/messages/message-analysis.d.ts +1 -1
- package/cli/script-core/statistics-core.js +1 -1
- package/cli/script-core/statistics-helper-core.js +4 -4
- package/config.d.ts +47 -24
- package/config.js +3 -3
- package/control-flow/basic-cfg-guided-visitor.d.ts +39 -0
- package/control-flow/basic-cfg-guided-visitor.js +114 -0
- package/control-flow/cfg-properties.d.ts +26 -0
- package/control-flow/cfg-properties.js +100 -0
- package/control-flow/cfg-simplification.d.ts +18 -0
- package/control-flow/cfg-simplification.js +55 -0
- package/control-flow/cfg-to-basic-blocks.d.ts +5 -0
- package/control-flow/cfg-to-basic-blocks.js +81 -0
- package/control-flow/control-flow-graph.d.ts +247 -0
- package/control-flow/control-flow-graph.js +290 -0
- package/control-flow/dfg-cfg-guided-visitor.d.ts +32 -0
- package/control-flow/dfg-cfg-guided-visitor.js +71 -0
- package/control-flow/diff-cfg.d.ts +11 -0
- package/control-flow/diff-cfg.js +161 -0
- package/control-flow/extract-cfg.d.ts +30 -0
- package/control-flow/extract-cfg.js +475 -0
- package/control-flow/happens-before.d.ts +7 -0
- package/{util/cfg → control-flow}/happens-before.js +3 -3
- package/control-flow/semantic-cfg-guided-visitor.d.ts +452 -0
- package/control-flow/semantic-cfg-guided-visitor.js +492 -0
- package/control-flow/simple-visitor.d.ts +25 -0
- package/control-flow/simple-visitor.js +80 -0
- package/control-flow/syntax-cfg-guided-visitor.d.ts +128 -0
- package/control-flow/syntax-cfg-guided-visitor.js +166 -0
- package/core/print/print.d.ts +1 -1
- package/core/print/slice-diff-ansi.js +1 -1
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/dataflow/environments/built-in-config.js +9 -6
- package/dataflow/environments/built-in.d.ts +8 -4
- package/dataflow/environments/built-in.js +47 -5
- package/dataflow/environments/default-builtin-config.d.ts +2 -0
- package/dataflow/environments/default-builtin-config.js +81 -14
- package/dataflow/environments/resolve-by-name.js +15 -4
- package/dataflow/extractor.js +2 -2
- package/dataflow/graph/dataflowgraph-builder.d.ts +3 -1
- package/dataflow/graph/dataflowgraph-builder.js +4 -2
- package/dataflow/graph/diff-dataflow-graph.d.ts +16 -0
- package/dataflow/graph/{diff.js → diff-dataflow-graph.js} +30 -56
- package/dataflow/graph/graph.d.ts +11 -3
- package/dataflow/graph/graph.js +27 -12
- package/dataflow/graph/vertex.d.ts +17 -2
- package/dataflow/internal/linker.d.ts +3 -2
- package/dataflow/internal/linker.js +33 -24
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +12 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +84 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +23 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +15 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +9 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +19 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +19 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
- package/dataflow/internal/process/functions/call/common.d.ts +4 -1
- package/dataflow/internal/process/functions/call/common.js +5 -3
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +1 -0
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +6 -4
- package/dataflow/internal/process/process-named-call.d.ts +1 -1
- package/dataflow/internal/process/process-named-call.js +5 -5
- package/dataflow/origin/dfg-get-origin.d.ts +82 -0
- package/dataflow/origin/dfg-get-origin.js +116 -0
- package/documentation/doc-util/doc-cfg.d.ts +13 -6
- package/documentation/doc-util/doc-cfg.js +20 -15
- package/documentation/doc-util/doc-cli-option.js +4 -2
- package/documentation/doc-util/doc-dfg.js +3 -3
- package/documentation/doc-util/doc-escape.d.ts +7 -0
- package/documentation/doc-util/doc-escape.js +19 -0
- package/documentation/doc-util/doc-files.d.ts +1 -0
- package/documentation/doc-util/doc-files.js +2 -1
- package/documentation/doc-util/doc-normalized-ast.js +3 -3
- package/documentation/doc-util/doc-query.js +2 -2
- package/documentation/doc-util/doc-repl.js +1 -1
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/doc-util/doc-server-message.js +2 -2
- package/documentation/doc-util/doc-structure.d.ts +1 -0
- package/documentation/doc-util/doc-structure.js +5 -0
- package/documentation/doc-util/doc-types.d.ts +7 -1
- package/documentation/doc-util/doc-types.js +13 -2
- package/documentation/print-capabilities-markdown.js +27 -1
- package/documentation/print-cfg-wiki.js +508 -20
- package/documentation/print-dataflow-graph-wiki.js +180 -25
- package/documentation/print-engines-wiki.js +1 -1
- package/documentation/print-faq-wiki.d.ts +1 -0
- package/documentation/print-faq-wiki.js +75 -0
- package/documentation/print-interface-wiki.js +1 -1
- package/documentation/print-linter-wiki.d.ts +1 -0
- package/documentation/print-linter-wiki.js +76 -0
- package/documentation/print-linting-and-testing-wiki.js +52 -36
- package/documentation/print-normalized-ast-wiki.js +1 -1
- package/documentation/print-onboarding-wiki.d.ts +1 -0
- package/documentation/print-onboarding-wiki.js +42 -0
- package/documentation/print-query-wiki.js +21 -1
- package/documentation/print-readme.js +10 -3
- package/linter/linter-executor.d.ts +9 -0
- package/linter/linter-executor.js +26 -0
- package/linter/linter-format.d.ts +65 -0
- package/linter/linter-format.js +9 -0
- package/linter/linter-rules.d.ts +42 -0
- package/linter/linter-rules.js +14 -0
- package/linter/rules/1-deprecated-functions.d.ts +34 -0
- package/linter/rules/1-deprecated-functions.js +54 -0
- package/linter/rules/2-file-path-validity.d.ts +48 -0
- package/linter/rules/2-file-path-validity.js +93 -0
- package/package.json +10 -6
- package/queries/catalog/call-context-query/call-context-query-executor.js +5 -5
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +3 -3
- package/queries/catalog/call-context-query/call-context-query-format.js +7 -3
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +2 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +24 -21
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +3 -1
- package/queries/catalog/cluster-query/cluster-query-format.js +6 -2
- package/queries/catalog/config-query/config-query-format.d.ts +2 -1
- package/queries/catalog/config-query/config-query-format.js +4 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +2 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +4 -3
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +3 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.js +11 -3
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +2 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +12 -3
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +4 -4
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +4 -3
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +2 -1
- package/queries/catalog/id-map-query/id-map-query-format.js +4 -3
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +2 -1
- package/queries/catalog/lineage-query/lineage-query-format.js +7 -3
- package/queries/catalog/linter-query/linter-query-executor.d.ts +3 -0
- package/queries/catalog/linter-query/linter-query-executor.js +28 -0
- package/queries/catalog/linter-query/linter-query-format.d.ts +80 -0
- package/queries/catalog/linter-query/linter-query-format.js +43 -0
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +4 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +2 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +4 -3
- package/queries/catalog/origin-query/origin-query-executor.d.ts +5 -0
- package/queries/catalog/origin-query/origin-query-executor.js +33 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +73 -0
- package/queries/catalog/origin-query/origin-query-format.js +31 -0
- package/queries/catalog/project-query/project-query-executor.js +1 -1
- package/queries/catalog/project-query/project-query-format.d.ts +2 -1
- package/queries/catalog/project-query/project-query-format.js +4 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -3
- package/queries/catalog/search-query/search-query-format.d.ts +2 -1
- package/queries/catalog/search-query/search-query-format.js +7 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +3 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.js +11 -3
- package/queries/query-print.d.ts +1 -1
- package/queries/query-print.js +4 -4
- package/queries/query.d.ts +143 -2
- package/queries/query.js +5 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +5 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +3 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +2 -2
- 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.js +26 -8
- package/r-bridge/retriever.js +2 -2
- package/search/flowr-search-builder.d.ts +31 -2
- package/search/flowr-search-builder.js +30 -0
- package/search/flowr-search.d.ts +7 -1
- package/search/search-executor/search-enrichers.d.ts +73 -0
- package/search/search-executor/search-enrichers.js +98 -0
- package/search/search-executor/search-generators.d.ts +7 -2
- package/search/search-executor/search-generators.js +21 -1
- package/search/search-executor/search-mappers.d.ts +19 -0
- package/search/search-executor/search-mappers.js +21 -0
- package/search/search-executor/search-transformer.d.ts +13 -1
- package/search/search-executor/search-transformer.js +11 -1
- package/slicing/criterion/collect-all.js +1 -1
- package/slicing/static/slice-call.js +13 -3
- package/statistics/features/supported/assignments/post-process.js +1 -1
- package/statistics/features/supported/defined-functions/post-process.js +2 -2
- package/statistics/features/supported/used-functions/post-process.js +1 -1
- package/statistics/features/supported/used-packages/post-process.js +2 -2
- package/statistics/features/supported/values/post-process.js +2 -2
- package/statistics/output/print-stats.js +2 -2
- package/statistics/summarizer/post-process/clusterer.d.ts +1 -1
- package/statistics/summarizer/post-process/clusterer.js +1 -1
- package/statistics/summarizer/post-process/histogram.js +3 -3
- package/statistics/summarizer/post-process/post-process-output.js +3 -3
- package/statistics/summarizer/second-phase/process.js +2 -2
- package/statistics/summarizer/summarizer.js +2 -2
- package/util/assert.js +36 -1
- package/util/cfg/cfg.d.ts +0 -80
- package/util/cfg/cfg.js +0 -549
- package/util/{arrays.d.ts → collections/arrays.d.ts} +1 -1
- package/util/{arrays.js → collections/arrays.js} +3 -3
- package/util/collections/set.js +17 -0
- package/util/diff-graph.d.ts +47 -0
- package/util/diff-graph.js +61 -0
- package/util/diff.d.ts +6 -6
- package/util/diff.js +1 -1
- package/util/mermaid/cfg.d.ts +9 -2
- package/util/mermaid/cfg.js +64 -12
- package/util/mermaid/dfg.d.ts +2 -1
- package/util/mermaid/dfg.js +26 -10
- package/util/mermaid/mermaid.d.ts +2 -0
- package/util/mermaid/mermaid.js +6 -0
- package/util/quads.js +1 -1
- package/util/schema.d.ts +1 -1
- package/util/schema.js +1 -1
- package/util/summarizer.js +1 -1
- package/util/{text.js → text/text.js} +1 -1
- package/util/{time.js → text/time.js} +1 -1
- package/util/version.js +1 -1
- package/dataflow/graph/diff.d.ts +0 -36
- package/util/cfg/happens-before.d.ts +0 -7
- package/util/cfg/visitor.d.ts +0 -9
- package/util/cfg/visitor.js +0 -30
- package/util/set.js +0 -31
- /package/util/{bimap.d.ts → collections/bimap.d.ts} +0 -0
- /package/util/{bimap.js → collections/bimap.js} +0 -0
- /package/util/{defaultmap.d.ts → collections/defaultmap.d.ts} +0 -0
- /package/util/{defaultmap.js → collections/defaultmap.js} +0 -0
- /package/util/{set.d.ts → collections/set.d.ts} +0 -0
- /package/util/{ansi.d.ts → text/ansi.d.ts} +0 -0
- /package/util/{ansi.js → text/ansi.js} +0 -0
- /package/util/{args.d.ts → text/args.d.ts} +0 -0
- /package/util/{args.js → text/args.js} +0 -0
- /package/util/{strings.d.ts → text/strings.d.ts} +0 -0
- /package/util/{strings.js → text/strings.js} +0 -0
- /package/util/{text.d.ts → text/text.d.ts} +0 -0
- /package/util/{time.d.ts → text/time.d.ts} +0 -0
|
@@ -14,7 +14,7 @@ export interface ResolveValueQueryResult extends BaseQueryResult {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const ResolveValueQueryDefinition: {
|
|
16
16
|
readonly executor: typeof executeResolveValueQuery;
|
|
17
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
18
18
|
readonly name: "parse";
|
|
19
19
|
readonly humanReadableName: "parse with R shell";
|
|
20
20
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -69,4 +69,5 @@ export declare const ResolveValueQueryDefinition: {
|
|
|
69
69
|
readonly dependencies: readonly ["normalize"];
|
|
70
70
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
71
71
|
readonly schema: Joi.ObjectSchema<any>;
|
|
72
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
72
73
|
};
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ResolveValueQueryDefinition = void 0;
|
|
7
|
-
const ansi_1 = require("../../../util/ansi");
|
|
8
|
-
const time_1 = require("../../../util/time");
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const time_1 = require("../../../util/text/time");
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const resolve_value_query_executor_1 = require("./resolve-value-query-executor");
|
|
11
11
|
function rValueToAscii(value) {
|
|
@@ -44,6 +44,7 @@ exports.ResolveValueQueryDefinition = {
|
|
|
44
44
|
schema: joi_1.default.object({
|
|
45
45
|
type: joi_1.default.string().valid('resolve-value').required().description('The type of the query.'),
|
|
46
46
|
criteria: joi_1.default.array().items(joi_1.default.string()).min(1).required().description('The slicing criteria to use.'),
|
|
47
|
-
}).description('The resolve value query used to get definitions of an identifier')
|
|
47
|
+
}).description('The resolve value query used to get definitions of an identifier'),
|
|
48
|
+
flattenInvolvedNodes: () => []
|
|
48
49
|
};
|
|
49
50
|
//# sourceMappingURL=resolve-value-query-format.js.map
|
|
@@ -15,7 +15,7 @@ export interface SearchQueryResult extends BaseQueryResult {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const SearchQueryDefinition: {
|
|
17
17
|
readonly executor: typeof executeSearch;
|
|
18
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
18
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
19
19
|
readonly name: "parse";
|
|
20
20
|
readonly humanReadableName: "parse with R shell";
|
|
21
21
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -70,4 +70,5 @@ export declare const SearchQueryDefinition: {
|
|
|
70
70
|
readonly dependencies: readonly ["normalize"];
|
|
71
71
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
72
72
|
readonly schema: Joi.ObjectSchema<any>;
|
|
73
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
73
74
|
};
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.SearchQueryDefinition = void 0;
|
|
7
|
-
const ansi_1 = require("../../../util/ansi");
|
|
8
|
-
const time_1 = require("../../../util/time");
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const time_1 = require("../../../util/text/time");
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const query_print_1 = require("../../query-print");
|
|
11
11
|
const search_query_executor_1 = require("./search-query-executor");
|
|
@@ -24,6 +24,10 @@ exports.SearchQueryDefinition = {
|
|
|
24
24
|
schema: joi_1.default.object({
|
|
25
25
|
type: joi_1.default.string().valid('search').required().description('The type of the query.'),
|
|
26
26
|
search: joi_1.default.object().required().description('The search query to execute.')
|
|
27
|
-
}).description('The search query searches the normalized AST and dataflow graph for nodes that match the given search query.')
|
|
27
|
+
}).description('The search query searches the normalized AST and dataflow graph for nodes that match the given search query.'),
|
|
28
|
+
flattenInvolvedNodes: (queryResults) => {
|
|
29
|
+
const out = queryResults;
|
|
30
|
+
return out.results.flatMap(({ ids }) => ids);
|
|
31
|
+
}
|
|
28
32
|
};
|
|
29
33
|
//# sourceMappingURL=search-query-format.js.map
|
|
@@ -4,6 +4,7 @@ import type { DEFAULT_DATAFLOW_PIPELINE, DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPEL
|
|
|
4
4
|
import type { SlicingCriteria } from '../../../slicing/criterion/parse';
|
|
5
5
|
import Joi from 'joi';
|
|
6
6
|
import { executeStaticSliceQuery } from './static-slice-query-executor';
|
|
7
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
8
|
/** Calculates and returns all clusters encountered in the dataflow graph. */
|
|
8
9
|
export interface StaticSliceQuery extends BaseQueryFormat {
|
|
9
10
|
readonly type: 'static-slice';
|
|
@@ -26,7 +27,7 @@ export interface StaticSliceQueryResult extends BaseQueryResult {
|
|
|
26
27
|
}
|
|
27
28
|
export declare const StaticSliceQueryDefinition: {
|
|
28
29
|
readonly executor: typeof executeStaticSliceQuery;
|
|
29
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
30
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
30
31
|
readonly name: "parse";
|
|
31
32
|
readonly humanReadableName: "parse with R shell";
|
|
32
33
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -81,4 +82,5 @@ export declare const StaticSliceQueryDefinition: {
|
|
|
81
82
|
readonly dependencies: readonly ["normalize"];
|
|
82
83
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
83
84
|
readonly schema: Joi.ObjectSchema<any>;
|
|
85
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
84
86
|
};
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.StaticSliceQueryDefinition = void 0;
|
|
7
|
-
const ansi_1 = require("../../../util/ansi");
|
|
8
|
-
const time_1 = require("../../../util/time");
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const time_1 = require("../../../util/text/time");
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const static_slice_query_executor_1 = require("./static-slice-query-executor");
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
@@ -38,6 +38,14 @@ exports.StaticSliceQueryDefinition = {
|
|
|
38
38
|
criteria: joi_1.default.array().items(joi_1.default.string()).min(0).required().description('The slicing criteria to use.'),
|
|
39
39
|
noReconstruction: joi_1.default.boolean().optional().description('Do not reconstruct the slice into readable code.'),
|
|
40
40
|
noMagicComments: joi_1.default.boolean().optional().description('Should the magic comments (force-including lines within the slice) be ignored?')
|
|
41
|
-
}).description('Slice query used to slice the dataflow graph')
|
|
41
|
+
}).description('Slice query used to slice the dataflow graph'),
|
|
42
|
+
flattenInvolvedNodes: (queryResults) => {
|
|
43
|
+
const flattened = [];
|
|
44
|
+
const out = queryResults;
|
|
45
|
+
for (const [_, obj] of Object.entries(out.results)) {
|
|
46
|
+
flattened.push(...obj.slice.result);
|
|
47
|
+
}
|
|
48
|
+
return flattened;
|
|
49
|
+
}
|
|
42
50
|
};
|
|
43
51
|
//# sourceMappingURL=static-slice-query-format.js.map
|
package/queries/query-print.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OutputFormatter } from '../util/ansi';
|
|
1
|
+
import type { OutputFormatter } from '../util/text/ansi';
|
|
2
2
|
import type { QueryResults, SupportedQueryTypes } from './query';
|
|
3
3
|
import type { PipelineOutput } from '../core/steps/pipeline/pipeline';
|
|
4
4
|
import type { DEFAULT_DATAFLOW_PIPELINE } from '../core/steps/pipeline/default-pipelines';
|
package/queries/query-print.js
CHANGED
|
@@ -3,17 +3,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.asciiCallContext = asciiCallContext;
|
|
4
4
|
exports.summarizeIdsIfTooLong = summarizeIdsIfTooLong;
|
|
5
5
|
exports.asciiSummaryOfQueryResult = asciiSummaryOfQueryResult;
|
|
6
|
-
const ansi_1 = require("../util/ansi");
|
|
6
|
+
const ansi_1 = require("../util/text/ansi");
|
|
7
7
|
const query_1 = require("./query");
|
|
8
8
|
const html_hover_over_1 = require("../util/html-hover-over");
|
|
9
|
-
const time_1 = require("../util/time");
|
|
9
|
+
const time_1 = require("../util/text/time");
|
|
10
10
|
const built_in_1 = require("../dataflow/environments/built-in");
|
|
11
11
|
function nodeString(nodeId, formatter, processed) {
|
|
12
12
|
const isObj = typeof nodeId === 'object' && nodeId !== null && 'id' in nodeId;
|
|
13
13
|
const id = isObj ? nodeId.id : nodeId;
|
|
14
14
|
const info = isObj ? nodeId.info : undefined;
|
|
15
|
-
if (
|
|
16
|
-
return (0, ansi_1.italic)(
|
|
15
|
+
if ((0, built_in_1.isBuiltIn)(id)) {
|
|
16
|
+
return (0, ansi_1.italic)(id, formatter) + (info ? ` (${JSON.stringify(info)})` : '');
|
|
17
17
|
}
|
|
18
18
|
const node = processed.normalize.idMap.get(id);
|
|
19
19
|
if (node === undefined) {
|
package/queries/query.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { LineageQuery } from './catalog/lineage-query/lineage-query-format'
|
|
|
9
9
|
import type { StaticSliceQuery } from './catalog/static-slice-query/static-slice-query-format';
|
|
10
10
|
import type { DataflowClusterQuery } from './catalog/cluster-query/cluster-query-format';
|
|
11
11
|
import type { DependenciesQuery } from './catalog/dependencies-query/dependencies-query-format';
|
|
12
|
-
import type { OutputFormatter } from '../util/ansi';
|
|
12
|
+
import type { OutputFormatter } from '../util/text/ansi';
|
|
13
13
|
import type { PipelineOutput } from '../core/steps/pipeline/pipeline';
|
|
14
14
|
import type { DEFAULT_DATAFLOW_PIPELINE } from '../core/steps/pipeline/default-pipelines';
|
|
15
15
|
import Joi from 'joi';
|
|
@@ -20,7 +20,10 @@ import type { HappensBeforeQuery } from './catalog/happens-before-query/happens-
|
|
|
20
20
|
import type { ResolveValueQuery } from './catalog/resolve-value-query/resolve-value-query-format';
|
|
21
21
|
import type { DataflowLensQuery } from './catalog/dataflow-lens-query/dataflow-lens-query-format';
|
|
22
22
|
import type { ProjectQuery } from './catalog/project-query/project-query-format';
|
|
23
|
-
|
|
23
|
+
import type { OriginQuery } from './catalog/origin-query/origin-query-format';
|
|
24
|
+
import type { LinterQuery } from './catalog/linter-query/linter-query-format';
|
|
25
|
+
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
26
|
+
export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DataflowLensQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | LineageQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery;
|
|
24
27
|
export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
|
|
25
28
|
type: QueryType;
|
|
26
29
|
};
|
|
@@ -32,17 +35,24 @@ export interface SupportedQuery<QueryType extends BaseQueryFormat['type']> {
|
|
|
32
35
|
executor: QueryExecutor<QueryArgumentsWithType<QueryType>, BaseQueryResult>;
|
|
33
36
|
asciiSummarizer: (formatter: OutputFormatter, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>, queryResults: BaseQueryResult, resultStrings: string[]) => boolean;
|
|
34
37
|
schema: Joi.ObjectSchema;
|
|
38
|
+
/**
|
|
39
|
+
* Flattens the involved query nodes to be added to a flowR search when the {@link fromQuery} function is used based on the given result after this query is executed.
|
|
40
|
+
* If this query does not involve any nodes, an empty array can be returned.
|
|
41
|
+
*/
|
|
42
|
+
flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
35
43
|
}
|
|
36
44
|
export declare const SupportedQueries: {
|
|
37
45
|
readonly 'call-context': {
|
|
38
46
|
readonly executor: typeof import("./catalog/call-context-query/call-context-query-executor").executeCallContextQueries;
|
|
39
47
|
readonly asciiSummarizer: (formatter: OutputFormatter, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
40
48
|
readonly schema: Joi.ObjectSchema<any>;
|
|
49
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
41
50
|
};
|
|
42
51
|
readonly config: {
|
|
43
52
|
readonly executor: typeof import("./catalog/config-query/config-query-executor").executeConfigQuery;
|
|
44
53
|
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: unknown, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
45
54
|
readonly schema: Joi.ObjectSchema<any>;
|
|
55
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
46
56
|
};
|
|
47
57
|
readonly dataflow: {
|
|
48
58
|
readonly executor: typeof import("./catalog/dataflow-query/dataflow-query-executor").executeDataflowQuery;
|
|
@@ -101,6 +111,7 @@ export declare const SupportedQueries: {
|
|
|
101
111
|
readonly dependencies: readonly ["normalize"];
|
|
102
112
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
103
113
|
readonly schema: Joi.ObjectSchema<any>;
|
|
114
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
104
115
|
};
|
|
105
116
|
readonly 'dataflow-lens': {
|
|
106
117
|
readonly executor: typeof import("./catalog/dataflow-lens-query/dataflow-lens-query-executor").executeDataflowLensQuery;
|
|
@@ -159,6 +170,7 @@ export declare const SupportedQueries: {
|
|
|
159
170
|
readonly dependencies: readonly ["normalize"];
|
|
160
171
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
161
172
|
readonly schema: Joi.ObjectSchema<any>;
|
|
173
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
162
174
|
};
|
|
163
175
|
readonly 'id-map': {
|
|
164
176
|
readonly executor: typeof import("./catalog/id-map-query/id-map-query-executor").executeIdMapQuery;
|
|
@@ -217,6 +229,7 @@ export declare const SupportedQueries: {
|
|
|
217
229
|
readonly dependencies: readonly ["normalize"];
|
|
218
230
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
219
231
|
readonly schema: Joi.ObjectSchema<any>;
|
|
232
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
220
233
|
};
|
|
221
234
|
readonly 'normalized-ast': {
|
|
222
235
|
readonly executor: typeof import("./catalog/normalized-ast-query/normalized-ast-query-executor").executeNormalizedAstQuery;
|
|
@@ -275,6 +288,7 @@ export declare const SupportedQueries: {
|
|
|
275
288
|
readonly dependencies: readonly ["normalize"];
|
|
276
289
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
277
290
|
readonly schema: Joi.ObjectSchema<any>;
|
|
291
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
278
292
|
};
|
|
279
293
|
readonly 'dataflow-cluster': {
|
|
280
294
|
readonly executor: typeof import("./catalog/cluster-query/cluster-query-executor").executeDataflowClusterQuery;
|
|
@@ -333,6 +347,7 @@ export declare const SupportedQueries: {
|
|
|
333
347
|
readonly dependencies: readonly ["normalize"];
|
|
334
348
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
335
349
|
readonly schema: Joi.ObjectSchema<any>;
|
|
350
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
336
351
|
};
|
|
337
352
|
readonly 'static-slice': {
|
|
338
353
|
readonly executor: typeof import("./catalog/static-slice-query/static-slice-query-executor").executeStaticSliceQuery;
|
|
@@ -391,6 +406,7 @@ export declare const SupportedQueries: {
|
|
|
391
406
|
readonly dependencies: readonly ["normalize"];
|
|
392
407
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
393
408
|
readonly schema: Joi.ObjectSchema<any>;
|
|
409
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
394
410
|
};
|
|
395
411
|
readonly lineage: {
|
|
396
412
|
readonly executor: typeof import("./catalog/lineage-query/lineage-query-executor").executeLineageQuery;
|
|
@@ -449,6 +465,7 @@ export declare const SupportedQueries: {
|
|
|
449
465
|
readonly dependencies: readonly ["normalize"];
|
|
450
466
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
451
467
|
readonly schema: Joi.ObjectSchema<any>;
|
|
468
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
452
469
|
};
|
|
453
470
|
readonly dependencies: {
|
|
454
471
|
readonly executor: typeof import("./catalog/dependencies-query/dependencies-query-executor").executeDependenciesQuery;
|
|
@@ -507,11 +524,13 @@ export declare const SupportedQueries: {
|
|
|
507
524
|
readonly dependencies: readonly ["normalize"];
|
|
508
525
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
509
526
|
readonly schema: Joi.ObjectSchema<any>;
|
|
527
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
510
528
|
};
|
|
511
529
|
readonly 'location-map': {
|
|
512
530
|
readonly executor: typeof import("./catalog/location-map-query/location-map-query-executor").executeLocationMapQuery;
|
|
513
531
|
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: unknown, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
514
532
|
readonly schema: Joi.ObjectSchema<any>;
|
|
533
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
515
534
|
};
|
|
516
535
|
readonly search: {
|
|
517
536
|
readonly executor: typeof import("./catalog/search-query/search-query-executor").executeSearch;
|
|
@@ -570,6 +589,7 @@ export declare const SupportedQueries: {
|
|
|
570
589
|
readonly dependencies: readonly ["normalize"];
|
|
571
590
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
572
591
|
readonly schema: Joi.ObjectSchema<any>;
|
|
592
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
573
593
|
};
|
|
574
594
|
readonly 'happens-before': {
|
|
575
595
|
readonly executor: typeof import("./catalog/happens-before-query/happens-before-query-executor").executeHappensBefore;
|
|
@@ -628,6 +648,7 @@ export declare const SupportedQueries: {
|
|
|
628
648
|
readonly dependencies: readonly ["normalize"];
|
|
629
649
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
630
650
|
readonly schema: Joi.ObjectSchema<any>;
|
|
651
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
631
652
|
};
|
|
632
653
|
readonly 'resolve-value': {
|
|
633
654
|
readonly executor: typeof import("./catalog/resolve-value-query/resolve-value-query-executor").executeResolveValueQuery;
|
|
@@ -686,6 +707,7 @@ export declare const SupportedQueries: {
|
|
|
686
707
|
readonly dependencies: readonly ["normalize"];
|
|
687
708
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
688
709
|
readonly schema: Joi.ObjectSchema<any>;
|
|
710
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
689
711
|
};
|
|
690
712
|
readonly project: {
|
|
691
713
|
readonly executor: typeof import("./catalog/project-query/project-query-executor").executeProjectQuery;
|
|
@@ -744,6 +766,125 @@ export declare const SupportedQueries: {
|
|
|
744
766
|
readonly dependencies: readonly ["normalize"];
|
|
745
767
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
746
768
|
readonly schema: Joi.ObjectSchema<any>;
|
|
769
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
770
|
+
};
|
|
771
|
+
readonly origin: {
|
|
772
|
+
readonly executor: typeof import("./catalog/origin-query/origin-query-executor").executeResolveValueQuery;
|
|
773
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: PipelineOutput<import("../core/steps/pipeline/pipeline").Pipeline<{
|
|
774
|
+
readonly name: "parse";
|
|
775
|
+
readonly humanReadableName: "parse with R shell";
|
|
776
|
+
readonly description: "Parse the given R code into an AST";
|
|
777
|
+
readonly processor: (_results: unknown, input: Partial<import("../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../r-bridge/parser").ParseStepOutput<string>>;
|
|
778
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
779
|
+
readonly printer: {
|
|
780
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
781
|
+
readonly 2: {
|
|
782
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
783
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
784
|
+
};
|
|
785
|
+
readonly 5: ({ parsed }: import("../r-bridge/parser").ParseStepOutput<string>, config: import("../util/quads").QuadSerializationConfiguration) => string;
|
|
786
|
+
};
|
|
787
|
+
readonly dependencies: readonly [];
|
|
788
|
+
readonly requiredInput: import("../r-bridge/parser").ParseRequiredInput<string>;
|
|
789
|
+
} | {
|
|
790
|
+
readonly name: "normalize";
|
|
791
|
+
readonly humanReadableName: "normalize";
|
|
792
|
+
readonly description: "Normalize the AST to flowR's AST";
|
|
793
|
+
readonly processor: (results: {
|
|
794
|
+
parse?: import("../r-bridge/parser").ParseStepOutput<string>;
|
|
795
|
+
}, input: Partial<import("../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => 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>>;
|
|
796
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
797
|
+
readonly printer: {
|
|
798
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
799
|
+
readonly 2: typeof import("../core/print/normalize-printer").normalizedAstToJson;
|
|
800
|
+
readonly 5: typeof import("../core/print/normalize-printer").normalizedAstToQuads;
|
|
801
|
+
readonly 3: typeof import("../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
802
|
+
readonly 4: typeof import("../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
803
|
+
};
|
|
804
|
+
readonly dependencies: readonly ["parse"];
|
|
805
|
+
readonly requiredInput: import("../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
806
|
+
} | {
|
|
807
|
+
readonly humanReadableName: "dataflow";
|
|
808
|
+
readonly processor: (results: {
|
|
809
|
+
normalize?: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
810
|
+
}, input: {
|
|
811
|
+
request?: import("../r-bridge/retriever").RParseRequests;
|
|
812
|
+
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
813
|
+
}) => import("../dataflow/info").DataflowInformation;
|
|
814
|
+
readonly requiredInput: {};
|
|
815
|
+
readonly name: "dataflow";
|
|
816
|
+
readonly description: "Construct the dataflow graph";
|
|
817
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
818
|
+
readonly printer: {
|
|
819
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
820
|
+
readonly 2: typeof import("../core/print/dataflow-printer").dataflowGraphToJson;
|
|
821
|
+
readonly 5: typeof import("../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
822
|
+
readonly 3: typeof import("../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
823
|
+
readonly 4: typeof import("../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
824
|
+
};
|
|
825
|
+
readonly dependencies: readonly ["normalize"];
|
|
826
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
827
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
828
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
829
|
+
};
|
|
830
|
+
readonly linter: {
|
|
831
|
+
readonly executor: typeof import("./catalog/linter-query/linter-query-executor").executeLinterQuery;
|
|
832
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: PipelineOutput<import("../core/steps/pipeline/pipeline").Pipeline<{
|
|
833
|
+
readonly name: "parse";
|
|
834
|
+
readonly humanReadableName: "parse with R shell";
|
|
835
|
+
readonly description: "Parse the given R code into an AST";
|
|
836
|
+
readonly processor: (_results: unknown, input: Partial<import("../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../r-bridge/parser").ParseStepOutput<string>>;
|
|
837
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
838
|
+
readonly printer: {
|
|
839
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
840
|
+
readonly 2: {
|
|
841
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
842
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
843
|
+
};
|
|
844
|
+
readonly 5: ({ parsed }: import("../r-bridge/parser").ParseStepOutput<string>, config: import("../util/quads").QuadSerializationConfiguration) => string;
|
|
845
|
+
};
|
|
846
|
+
readonly dependencies: readonly [];
|
|
847
|
+
readonly requiredInput: import("../r-bridge/parser").ParseRequiredInput<string>;
|
|
848
|
+
} | {
|
|
849
|
+
readonly name: "normalize";
|
|
850
|
+
readonly humanReadableName: "normalize";
|
|
851
|
+
readonly description: "Normalize the AST to flowR's AST";
|
|
852
|
+
readonly processor: (results: {
|
|
853
|
+
parse?: import("../r-bridge/parser").ParseStepOutput<string>;
|
|
854
|
+
}, input: Partial<import("../core/steps/all/core/10-normalize").NormalizeRequiredInput>) => 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>>;
|
|
855
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
856
|
+
readonly printer: {
|
|
857
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
858
|
+
readonly 2: typeof import("../core/print/normalize-printer").normalizedAstToJson;
|
|
859
|
+
readonly 5: typeof import("../core/print/normalize-printer").normalizedAstToQuads;
|
|
860
|
+
readonly 3: typeof import("../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
861
|
+
readonly 4: typeof import("../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
862
|
+
};
|
|
863
|
+
readonly dependencies: readonly ["parse"];
|
|
864
|
+
readonly requiredInput: import("../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
865
|
+
} | {
|
|
866
|
+
readonly humanReadableName: "dataflow";
|
|
867
|
+
readonly processor: (results: {
|
|
868
|
+
normalize?: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
869
|
+
}, input: {
|
|
870
|
+
request?: import("../r-bridge/retriever").RParseRequests;
|
|
871
|
+
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
872
|
+
}) => import("../dataflow/info").DataflowInformation;
|
|
873
|
+
readonly requiredInput: {};
|
|
874
|
+
readonly name: "dataflow";
|
|
875
|
+
readonly description: "Construct the dataflow graph";
|
|
876
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
877
|
+
readonly printer: {
|
|
878
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
879
|
+
readonly 2: typeof import("../core/print/dataflow-printer").dataflowGraphToJson;
|
|
880
|
+
readonly 5: typeof import("../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
881
|
+
readonly 3: typeof import("../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
882
|
+
readonly 4: typeof import("../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
883
|
+
};
|
|
884
|
+
readonly dependencies: readonly ["normalize"];
|
|
885
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
886
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
887
|
+
readonly flattenInvolvedNodes: () => never[];
|
|
747
888
|
};
|
|
748
889
|
};
|
|
749
890
|
export type SupportedQueryTypes = keyof typeof SupportedQueries;
|
package/queries/query.js
CHANGED
|
@@ -28,6 +28,8 @@ const happens_before_query_format_1 = require("./catalog/happens-before-query/ha
|
|
|
28
28
|
const resolve_value_query_format_1 = require("./catalog/resolve-value-query/resolve-value-query-format");
|
|
29
29
|
const dataflow_lens_query_format_1 = require("./catalog/dataflow-lens-query/dataflow-lens-query-format");
|
|
30
30
|
const project_query_format_1 = require("./catalog/project-query/project-query-format");
|
|
31
|
+
const origin_query_format_1 = require("./catalog/origin-query/origin-query-format");
|
|
32
|
+
const linter_query_format_1 = require("./catalog/linter-query/linter-query-format");
|
|
31
33
|
exports.SupportedQueries = {
|
|
32
34
|
'call-context': call_context_query_format_1.CallContextQueryDefinition,
|
|
33
35
|
'config': config_query_format_1.ConfigQueryDefinition,
|
|
@@ -43,7 +45,9 @@ exports.SupportedQueries = {
|
|
|
43
45
|
'search': search_query_format_1.SearchQueryDefinition,
|
|
44
46
|
'happens-before': happens_before_query_format_1.HappensBeforeQueryDefinition,
|
|
45
47
|
'resolve-value': resolve_value_query_format_1.ResolveValueQueryDefinition,
|
|
46
|
-
'project': project_query_format_1.ProjectQueryDefinition
|
|
48
|
+
'project': project_query_format_1.ProjectQueryDefinition,
|
|
49
|
+
'origin': origin_query_format_1.OriginQueryDefinition,
|
|
50
|
+
'linter': linter_query_format_1.LinterQueryDefinition
|
|
47
51
|
};
|
|
48
52
|
function executeQueriesOfSameType(data, ...queries) {
|
|
49
53
|
(0, assert_1.guard)(queries.length > 0, 'At least one query must be provided');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Leaf, Location, NoInfo } from '../model';
|
|
2
|
-
import
|
|
1
|
+
import type { Leaf, Location, NoInfo, RNode } from '../model';
|
|
2
|
+
import { RType } from '../type';
|
|
3
3
|
import type { RNumberValue } from '../../../convert-values';
|
|
4
4
|
/**
|
|
5
5
|
* A number like `3`, `-2.14`, `1L`, or `2i`.
|
|
@@ -10,3 +10,4 @@ export interface RNumber<Info = NoInfo> extends Leaf<Info>, Location {
|
|
|
10
10
|
readonly type: RType.Number;
|
|
11
11
|
content: RNumberValue;
|
|
12
12
|
}
|
|
13
|
+
export declare function isRNumber(node: RNode | undefined): node is RNumber;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Leaf, Location, NoInfo } from '../model';
|
|
2
|
-
import type { RType } from '../type';
|
|
1
|
+
import type { Leaf, Location, NoInfo, RNode } from '../model';
|
|
3
2
|
import type { RStringValue } from '../../../convert-values';
|
|
3
|
+
import { RType } from '../type';
|
|
4
4
|
/**
|
|
5
5
|
* Represents a string like `"hello"`, including raw strings like `r"(hello)"`.
|
|
6
6
|
*/
|
|
@@ -8,3 +8,4 @@ export interface RString<Info = NoInfo> extends Leaf<Info>, Location {
|
|
|
8
8
|
readonly type: RType.String;
|
|
9
9
|
content: RStringValue;
|
|
10
10
|
}
|
|
11
|
+
export declare function isRString(node: RNode | undefined): node is RString;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type { NoInfo, RNode } from '../model';
|
|
12
12
|
import type { SourceRange } from '../../../../../util/range';
|
|
13
|
-
import { BiMap } from '../../../../../util/bimap';
|
|
13
|
+
import { BiMap } from '../../../../../util/collections/bimap';
|
|
14
14
|
import type { MergeableRecord } from '../../../../../util/objects';
|
|
15
15
|
import { RoleInParent } from './role';
|
|
16
16
|
import type { NodeId } from './node-id';
|
|
@@ -17,7 +17,7 @@ exports.nodeToLocationId = nodeToLocationId;
|
|
|
17
17
|
exports.deterministicLocationIdGenerator = deterministicLocationIdGenerator;
|
|
18
18
|
exports.decorateAst = decorateAst;
|
|
19
19
|
const assert_1 = require("../../../../../util/assert");
|
|
20
|
-
const bimap_1 = require("../../../../../util/bimap");
|
|
20
|
+
const bimap_1 = require("../../../../../util/collections/bimap");
|
|
21
21
|
const type_1 = require("../type");
|
|
22
22
|
const stateful_fold_1 = require("./stateful-fold");
|
|
23
23
|
const r_function_call_1 = require("../nodes/r-function-call");
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.foldAst = foldAst;
|
|
4
4
|
const stateful_fold_1 = require("./stateful-fold");
|
|
5
|
-
|
|
5
|
+
function down() {
|
|
6
|
+
return undefined;
|
|
7
|
+
}
|
|
6
8
|
/**
|
|
7
9
|
* Folds in old functional-fashion over the AST structure.
|
|
8
10
|
* <p>
|
|
@@ -47,7 +47,7 @@ export interface StatefulFoldFunctions<Info, Down, Up> {
|
|
|
47
47
|
foldWhile: (loop: RWhileLoop<Info>, condition: Up, body: Up, down: Down) => Up;
|
|
48
48
|
foldRepeat: (loop: RRepeatLoop<Info>, body: Up, down: Down) => Up;
|
|
49
49
|
foldNext: (next: RNext<Info>, down: Down) => Up;
|
|
50
|
-
foldBreak: (
|
|
50
|
+
foldBreak: (brk: RBreak<Info>, down: Down) => Up;
|
|
51
51
|
};
|
|
52
52
|
other: {
|
|
53
53
|
foldComment: (comment: RComment<Info>, down: Down) => Up;
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.normalizeExpression = normalizeExpression;
|
|
4
4
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
5
5
|
const normalize_access_1 = require("../normalize-access");
|
|
6
|
-
const arrays_1 = require("../../../../../../../util/arrays");
|
|
6
|
+
const arrays_1 = require("../../../../../../../util/collections/arrays");
|
|
7
7
|
const normalize_expressions_1 = require("../structure/normalize-expressions");
|
|
8
8
|
const normalize_call_1 = require("../functions/normalize-call");
|
|
9
9
|
const normalize_definition_1 = require("../functions/normalize-definition");
|
|
@@ -6,7 +6,7 @@ const normalize_meta_1 = require("../../normalize-meta");
|
|
|
6
6
|
const assert_1 = require("../../../../../../../util/assert");
|
|
7
7
|
const type_1 = require("../../../../model/type");
|
|
8
8
|
const normalize_single_node_1 = require("../structure/normalize-single-node");
|
|
9
|
-
const strings_1 = require("../../../../../../../util/strings");
|
|
9
|
+
const strings_1 = require("../../../../../../../util/text/strings");
|
|
10
10
|
/**
|
|
11
11
|
* Either parses `[expr]` or `[SYMBOL_SUB, EQ_SUB, expr]` as an argument of a function call in R.
|
|
12
12
|
* Probably directly called by the function call parser as otherwise, we do not expect to find arguments.
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.tryNormalizeFunctionCall = tryNormalizeFunctionCall;
|
|
4
4
|
const parser_1 = require("../../../json/parser");
|
|
5
5
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
6
|
-
const arrays_1 = require("../../../../../../../util/arrays");
|
|
6
|
+
const arrays_1 = require("../../../../../../../util/collections/arrays");
|
|
7
7
|
const assert_1 = require("../../../../../../../util/assert");
|
|
8
8
|
const normalize_argument_1 = require("./normalize-argument");
|
|
9
9
|
const r_function_call_1 = require("../../../../model/nodes/r-function-call");
|
|
@@ -4,7 +4,7 @@ exports.tryNormalizeFunctionDefinition = tryNormalizeFunctionDefinition;
|
|
|
4
4
|
const parser_1 = require("../../../json/parser");
|
|
5
5
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
6
6
|
const assert_1 = require("../../../../../../../util/assert");
|
|
7
|
-
const arrays_1 = require("../../../../../../../util/arrays");
|
|
7
|
+
const arrays_1 = require("../../../../../../../util/collections/arrays");
|
|
8
8
|
const normalize_parameter_1 = require("./normalize-parameter");
|
|
9
9
|
const type_1 = require("../../../../model/type");
|
|
10
10
|
const normalize_expressions_1 = require("../structure/normalize-expressions");
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.tryNormalizeAccess = tryNormalizeAccess;
|
|
4
4
|
const normalize_argument_1 = require("./functions/normalize-argument");
|
|
5
5
|
const parser_1 = require("../../json/parser");
|
|
6
|
-
const arrays_1 = require("../../../../../../util/arrays");
|
|
6
|
+
const arrays_1 = require("../../../../../../util/collections/arrays");
|
|
7
7
|
const assert_1 = require("../../../../../../util/assert");
|
|
8
8
|
const normalize_meta_1 = require("../normalize-meta");
|
|
9
9
|
const type_1 = require("../../../model/type");
|
|
@@ -6,7 +6,7 @@ const parser_1 = require("../../../json/parser");
|
|
|
6
6
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
7
7
|
const assert_1 = require("../../../../../../../util/assert");
|
|
8
8
|
const log_1 = require("../../../../../../../util/log");
|
|
9
|
-
const strings_1 = require("../../../../../../../util/strings");
|
|
9
|
+
const strings_1 = require("../../../../../../../util/text/strings");
|
|
10
10
|
const type_1 = require("../../../../model/type");
|
|
11
11
|
const operators_1 = require("../../../../model/operators");
|
|
12
12
|
const normalize_single_node_1 = require("../structure/normalize-single-node");
|
|
@@ -4,7 +4,7 @@ exports.normalizeRootObjToAst = normalizeRootObjToAst;
|
|
|
4
4
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
5
5
|
const normalize_expressions_1 = require("./normalize-expressions");
|
|
6
6
|
const log_1 = require("../../../../../../../util/log");
|
|
7
|
-
const arrays_1 = require("../../../../../../../util/arrays");
|
|
7
|
+
const arrays_1 = require("../../../../../../../util/collections/arrays");
|
|
8
8
|
const type_1 = require("../../../../model/type");
|
|
9
9
|
/**
|
|
10
10
|
* Takes the parse dta as object and produces an undecorated, normalized AST.
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.tryNormalizeSymbol = tryNormalizeSymbol;
|
|
4
4
|
const assert_1 = require("../../../../../../../util/assert");
|
|
5
5
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
6
|
-
const strings_1 = require("../../../../../../../util/strings");
|
|
6
|
+
const strings_1 = require("../../../../../../../util/text/strings");
|
|
7
7
|
const type_1 = require("../../../../model/type");
|
|
8
8
|
/**
|
|
9
9
|
* Normalize the given object as an R symbol (incorporating namespace information).
|