@eagleoutice/flowr 2.5.0 → 2.6.1
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 +46 -35
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/data-frame/absint-visitor.js +1 -1
- package/cli/flowr.js +11 -33
- package/cli/repl/commands/repl-cfg.d.ts +5 -5
- package/cli/repl/commands/repl-cfg.js +21 -22
- package/cli/repl/commands/repl-commands.d.ts +3 -3
- package/cli/repl/commands/repl-commands.js +2 -0
- package/cli/repl/commands/repl-dataflow.d.ts +5 -5
- package/cli/repl/commands/repl-dataflow.js +27 -30
- package/cli/repl/commands/repl-execute.d.ts +1 -1
- package/cli/repl/commands/repl-execute.js +8 -7
- package/cli/repl/commands/repl-lineage.d.ts +2 -2
- package/cli/repl/commands/repl-lineage.js +11 -11
- package/cli/repl/commands/repl-main.d.ts +35 -7
- package/cli/repl/commands/repl-normalize.d.ts +3 -3
- package/cli/repl/commands/repl-normalize.js +15 -19
- package/cli/repl/commands/repl-parse.d.ts +2 -2
- package/cli/repl/commands/repl-parse.js +14 -8
- package/cli/repl/commands/repl-query.d.ts +3 -3
- package/cli/repl/commands/repl-query.js +29 -19
- package/cli/repl/commands/repl-quit.js +1 -0
- package/cli/repl/commands/repl-version.d.ts +1 -16
- package/cli/repl/commands/repl-version.js +2 -18
- package/cli/repl/core.d.ts +12 -9
- package/cli/repl/core.js +26 -12
- package/cli/repl/print-version.js +2 -2
- package/cli/repl/server/connection.d.ts +7 -3
- package/cli/repl/server/connection.js +46 -50
- package/cli/repl/server/messages/message-hello.d.ts +1 -1
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/repl/server/server.js +2 -2
- package/cli/slicer-app.js +1 -1
- package/config.d.ts +1 -1
- package/config.js +4 -1
- package/control-flow/extract-cfg.d.ts +1 -1
- package/control-flow/extract-cfg.js +1 -1
- package/core/pipeline-executor.d.ts +5 -0
- package/core/pipeline-executor.js +5 -0
- package/core/steps/all/core/20-dataflow.d.ts +3 -1
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/core/steps/pipeline/default-pipelines.d.ts +24 -8
- package/core/steps/pipeline/default-pipelines.js +4 -1
- package/dataflow/environments/default-builtin-config.js +8 -0
- package/dataflow/eval/resolve/alias-tracking.js +2 -0
- package/dataflow/eval/resolve/resolve.js +3 -0
- package/dataflow/eval/values/r-value.d.ts +4 -1
- package/dataflow/eval/values/r-value.js +2 -0
- package/dataflow/extractor.d.ts +4 -1
- package/dataflow/extractor.js +7 -5
- package/dataflow/fn/higher-order-function.d.ts +9 -0
- package/dataflow/fn/higher-order-function.js +75 -0
- package/dataflow/graph/dataflowgraph-builder.d.ts +11 -12
- package/dataflow/graph/dataflowgraph-builder.js +6 -6
- package/documentation/doc-util/doc-query.d.ts +3 -6
- package/documentation/doc-util/doc-query.js +5 -17
- package/documentation/doc-util/doc-repl.js +5 -2
- package/documentation/doc-util/doc-search.js +7 -10
- package/documentation/doc-util/doc-structure.d.ts +4 -0
- package/documentation/doc-util/doc-structure.js +28 -0
- package/documentation/doc-util/doc-types.d.ts +5 -1
- package/documentation/doc-util/doc-types.js +29 -3
- package/documentation/print-analyzer-wiki.d.ts +1 -0
- package/documentation/print-analyzer-wiki.js +137 -0
- package/documentation/print-core-wiki.d.ts +2 -1
- package/documentation/print-core-wiki.js +58 -4
- package/documentation/print-dataflow-graph-wiki.js +16 -23
- package/documentation/print-interface-wiki.js +18 -1
- package/documentation/print-linter-wiki.js +5 -1
- package/documentation/print-normalized-ast-wiki.js +6 -8
- package/documentation/print-query-wiki.js +20 -0
- package/documentation/print-readme.js +1 -1
- package/engines.d.ts +9 -0
- package/engines.js +38 -0
- package/linter/linter-executor.d.ts +2 -8
- package/linter/linter-executor.js +9 -4
- package/linter/linter-format.d.ts +8 -9
- package/linter/linter-rules.d.ts +57 -15
- package/linter/linter-rules.js +2 -0
- package/linter/rules/absolute-path.d.ts +1 -0
- package/linter/rules/dataframe-access-validation.d.ts +4 -3
- package/linter/rules/dataframe-access-validation.js +7 -4
- package/linter/rules/dead-code.d.ts +2 -1
- package/linter/rules/deprecated-functions.d.ts +15 -28
- package/linter/rules/deprecated-functions.js +5 -43
- package/linter/rules/file-path-validity.d.ts +2 -1
- package/linter/rules/file-path-validity.js +1 -1
- package/linter/rules/function-finder-util.d.ts +51 -0
- package/linter/rules/function-finder-util.js +77 -0
- package/linter/rules/naming-convention.d.ts +2 -1
- package/linter/rules/network-functions.d.ts +40 -0
- package/linter/rules/network-functions.js +24 -0
- package/linter/rules/seeded-randomness.d.ts +2 -1
- package/linter/rules/unused-definition.d.ts +2 -1
- package/linter/rules/useless-loop.d.ts +3 -2
- package/linter/rules/useless-loop.js +4 -6
- package/package.json +2 -1
- package/project/cache/flowr-analyzer-cache.d.ts +94 -0
- package/project/cache/flowr-analyzer-cache.js +164 -0
- package/project/cache/flowr-cache.d.ts +28 -0
- package/project/cache/flowr-cache.js +49 -0
- package/project/cfg-kind.d.ts +17 -0
- package/project/cfg-kind.js +22 -0
- package/project/context/abstract-flowr-analyzer-context.d.ts +39 -0
- package/project/context/abstract-flowr-analyzer-context.js +46 -0
- package/project/context/flowr-analyzer-context.d.ts +54 -0
- package/project/context/flowr-analyzer-context.js +58 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +39 -0
- package/project/context/flowr-analyzer-dependencies-context.js +43 -0
- package/project/context/flowr-analyzer-files-context.d.ts +87 -0
- package/project/context/flowr-analyzer-files-context.js +134 -0
- package/project/context/flowr-analyzer-loading-order-context.d.ts +77 -0
- package/project/context/flowr-analyzer-loading-order-context.js +96 -0
- package/project/context/flowr-file.d.ts +89 -0
- package/project/context/flowr-file.js +78 -0
- package/project/flowr-analyzer-builder.d.ts +106 -0
- package/project/flowr-analyzer-builder.js +197 -0
- package/project/flowr-analyzer.d.ts +126 -0
- package/project/flowr-analyzer.js +88 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +17 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +28 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +21 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +34 -0
- package/project/plugins/file-plugins/flowr-description-file.d.ts +24 -0
- package/project/plugins/file-plugins/flowr-description-file.js +38 -0
- package/project/plugins/flowr-analyzer-plugin.d.ts +90 -0
- package/project/plugins/flowr-analyzer-plugin.js +82 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +14 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +56 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.d.ts +13 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +14 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +41 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +29 -0
- package/project/plugins/package-version-plugins/package.d.ts +15 -0
- package/project/plugins/package-version-plugins/package.js +56 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.d.ts +15 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +44 -0
- package/queries/base-query-format.d.ts +2 -8
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +21 -13
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -3
- package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-executor.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -54
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/config-query/config-query-executor.d.ts +1 -1
- package/queries/catalog/config-query/config-query-executor.js +5 -5
- package/queries/catalog/config-query/config-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.js +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +3 -3
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -54
- package/queries/catalog/control-flow-query/control-flow-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -54
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -54
- package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +19 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +7 -56
- package/queries/catalog/dependencies-query/dependencies-query-format.js +7 -4
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -4
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -54
- package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
- 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 +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -54
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-executor.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -54
- package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +3 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +45 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +22 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +32 -0
- package/queries/catalog/lineage-query/lineage-query-executor.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-executor.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -54
- package/queries/catalog/lineage-query/lineage-query-format.js +1 -1
- package/queries/catalog/linter-query/linter-query-executor.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-executor.js +2 -3
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -54
- package/queries/catalog/linter-query/linter-query-format.js +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-executor.js +3 -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 +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -54
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -1
- package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -54
- package/queries/catalog/origin-query/origin-query-format.js +1 -1
- package/queries/catalog/project-query/project-query-executor.d.ts +1 -1
- package/queries/catalog/project-query/project-query-executor.js +2 -2
- package/queries/catalog/project-query/project-query-format.d.ts +1 -54
- package/queries/catalog/project-query/project-query-format.js +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +4 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -54
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
- package/queries/catalog/search-query/search-query-executor.d.ts +1 -1
- package/queries/catalog/search-query/search-query-executor.js +3 -3
- package/queries/catalog/search-query/search-query-format.d.ts +1 -54
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -54
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -1
- package/queries/query-print.d.ts +4 -4
- package/queries/query-print.js +12 -12
- package/queries/query.d.ts +37 -885
- package/queries/query.js +3 -1
- package/r-bridge/parser.d.ts +7 -0
- package/r-bridge/retriever.d.ts +6 -5
- package/r-bridge/retriever.js +9 -5
- package/search/flowr-search-executor.d.ts +3 -5
- package/search/flowr-search-executor.js +6 -4
- package/search/flowr-search-filters.d.ts +12 -6
- package/search/flowr-search-filters.js +1 -1
- package/search/flowr-search.d.ts +5 -16
- package/search/flowr-search.js +14 -5
- package/search/search-executor/search-enrichers.d.ts +37 -36
- package/search/search-executor/search-enrichers.js +5 -4
- package/search/search-executor/search-generators.d.ts +12 -12
- package/search/search-executor/search-generators.js +27 -19
- package/search/search-executor/search-mappers.d.ts +5 -5
- package/search/search-executor/search-transformer.d.ts +17 -17
- package/search/search-executor/search-transformer.js +14 -7
- package/util/collections/arrays.d.ts +1 -0
- package/util/collections/arrays.js +15 -0
- package/util/collections/objectmap.d.ts +17 -0
- package/util/collections/objectmap.js +28 -0
- package/util/containers.d.ts +0 -1
- package/util/containers.js +0 -1
- package/util/files.d.ts +17 -0
- package/util/files.js +65 -0
- package/util/formats/adapter.d.ts +4 -2
- package/util/formats/adapter.js +11 -4
- package/util/r-value.d.ts +1 -1
- package/util/r-value.js +2 -0
- package/util/version.d.ts +17 -0
- package/util/version.js +28 -1
|
@@ -14,60 +14,7 @@ export interface DataflowLensQueryResult extends BaseQueryResult {
|
|
|
14
14
|
}
|
|
15
15
|
export declare const DataflowLensQueryDefinition: {
|
|
16
16
|
readonly executor: typeof executeDataflowLensQuery;
|
|
17
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
18
|
-
readonly name: "parse";
|
|
19
|
-
readonly humanReadableName: "parse with R shell";
|
|
20
|
-
readonly description: "Parse the given R code into an AST";
|
|
21
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
22
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
23
|
-
readonly printer: {
|
|
24
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
25
|
-
readonly 2: {
|
|
26
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
27
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
28
|
-
};
|
|
29
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
30
|
-
};
|
|
31
|
-
readonly dependencies: readonly [];
|
|
32
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
33
|
-
} | {
|
|
34
|
-
readonly name: "normalize";
|
|
35
|
-
readonly humanReadableName: "normalize";
|
|
36
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
37
|
-
readonly processor: (results: {
|
|
38
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
39
|
-
}, 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>>;
|
|
40
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
41
|
-
readonly printer: {
|
|
42
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
43
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
44
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
45
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
46
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
47
|
-
};
|
|
48
|
-
readonly dependencies: readonly ["parse"];
|
|
49
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
50
|
-
} | {
|
|
51
|
-
readonly humanReadableName: "dataflow";
|
|
52
|
-
readonly processor: (results: {
|
|
53
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
54
|
-
}, input: {
|
|
55
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
56
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
57
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
58
|
-
readonly requiredInput: {};
|
|
59
|
-
readonly name: "dataflow";
|
|
60
|
-
readonly description: "Construct the dataflow graph";
|
|
61
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
62
|
-
readonly printer: {
|
|
63
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
64
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
65
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
66
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
67
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
68
|
-
};
|
|
69
|
-
readonly dependencies: readonly ["normalize"];
|
|
70
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
71
18
|
readonly schema: Joi.ObjectSchema<any>;
|
|
72
19
|
readonly flattenInvolvedNodes: () => never[];
|
|
73
20
|
};
|
|
@@ -11,7 +11,7 @@ const dfg_1 = require("../../../util/mermaid/dfg");
|
|
|
11
11
|
const joi_1 = __importDefault(require("joi"));
|
|
12
12
|
exports.DataflowLensQueryDefinition = {
|
|
13
13
|
executor: dataflow_lens_query_executor_1.executeDataflowLensQuery,
|
|
14
|
-
asciiSummarizer: (formatter,
|
|
14
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
15
15
|
const out = queryResults;
|
|
16
16
|
result.push(`Query: ${(0, ansi_1.bold)('dataflow-lens', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
17
|
result.push(` ╰ [Simplified Graph](${(0, dfg_1.graphToMermaidUrl)(out.simplifiedGraph, false, undefined, true)})`);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DataflowQuery, DataflowQueryResult } from './dataflow-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeDataflowQuery({
|
|
3
|
+
export declare function executeDataflowQuery({ analyzer }: BasicQueryData, queries: readonly DataflowQuery[]): Promise<DataflowQueryResult>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeDataflowQuery = executeDataflowQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
-
function executeDataflowQuery({
|
|
5
|
+
async function executeDataflowQuery({ analyzer }, queries) {
|
|
6
6
|
if (queries.length !== 1) {
|
|
7
7
|
log_1.log.warn('Dataflow query expects only up to one query, but got', queries.length);
|
|
8
8
|
}
|
|
@@ -11,7 +11,7 @@ function executeDataflowQuery({ dataflow: { graph } }, queries) {
|
|
|
11
11
|
/* there is no sense in measuring a get */
|
|
12
12
|
timing: 0
|
|
13
13
|
},
|
|
14
|
-
graph
|
|
14
|
+
graph: (await analyzer.dataflow()).graph
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=dataflow-query-executor.js.map
|
|
@@ -15,60 +15,7 @@ export interface DataflowQueryResult extends BaseQueryResult {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const DataflowQueryDefinition: {
|
|
17
17
|
readonly executor: typeof executeDataflowQuery;
|
|
18
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
19
|
-
readonly name: "parse";
|
|
20
|
-
readonly humanReadableName: "parse with R shell";
|
|
21
|
-
readonly description: "Parse the given R code into an AST";
|
|
22
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
23
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
24
|
-
readonly printer: {
|
|
25
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
26
|
-
readonly 2: {
|
|
27
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
28
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
29
|
-
};
|
|
30
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
31
|
-
};
|
|
32
|
-
readonly dependencies: readonly [];
|
|
33
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
34
|
-
} | {
|
|
35
|
-
readonly name: "normalize";
|
|
36
|
-
readonly humanReadableName: "normalize";
|
|
37
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
38
|
-
readonly processor: (results: {
|
|
39
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
40
|
-
}, 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>>;
|
|
41
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
42
|
-
readonly printer: {
|
|
43
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
44
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
45
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
46
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
47
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
48
|
-
};
|
|
49
|
-
readonly dependencies: readonly ["parse"];
|
|
50
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
51
|
-
} | {
|
|
52
|
-
readonly humanReadableName: "dataflow";
|
|
53
|
-
readonly processor: (results: {
|
|
54
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
55
|
-
}, input: {
|
|
56
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
57
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
58
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
59
|
-
readonly requiredInput: {};
|
|
60
|
-
readonly name: "dataflow";
|
|
61
|
-
readonly description: "Construct the dataflow graph";
|
|
62
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
63
|
-
readonly printer: {
|
|
64
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
65
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
66
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
67
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
68
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
69
|
-
};
|
|
70
|
-
readonly dependencies: readonly ["normalize"];
|
|
71
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
18
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
72
19
|
readonly schema: Joi.ObjectSchema<any>;
|
|
73
20
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
74
21
|
};
|
|
@@ -11,7 +11,7 @@ const dfg_1 = require("../../../util/mermaid/dfg");
|
|
|
11
11
|
const joi_1 = __importDefault(require("joi"));
|
|
12
12
|
exports.DataflowQueryDefinition = {
|
|
13
13
|
executor: dataflow_query_executor_1.executeDataflowQuery,
|
|
14
|
-
asciiSummarizer: (formatter,
|
|
14
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
15
15
|
const out = queryResults;
|
|
16
16
|
result.push(`Query: ${(0, ansi_1.bold)('dataflow', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
17
|
result.push(` ╰ [Dataflow Graph](${(0, dfg_1.graphToMermaidUrl)(out.graph)})`);
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DependenciesQuery, DependenciesQueryResult } from './dependencies-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeDependenciesQuery(
|
|
3
|
+
export declare function executeDependenciesQuery({ analyzer, }: BasicQueryData, queries: readonly DependenciesQuery[]): Promise<DependenciesQueryResult>;
|
|
@@ -11,10 +11,14 @@ const function_info_1 = require("./function-info/function-info");
|
|
|
11
11
|
const identify_link_to_last_call_relation_1 = require("../call-context-query/identify-link-to-last-call-relation");
|
|
12
12
|
const resolve_argument_1 = require("../../../dataflow/eval/resolve/resolve-argument");
|
|
13
13
|
const assert_1 = require("../../../util/assert");
|
|
14
|
-
function executeDependenciesQuery(
|
|
14
|
+
async function executeDependenciesQuery({ analyzer, }, queries) {
|
|
15
15
|
if (queries.length !== 1) {
|
|
16
16
|
log_1.log.warn('Dependencies query expects only up to one query, but got ', queries.length, 'only using the first query');
|
|
17
17
|
}
|
|
18
|
+
const data = { analyzer };
|
|
19
|
+
const normalize = await analyzer.normalize();
|
|
20
|
+
const dataflow = await analyzer.dataflow();
|
|
21
|
+
const config = analyzer.flowrConfig;
|
|
18
22
|
const now = Date.now();
|
|
19
23
|
const [query] = queries;
|
|
20
24
|
const ignoreDefault = query.ignoreDefaultFunctions ?? false;
|
|
@@ -28,10 +32,10 @@ function executeDependenciesQuery(data, queries) {
|
|
|
28
32
|
}
|
|
29
33
|
}
|
|
30
34
|
const queryResults = functions.values().toArray().flat().length === 0 ? { kinds: {}, '.meta': { timing: 0 } } :
|
|
31
|
-
(0, query_1.executeQueriesOfSameType)(data, functions.entries().map(([c, f]) => makeCallContextQuery(f, c)).toArray().flat());
|
|
35
|
+
await (0, query_1.executeQueriesOfSameType)(data, functions.entries().map(([c, f]) => makeCallContextQuery(f, c)).toArray().flat());
|
|
32
36
|
const results = Object.fromEntries(functions.entries().map(([c, f]) => {
|
|
33
|
-
const results = getResults(queries,
|
|
34
|
-
// only default categories allow additional analyses, so we null
|
|
37
|
+
const results = getResults(queries, { dataflow, config, normalize }, queryResults, c, f, data);
|
|
38
|
+
// only default categories allow additional analyses, so we null-coalesce here!
|
|
35
39
|
dependencies_query_format_1.DefaultDependencyCategories[c]?.additionalAnalysis?.(data, ignoreDefault, f, queryResults, results);
|
|
36
40
|
return [c, results];
|
|
37
41
|
}));
|
|
@@ -39,7 +43,7 @@ function executeDependenciesQuery(data, queries) {
|
|
|
39
43
|
'.meta': {
|
|
40
44
|
timing: Date.now() - now
|
|
41
45
|
},
|
|
42
|
-
...results
|
|
46
|
+
...results,
|
|
43
47
|
};
|
|
44
48
|
}
|
|
45
49
|
function makeCallContextQuery(functions, kind) {
|
|
@@ -62,15 +66,15 @@ function dropInfoOnLinkedIds(linkedIds) {
|
|
|
62
66
|
}
|
|
63
67
|
const readOnlyModes = new Set(['r', 'rt', 'rb']);
|
|
64
68
|
const writeOnlyModes = new Set(['w', 'wt', 'wb', 'a', 'at', 'ab']);
|
|
65
|
-
function getResults(queries,
|
|
69
|
+
function getResults(queries, { dataflow, config, normalize }, results, kind, functions, data) {
|
|
66
70
|
const defaultValue = (0, dependencies_query_format_1.getAllCategories)(queries)[kind].defaultValue;
|
|
67
71
|
const functionMap = new Map(functions.map(f => [f.name, f]));
|
|
68
72
|
const kindEntries = Object.entries(results?.kinds[kind]?.subkinds ?? {});
|
|
69
73
|
return kindEntries.flatMap(([name, results]) => results.flatMap(({ id, linkedIds }) => {
|
|
70
|
-
const vertex =
|
|
74
|
+
const vertex = dataflow.graph.getVertex(id);
|
|
71
75
|
const info = functionMap.get(name);
|
|
72
|
-
const args = (0, resolve_argument_1.getArgumentStringValue)(
|
|
73
|
-
const linkedArgs = collectValuesFromLinks(args,
|
|
76
|
+
const args = (0, resolve_argument_1.getArgumentStringValue)(config.solver.variables, dataflow.graph, vertex, info.argIdx, info.argName, info.resolveValue);
|
|
77
|
+
const linkedArgs = collectValuesFromLinks(args, { dataflow, config }, linkedIds);
|
|
74
78
|
const linked = dropInfoOnLinkedIds(linkedIds);
|
|
75
79
|
const foundValues = linkedArgs ?? args;
|
|
76
80
|
if (!foundValues) {
|
|
@@ -90,7 +94,7 @@ function getResults(queries, data, results, kind, functions) {
|
|
|
90
94
|
(0, assert_1.guard)('mode' in (info.additionalArgs ?? {}), 'Need additional argument mode when checking for mode');
|
|
91
95
|
const margs = info.additionalArgs?.mode;
|
|
92
96
|
(0, assert_1.guard)(margs, 'Need additional argument mode when checking for mode');
|
|
93
|
-
const modeArgs = (0, resolve_argument_1.getArgumentStringValue)(
|
|
97
|
+
const modeArgs = (0, resolve_argument_1.getArgumentStringValue)(config.solver.variables, dataflow.graph, vertex, margs.argIdx, margs.argName, margs.resolveValue);
|
|
94
98
|
const modeValues = modeArgs?.values().flatMap(v => [...v]) ?? [];
|
|
95
99
|
if (info.ignoreIf === 'mode-only-read' && modeValues.every(m => m && readOnlyModes.has(m))) {
|
|
96
100
|
// all modes are read-only, so we can ignore this
|
|
@@ -104,12 +108,15 @@ function getResults(queries, data, results, kind, functions) {
|
|
|
104
108
|
const results = [];
|
|
105
109
|
for (const [arg, values] of foundValues.entries()) {
|
|
106
110
|
for (const value of values) {
|
|
111
|
+
const dep = value ? data?.analyzer.context().deps.getDependency(value) ?? undefined : undefined;
|
|
107
112
|
const result = (0, objects_1.compactRecord)({
|
|
108
113
|
nodeId: id,
|
|
109
114
|
functionName: vertex.name,
|
|
110
115
|
lexemeOfArgument: getLexeme(value, arg),
|
|
111
116
|
linkedIds: linked?.length ? linked : undefined,
|
|
112
|
-
value: value ?? defaultValue
|
|
117
|
+
value: value ?? defaultValue,
|
|
118
|
+
versionConstraints: dep?.versionConstraints,
|
|
119
|
+
derivedVersion: dep?.derivedVersion
|
|
113
120
|
});
|
|
114
121
|
if (result) {
|
|
115
122
|
results.push(result);
|
|
@@ -122,7 +129,7 @@ function getResults(queries, data, results, kind, functions) {
|
|
|
122
129
|
if ((argument && argument !== dependencies_query_format_1.Unknown) || !id) {
|
|
123
130
|
return undefined;
|
|
124
131
|
}
|
|
125
|
-
let get =
|
|
132
|
+
let get = normalize.idMap.get(id);
|
|
126
133
|
if (get?.type === type_1.RType.Argument) {
|
|
127
134
|
get = get.value;
|
|
128
135
|
}
|
|
@@ -4,19 +4,21 @@ import Joi from 'joi';
|
|
|
4
4
|
import { executeDependenciesQuery } from './dependencies-query-executor';
|
|
5
5
|
import type { FunctionInfo } from './function-info/function-info';
|
|
6
6
|
import type { CallContextQueryResult } from '../call-context-query/call-context-query-format';
|
|
7
|
+
import type { Range } from 'semver';
|
|
8
|
+
import type { AsyncOrSync } from 'ts-essentials';
|
|
7
9
|
export declare const Unknown = "unknown";
|
|
8
10
|
export interface DependencyCategorySettings {
|
|
9
11
|
queryDisplayName?: string;
|
|
10
12
|
functions: FunctionInfo[];
|
|
11
13
|
defaultValue?: string;
|
|
12
|
-
additionalAnalysis?: (data: BasicQueryData, ignoreDefault: boolean, functions: FunctionInfo[], queryResults: CallContextQueryResult, result: DependencyInfo[]) => void
|
|
14
|
+
additionalAnalysis?: (data: BasicQueryData, ignoreDefault: boolean, functions: FunctionInfo[], queryResults: CallContextQueryResult, result: DependencyInfo[]) => AsyncOrSync<void>;
|
|
13
15
|
}
|
|
14
16
|
export declare const DefaultDependencyCategories: {
|
|
15
17
|
readonly library: {
|
|
16
18
|
readonly queryDisplayName: "Libraries";
|
|
17
19
|
readonly functions: FunctionInfo[];
|
|
18
20
|
readonly defaultValue: "unknown";
|
|
19
|
-
readonly additionalAnalysis: (data: BasicQueryData, ignoreDefault: boolean, _functions: FunctionInfo[], _queryResults: CallContextQueryResult, result: DependencyInfo[]) => void
|
|
21
|
+
readonly additionalAnalysis: (data: BasicQueryData, ignoreDefault: boolean, _functions: FunctionInfo[], _queryResults: CallContextQueryResult, result: DependencyInfo[]) => Promise<void>;
|
|
20
22
|
};
|
|
21
23
|
readonly source: {
|
|
22
24
|
readonly queryDisplayName: "Sourced Files";
|
|
@@ -59,64 +61,13 @@ export interface DependencyInfo extends Record<string, unknown> {
|
|
|
59
61
|
lexemeOfArgument?: string;
|
|
60
62
|
/** The library name, file, source, destination etc. being sourced, read from, or written to. */
|
|
61
63
|
value?: string;
|
|
64
|
+
versionConstraints?: Range[];
|
|
65
|
+
derivedVersion?: Range;
|
|
62
66
|
}
|
|
63
67
|
export declare function getAllCategories(queries: readonly DependenciesQuery[]): Record<DependencyCategoryName, DependencyCategorySettings>;
|
|
64
68
|
export declare const DependenciesQueryDefinition: {
|
|
65
69
|
readonly executor: typeof executeDependenciesQuery;
|
|
66
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
67
|
-
readonly name: "parse";
|
|
68
|
-
readonly humanReadableName: "parse with R shell";
|
|
69
|
-
readonly description: "Parse the given R code into an AST";
|
|
70
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
71
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
72
|
-
readonly printer: {
|
|
73
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
74
|
-
readonly 2: {
|
|
75
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
76
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
77
|
-
};
|
|
78
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
79
|
-
};
|
|
80
|
-
readonly dependencies: readonly [];
|
|
81
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
82
|
-
} | {
|
|
83
|
-
readonly name: "normalize";
|
|
84
|
-
readonly humanReadableName: "normalize";
|
|
85
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
86
|
-
readonly processor: (results: {
|
|
87
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
88
|
-
}, 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>>;
|
|
89
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
90
|
-
readonly printer: {
|
|
91
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
92
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
93
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
94
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
95
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
96
|
-
};
|
|
97
|
-
readonly dependencies: readonly ["parse"];
|
|
98
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
99
|
-
} | {
|
|
100
|
-
readonly humanReadableName: "dataflow";
|
|
101
|
-
readonly processor: (results: {
|
|
102
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
103
|
-
}, input: {
|
|
104
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
105
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
106
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
107
|
-
readonly requiredInput: {};
|
|
108
|
-
readonly name: "dataflow";
|
|
109
|
-
readonly description: "Construct the dataflow graph";
|
|
110
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
111
|
-
readonly printer: {
|
|
112
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
113
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
114
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
115
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
116
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
117
|
-
};
|
|
118
|
-
readonly dependencies: readonly ["normalize"];
|
|
119
|
-
}>>, queryResults: BaseQueryResult, result: string[], queries: readonly import("../../query").Query[]) => true;
|
|
70
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[], queries: readonly import("../../query").Query[]) => true;
|
|
120
71
|
readonly schema: Joi.ObjectSchema<any>;
|
|
121
72
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult, query: readonly import("../../query").Query[]) => NodeId[];
|
|
122
73
|
};
|
|
@@ -23,15 +23,18 @@ exports.DefaultDependencyCategories = {
|
|
|
23
23
|
functions: library_functions_1.LibraryFunctions,
|
|
24
24
|
defaultValue: exports.Unknown,
|
|
25
25
|
/* for libraries, we have to additionally track all uses of `::` and `:::`, for this we currently simply traverse all uses */
|
|
26
|
-
additionalAnalysis: (data, ignoreDefault, _functions, _queryResults, result) => {
|
|
26
|
+
additionalAnalysis: async (data, ignoreDefault, _functions, _queryResults, result) => {
|
|
27
27
|
if (!ignoreDefault) {
|
|
28
|
-
(0, visitor_1.visitAst)(data.
|
|
28
|
+
(0, visitor_1.visitAst)((await data.analyzer.normalize()).ast, n => {
|
|
29
29
|
if (n.type === type_1.RType.Symbol && n.namespace) {
|
|
30
|
+
const dep = data.analyzer.context().deps.getDependency(n.namespace);
|
|
30
31
|
/* we should improve the identification of ':::' */
|
|
31
32
|
result.push({
|
|
32
33
|
nodeId: n.info.id,
|
|
33
34
|
functionName: (n.info.fullLexeme ?? n.lexeme).includes(':::') ? ':::' : '::',
|
|
34
35
|
value: n.namespace,
|
|
36
|
+
versionConstraints: dep?.versionConstraints,
|
|
37
|
+
derivedVersion: dep?.derivedVersion
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
40
|
});
|
|
@@ -75,7 +78,7 @@ function printResultSection(title, infos, result) {
|
|
|
75
78
|
}, new Map());
|
|
76
79
|
for (const [functionName, infos] of grouped) {
|
|
77
80
|
result.push(` ╰ \`${functionName}\``);
|
|
78
|
-
result.push(infos.map(i => ` ╰ Node Id: ${i.nodeId}${i.value !== undefined ? `, \`${i.value}\`` : ''}`).join('\n'));
|
|
81
|
+
result.push(infos.map(i => ` ╰ Node Id: ${i.nodeId}${i.value !== undefined ? `, \`${i.value}\`` : ''}${i.derivedVersion !== undefined ? `, Version: \`${i.derivedVersion.format()}\`` : ''}`).join('\n'));
|
|
79
82
|
}
|
|
80
83
|
}
|
|
81
84
|
function getAllCategories(queries) {
|
|
@@ -95,7 +98,7 @@ const functionInfoSchema = joi_1.default.array().items(joi_1.default.object({
|
|
|
95
98
|
})).optional();
|
|
96
99
|
exports.DependenciesQueryDefinition = {
|
|
97
100
|
executor: dependencies_query_executor_1.executeDependenciesQuery,
|
|
98
|
-
asciiSummarizer: (formatter,
|
|
101
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result, queries) => {
|
|
99
102
|
const out = queryResults;
|
|
100
103
|
result.push(`Query: ${(0, ansi_1.bold)('dependencies', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
101
104
|
for (const [category, value] of Object.entries(getAllCategories(queries))) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { DfShapeQuery, DfShapeQueryResult } from './df-shape-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeDfShapeQuery({
|
|
3
|
+
export declare function executeDfShapeQuery({ analyzer }: BasicQueryData, queries: readonly DfShapeQuery[]): Promise<DfShapeQueryResult>;
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeDfShapeQuery = executeDfShapeQuery;
|
|
4
4
|
const log_1 = require("../../../util/log");
|
|
5
|
-
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
6
5
|
const shape_inference_1 = require("../../../abstract-interpretation/data-frame/shape-inference");
|
|
7
6
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
8
|
-
function executeDfShapeQuery({
|
|
7
|
+
async function executeDfShapeQuery({ analyzer }, queries) {
|
|
9
8
|
if (queries.length !== 1 && queries.some(query => query.criterion === undefined)) {
|
|
10
9
|
log_1.log.warn('The dataframe shape query expects only up to one query without slicing criterion, but got', queries.length);
|
|
11
10
|
queries = [{ type: 'df-shape' }];
|
|
12
11
|
}
|
|
12
|
+
const graph = (await analyzer.dataflow()).graph;
|
|
13
|
+
const ast = await analyzer.normalize();
|
|
13
14
|
const start = Date.now();
|
|
14
|
-
const
|
|
15
|
-
const domains = (0, shape_inference_1.inferDataFrameShapes)(cfg, graph, ast, config);
|
|
15
|
+
const domains = (0, shape_inference_1.inferDataFrameShapes)(await analyzer.controlflow(), graph, ast, analyzer.flowrConfig);
|
|
16
16
|
if (queries.length === 1 && queries[0].criterion === undefined) {
|
|
17
17
|
return {
|
|
18
18
|
'.meta': {
|
|
@@ -13,60 +13,7 @@ export interface DfShapeQueryResult extends BaseQueryResult {
|
|
|
13
13
|
}
|
|
14
14
|
export declare const DfShapeQueryDefinition: {
|
|
15
15
|
readonly executor: typeof executeDfShapeQuery;
|
|
16
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
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
|
-
}, config: import("../../../config").FlowrConfigOptions) => 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;
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
17
|
readonly schema: Joi.ObjectSchema<any>;
|
|
71
18
|
readonly flattenInvolvedNodes: () => never[];
|
|
72
19
|
};
|
|
@@ -11,7 +11,7 @@ const df_shape_query_executor_1 = require("./df-shape-query-executor");
|
|
|
11
11
|
const json_1 = require("../../../util/json");
|
|
12
12
|
exports.DfShapeQueryDefinition = {
|
|
13
13
|
executor: df_shape_query_executor_1.executeDfShapeQuery,
|
|
14
|
-
asciiSummarizer: (formatter,
|
|
14
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
15
15
|
const out = queryResults;
|
|
16
16
|
result.push(`Query: ${(0, ansi_1.bold)('df-shape', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
17
|
result.push(...out.domains.entries().take(20).map(([key, domain]) => {
|
|
@@ -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({
|
|
3
|
+
export declare function executeHappensBefore({ analyzer }: BasicQueryData, queries: readonly HappensBeforeQuery[]): Promise<HappensBeforeQueryResult>;
|
|
@@ -6,9 +6,10 @@ const log_1 = require("../../../util/log");
|
|
|
6
6
|
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
7
7
|
const happens_before_1 = require("../../../control-flow/happens-before");
|
|
8
8
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
9
|
-
function executeHappensBefore({
|
|
9
|
+
async function executeHappensBefore({ analyzer }, queries) {
|
|
10
10
|
const start = Date.now();
|
|
11
11
|
const results = {};
|
|
12
|
+
const ast = await analyzer.normalize();
|
|
12
13
|
const cfg = (0, extract_cfg_1.extractCfgQuick)(ast);
|
|
13
14
|
for (const query of queries) {
|
|
14
15
|
const { a, b } = query;
|
|
@@ -13,60 +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/text/ansi").OutputFormatter,
|
|
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
|
-
}, config: import("../../../config").FlowrConfigOptions) => 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;
|
|
16
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
17
|
readonly schema: Joi.ObjectSchema<any>;
|
|
71
18
|
readonly flattenInvolvedNodes: () => never[];
|
|
72
19
|
};
|
|
@@ -10,7 +10,7 @@ const joi_1 = __importDefault(require("joi"));
|
|
|
10
10
|
const happens_before_query_executor_1 = require("./happens-before-query-executor");
|
|
11
11
|
exports.HappensBeforeQueryDefinition = {
|
|
12
12
|
executor: happens_before_query_executor_1.executeHappensBefore,
|
|
13
|
-
asciiSummarizer: (formatter,
|
|
13
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
14
14
|
const out = queryResults;
|
|
15
15
|
result.push(`Query: ${(0, ansi_1.bold)('happens-before', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
16
16
|
for (const [key, value] of Object.entries(out.results)) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { IdMapQuery, IdMapQueryResult } from './id-map-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
-
export declare function executeIdMapQuery({
|
|
3
|
+
export declare function executeIdMapQuery({ analyzer }: BasicQueryData, queries: readonly IdMapQuery[]): Promise<IdMapQueryResult>;
|