@eagleoutice/flowr 2.2.12 → 2.2.13
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 +19 -14
- 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 +505 -17
- 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-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/package.json +9 -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 +1 -1
- package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
- 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 +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.js +1 -1
- package/queries/catalog/config-query/config-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +2 -2
- 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 +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-format.js +2 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +2 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -2
- 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 +71 -0
- package/queries/catalog/origin-query/origin-query-format.js +27 -0
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.js +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -2
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.js +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.js +2 -2
- package/queries/query-print.d.ts +1 -1
- package/queries/query-print.js +4 -4
- package/queries/query.d.ts +61 -2
- package/queries/query.js +3 -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 +1 -1
- package/search/search-executor/search-generators.d.ts +1 -1
- package/search/search-executor/search-transformer.d.ts +1 -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
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DataflowLensQueryDefinition = void 0;
|
|
7
7
|
const dataflow_lens_query_executor_1 = require("./dataflow-lens-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
11
11
|
const joi_1 = __importDefault(require("joi"));
|
|
12
12
|
exports.DataflowLensQueryDefinition = {
|
|
@@ -14,7 +14,7 @@ export interface DataflowQueryResult extends BaseQueryResult {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const DataflowQueryDefinition: {
|
|
16
16
|
readonly executor: typeof executeDataflowQuery;
|
|
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";
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DataflowQueryDefinition = void 0;
|
|
7
7
|
const dataflow_query_executor_1 = require("./dataflow-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
11
11
|
const joi_1 = __importDefault(require("joi"));
|
|
12
12
|
exports.DataflowQueryDefinition = {
|
|
@@ -17,6 +17,7 @@ const source_functions_1 = require("./function-info/source-functions");
|
|
|
17
17
|
const read_functions_1 = require("./function-info/read-functions");
|
|
18
18
|
const write_functions_1 = require("./function-info/write-functions");
|
|
19
19
|
const function_info_1 = require("./function-info/function-info");
|
|
20
|
+
const identify_link_to_last_call_relation_1 = require("../call-context-query/identify-link-to-last-call-relation");
|
|
20
21
|
function collectNamespaceAccesses(data, libraries) {
|
|
21
22
|
/* for libraries, we have to additionally track all uses of `::` and `:::`, for this we currently simply traverse all uses */
|
|
22
23
|
(0, visitor_1.visitAst)(data.ast.ast, n => {
|
|
@@ -96,6 +97,7 @@ function makeCallContextQuery(functions, kind) {
|
|
|
96
97
|
return functions.map(f => ({
|
|
97
98
|
type: 'call-context',
|
|
98
99
|
callName: f.name,
|
|
100
|
+
callTargets: identify_link_to_last_call_relation_1.CallTargets.MustIncludeGlobal,
|
|
99
101
|
includeAliases: false,
|
|
100
102
|
callNameExact: true,
|
|
101
103
|
subkind: f.name,
|
|
@@ -279,9 +281,9 @@ function getArgumentValue(data, vertex, argumentIndex, argumentName, resolveValu
|
|
|
279
281
|
return undefined;
|
|
280
282
|
}
|
|
281
283
|
function getFunctionsToCheck(customFunctions, ignoreDefaultFunctions, defaultFunctions) {
|
|
282
|
-
|
|
284
|
+
let functions = ignoreDefaultFunctions ? [] : [...defaultFunctions];
|
|
283
285
|
if (customFunctions) {
|
|
284
|
-
functions.
|
|
286
|
+
functions = functions.concat(customFunctions);
|
|
285
287
|
}
|
|
286
288
|
return functions;
|
|
287
289
|
}
|
|
@@ -39,7 +39,7 @@ export type WriteInfo = (DependencyInfo & {
|
|
|
39
39
|
});
|
|
40
40
|
export declare const DependenciesQueryDefinition: {
|
|
41
41
|
readonly executor: typeof executeDependenciesQuery;
|
|
42
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
42
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
43
43
|
readonly name: "parse";
|
|
44
44
|
readonly humanReadableName: "parse with R shell";
|
|
45
45
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DependenciesQueryDefinition = exports.Unknown = 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 dependencies_query_executor_1 = require("./dependencies-query-executor");
|
|
11
11
|
exports.Unknown = 'unknown';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { BasicQueryData } from '../../base-query-format';
|
|
2
2
|
import type { HappensBeforeQuery, HappensBeforeQueryResult } from './happens-before-query-format';
|
|
3
|
-
export declare function executeHappensBefore({ ast
|
|
3
|
+
export declare function executeHappensBefore({ ast }: BasicQueryData, queries: readonly HappensBeforeQuery[]): HappensBeforeQueryResult;
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.executeHappensBefore = executeHappensBefore;
|
|
4
4
|
const logic_1 = require("../../../util/logic");
|
|
5
5
|
const log_1 = require("../../../util/log");
|
|
6
|
-
const
|
|
7
|
-
const happens_before_1 = require("../../../
|
|
6
|
+
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
7
|
+
const happens_before_1 = require("../../../control-flow/happens-before");
|
|
8
8
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
9
|
-
function executeHappensBefore({ ast
|
|
9
|
+
function executeHappensBefore({ ast }, queries) {
|
|
10
10
|
const start = Date.now();
|
|
11
11
|
const results = {};
|
|
12
|
-
const cfg = (0,
|
|
12
|
+
const cfg = (0, extract_cfg_1.extractSimpleCfg)(ast);
|
|
13
13
|
for (const query of queries) {
|
|
14
14
|
const { a, b } = query;
|
|
15
15
|
const fingerprint = `${a}<${b}`;
|
|
@@ -13,7 +13,7 @@ export interface HappensBeforeQueryResult extends BaseQueryResult {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const HappensBeforeQueryDefinition: {
|
|
15
15
|
readonly executor: typeof executeHappensBefore;
|
|
16
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
17
17
|
readonly name: "parse";
|
|
18
18
|
readonly humanReadableName: "parse with R shell";
|
|
19
19
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.HappensBeforeQueryDefinition = 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 happens_before_query_executor_1 = require("./happens-before-query-executor");
|
|
11
11
|
exports.HappensBeforeQueryDefinition = {
|
|
@@ -10,7 +10,7 @@ export interface IdMapQueryResult extends BaseQueryResult {
|
|
|
10
10
|
}
|
|
11
11
|
export declare const IdMapQueryDefinition: {
|
|
12
12
|
readonly executor: typeof executeIdMapQuery;
|
|
13
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
13
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
14
14
|
readonly name: "parse";
|
|
15
15
|
readonly humanReadableName: "parse with R shell";
|
|
16
16
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IdMapQueryDefinition = void 0;
|
|
7
7
|
const id_map_query_executor_1 = require("./id-map-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const joi_1 = __importDefault(require("joi"));
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
exports.IdMapQueryDefinition = {
|
|
@@ -16,7 +16,7 @@ export interface LineageQueryResult extends BaseQueryResult {
|
|
|
16
16
|
}
|
|
17
17
|
export declare const LineageQueryDefinition: {
|
|
18
18
|
readonly executor: typeof executeLineageQuery;
|
|
19
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
19
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
20
20
|
readonly name: "parse";
|
|
21
21
|
readonly humanReadableName: "parse with R shell";
|
|
22
22
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -4,8 +4,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LineageQueryDefinition = 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 lineage_query_executor_1 = require("./lineage-query-executor");
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import { executeLocationMapQuery } from './location-map-query-executor';
|
|
3
|
-
import { type OutputFormatter } from '../../../util/ansi';
|
|
3
|
+
import { type OutputFormatter } from '../../../util/text/ansi';
|
|
4
4
|
import Joi from 'joi';
|
|
5
5
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
6
|
import type { SourceRange } from '../../../util/range';
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.LocationMapQueryDefinition = void 0;
|
|
7
7
|
const location_map_query_executor_1 = require("./location-map-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const joi_1 = __importDefault(require("joi"));
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
exports.LocationMapQueryDefinition = {
|
|
@@ -13,7 +13,7 @@ export interface NormalizedAstQueryResult extends BaseQueryResult {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const NormalizedAstQueryDefinition: {
|
|
15
15
|
readonly executor: typeof executeNormalizedAstQuery;
|
|
16
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
17
17
|
readonly name: "parse";
|
|
18
18
|
readonly humanReadableName: "parse with R shell";
|
|
19
19
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.NormalizedAstQueryDefinition = void 0;
|
|
7
7
|
const normalized_ast_query_executor_1 = require("./normalized-ast-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const ast_1 = require("../../../util/mermaid/ast");
|
|
11
11
|
const joi_1 = __importDefault(require("joi"));
|
|
12
12
|
exports.NormalizedAstQueryDefinition = {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
2
|
+
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
3
|
+
import type { OriginQueryResult, OriginQuery } from './origin-query-format';
|
|
4
|
+
export declare function fingerPrintOfQuery(query: OriginQuery): SingleSlicingCriterion;
|
|
5
|
+
export declare function executeResolveValueQuery({ dataflow: { graph }, ast }: BasicQueryData, queries: readonly OriginQuery[]): OriginQueryResult;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fingerPrintOfQuery = fingerPrintOfQuery;
|
|
4
|
+
exports.executeResolveValueQuery = executeResolveValueQuery;
|
|
5
|
+
const log_1 = require("../../../util/log");
|
|
6
|
+
const parse_1 = require("../../../slicing/criterion/parse");
|
|
7
|
+
const dfg_get_origin_1 = require("../../../dataflow/origin/dfg-get-origin");
|
|
8
|
+
function fingerPrintOfQuery(query) {
|
|
9
|
+
return query.criterion;
|
|
10
|
+
}
|
|
11
|
+
function executeResolveValueQuery({ dataflow: { graph }, ast }, queries) {
|
|
12
|
+
const start = Date.now();
|
|
13
|
+
const results = {};
|
|
14
|
+
for (const query of queries) {
|
|
15
|
+
const key = fingerPrintOfQuery(query);
|
|
16
|
+
if (results[key]) {
|
|
17
|
+
log_1.log.warn(`Duplicate Key for origin-query: ${key}, skipping...`);
|
|
18
|
+
}
|
|
19
|
+
const astId = (0, parse_1.slicingCriterionToId)(key, ast.idMap);
|
|
20
|
+
if (astId === undefined) {
|
|
21
|
+
log_1.log.warn(`Could not resolve id for ${key}, skipping...`);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
results[key] = (0, dfg_get_origin_1.getOriginInDfg)(graph, astId);
|
|
25
|
+
}
|
|
26
|
+
return {
|
|
27
|
+
'.meta': {
|
|
28
|
+
timing: Date.now() - start
|
|
29
|
+
},
|
|
30
|
+
results
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=origin-query-executor.js.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
3
|
+
import Joi from 'joi';
|
|
4
|
+
import { executeResolveValueQuery } from './origin-query-executor';
|
|
5
|
+
import type { Origin } from '../../../dataflow/origin/dfg-get-origin';
|
|
6
|
+
export interface OriginQuery extends BaseQueryFormat {
|
|
7
|
+
readonly type: 'origin';
|
|
8
|
+
/** The slicing criteria to use */
|
|
9
|
+
readonly criterion: SingleSlicingCriterion;
|
|
10
|
+
}
|
|
11
|
+
export interface OriginQueryResult extends BaseQueryResult {
|
|
12
|
+
results: Record<SingleSlicingCriterion, Origin[] | undefined>;
|
|
13
|
+
}
|
|
14
|
+
export declare const OriginQueryDefinition: {
|
|
15
|
+
readonly executor: typeof executeResolveValueQuery;
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
17
|
+
readonly name: "parse";
|
|
18
|
+
readonly humanReadableName: "parse with R shell";
|
|
19
|
+
readonly description: "Parse the given R code into an AST";
|
|
20
|
+
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
21
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
22
|
+
readonly printer: {
|
|
23
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
24
|
+
readonly 2: {
|
|
25
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
26
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
27
|
+
};
|
|
28
|
+
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
29
|
+
};
|
|
30
|
+
readonly dependencies: readonly [];
|
|
31
|
+
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
32
|
+
} | {
|
|
33
|
+
readonly name: "normalize";
|
|
34
|
+
readonly humanReadableName: "normalize";
|
|
35
|
+
readonly description: "Normalize the AST to flowR's AST";
|
|
36
|
+
readonly processor: (results: {
|
|
37
|
+
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
38
|
+
}, 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>>;
|
|
39
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
40
|
+
readonly printer: {
|
|
41
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
42
|
+
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
43
|
+
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
44
|
+
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
45
|
+
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
46
|
+
};
|
|
47
|
+
readonly dependencies: readonly ["parse"];
|
|
48
|
+
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
49
|
+
} | {
|
|
50
|
+
readonly humanReadableName: "dataflow";
|
|
51
|
+
readonly processor: (results: {
|
|
52
|
+
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
53
|
+
}, input: {
|
|
54
|
+
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
55
|
+
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
56
|
+
}) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
+
readonly requiredInput: {};
|
|
58
|
+
readonly name: "dataflow";
|
|
59
|
+
readonly description: "Construct the dataflow graph";
|
|
60
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
61
|
+
readonly printer: {
|
|
62
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
63
|
+
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
64
|
+
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
65
|
+
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
66
|
+
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
67
|
+
};
|
|
68
|
+
readonly dependencies: readonly ["normalize"];
|
|
69
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
71
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.OriginQueryDefinition = void 0;
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const time_1 = require("../../../util/text/time");
|
|
9
|
+
const joi_1 = __importDefault(require("joi"));
|
|
10
|
+
const origin_query_executor_1 = require("./origin-query-executor");
|
|
11
|
+
exports.OriginQueryDefinition = {
|
|
12
|
+
executor: origin_query_executor_1.executeResolveValueQuery,
|
|
13
|
+
asciiSummarizer: (formatter, _processed, queryResults, result) => {
|
|
14
|
+
const out = queryResults;
|
|
15
|
+
result.push(`Query: ${(0, ansi_1.bold)('origin', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
16
|
+
for (const [criteria, obj] of Object.entries(out.results)) {
|
|
17
|
+
result.push(` ╰ Origins for {${criteria}}`);
|
|
18
|
+
result.push(` ╰ ${obj?.map(o => JSON.stringify(o)).join(', ')}`);
|
|
19
|
+
}
|
|
20
|
+
return true;
|
|
21
|
+
},
|
|
22
|
+
schema: joi_1.default.object({
|
|
23
|
+
type: joi_1.default.string().valid('origin').required().description('The type of the query.'),
|
|
24
|
+
criterion: joi_1.default.string().required().description('The slicing criteria to use'),
|
|
25
|
+
}).description('The resolve value query used to get definitions of an identifier')
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=origin-query-format.js.map
|
|
@@ -9,7 +9,7 @@ export interface ProjectQueryResult extends BaseQueryResult {
|
|
|
9
9
|
}
|
|
10
10
|
export declare const ProjectQueryDefinition: {
|
|
11
11
|
readonly executor: typeof executeProjectQuery;
|
|
12
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
12
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
13
13
|
readonly name: "parse";
|
|
14
14
|
readonly humanReadableName: "parse with R shell";
|
|
15
15
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ProjectQueryDefinition = void 0;
|
|
7
7
|
const project_query_executor_1 = require("./project-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/ansi");
|
|
9
|
-
const time_1 = require("../../../util/time");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const joi_1 = __importDefault(require("joi"));
|
|
11
11
|
exports.ProjectQueryDefinition = {
|
|
12
12
|
executor: project_query_executor_1.executeProjectQuery,
|
|
@@ -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";
|
|
@@ -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) {
|
|
@@ -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";
|
|
@@ -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");
|
|
@@ -26,7 +26,7 @@ export interface StaticSliceQueryResult extends BaseQueryResult {
|
|
|
26
26
|
}
|
|
27
27
|
export declare const StaticSliceQueryDefinition: {
|
|
28
28
|
readonly executor: typeof executeStaticSliceQuery;
|
|
29
|
-
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
29
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _processed: PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
30
30
|
readonly name: "parse";
|
|
31
31
|
readonly humanReadableName: "parse with R shell";
|
|
32
32
|
readonly description: "Parse the given R code into an AST";
|
|
@@ -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");
|
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,8 @@ 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
|
+
export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DataflowLensQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | LineageQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | ResolveValueQuery | ProjectQuery | OriginQuery;
|
|
24
25
|
export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
|
|
25
26
|
type: QueryType;
|
|
26
27
|
};
|
|
@@ -745,6 +746,64 @@ export declare const SupportedQueries: {
|
|
|
745
746
|
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
746
747
|
readonly schema: Joi.ObjectSchema<any>;
|
|
747
748
|
};
|
|
749
|
+
readonly origin: {
|
|
750
|
+
readonly executor: typeof import("./catalog/origin-query/origin-query-executor").executeResolveValueQuery;
|
|
751
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, _processed: PipelineOutput<import("../core/steps/pipeline/pipeline").Pipeline<{
|
|
752
|
+
readonly name: "parse";
|
|
753
|
+
readonly humanReadableName: "parse with R shell";
|
|
754
|
+
readonly description: "Parse the given R code into an AST";
|
|
755
|
+
readonly processor: (_results: unknown, input: Partial<import("../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../r-bridge/parser").ParseStepOutput<string>>;
|
|
756
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
757
|
+
readonly printer: {
|
|
758
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
759
|
+
readonly 2: {
|
|
760
|
+
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
761
|
+
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
762
|
+
};
|
|
763
|
+
readonly 5: ({ parsed }: import("../r-bridge/parser").ParseStepOutput<string>, config: import("../util/quads").QuadSerializationConfiguration) => string;
|
|
764
|
+
};
|
|
765
|
+
readonly dependencies: readonly [];
|
|
766
|
+
readonly requiredInput: import("../r-bridge/parser").ParseRequiredInput<string>;
|
|
767
|
+
} | {
|
|
768
|
+
readonly name: "normalize";
|
|
769
|
+
readonly humanReadableName: "normalize";
|
|
770
|
+
readonly description: "Normalize the AST to flowR's AST";
|
|
771
|
+
readonly processor: (results: {
|
|
772
|
+
parse?: import("../r-bridge/parser").ParseStepOutput<string>;
|
|
773
|
+
}, 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>>;
|
|
774
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
775
|
+
readonly printer: {
|
|
776
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
777
|
+
readonly 2: typeof import("../core/print/normalize-printer").normalizedAstToJson;
|
|
778
|
+
readonly 5: typeof import("../core/print/normalize-printer").normalizedAstToQuads;
|
|
779
|
+
readonly 3: typeof import("../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
780
|
+
readonly 4: typeof import("../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
781
|
+
};
|
|
782
|
+
readonly dependencies: readonly ["parse"];
|
|
783
|
+
readonly requiredInput: import("../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
784
|
+
} | {
|
|
785
|
+
readonly humanReadableName: "dataflow";
|
|
786
|
+
readonly processor: (results: {
|
|
787
|
+
normalize?: import("../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
788
|
+
}, input: {
|
|
789
|
+
request?: import("../r-bridge/retriever").RParseRequests;
|
|
790
|
+
parser?: import("../r-bridge/parser").Parser<import("../r-bridge/parser").KnownParserType>;
|
|
791
|
+
}) => import("../dataflow/info").DataflowInformation;
|
|
792
|
+
readonly requiredInput: {};
|
|
793
|
+
readonly name: "dataflow";
|
|
794
|
+
readonly description: "Construct the dataflow graph";
|
|
795
|
+
readonly executed: import("../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
796
|
+
readonly printer: {
|
|
797
|
+
readonly 0: typeof import("../core/print/print").internalPrinter;
|
|
798
|
+
readonly 2: typeof import("../core/print/dataflow-printer").dataflowGraphToJson;
|
|
799
|
+
readonly 5: typeof import("../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
800
|
+
readonly 3: typeof import("../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
801
|
+
readonly 4: typeof import("../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
802
|
+
};
|
|
803
|
+
readonly dependencies: readonly ["normalize"];
|
|
804
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
805
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
806
|
+
};
|
|
748
807
|
};
|
|
749
808
|
export type SupportedQueryTypes = keyof typeof SupportedQueries;
|
|
750
809
|
export type QueryResult<Type extends Query['type']> = ReturnType<typeof SupportedQueries[Type]['executor']>;
|
package/queries/query.js
CHANGED
|
@@ -28,6 +28,7 @@ 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");
|
|
31
32
|
exports.SupportedQueries = {
|
|
32
33
|
'call-context': call_context_query_format_1.CallContextQueryDefinition,
|
|
33
34
|
'config': config_query_format_1.ConfigQueryDefinition,
|
|
@@ -43,7 +44,8 @@ exports.SupportedQueries = {
|
|
|
43
44
|
'search': search_query_format_1.SearchQueryDefinition,
|
|
44
45
|
'happens-before': happens_before_query_format_1.HappensBeforeQueryDefinition,
|
|
45
46
|
'resolve-value': resolve_value_query_format_1.ResolveValueQueryDefinition,
|
|
46
|
-
'project': project_query_format_1.ProjectQueryDefinition
|
|
47
|
+
'project': project_query_format_1.ProjectQueryDefinition,
|
|
48
|
+
'origin': origin_query_format_1.OriginQueryDefinition,
|
|
47
49
|
};
|
|
48
50
|
function executeQueriesOfSameType(data, ...queries) {
|
|
49
51
|
(0, assert_1.guard)(queries.length > 0, 'At least one query must be provided');
|