@eagleoutice/flowr 2.2.11 → 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.d.ts +49 -22
- package/benchmark/slicer.js +89 -29
- package/benchmark/stats/print.js +16 -10
- package/benchmark/stats/size-of.js +18 -1
- package/benchmark/stats/stats.d.ts +3 -0
- 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 +9 -3
- package/benchmark/summarizer/summarizer.js +1 -1
- package/cli/benchmark-app.d.ts +5 -0
- package/cli/benchmark-app.js +49 -6
- package/cli/benchmark-helper-app.d.ts +4 -0
- package/cli/benchmark-helper-app.js +20 -4
- package/cli/common/options.js +15 -6
- 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 +6 -2
- package/cli/repl/commands/repl-dataflow.d.ts +2 -0
- package/cli/repl/commands/repl-dataflow.js +37 -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 +60 -21
- package/config.js +24 -4
- 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.d.ts +5 -2
- package/dataflow/environments/built-in-config.js +17 -8
- package/dataflow/environments/built-in.d.ts +16 -5
- package/dataflow/environments/built-in.js +55 -6
- package/dataflow/environments/clone.d.ts +5 -0
- package/dataflow/environments/clone.js +5 -0
- package/dataflow/environments/default-builtin-config.d.ts +2 -0
- package/dataflow/environments/default-builtin-config.js +164 -13
- package/dataflow/environments/define.d.ts +5 -1
- package/dataflow/environments/define.js +36 -10
- package/dataflow/environments/overwrite.js +4 -0
- package/dataflow/environments/remove.d.ts +6 -0
- package/dataflow/environments/remove.js +24 -0
- package/dataflow/environments/resolve-by-name.js +16 -5
- package/dataflow/extractor.js +2 -2
- package/dataflow/graph/dataflowgraph-builder.d.ts +79 -7
- package/dataflow/graph/dataflowgraph-builder.js +106 -8
- 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 +17 -4
- package/dataflow/graph/graph.js +51 -12
- package/dataflow/graph/vertex.d.ts +59 -4
- package/dataflow/graph/vertex.js +32 -0
- package/dataflow/internal/linker.d.ts +3 -2
- package/dataflow/internal/linker.js +36 -25
- 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.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +67 -54
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +108 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +54 -17
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +10 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +140 -0
- 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 +51 -17
- 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 +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +100 -31
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +41 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +35 -8
- 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.d.ts +15 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +75 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
- package/dataflow/internal/process/functions/call/common.d.ts +5 -2
- package/dataflow/internal/process/functions/call/common.js +9 -5
- 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.d.ts +2 -0
- package/dataflow/internal/process/functions/call/named-call-handling.js +10 -6
- 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 +4 -1
- package/dataflow/internal/process/process-named-call.js +8 -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 +20 -4
- package/documentation/doc-util/doc-cfg.js +41 -7
- package/documentation/doc-util/doc-cli-option.js +4 -2
- package/documentation/doc-util/doc-code.js +10 -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 +28 -2
- package/documentation/print-cfg-wiki.d.ts +1 -0
- package/documentation/print-cfg-wiki.js +572 -0
- package/documentation/print-core-wiki.js +2 -2
- 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 +2 -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 +23 -3
- package/documentation/print-readme.js +10 -3
- 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 +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 +17 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +2 -26
- package/queries/catalog/dependencies-query/dependencies-query-format.js +4 -147
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +24 -0
- package/queries/catalog/dependencies-query/function-info/function-info.js +10 -0
- package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/library-functions.js +18 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.js +101 -0
- package/queries/catalog/dependencies-query/function-info/source-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/source-functions.js +11 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.js +87 -0
- 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/data/data.d.ts +2 -2
- package/r-bridge/data/data.js +2 -2
- 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} +24 -1
- package/util/{arrays.js → collections/arrays.js} +44 -3
- package/util/collections/set.js +17 -0
- package/util/{list-access.d.ts → containers.d.ts} +24 -4
- package/util/{list-access.js → containers.js} +42 -12
- 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/ast.js +12 -1
- package/util/mermaid/cfg.d.ts +9 -2
- package/util/mermaid/cfg.js +65 -13
- 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/parallel.d.ts +2 -1
- package/util/parallel.js +11 -2
- package/util/prefix.d.ts +13 -0
- package/util/prefix.js +34 -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
|
@@ -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');
|
package/r-bridge/data/data.d.ts
CHANGED
|
@@ -149,7 +149,7 @@ export declare const flowrCapabilities: {
|
|
|
149
149
|
}, {
|
|
150
150
|
readonly name: "Resolve Arguments";
|
|
151
151
|
readonly id: "resolve-arguments";
|
|
152
|
-
readonly supported: "
|
|
152
|
+
readonly supported: "fully";
|
|
153
153
|
readonly description: "_Correctly bind arguments (including [`pmatch`](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/pmatch))._ Currently, we do not have a correct implementation for `pmatch`. Furthermore, more tests would be nice.";
|
|
154
154
|
}, {
|
|
155
155
|
readonly name: "Side-Effects in Argument";
|
|
@@ -418,7 +418,7 @@ export declare const flowrCapabilities: {
|
|
|
418
418
|
}, {
|
|
419
419
|
readonly name: "Internal and Primitive Functions";
|
|
420
420
|
readonly id: "built-in-internal-and-primitive-functions";
|
|
421
|
-
readonly supported: "
|
|
421
|
+
readonly supported: "partially";
|
|
422
422
|
readonly description: "_Handle `.Internal`, `.Primitive`, ..._ In general we can not handle them as they refer to non-R code. We currently do not support them when used with the function.";
|
|
423
423
|
}, {
|
|
424
424
|
readonly name: "Options";
|
package/r-bridge/data/data.js
CHANGED
|
@@ -200,7 +200,7 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { simplified: true })}
|
|
|
200
200
|
{
|
|
201
201
|
name: 'Resolve Arguments',
|
|
202
202
|
id: 'resolve-arguments',
|
|
203
|
-
supported: '
|
|
203
|
+
supported: 'fully',
|
|
204
204
|
description: '_Correctly bind arguments (including [`pmatch`](https://www.rdocumentation.org/packages/base/versions/3.6.2/topics/pmatch))._ Currently, we do not have a correct implementation for `pmatch`. Furthermore, more tests would be nice.'
|
|
205
205
|
},
|
|
206
206
|
{
|
|
@@ -532,7 +532,7 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { simplified: true })}
|
|
|
532
532
|
{
|
|
533
533
|
name: 'Internal and Primitive Functions',
|
|
534
534
|
id: 'built-in-internal-and-primitive-functions',
|
|
535
|
-
supported: '
|
|
535
|
+
supported: 'partially',
|
|
536
536
|
description: '_Handle `.Internal`, `.Primitive`, ..._ In general we can not handle them as they refer to non-R code. We currently do not support them when used with the function.'
|
|
537
537
|
},
|
|
538
538
|
{
|
|
@@ -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';
|