@eagleoutice/flowr 2.4.8 → 2.6.0
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 +66 -45
- package/benchmark/slicer.js +1 -1
- package/benchmark/summarizer/second-phase/graph.js +2 -2
- package/cli/flowr.js +3 -29
- 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.js +1 -0
- package/cli/repl/commands/repl-lineage.js +1 -0
- package/cli/repl/commands/repl-main.d.ts +34 -3
- 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 +13 -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.js +1 -0
- package/cli/repl/core.d.ts +4 -1
- package/cli/repl/core.js +21 -1
- package/cli/repl/server/connection.d.ts +7 -3
- package/cli/repl/server/connection.js +40 -48
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/slicer-app.js +8 -3
- 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/pipeline/create-pipeline.js +1 -1
- package/core/steps/pipeline/default-pipelines.d.ts +42 -42
- package/core/steps/pipeline/default-pipelines.js +4 -1
- 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-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 +15 -22
- package/documentation/print-interface-wiki.js +18 -1
- package/documentation/print-linter-wiki.js +5 -1
- package/documentation/print-linting-and-testing-wiki.js +4 -0
- package/documentation/print-normalized-ast-wiki.js +6 -8
- package/documentation/print-readme.js +6 -0
- 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 +5 -1
- package/project/cache/flowr-analyzer-cache.d.ts +93 -0
- package/project/cache/flowr-analyzer-cache.js +156 -0
- package/project/cache/flowr-cache.d.ts +28 -0
- package/project/cache/flowr-cache.js +49 -0
- package/project/context/abstract-flowr-analyzer-context.d.ts +35 -0
- package/project/context/abstract-flowr-analyzer-context.js +46 -0
- package/project/context/flowr-analyzer-context.d.ts +48 -0
- package/project/context/flowr-analyzer-context.js +47 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +38 -0
- package/project/context/flowr-analyzer-dependencies-context.js +39 -0
- package/project/context/flowr-analyzer-files-context.d.ts +86 -0
- package/project/context/flowr-analyzer-files-context.js +130 -0
- package/project/context/flowr-analyzer-loading-order-context.d.ts +76 -0
- package/project/context/flowr-analyzer-loading-order-context.js +90 -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 +125 -0
- package/project/flowr-analyzer.js +81 -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 +20 -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 +2 -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/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 +29 -885
- package/queries/query.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +1 -1
- package/r-bridge/retriever.d.ts +15 -2
- package/r-bridge/retriever.js +15 -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 +4 -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-format.d.ts +6 -0
- package/util/formats/adapter-format.js +3 -0
- package/util/formats/adapter.d.ts +18 -0
- package/util/formats/adapter.js +49 -0
- package/util/formats/adapters/r-adapter.d.ts +4 -0
- package/util/formats/adapters/r-adapter.js +7 -0
- package/util/formats/adapters/rmd-adapter.d.ts +26 -0
- package/util/formats/adapters/rmd-adapter.js +91 -0
- package/util/version.js +1 -1
|
@@ -15,60 +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/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
|
};
|
|
@@ -13,7 +13,7 @@ const flowr_search_printer_1 = require("../../../search/flowr-search-printer");
|
|
|
13
13
|
const mermaid_1 = require("../../../util/mermaid/mermaid");
|
|
14
14
|
exports.SearchQueryDefinition = {
|
|
15
15
|
executor: search_query_executor_1.executeSearch,
|
|
16
|
-
asciiSummarizer: (formatter,
|
|
16
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
17
17
|
const out = queryResults;
|
|
18
18
|
result.push(`Query: ${(0, ansi_1.bold)('search', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
19
19
|
for (const [, { ids, search }] of out.results.entries()) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { StaticSliceQuery, StaticSliceQueryResult } from './static-slice-query-format';
|
|
2
2
|
import type { BasicQueryData } from '../../base-query-format';
|
|
3
3
|
export declare function fingerPrintOfQuery(query: StaticSliceQuery): string;
|
|
4
|
-
export declare function executeStaticSliceQuery({
|
|
4
|
+
export declare function executeStaticSliceQuery({ analyzer }: BasicQueryData, queries: readonly StaticSliceQuery[]): Promise<StaticSliceQueryResult>;
|
|
@@ -11,7 +11,7 @@ const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
|
|
|
11
11
|
function fingerPrintOfQuery(query) {
|
|
12
12
|
return JSON.stringify(query);
|
|
13
13
|
}
|
|
14
|
-
function executeStaticSliceQuery({
|
|
14
|
+
async function executeStaticSliceQuery({ analyzer }, queries) {
|
|
15
15
|
const start = Date.now();
|
|
16
16
|
const results = {};
|
|
17
17
|
for (const query of queries) {
|
|
@@ -21,14 +21,14 @@ function executeStaticSliceQuery({ dataflow, ast, config }, queries) {
|
|
|
21
21
|
}
|
|
22
22
|
const { criteria, noReconstruction, noMagicComments } = query;
|
|
23
23
|
const sliceStart = Date.now();
|
|
24
|
-
const slice = (0, static_slicer_1.staticSlice)(dataflow,
|
|
24
|
+
const slice = (0, static_slicer_1.staticSlice)(await analyzer.dataflow(), await analyzer.normalize(), criteria, query.direction ?? _00_slice_1.SliceDirection.Backward, analyzer.flowrConfig.solver.slicer?.threshold);
|
|
25
25
|
const sliceEnd = Date.now();
|
|
26
26
|
if (noReconstruction) {
|
|
27
27
|
results[key] = { slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } } };
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
const reconstructStart = Date.now();
|
|
31
|
-
const reconstruct = (0, reconstruct_1.reconstructToCode)(
|
|
31
|
+
const reconstruct = (0, reconstruct_1.reconstructToCode)(await analyzer.normalize(), slice.result, noMagicComments ? auto_select_defaults_1.doNotAutoSelect : (0, magic_comments_1.makeMagicCommentHandler)(auto_select_defaults_1.doNotAutoSelect));
|
|
32
32
|
const reconstructEnd = Date.now();
|
|
33
33
|
results[key] = {
|
|
34
34
|
slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } },
|
|
@@ -30,60 +30,7 @@ export interface StaticSliceQueryResult extends BaseQueryResult {
|
|
|
30
30
|
}
|
|
31
31
|
export declare const StaticSliceQueryDefinition: {
|
|
32
32
|
readonly executor: typeof executeStaticSliceQuery;
|
|
33
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter,
|
|
34
|
-
readonly name: "parse";
|
|
35
|
-
readonly humanReadableName: "parse with R shell";
|
|
36
|
-
readonly description: "Parse the given R code into an AST";
|
|
37
|
-
readonly processor: (_results: unknown, input: Partial<import("../../../r-bridge/parser").ParseRequiredInput<string>>) => Promise<import("../../../r-bridge/parser").ParseStepOutput<string>>;
|
|
38
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
39
|
-
readonly printer: {
|
|
40
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
41
|
-
readonly 2: {
|
|
42
|
-
(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string;
|
|
43
|
-
(value: any, replacer?: (number | string)[] | null, space?: string | number): string;
|
|
44
|
-
};
|
|
45
|
-
readonly 5: ({ parsed }: import("../../../r-bridge/parser").ParseStepOutput<string>, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
46
|
-
};
|
|
47
|
-
readonly dependencies: readonly [];
|
|
48
|
-
readonly requiredInput: import("../../../r-bridge/parser").ParseRequiredInput<string>;
|
|
49
|
-
} | {
|
|
50
|
-
readonly name: "normalize";
|
|
51
|
-
readonly humanReadableName: "normalize";
|
|
52
|
-
readonly description: "Normalize the AST to flowR's AST";
|
|
53
|
-
readonly processor: (results: {
|
|
54
|
-
parse?: import("../../../r-bridge/parser").ParseStepOutput<string>;
|
|
55
|
-
}, 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>>;
|
|
56
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
57
|
-
readonly printer: {
|
|
58
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
59
|
-
readonly 2: typeof import("../../../core/print/normalize-printer").normalizedAstToJson;
|
|
60
|
-
readonly 5: typeof import("../../../core/print/normalize-printer").normalizedAstToQuads;
|
|
61
|
-
readonly 3: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaid;
|
|
62
|
-
readonly 4: typeof import("../../../core/print/normalize-printer").printNormalizedAstToMermaidUrl;
|
|
63
|
-
};
|
|
64
|
-
readonly dependencies: readonly ["parse"];
|
|
65
|
-
readonly requiredInput: import("../../../core/steps/all/core/10-normalize").NormalizeRequiredInput;
|
|
66
|
-
} | {
|
|
67
|
-
readonly humanReadableName: "dataflow";
|
|
68
|
-
readonly processor: (results: {
|
|
69
|
-
normalize?: import("../../../r-bridge/lang-4.x/ast/model/processing/decorate").NormalizedAst;
|
|
70
|
-
}, input: {
|
|
71
|
-
request?: import("../../../r-bridge/retriever").RParseRequests;
|
|
72
|
-
parser?: import("../../../r-bridge/parser").Parser<import("../../../r-bridge/parser").KnownParserType>;
|
|
73
|
-
}, config: import("../../../config").FlowrConfigOptions) => import("../../../dataflow/info").DataflowInformation;
|
|
74
|
-
readonly requiredInput: {};
|
|
75
|
-
readonly name: "dataflow";
|
|
76
|
-
readonly description: "Construct the dataflow graph";
|
|
77
|
-
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
78
|
-
readonly printer: {
|
|
79
|
-
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
80
|
-
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
81
|
-
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
82
|
-
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
83
|
-
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
84
|
-
};
|
|
85
|
-
readonly dependencies: readonly ["normalize"];
|
|
86
|
-
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
33
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").FlowrAnalysisProvider, queryResults: BaseQueryResult, result: string[]) => true;
|
|
87
34
|
readonly schema: Joi.ObjectSchema<any>;
|
|
88
35
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
89
36
|
};
|
|
@@ -12,7 +12,7 @@ const query_print_1 = require("../../query-print");
|
|
|
12
12
|
const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
|
|
13
13
|
exports.StaticSliceQueryDefinition = {
|
|
14
14
|
executor: static_slice_query_executor_1.executeStaticSliceQuery,
|
|
15
|
-
asciiSummarizer: (formatter,
|
|
15
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
16
16
|
const out = queryResults;
|
|
17
17
|
result.push(`Query: ${(0, ansi_1.bold)('static-slice', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
18
18
|
for (const [fingerprint, obj] of Object.entries(out.results)) {
|
package/queries/query-print.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { OutputFormatter } from '../util/text/ansi';
|
|
2
2
|
import type { Queries, QueryResults, SupportedQueryTypes } from './query';
|
|
3
|
-
import type { PipelineOutput } from '../core/steps/pipeline/pipeline';
|
|
4
|
-
import type { DEFAULT_DATAFLOW_PIPELINE } from '../core/steps/pipeline/default-pipelines';
|
|
5
3
|
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
|
-
|
|
4
|
+
import type { AstIdMap, ParentInformation } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
|
+
import type { FlowrAnalysisProvider } from '../project/flowr-analyzer';
|
|
6
|
+
export declare function asciiCallContext(formatter: OutputFormatter, results: QueryResults<'call-context'>['call-context'], idMap: AstIdMap<ParentInformation>): string;
|
|
7
7
|
export declare function summarizeIdsIfTooLong(formatter: OutputFormatter, ids: readonly NodeId[]): string;
|
|
8
|
-
export declare function asciiSummaryOfQueryResult<S extends SupportedQueryTypes>(formatter: OutputFormatter, totalInMs: number, results:
|
|
8
|
+
export declare function asciiSummaryOfQueryResult<S extends SupportedQueryTypes>(formatter: OutputFormatter, totalInMs: number, results: QueryResults<S>, analyzer: FlowrAnalysisProvider, queries: Queries<S>): Promise<string>;
|
package/queries/query-print.js
CHANGED
|
@@ -8,48 +8,48 @@ const query_1 = require("./query");
|
|
|
8
8
|
const html_hover_over_1 = require("../util/html-hover-over");
|
|
9
9
|
const time_1 = require("../util/text/time");
|
|
10
10
|
const built_in_1 = require("../dataflow/environments/built-in");
|
|
11
|
-
function nodeString(nodeId, formatter,
|
|
11
|
+
function nodeString(nodeId, formatter, idMap) {
|
|
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
15
|
if ((0, built_in_1.isBuiltIn)(id)) {
|
|
16
16
|
return (0, ansi_1.italic)(id, formatter) + (info ? ` (${JSON.stringify(info)})` : '');
|
|
17
17
|
}
|
|
18
|
-
const node =
|
|
18
|
+
const node = idMap.get(id);
|
|
19
19
|
if (node === undefined) {
|
|
20
20
|
return `UNKNOWN: ${id} (info: ${JSON.stringify(info)})`;
|
|
21
21
|
}
|
|
22
22
|
return `${(0, ansi_1.italic)('`' + (node.lexeme ?? node.info.fullLexeme ?? 'UNKNOWN') + '`', formatter)} (L.${node.location?.[0]}${info ? ', ' + JSON.stringify(info) : ''})`;
|
|
23
23
|
}
|
|
24
|
-
function asciiCallContextSubHit(formatter, results,
|
|
24
|
+
function asciiCallContextSubHit(formatter, results, idMap) {
|
|
25
25
|
const result = [];
|
|
26
26
|
for (const { id, calls = [], linkedIds = [], aliasRoots = [] } of results) {
|
|
27
|
-
const node =
|
|
27
|
+
const node = idMap.get(id);
|
|
28
28
|
if (node === undefined) {
|
|
29
29
|
result.push(` ${(0, ansi_1.bold)('UNKNOWN: ' + JSON.stringify({ calls, linkedIds }))}`);
|
|
30
30
|
continue;
|
|
31
31
|
}
|
|
32
|
-
let line = nodeString(id, formatter,
|
|
32
|
+
let line = nodeString(id, formatter, idMap);
|
|
33
33
|
if (calls.length > 0) {
|
|
34
|
-
line += ` with ${calls.length} call${calls.length > 1 ? 's' : ''} (${calls.map(c => nodeString(c, formatter,
|
|
34
|
+
line += ` with ${calls.length} call${calls.length > 1 ? 's' : ''} (${calls.map(c => nodeString(c, formatter, idMap)).join(', ')})`;
|
|
35
35
|
}
|
|
36
36
|
if (linkedIds.length > 0) {
|
|
37
|
-
line += ` with ${linkedIds.length} link${linkedIds.length > 1 ? 's' : ''} (${linkedIds.map(c => nodeString(c, formatter,
|
|
37
|
+
line += ` with ${linkedIds.length} link${linkedIds.length > 1 ? 's' : ''} (${linkedIds.map(c => nodeString(c, formatter, idMap)).join(', ')})`;
|
|
38
38
|
}
|
|
39
39
|
if (aliasRoots.length > 0) {
|
|
40
|
-
line += ` with ${aliasRoots.length} alias root${aliasRoots.length > 1 ? 's' : ''} (${aliasRoots.map(c => nodeString(c, formatter,
|
|
40
|
+
line += ` with ${aliasRoots.length} alias root${aliasRoots.length > 1 ? 's' : ''} (${aliasRoots.map(c => nodeString(c, formatter, idMap)).join(', ')})`;
|
|
41
41
|
}
|
|
42
42
|
result.push(line);
|
|
43
43
|
}
|
|
44
44
|
return result.join(', ');
|
|
45
45
|
}
|
|
46
|
-
function asciiCallContext(formatter, results,
|
|
46
|
+
function asciiCallContext(formatter, results, idMap) {
|
|
47
47
|
/* traverse over 'kinds' and within them 'subkinds' */
|
|
48
48
|
const result = [];
|
|
49
49
|
for (const [kind, { subkinds }] of Object.entries(results['kinds'])) {
|
|
50
50
|
result.push(` ╰ ${(0, ansi_1.bold)(kind, formatter)}`);
|
|
51
51
|
for (const [subkind, values] of Object.entries(subkinds)) {
|
|
52
|
-
result.push(` ╰ ${(0, ansi_1.bold)(subkind, formatter)}: ${asciiCallContextSubHit(formatter, values,
|
|
52
|
+
result.push(` ╰ ${(0, ansi_1.bold)(subkind, formatter)}: ${asciiCallContextSubHit(formatter, values, idMap)}`);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
return result.join('\n');
|
|
@@ -69,7 +69,7 @@ function summarizeIdsIfTooLong(formatter, ids) {
|
|
|
69
69
|
}
|
|
70
70
|
return formatter === ansi_1.markdownFormatter ? (0, html_hover_over_1.textWithTooltip)(acc, JSON.stringify(ids)) : acc;
|
|
71
71
|
}
|
|
72
|
-
function asciiSummaryOfQueryResult(formatter, totalInMs, results,
|
|
72
|
+
async function asciiSummaryOfQueryResult(formatter, totalInMs, results, analyzer, queries) {
|
|
73
73
|
const result = [];
|
|
74
74
|
for (const [query, queryResults] of Object.entries(results)) {
|
|
75
75
|
if (query === '.meta') {
|
|
@@ -77,7 +77,7 @@ function asciiSummaryOfQueryResult(formatter, totalInMs, results, processed, que
|
|
|
77
77
|
}
|
|
78
78
|
const queryType = query_1.SupportedQueries[query];
|
|
79
79
|
const relevantQueries = queries.filter(q => q.type === query);
|
|
80
|
-
if (queryType.asciiSummarizer(formatter,
|
|
80
|
+
if (await queryType.asciiSummarizer(formatter, analyzer, queryResults, result, relevantQueries)) {
|
|
81
81
|
continue;
|
|
82
82
|
}
|
|
83
83
|
result.push(`Query: ${(0, ansi_1.bold)(query, formatter)}`);
|