@eagleoutice/flowr 2.9.11 → 2.9.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -31
- package/benchmark/slicer.d.ts +4 -2
- package/benchmark/slicer.js +20 -6
- package/benchmark/stats/print.js +12 -0
- package/benchmark/stats/stats.d.ts +3 -2
- package/benchmark/stats/stats.js +1 -1
- package/benchmark/summarizer/data.d.ts +1 -0
- package/benchmark/summarizer/second-phase/process.js +5 -0
- package/cli/benchmark-app.d.ts +1 -0
- package/cli/benchmark-app.js +1 -0
- package/cli/benchmark-helper-app.d.ts +2 -1
- package/cli/benchmark-helper-app.js +6 -3
- package/cli/common/options.d.ts +8 -0
- package/cli/common/options.js +3 -1
- package/cli/common/scripts-info.d.ts +8 -0
- package/cli/export-quads-app.js +1 -1
- package/cli/flowr.js +3 -3
- package/cli/repl/core.d.ts +3 -3
- package/cli/repl/server/connection.d.ts +2 -2
- package/cli/repl/server/server.d.ts +2 -2
- package/cli/script-core/statistics-core.d.ts +2 -2
- package/cli/script-core/statistics-helper-core.d.ts +2 -2
- package/cli/script-core/statistics-helper-core.js +1 -1
- package/cli/slicer-app.js +2 -2
- package/cli/statistics-app.js +1 -1
- package/cli/statistics-helper-app.js +1 -1
- package/cli/wiki.js +2 -2
- package/config.d.ts +65 -24
- package/config.js +197 -161
- package/control-flow/extract-cfg.js +5 -8
- package/core/steps/pipeline-step.d.ts +2 -2
- package/dataflow/cluster.js +12 -8
- package/dataflow/eval/resolve/alias-tracking.js +12 -15
- package/dataflow/graph/graph.js +8 -8
- package/dataflow/graph/quads.js +4 -7
- package/dataflow/internal/linker.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +20 -9
- package/documentation/doc-readme.js +2 -2
- package/documentation/wiki-analyzer.js +7 -5
- package/documentation/wiki-core.js +1 -3
- package/documentation/wiki-dataflow-graph.js +87 -32
- package/documentation/wiki-engine.js +18 -0
- package/documentation/wiki-interface.js +5 -3
- package/documentation/wiki-linter.js +5 -5
- package/documentation/wiki-mk/doc-context.d.ts +44 -11
- package/documentation/wiki-mk/doc-context.js +19 -17
- package/engines.d.ts +2 -2
- package/engines.js +4 -4
- package/linter/rules/dataframe-access-validation.js +5 -5
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +7 -3
- package/package.json +3 -1
- package/project/context/flowr-analyzer-context.d.ts +6 -6
- package/project/context/flowr-analyzer-context.js +2 -2
- package/project/context/flowr-analyzer-files-context.d.ts +2 -2
- package/project/context/flowr-analyzer-files-context.js +28 -8
- package/project/flowr-analyzer-builder.d.ts +10 -6
- package/project/flowr-analyzer-builder.js +12 -3
- package/project/flowr-analyzer.d.ts +3 -3
- package/queries/catalog/config-query/config-query-format.d.ts +5 -5
- package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +9 -1
- package/queries/catalog/dependencies-query/function-info/write-functions.js +1 -0
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +2 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
- package/queries/catalog/files-query/files-query-format.d.ts +3 -3
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +3 -3
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +3 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/query.d.ts +18 -18
- package/r-bridge/lang-4.x/ast/model/model.d.ts +7 -2
- package/r-bridge/lang-4.x/ast/model/model.js +13 -0
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +6 -2
- package/statistics/statistics.d.ts +2 -2
- package/util/mermaid/dfg.d.ts +8 -0
- package/util/mermaid/dfg.js +4 -0
- package/util/objects.d.ts +12 -0
- package/util/objects.js +28 -0
- package/util/quads.js +14 -6
- package/util/range.d.ts +3 -0
- package/util/range.js +3 -0
- package/util/summarizer.js +1 -1
- package/util/version.js +1 -1
|
@@ -2,20 +2,20 @@ import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
|
2
2
|
import { executeConfigQuery } from './config-query-executor';
|
|
3
3
|
import { type OutputFormatter } from '../../../util/text/ansi';
|
|
4
4
|
import Joi from 'joi';
|
|
5
|
-
import type {
|
|
5
|
+
import type { FlowrConfig } from '../../../config';
|
|
6
6
|
import type { DeepPartial } from 'ts-essentials';
|
|
7
7
|
import type { ParsedQueryLine, Query } from '../../query';
|
|
8
8
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
9
9
|
import type { CommandCompletions } from '../../../cli/repl/core';
|
|
10
10
|
export interface ConfigQuery extends BaseQueryFormat {
|
|
11
11
|
readonly type: 'config';
|
|
12
|
-
readonly update?: DeepPartial<
|
|
12
|
+
readonly update?: DeepPartial<FlowrConfig>;
|
|
13
13
|
}
|
|
14
14
|
export interface ConfigQueryResult extends BaseQueryResult {
|
|
15
|
-
readonly config:
|
|
15
|
+
readonly config: FlowrConfig;
|
|
16
16
|
}
|
|
17
|
-
declare function configReplCompleter(partialLine: readonly string[], _startingNewArg: boolean, config:
|
|
18
|
-
declare function configQueryLineParser(output: ReplOutput, line: readonly string[], _config:
|
|
17
|
+
declare function configReplCompleter(partialLine: readonly string[], _startingNewArg: boolean, config: FlowrConfig): CommandCompletions;
|
|
18
|
+
declare function configQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'config'>;
|
|
19
19
|
export declare const ConfigQueryDefinition: {
|
|
20
20
|
readonly executor: typeof executeConfigQuery;
|
|
21
21
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
|
|
@@ -13,6 +13,7 @@ exports.LibraryFunctions = [
|
|
|
13
13
|
{ package: 'easypackages', name: 'from_import', argIdx: 0, argName: 'package', resolveValue: true },
|
|
14
14
|
{ package: 'easypackages', name: 'libraries', argIdx: 'unnamed', resolveValue: true },
|
|
15
15
|
{ package: 'librarian', name: 'shelf', argIdx: 'unnamed', resolveValue: true },
|
|
16
|
-
{ package: 'devtools', name: 'load_all', argIdx: 0, argName: 'path', resolveValue: true }
|
|
16
|
+
{ package: 'devtools', name: 'load_all', argIdx: 0, argName: 'path', resolveValue: true, defaultValue: '.' },
|
|
17
|
+
{ package: 'devtools', name: 'load_code', argIdx: 0, argName: 'path', resolveValue: true, defaultValue: '.' },
|
|
17
18
|
];
|
|
18
19
|
//# sourceMappingURL=library-functions.js.map
|
|
@@ -93,7 +93,7 @@ exports.ReadFunctions = [
|
|
|
93
93
|
{ package: 'XLConnect', name: 'loadWorkbook', argIdx: 0, argName: 'filename', resolveValue: true },
|
|
94
94
|
{ package: 'DiagrammeR', name: 'import_graph', argIdx: 0, argName: 'graph_file', resolveValue: true },
|
|
95
95
|
{ package: 'DiagrammeR', name: 'open_graph', argIdx: 0, argName: 'file', resolveValue: true },
|
|
96
|
-
{ package: 'highcharter', name: 'download_map_data', argIdx: 0, argName: 'url', resolveValue: true },
|
|
96
|
+
{ package: 'highcharter', name: 'download_map_data', argIdx: 0, argName: 'url', resolveValue: true, defaultValue: 'custom/world.js' },
|
|
97
97
|
{ package: 'rvest', name: 'read_html', argIdx: 0, argName: 'x', resolveValue: true },
|
|
98
98
|
{ package: 'rvest', name: 'read_html_live', argIdx: 0, argName: 'url', resolveValue: true },
|
|
99
99
|
{ package: 'stats', name: 'read.ftable', argIdx: 0, argName: 'file', resolveValue: true },
|
|
@@ -9,5 +9,13 @@ exports.VisualizeFunctions =
|
|
|
9
9
|
// plot creation
|
|
10
10
|
default_builtin_config_1.GgPlotCreate.map(f => ({ package: 'ggplot2', name: f })).concat(default_builtin_config_1.TinyPlotCrate.map(f => ({ package: 'tinyplot', name: f })), default_builtin_config_1.GraphicsPlotCreate.map(f => ({ name: f })),
|
|
11
11
|
// plot modification
|
|
12
|
-
default_builtin_config_1.GgPlotImplicitAddons.concat(default_builtin_config_1.GgPlotAddons).map(f => ({ package: 'ggplot2', name: f, linkTo: LinkToPlotCreation })), default_builtin_config_1.TinyPlotAddons.map(f => ({ package: 'tinyplot', name: f, linkTo: LinkToPlotCreation })), default_builtin_config_1.GraphicsPlotAddons.map(f => ({ name: f, linkTo: LinkToPlotCreation })))
|
|
12
|
+
default_builtin_config_1.GgPlotImplicitAddons.concat(default_builtin_config_1.GgPlotAddons).map(f => ({ package: 'ggplot2', name: f, linkTo: LinkToPlotCreation })), default_builtin_config_1.TinyPlotAddons.map(f => ({ package: 'tinyplot', name: f, linkTo: LinkToPlotCreation })), default_builtin_config_1.GraphicsPlotAddons.map(f => ({ name: f, linkTo: LinkToPlotCreation }))).map(f => {
|
|
13
|
+
if (f.name !== 'hist') {
|
|
14
|
+
return f;
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
// ignore if plot is false.
|
|
18
|
+
return { ...f, ignoreIf: 'arg-false', additionalArgs: { val: { argIdx: 17, argName: 'plot', resolveValue: true } } };
|
|
19
|
+
}
|
|
20
|
+
});
|
|
13
21
|
//# sourceMappingURL=visualize-functions.js.map
|
|
@@ -115,5 +115,6 @@ exports.WriteFunctions = [
|
|
|
115
115
|
{ package: 'rpolars', name: 'write_csv', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
|
|
116
116
|
{ package: 'rpolars', name: 'write_ndjson', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
|
|
117
117
|
{ package: 'rpolars', name: 'write_parquet', argIdx: 0, argName: 'file', resolveValue: true, ignoreIf: 'arg-missing' },
|
|
118
|
+
{ package: 'magick', name: 'image_write', argIdx: 1, argName: 'path', resolveValue: true, ignoreIf: 'arg-missing' },
|
|
118
119
|
];
|
|
119
120
|
//# sourceMappingURL=write-functions.js.map
|
|
@@ -2,7 +2,7 @@ import Joi from 'joi';
|
|
|
2
2
|
import type { DataFrameDomain } from '../../../abstract-interpretation/data-frame/dataframe-domain';
|
|
3
3
|
import type { StateAbstractDomain } from '../../../abstract-interpretation/domains/state-abstract-domain';
|
|
4
4
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
5
|
-
import type {
|
|
5
|
+
import type { FlowrConfig } from '../../../config';
|
|
6
6
|
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
7
7
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
8
8
|
import type { ParsedQueryLine } from '../../query';
|
|
@@ -15,7 +15,7 @@ export interface DfShapeQuery extends BaseQueryFormat {
|
|
|
15
15
|
export interface DfShapeQueryResult extends BaseQueryResult {
|
|
16
16
|
domains: StateAbstractDomain<DataFrameDomain> | Map<SingleSlicingCriterion, DataFrameDomain | undefined>;
|
|
17
17
|
}
|
|
18
|
-
declare function dfShapeQueryLineParser(_output: ReplOutput, line: readonly string[], _config:
|
|
18
|
+
declare function dfShapeQueryLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'df-shape'>;
|
|
19
19
|
export declare const DfShapeQueryDefinition: {
|
|
20
20
|
readonly executor: typeof executeDfShapeQuery;
|
|
21
21
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
@@ -5,7 +5,7 @@ import { executeDoesCallQuery } from './does-call-query-executor';
|
|
|
5
5
|
import { type NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
6
|
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
7
7
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
-
import type {
|
|
8
|
+
import type { FlowrConfig } from '../../../config';
|
|
9
9
|
interface CallsIdConstraint {
|
|
10
10
|
readonly type: 'calls-id';
|
|
11
11
|
/** The id of the function being called. */
|
|
@@ -40,7 +40,7 @@ export interface DoesCallQueryResult extends BaseQueryResult {
|
|
|
40
40
|
/** Results are either false (does not call) or an object with details on the calls made */
|
|
41
41
|
readonly results: Record<string, FindAllCallsResult | false>;
|
|
42
42
|
}
|
|
43
|
-
declare function doesCallQueryLineParser(output: ReplOutput, line: readonly string[], _config:
|
|
43
|
+
declare function doesCallQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'does-call'>;
|
|
44
44
|
export declare const DoesCallQueryDefinition: {
|
|
45
45
|
readonly executor: typeof executeDoesCallQuery;
|
|
46
46
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
@@ -5,7 +5,7 @@ import { executeFileQuery } from './files-query-executor';
|
|
|
5
5
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
6
|
import { FileRole } from '../../../project/context/flowr-file';
|
|
7
7
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
-
import type {
|
|
8
|
+
import type { FlowrConfig } from '../../../config';
|
|
9
9
|
import type { CommandCompletions } from '../../../cli/repl/core';
|
|
10
10
|
/**
|
|
11
11
|
* Returns the content(s) of all files matching the given pattern.
|
|
@@ -24,8 +24,8 @@ export interface FileQueryInfo<T = object> {
|
|
|
24
24
|
export interface FilesQueryResult extends BaseQueryResult {
|
|
25
25
|
files: FileQueryInfo[];
|
|
26
26
|
}
|
|
27
|
-
declare function filesQueryLineParser(output: ReplOutput, line: readonly string[], _config:
|
|
28
|
-
declare function filesQueryCompleter(line: readonly string[], startingNewArg: boolean, _config:
|
|
27
|
+
declare function filesQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'files'>;
|
|
28
|
+
declare function filesQueryCompleter(line: readonly string[], startingNewArg: boolean, _config: FlowrConfig): CommandCompletions;
|
|
29
29
|
export declare const FilesQueryDefinition: {
|
|
30
30
|
readonly executor: typeof executeFileQuery;
|
|
31
31
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
@@ -4,7 +4,7 @@ import type { ParsedQueryLine } from '../../query';
|
|
|
4
4
|
import { executeExceptionQuery } from './inspect-exception-query-executor';
|
|
5
5
|
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
6
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
7
|
-
import type {
|
|
7
|
+
import type { FlowrConfig } from '../../../config';
|
|
8
8
|
import type { ExceptionPoint } from '../../../dataflow/fn/exceptions-of-function';
|
|
9
9
|
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
10
10
|
/**
|
|
@@ -23,7 +23,7 @@ export interface InspectExceptionQueryResult extends BaseQueryResult {
|
|
|
23
23
|
*/
|
|
24
24
|
readonly exceptions: Record<NodeId, ExceptionPoint[]>;
|
|
25
25
|
}
|
|
26
|
-
declare function inspectExceptionLineParser(_output: ReplOutput, line: readonly string[], _config:
|
|
26
|
+
declare function inspectExceptionLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-exception'>;
|
|
27
27
|
export declare const InspectExceptionQueryDefinition: {
|
|
28
28
|
readonly executor: typeof executeExceptionQuery;
|
|
29
29
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
@@ -5,7 +5,7 @@ import { executeHigherOrderQuery } from './inspect-higher-order-query-executor';
|
|
|
5
5
|
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
6
|
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
7
7
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
-
import type {
|
|
8
|
+
import type { FlowrConfig } from '../../../config';
|
|
9
9
|
/**
|
|
10
10
|
* Either returns all function definitions alongside whether they are higher-order functions,
|
|
11
11
|
* or just those matching the filters.
|
|
@@ -17,7 +17,7 @@ export interface InspectHigherOrderQuery extends BaseQueryFormat {
|
|
|
17
17
|
export interface InspectHigherOrderQueryResult extends BaseQueryResult {
|
|
18
18
|
readonly higherOrder: Record<NodeId, boolean>;
|
|
19
19
|
}
|
|
20
|
-
declare function inspectHoLineParser(_output: ReplOutput, line: readonly string[], _config:
|
|
20
|
+
declare function inspectHoLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-higher-order'>;
|
|
21
21
|
export declare const InspectHigherOrderQueryDefinition: {
|
|
22
22
|
readonly executor: typeof executeHigherOrderQuery;
|
|
23
23
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
@@ -5,7 +5,7 @@ import { executeRecursionQuery } from './inspect-recursion-query-executor';
|
|
|
5
5
|
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
6
|
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
7
7
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
-
import type {
|
|
8
|
+
import type { FlowrConfig } from '../../../config';
|
|
9
9
|
/**
|
|
10
10
|
* Either returns all function definitions alongside whether they are recursive,
|
|
11
11
|
* or just those matching the filters.
|
|
@@ -17,7 +17,7 @@ export interface InspectRecursionQuery extends BaseQueryFormat {
|
|
|
17
17
|
export interface InspectRecursionQueryResult extends BaseQueryResult {
|
|
18
18
|
readonly recursive: Record<NodeId, boolean>;
|
|
19
19
|
}
|
|
20
|
-
declare function inspectRecLineParser(output: ReplOutput, line: readonly string[], _config:
|
|
20
|
+
declare function inspectRecLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-recursion'>;
|
|
21
21
|
export declare const InspectRecursionQueryDefinition: {
|
|
22
22
|
readonly executor: typeof executeRecursionQuery;
|
|
23
23
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
@@ -4,7 +4,7 @@ import Joi from 'joi';
|
|
|
4
4
|
import { executeLinterQuery } from './linter-query-executor';
|
|
5
5
|
import { type LintingRuleNames } from '../../../linter/linter-rules';
|
|
6
6
|
import { type ConfiguredLintingRule, LintingResults } from '../../../linter/linter-format';
|
|
7
|
-
import type {
|
|
7
|
+
import type { FlowrConfig } from '../../../config';
|
|
8
8
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
9
9
|
import type { CommandCompletions } from '../../../cli/repl/core';
|
|
10
10
|
export interface LinterQuery extends BaseQueryFormat {
|
|
@@ -23,8 +23,8 @@ export interface LinterQueryResult extends BaseQueryResult {
|
|
|
23
23
|
[L in LintingRuleNames]?: LintingResults<L>;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
declare function linterQueryLineParser(output: ReplOutput, line: readonly string[], _config:
|
|
27
|
-
declare function linterQueryCompleter(line: readonly string[], startingNewArg: boolean, _config:
|
|
26
|
+
declare function linterQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'linter'>;
|
|
27
|
+
declare function linterQueryCompleter(line: readonly string[], startingNewArg: boolean, _config: FlowrConfig): CommandCompletions;
|
|
28
28
|
export declare const LinterQueryDefinition: {
|
|
29
29
|
readonly executor: typeof executeLinterQuery;
|
|
30
30
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
@@ -6,7 +6,7 @@ import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/nod
|
|
|
6
6
|
import type { SourceRange } from '../../../util/range';
|
|
7
7
|
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
8
8
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
9
|
-
import type {
|
|
9
|
+
import type { FlowrConfig } from '../../../config';
|
|
10
10
|
import type { ParsedQueryLine } from '../../query';
|
|
11
11
|
export interface LocationMapQuery extends BaseQueryFormat {
|
|
12
12
|
readonly type: 'location-map';
|
|
@@ -25,7 +25,7 @@ export interface LocationMapQueryResult extends BaseQueryResult {
|
|
|
25
25
|
ids: Record<NodeId, [FileId, SourceRange]>;
|
|
26
26
|
};
|
|
27
27
|
}
|
|
28
|
-
declare function locationMapLineParser(_output: ReplOutput, line: readonly string[], _config:
|
|
28
|
+
declare function locationMapLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'location-map'>;
|
|
29
29
|
export declare const LocationMapQueryDefinition: {
|
|
30
30
|
readonly executor: typeof executeLocationMapQuery;
|
|
31
31
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => true;
|
|
@@ -6,7 +6,7 @@ import { executeResolveValueQuery } from './origin-query-executor';
|
|
|
6
6
|
import type { Origin } from '../../../dataflow/origin/dfg-get-origin';
|
|
7
7
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
8
8
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
9
|
-
import type {
|
|
9
|
+
import type { FlowrConfig } from '../../../config';
|
|
10
10
|
export interface OriginQuery extends BaseQueryFormat {
|
|
11
11
|
readonly type: 'origin';
|
|
12
12
|
/** The slicing criteria to use */
|
|
@@ -15,7 +15,7 @@ export interface OriginQuery extends BaseQueryFormat {
|
|
|
15
15
|
export interface OriginQueryResult extends BaseQueryResult {
|
|
16
16
|
results: Record<SingleSlicingCriterion, Origin[] | undefined>;
|
|
17
17
|
}
|
|
18
|
-
declare function originQueryLineParser(output: ReplOutput, line: readonly string[], _config:
|
|
18
|
+
declare function originQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'origin'>;
|
|
19
19
|
export declare const OriginQueryDefinition: {
|
|
20
20
|
readonly executor: typeof executeResolveValueQuery;
|
|
21
21
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
@@ -18,15 +18,15 @@ async function executeResolveValueQuery({ analyzer }, queries) {
|
|
|
18
18
|
const start = Date.now();
|
|
19
19
|
const results = {};
|
|
20
20
|
const graph = (await analyzer.dataflow()).graph;
|
|
21
|
-
const
|
|
21
|
+
const idMap = (await analyzer.normalize()).idMap;
|
|
22
22
|
for (const query of queries) {
|
|
23
23
|
const key = fingerPrintOfQuery(query);
|
|
24
24
|
if (results[key]) {
|
|
25
25
|
log_1.log.warn(`Duplicate Key for resolve-value-query: ${key}, skipping...`);
|
|
26
26
|
}
|
|
27
27
|
const values = query.criteria
|
|
28
|
-
.map(criteria => (0, parse_1.slicingCriterionToId)(criteria,
|
|
29
|
-
.flatMap(ident => (0, alias_tracking_1.resolveIdToValue)(ident, { graph, full: true, idMap
|
|
28
|
+
.map(criteria => (0, parse_1.slicingCriterionToId)(criteria, idMap))
|
|
29
|
+
.flatMap(ident => (0, alias_tracking_1.resolveIdToValue)(ident, { graph, full: true, idMap, resolve: analyzer.flowrConfig.solver.variables, ctx: analyzer.inspectContext() }));
|
|
30
30
|
results[key] = {
|
|
31
31
|
values: values
|
|
32
32
|
};
|
|
@@ -5,7 +5,7 @@ import Joi from 'joi';
|
|
|
5
5
|
import { executeResolveValueQuery } from './resolve-value-query-executor';
|
|
6
6
|
import type { ResolveResult } from '../../../dataflow/eval/resolve/alias-tracking';
|
|
7
7
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
-
import type {
|
|
8
|
+
import type { FlowrConfig } from '../../../config';
|
|
9
9
|
export interface ResolveValueQuery extends BaseQueryFormat {
|
|
10
10
|
readonly type: 'resolve-value';
|
|
11
11
|
/** The slicing criteria to use */
|
|
@@ -16,7 +16,7 @@ export interface ResolveValueQueryResult extends BaseQueryResult {
|
|
|
16
16
|
values: ResolveResult[];
|
|
17
17
|
}>;
|
|
18
18
|
}
|
|
19
|
-
declare function resolveValueLineParser(output: ReplOutput, line: readonly string[], _config:
|
|
19
|
+
declare function resolveValueLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'resolve-value'>;
|
|
20
20
|
export declare const ResolveValueQueryDefinition: {
|
|
21
21
|
readonly executor: typeof executeResolveValueQuery;
|
|
22
22
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
@@ -30,6 +30,10 @@ exports.ResolveValueQueryDefinition = {
|
|
|
30
30
|
executor: resolve_value_query_executor_1.executeResolveValueQuery,
|
|
31
31
|
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
32
32
|
const out = queryResults;
|
|
33
|
+
if (out === undefined || typeof out !== 'object' || !('.meta' in out)) {
|
|
34
|
+
result.push(formatter.format('Resolve value failed (maybe your criterion does not exist?)!', { color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }));
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
33
37
|
result.push(`Query: ${(0, ansi_1.bold)('resolve-value', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
34
38
|
for (const [fingerprint, obj] of Object.entries(out.results)) {
|
|
35
39
|
const { criteria } = JSON.parse(fingerprint);
|
|
@@ -8,7 +8,7 @@ import { executeStaticSliceQuery } from './static-slice-query-executor';
|
|
|
8
8
|
import { SliceDirection } from '../../../core/steps/all/static-slicing/00-slice';
|
|
9
9
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
10
10
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
11
|
-
import type {
|
|
11
|
+
import type { FlowrConfig } from '../../../config';
|
|
12
12
|
/** Calculates and returns all clusters encountered in the dataflow graph. */
|
|
13
13
|
export interface StaticSliceQuery extends BaseQueryFormat {
|
|
14
14
|
readonly type: 'static-slice';
|
|
@@ -31,7 +31,7 @@ export interface StaticSliceQueryResult extends BaseQueryResult {
|
|
|
31
31
|
*/
|
|
32
32
|
results: Record<string, Omit<PipelineOutput<typeof DEFAULT_SLICING_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>> | Omit<PipelineOutput<typeof DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>>>;
|
|
33
33
|
}
|
|
34
|
-
declare function sliceQueryLineParser(output: ReplOutput, line: readonly string[], _config:
|
|
34
|
+
declare function sliceQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'static-slice'>;
|
|
35
35
|
export declare const StaticSliceQueryDefinition: {
|
|
36
36
|
readonly executor: typeof executeStaticSliceQuery;
|
|
37
37
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
package/queries/query.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
|
23
23
|
import { type ControlFlowQuery } from './catalog/control-flow-query/control-flow-query-format';
|
|
24
24
|
import { type DfShapeQuery } from './catalog/df-shape-query/df-shape-query-format';
|
|
25
25
|
import type { AsyncOrSync } from 'ts-essentials';
|
|
26
|
-
import type {
|
|
26
|
+
import type { FlowrConfig } from '../config';
|
|
27
27
|
import { type InspectHigherOrderQuery } from './catalog/inspect-higher-order-query/inspect-higher-order-query-format';
|
|
28
28
|
import type { ReadonlyFlowrAnalysisProvider } from '../project/flowr-analyzer';
|
|
29
29
|
import type { ReplOutput } from '../cli/repl/commands/repl-main';
|
|
@@ -53,9 +53,9 @@ export interface ParsedQueryLine<QueryType extends BaseQueryFormat['type']> {
|
|
|
53
53
|
export interface SupportedQuery<QueryType extends BaseQueryFormat['type'] = BaseQueryFormat['type']> {
|
|
54
54
|
executor: QueryExecutor<QueryArgumentsWithType<QueryType>, Promise<BaseQueryResult>>;
|
|
55
55
|
/** optional completion in, e.g., the repl */
|
|
56
|
-
completer?: (splitLine: readonly string[], startingNewArg: boolean, config:
|
|
56
|
+
completer?: (splitLine: readonly string[], startingNewArg: boolean, config: FlowrConfig) => CommandCompletions;
|
|
57
57
|
/** optional query construction from an, e.g., repl line */
|
|
58
|
-
fromLine?: (output: ReplOutput, splitLine: readonly string[], config:
|
|
58
|
+
fromLine?: (output: ReplOutput, splitLine: readonly string[], config: FlowrConfig) => ParsedQueryLine<QueryType>;
|
|
59
59
|
/**
|
|
60
60
|
* Generates an ASCII summary of the query result to be printed in, e.g., the REPL.
|
|
61
61
|
* @returns whether a summary was produced (`true` if so, `false` if not, in this case a default/generic summary will be created)
|
|
@@ -79,8 +79,8 @@ export declare const SupportedQueries: {
|
|
|
79
79
|
readonly config: {
|
|
80
80
|
readonly executor: typeof import("./catalog/config-query/config-query-executor").executeConfigQuery;
|
|
81
81
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
|
|
82
|
-
readonly completer: (partialLine: readonly string[], _startingNewArg: boolean, config:
|
|
83
|
-
readonly fromLine: (output: ReplOutput, line: readonly string[], _config:
|
|
82
|
+
readonly completer: (partialLine: readonly string[], _startingNewArg: boolean, config: FlowrConfig) => CommandCompletions;
|
|
83
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"config">;
|
|
84
84
|
readonly schema: Joi.ObjectSchema<any>;
|
|
85
85
|
readonly flattenInvolvedNodes: () => never[];
|
|
86
86
|
};
|
|
@@ -105,7 +105,7 @@ export declare const SupportedQueries: {
|
|
|
105
105
|
readonly 'does-call': {
|
|
106
106
|
readonly executor: typeof import("./catalog/does-call-query/does-call-query-executor").executeDoesCallQuery;
|
|
107
107
|
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
108
|
-
readonly fromLine: (output: ReplOutput, line: readonly string[], _config:
|
|
108
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"does-call">;
|
|
109
109
|
readonly schema: Joi.ObjectSchema<any>;
|
|
110
110
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
111
111
|
};
|
|
@@ -119,15 +119,15 @@ export declare const SupportedQueries: {
|
|
|
119
119
|
readonly executor: typeof import("./catalog/df-shape-query/df-shape-query-executor").executeDfShapeQuery;
|
|
120
120
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
121
121
|
readonly jsonFormatter: (queryResults: BaseQueryResult) => object;
|
|
122
|
-
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config:
|
|
122
|
+
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"df-shape">;
|
|
123
123
|
readonly schema: Joi.ObjectSchema<any>;
|
|
124
124
|
readonly flattenInvolvedNodes: () => never[];
|
|
125
125
|
};
|
|
126
126
|
readonly files: {
|
|
127
127
|
readonly executor: typeof import("./catalog/files-query/files-query-executor").executeFileQuery;
|
|
128
128
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
129
|
-
readonly completer: (line: readonly string[], startingNewArg: boolean, _config:
|
|
130
|
-
readonly fromLine: (output: ReplOutput, line: readonly string[], _config:
|
|
129
|
+
readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
|
|
130
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"files">;
|
|
131
131
|
readonly schema: Joi.ObjectSchema<any>;
|
|
132
132
|
readonly flattenInvolvedNodes: (_: BaseQueryResult) => NodeId[];
|
|
133
133
|
};
|
|
@@ -152,7 +152,7 @@ export declare const SupportedQueries: {
|
|
|
152
152
|
readonly 'static-slice': {
|
|
153
153
|
readonly executor: typeof import("./catalog/static-slice-query/static-slice-query-executor").executeStaticSliceQuery;
|
|
154
154
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
155
|
-
readonly fromLine: (output: ReplOutput, line: readonly string[], _config:
|
|
155
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"static-slice">;
|
|
156
156
|
readonly schema: Joi.ObjectSchema<any>;
|
|
157
157
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
158
158
|
};
|
|
@@ -165,7 +165,7 @@ export declare const SupportedQueries: {
|
|
|
165
165
|
readonly 'location-map': {
|
|
166
166
|
readonly executor: typeof import("./catalog/location-map-query/location-map-query-executor").executeLocationMapQuery;
|
|
167
167
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: unknown, queryResults: BaseQueryResult, result: string[]) => true;
|
|
168
|
-
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config:
|
|
168
|
+
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"location-map">;
|
|
169
169
|
readonly schema: Joi.ObjectSchema<any>;
|
|
170
170
|
readonly flattenInvolvedNodes: () => never[];
|
|
171
171
|
};
|
|
@@ -184,28 +184,28 @@ export declare const SupportedQueries: {
|
|
|
184
184
|
readonly 'inspect-exception': {
|
|
185
185
|
readonly executor: typeof import("./catalog/inspect-exceptions-query/inspect-exception-query-executor").executeExceptionQuery;
|
|
186
186
|
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
187
|
-
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config:
|
|
187
|
+
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-exception">;
|
|
188
188
|
readonly schema: Joi.ObjectSchema<any>;
|
|
189
189
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
190
190
|
};
|
|
191
191
|
readonly 'inspect-higher-order': {
|
|
192
192
|
readonly executor: typeof import("./catalog/inspect-higher-order-query/inspect-higher-order-query-executor").executeHigherOrderQuery;
|
|
193
193
|
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
194
|
-
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config:
|
|
194
|
+
readonly fromLine: (_output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-higher-order">;
|
|
195
195
|
readonly schema: Joi.ObjectSchema<any>;
|
|
196
196
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
197
197
|
};
|
|
198
198
|
readonly 'inspect-recursion': {
|
|
199
199
|
readonly executor: typeof import("./catalog/inspect-recursion-query/inspect-recursion-query-executor").executeRecursionQuery;
|
|
200
200
|
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
201
|
-
readonly fromLine: (output: ReplOutput, line: readonly string[], _config:
|
|
201
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-recursion">;
|
|
202
202
|
readonly schema: Joi.ObjectSchema<any>;
|
|
203
203
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
204
204
|
};
|
|
205
205
|
readonly 'resolve-value': {
|
|
206
206
|
readonly executor: typeof import("./catalog/resolve-value-query/resolve-value-query-executor").executeResolveValueQuery;
|
|
207
207
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
208
|
-
readonly fromLine: (output: ReplOutput, line: readonly string[], _config:
|
|
208
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"resolve-value">;
|
|
209
209
|
readonly schema: Joi.ObjectSchema<any>;
|
|
210
210
|
readonly flattenInvolvedNodes: () => never[];
|
|
211
211
|
};
|
|
@@ -218,15 +218,15 @@ export declare const SupportedQueries: {
|
|
|
218
218
|
readonly origin: {
|
|
219
219
|
readonly executor: typeof import("./catalog/origin-query/origin-query-executor").executeResolveValueQuery;
|
|
220
220
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
221
|
-
readonly fromLine: (output: ReplOutput, line: readonly string[], _config:
|
|
221
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"origin">;
|
|
222
222
|
readonly schema: Joi.ObjectSchema<any>;
|
|
223
223
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
224
224
|
};
|
|
225
225
|
readonly linter: {
|
|
226
226
|
readonly executor: typeof import("./catalog/linter-query/linter-query-executor").executeLinterQuery;
|
|
227
227
|
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
228
|
-
readonly completer: (line: readonly string[], startingNewArg: boolean, _config:
|
|
229
|
-
readonly fromLine: (output: ReplOutput, line: readonly string[], _config:
|
|
228
|
+
readonly completer: (line: readonly string[], startingNewArg: boolean, _config: FlowrConfig) => CommandCompletions;
|
|
229
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"linter">;
|
|
230
230
|
readonly schema: Joi.ObjectSchema<any>;
|
|
231
231
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => ((string & {
|
|
232
232
|
__brand?: "node-id";
|
|
@@ -258,13 +258,18 @@ export declare const RNode: {
|
|
|
258
258
|
* Returns the direct parent of a node.
|
|
259
259
|
* Usually, only root nodes do not have a parent, and you can assume that there is a
|
|
260
260
|
* linear chain of parents leading to the root node.
|
|
261
|
+
* @see {@link iterateParents} - to get all parents of a node
|
|
261
262
|
*/
|
|
262
|
-
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: Map<NodeId, RNode<OtherInfo>>) => RNode<OtherInfo> | undefined;
|
|
263
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: Map<NodeId, RNode<OtherInfo & ParentInformation>>) => RNode<OtherInfo & ParentInformation> | undefined;
|
|
264
|
+
/**
|
|
265
|
+
* Returns an iterable of all parents of a node, starting with the direct parent and ending with the root node.
|
|
266
|
+
*/
|
|
267
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation> | undefined, idMap: Map<NodeId, RNode<OtherInfo & ParentInformation>>) => Generator<RNode<OtherInfo & ParentInformation>>;
|
|
263
268
|
/**
|
|
264
269
|
* In contrast to the nesting stored in the {@link RNode} structure,
|
|
265
270
|
* this function calculates the depth of a node by counting the number of parents until the root node is reached.
|
|
266
271
|
*/
|
|
267
|
-
readonly depth: (this: void, node: RNode
|
|
272
|
+
readonly depth: (this: void, node: RNode<ParentInformation>, idMap: Map<NodeId, RNode<ParentInformation>>) => number;
|
|
268
273
|
/**
|
|
269
274
|
* Collects all node ids within a tree given by a respective root node, but stops collecting at nodes where the given `stop` function returns `true`.
|
|
270
275
|
* <p>
|
|
@@ -200,6 +200,7 @@ exports.RNode = {
|
|
|
200
200
|
* Returns the direct parent of a node.
|
|
201
201
|
* Usually, only root nodes do not have a parent, and you can assume that there is a
|
|
202
202
|
* linear chain of parents leading to the root node.
|
|
203
|
+
* @see {@link iterateParents} - to get all parents of a node
|
|
203
204
|
*/
|
|
204
205
|
directParent(node, idMap) {
|
|
205
206
|
const parentId = node.info.parent;
|
|
@@ -208,6 +209,18 @@ exports.RNode = {
|
|
|
208
209
|
}
|
|
209
210
|
return idMap.get(parentId);
|
|
210
211
|
},
|
|
212
|
+
/**
|
|
213
|
+
* Returns an iterable of all parents of a node, starting with the direct parent and ending with the root node.
|
|
214
|
+
*/
|
|
215
|
+
*iterateParents(node, idMap) {
|
|
216
|
+
let currentNode = node;
|
|
217
|
+
while (currentNode) {
|
|
218
|
+
currentNode = exports.RNode.directParent(currentNode, idMap);
|
|
219
|
+
if (currentNode) {
|
|
220
|
+
yield currentNode;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
},
|
|
211
224
|
/**
|
|
212
225
|
* In contrast to the nesting stored in the {@link RNode} structure,
|
|
213
226
|
* this function calculates the depth of a node by counting the number of parents until the root node is reached.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type IdGenerator, type NormalizedAst } from '../../model/processing/decorate';
|
|
2
2
|
import type { NoInfo } from '../../model/model';
|
|
3
3
|
import type { ParseStepOutput, ParseStepOutputSingleFile } from '../../../../parser';
|
|
4
|
-
import {
|
|
4
|
+
import { FlowrConfig } from '../../../../../config';
|
|
5
5
|
import type { Tree } from 'web-tree-sitter';
|
|
6
6
|
import { RProject } from '../../model/nodes/r-project';
|
|
7
7
|
export declare const parseLog: import("tslog").Logger<import("tslog").ILogObj>;
|
|
@@ -19,4 +19,4 @@ export declare function normalizeButNotDecorated({ parsed, filePath }: ParseStep
|
|
|
19
19
|
/**
|
|
20
20
|
* Tree-Sitter pendant to {@link normalize}.
|
|
21
21
|
*/
|
|
22
|
-
export declare function normalizeTreeSitter(parsed: ParseStepOutput<Tree>, getId
|
|
22
|
+
export declare function normalizeTreeSitter(parsed: ParseStepOutput<Tree>, getId?: IdGenerator<NoInfo>, config?: FlowrConfig): NormalizedAst;
|
|
@@ -32,8 +32,8 @@ function normalizeButNotDecorated({ parsed, filePath }) {
|
|
|
32
32
|
/**
|
|
33
33
|
* Tree-Sitter pendant to {@link normalize}.
|
|
34
34
|
*/
|
|
35
|
-
function normalizeTreeSitter(parsed, getId = (0, decorate_1.deterministicCountingIdGenerator)(0), config) {
|
|
36
|
-
const lax =
|
|
35
|
+
function normalizeTreeSitter(parsed, getId = (0, decorate_1.deterministicCountingIdGenerator)(0), config = config_1.FlowrConfig.default()) {
|
|
36
|
+
const lax = config_1.FlowrConfig.getForEngine(config, 'tree-sitter')?.lax;
|
|
37
37
|
const result = (0, decorate_1.decorateAst)((0, tree_sitter_normalize_1.normalizeTreeSitterTreeToAst)(parsed.files, lax), { getId });
|
|
38
38
|
result.hasError = parsed.files.some(p => p.parsed.rootNode.hasError);
|
|
39
39
|
return result;
|
|
@@ -224,14 +224,18 @@ function convertTreeNode(node) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
case tree_sitter_types_1.TreeSitterType.UnaryOperator: {
|
|
227
|
-
const [
|
|
227
|
+
const [comments, children] = splitComments(nonErrorChildren(node));
|
|
228
|
+
const [op, operand] = children;
|
|
228
229
|
return {
|
|
229
230
|
type: type_1.RType.UnaryOp,
|
|
230
231
|
operand: convertTreeNode(operand),
|
|
231
232
|
location: makeSourceRange(op),
|
|
232
233
|
operator: op.text,
|
|
233
234
|
lexeme: op.text,
|
|
234
|
-
|
|
235
|
+
info: {
|
|
236
|
+
...defaultInfo.info,
|
|
237
|
+
adToks: comments.map(c => c[1]),
|
|
238
|
+
}
|
|
235
239
|
};
|
|
236
240
|
}
|
|
237
241
|
case tree_sitter_types_1.TreeSitterType.NamespaceOperator: {
|
|
@@ -4,7 +4,7 @@ import type { PipelineOutput } from '../core/steps/pipeline/pipeline';
|
|
|
4
4
|
import { DEFAULT_DATAFLOW_PIPELINE } from '../core/steps/pipeline/default-pipelines';
|
|
5
5
|
import type { RShell } from '../r-bridge/shell';
|
|
6
6
|
import { type FeatureSelection, type FeatureStatistics } from './features/feature';
|
|
7
|
-
import type {
|
|
7
|
+
import type { FlowrConfig } from '../config';
|
|
8
8
|
/**
|
|
9
9
|
* By default, {@link extractUsageStatistics} requires a generator, but sometimes you already know all the files
|
|
10
10
|
* that you want to process. This function simply reps your requests as a generator.
|
|
@@ -21,7 +21,7 @@ type DataflowResult = PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>;
|
|
|
21
21
|
* If your request is statically known, you can use {@link staticRequests} to create this generator.
|
|
22
22
|
* @param rootPath - The root path to the project, this is used to relativize the file paths in the statistics.
|
|
23
23
|
*/
|
|
24
|
-
export declare function extractUsageStatistics<T extends RParseRequestFromText | RParseRequestFromFile>(shell: RShell, config:
|
|
24
|
+
export declare function extractUsageStatistics<T extends RParseRequestFromText | RParseRequestFromFile>(shell: RShell, config: FlowrConfig, onRequest: (request: T) => void, features: FeatureSelection, requests: AsyncGenerator<T>, rootPath?: string): Promise<{
|
|
25
25
|
features: FeatureStatistics;
|
|
26
26
|
meta: MetaStatistics;
|
|
27
27
|
outputs: Map<T, DataflowResult>;
|
package/util/mermaid/dfg.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type DataflowGraph } from '../../dataflow/graph/graph';
|
|
2
2
|
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
3
|
import { type IdentifierDefinition } from '../../dataflow/environments/identifier';
|
|
4
|
+
import { type DataflowGraphVertexInfo } from '../../dataflow/graph/vertex';
|
|
4
5
|
import { type MermaidMarkdownMark, type MermaidMarkStyle } from './info';
|
|
5
6
|
interface MermaidGraph {
|
|
6
7
|
nodeLines: string[];
|
|
@@ -15,6 +16,13 @@ interface MermaidGraph {
|
|
|
15
16
|
/** if given, the dataflow graph will only focus on the "important" parts */
|
|
16
17
|
simplified?: boolean;
|
|
17
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Translates a vertex tag to the corresponding mermaid node brackets.
|
|
21
|
+
*/
|
|
22
|
+
export declare function mermaidNodeBrackets(tag: DataflowGraphVertexInfo['tag']): {
|
|
23
|
+
open: string;
|
|
24
|
+
close: string;
|
|
25
|
+
};
|
|
18
26
|
/**
|
|
19
27
|
* Prints an identifier definition in a human-readable format.
|
|
20
28
|
*/
|