@eagleoutice/flowr 2.1.2 → 2.1.4
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/benchmark/slicer.js +1 -1
- package/cli/repl/commands/repl-parse.js +1 -1
- package/cli/repl/commands/repl-query.d.ts +0 -5
- package/cli/repl/commands/repl-query.js +4 -145
- package/cli/repl/server/connection.js +6 -1
- package/cli/repl/server/messages/message-query.js +2 -2
- package/cli/repl/server/net.js +1 -1
- package/cli/repl/server/send.js +3 -6
- package/cli/repl/server/server.d.ts +2 -2
- package/cli/repl/server/server.js +1 -1
- package/config.js +1 -1
- package/core/pipeline-executor.js +2 -1
- package/core/steps/all/core/00-parse.d.ts +11 -4
- package/core/steps/all/core/00-parse.js +5 -5
- package/core/steps/all/core/10-normalize.d.ts +2 -1
- package/core/steps/all/core/20-dataflow.d.ts +2 -2
- package/core/steps/all/core/20-dataflow.js +2 -2
- package/core/steps/pipeline/default-pipelines.d.ts +41 -23
- package/core/steps/pipeline/pipeline.d.ts +15 -3
- package/core/steps/pipeline/pipeline.js +2 -2
- package/dataflow/environments/built-in.d.ts +8 -6
- package/dataflow/environments/built-in.js +6 -1
- package/dataflow/environments/default-builtin-config.js +21 -5
- package/dataflow/environments/environment.d.ts +1 -0
- package/dataflow/environments/environment.js +5 -5
- package/dataflow/extractor.js +23 -0
- package/dataflow/graph/dataflowgraph-builder.d.ts +2 -0
- package/dataflow/graph/dataflowgraph-builder.js +9 -0
- package/dataflow/graph/diff.js +1 -1
- package/dataflow/graph/graph.d.ts +7 -2
- package/dataflow/graph/graph.js +10 -2
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +13 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/processor.d.ts +3 -3
- package/documentation/data/server/doc-data-server-messages.js +9 -10
- package/documentation/doc-util/doc-cli-option.js +4 -4
- package/documentation/doc-util/doc-query.d.ts +3 -1
- package/documentation/doc-util/doc-query.js +16 -9
- package/documentation/doc-util/doc-repl.js +2 -2
- package/documentation/print-dataflow-graph-wiki.js +2 -1
- package/documentation/print-interface-wiki.js +8 -3
- package/documentation/print-query-wiki.js +139 -16
- package/package.json +3 -2
- package/queries/base-query-format.d.ts +6 -0
- 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 +27 -81
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +14 -13
- package/queries/catalog/call-context-query/call-context-query-format.js +32 -14
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +17 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +99 -0
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +59 -0
- package/queries/catalog/cluster-query/cluster-query-format.js +29 -0
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +59 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.js +21 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +3 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +144 -0
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +102 -0
- package/queries/catalog/dependencies-query/dependencies-query-format.js +187 -0
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +59 -0
- package/queries/catalog/id-map-query/id-map-query-format.js +21 -0
- package/queries/catalog/lineage-query/lineage-query-executor.d.ts +3 -0
- package/queries/catalog/lineage-query/lineage-query-executor.js +22 -0
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +73 -0
- package/queries/catalog/lineage-query/lineage-query-format.js +27 -0
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +3 -0
- package/queries/catalog/location-map-query/location-map-query-executor.js +21 -0
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +17 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +24 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +59 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +21 -0
- 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 +8 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +59 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.js +40 -0
- package/queries/query-print.d.ts +8 -0
- package/queries/query-print.js +94 -0
- package/queries/query.d.ts +431 -23
- package/queries/query.js +36 -16
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
- package/r-bridge/retriever.js +1 -1
- package/r-bridge/shell-executor.js +1 -1
- package/r-bridge/shell.d.ts +1 -2
- package/r-bridge/shell.js +22 -18
- package/slicing/static/static-slicer.js +3 -1
- package/statistics/features/supported/used-functions/used-functions.js +1 -1
- package/{documentation/doc-util/doc-hover-over.js → util/html-hover-over.js} +1 -1
- package/util/json.d.ts +2 -1
- package/util/json.js +101 -3
- package/util/objects.d.ts +2 -1
- package/util/objects.js +3 -0
- package/util/version.js +1 -1
- package/queries/query-schema.d.ts +0 -12
- package/queries/query-schema.js +0 -50
- /package/{documentation/doc-util/doc-hover-over.d.ts → util/html-hover-over.d.ts} +0 -0
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
OnlyLocal = "local",
|
|
10
|
-
/** call targets a function that is defined locally or globally, but must include a local function */
|
|
11
|
-
MustIncludeLocal = "must-include-local",
|
|
12
|
-
/** call targets a function that is defined locally or globally */
|
|
13
|
-
Any = "any"
|
|
14
|
-
}
|
|
3
|
+
import { executeCallContextQueries } from './call-context-query-executor';
|
|
4
|
+
import type { OutputFormatter } from '../../../util/ansi';
|
|
5
|
+
import Joi from 'joi';
|
|
6
|
+
import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
|
|
7
|
+
import type { DEFAULT_DATAFLOW_PIPELINE } from '../../../core/steps/pipeline/default-pipelines';
|
|
8
|
+
import { CallTargets } from './identify-link-to-last-call-relation';
|
|
15
9
|
export interface DefaultCallContextQueryFormat<CallName extends RegExp | string> extends BaseQueryFormat {
|
|
16
10
|
readonly type: 'call-context';
|
|
17
11
|
/** Regex regarding the function name, please note that strings will be interpreted as regular expressions too! */
|
|
@@ -45,13 +39,15 @@ interface LinkToLastCall<CallName extends RegExp | string = RegExp | string> ext
|
|
|
45
39
|
/** Regex regarding the function name of the last call. Similar to {@link DefaultCallContextQueryFormat#callName}, strings are interpreted as a `RegExp`. */
|
|
46
40
|
readonly callName: CallName;
|
|
47
41
|
}
|
|
48
|
-
type LinkTo<CallName extends RegExp | string> = LinkToLastCall<CallName>;
|
|
42
|
+
export type LinkTo<CallName extends RegExp | string> = LinkToLastCall<CallName>;
|
|
49
43
|
export interface SubCallContextQueryFormat<CallName extends RegExp | string = RegExp | string> extends DefaultCallContextQueryFormat<CallName> {
|
|
50
44
|
readonly linkTo: LinkTo<CallName>;
|
|
51
45
|
}
|
|
52
46
|
export interface CallContextQuerySubKindResult {
|
|
53
47
|
/** The id of the call vertex identified within the supplied dataflow graph */
|
|
54
48
|
readonly id: NodeId;
|
|
49
|
+
/** The name of the function call */
|
|
50
|
+
readonly name: string;
|
|
55
51
|
/**
|
|
56
52
|
* Ids of functions which are called by the respective function call,
|
|
57
53
|
* this will only be populated whenever you explicitly state the {@link DefaultCallContextQueryFormat#callTargets}.
|
|
@@ -73,4 +69,9 @@ export interface CallContextQueryResult extends BaseQueryResult {
|
|
|
73
69
|
readonly kinds: CallContextQueryKindResult;
|
|
74
70
|
}
|
|
75
71
|
export type CallContextQuery<CallName extends RegExp | string = RegExp | string> = DefaultCallContextQueryFormat<CallName> | SubCallContextQueryFormat<CallName>;
|
|
72
|
+
export declare const CallContextQueryDefinition: {
|
|
73
|
+
readonly executor: typeof executeCallContextQueries;
|
|
74
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
75
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
76
|
+
};
|
|
76
77
|
export {};
|
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
6
|
+
exports.CallContextQueryDefinition = void 0;
|
|
7
|
+
const call_context_query_executor_1 = require("./call-context-query-executor");
|
|
8
|
+
const ansi_1 = require("../../../util/ansi");
|
|
9
|
+
const time_1 = require("../../../util/time");
|
|
10
|
+
const joi_1 = __importDefault(require("joi"));
|
|
11
|
+
const query_print_1 = require("../../query-print");
|
|
12
|
+
const identify_link_to_last_call_relation_1 = require("./identify-link-to-last-call-relation");
|
|
13
|
+
exports.CallContextQueryDefinition = {
|
|
14
|
+
executor: call_context_query_executor_1.executeCallContextQueries,
|
|
15
|
+
asciiSummarizer: (formatter, processed, queryResults, result) => {
|
|
16
|
+
const out = queryResults;
|
|
17
|
+
result.push(`Query: ${(0, ansi_1.bold)('call-context', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
18
|
+
result.push((0, query_print_1.asciiCallContext)(formatter, out, processed));
|
|
19
|
+
return true;
|
|
20
|
+
},
|
|
21
|
+
schema: joi_1.default.object({
|
|
22
|
+
type: joi_1.default.string().valid('call-context').required().description('The type of the query.'),
|
|
23
|
+
callName: joi_1.default.string().required().description('Regex regarding the function name!'),
|
|
24
|
+
callNameExact: joi_1.default.boolean().optional().description('Should we automatically add the `^` and `$` anchors to the regex to make it an exact match?'),
|
|
25
|
+
kind: joi_1.default.string().optional().description('The kind of the call, this can be used to group calls together (e.g., linking `plot` to `visualize`). Defaults to `.`'),
|
|
26
|
+
subkind: joi_1.default.string().optional().description('The subkind of the call, this can be used to uniquely identify the respective call type when grouping the output (e.g., the normalized name, linking `ggplot` to `plot`). Defaults to `.`'),
|
|
27
|
+
callTargets: joi_1.default.string().valid(...Object.values(identify_link_to_last_call_relation_1.CallTargets)).optional().description('Call targets the function may have. This defaults to `any`. Request this specifically to gain all call targets we can resolve.'),
|
|
28
|
+
includeAliases: joi_1.default.boolean().optional().description('Consider a case like `f <- function_of_interest`, do you want uses of `f` to be included in the results?'),
|
|
29
|
+
linkTo: joi_1.default.object({
|
|
30
|
+
type: joi_1.default.string().valid('link-to-last-call').required().description('The type of the linkTo sub-query.'),
|
|
31
|
+
callName: joi_1.default.string().required().description('Regex regarding the function name of the last call. Similar to `callName`, strings are interpreted as a regular expression.')
|
|
32
|
+
}).optional().description('Links the current call to the last call of the given kind. This way, you can link a call like `points` to the latest graphics plot etc.')
|
|
33
|
+
}).description('Call context query used to find calls in the dataflow graph')
|
|
34
|
+
};
|
|
17
35
|
//# sourceMappingURL=call-context-query-format.js.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
+
import type { ControlFlowGraph } from '../../../util/cfg/cfg';
|
|
3
|
+
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
4
|
+
export declare enum CallTargets {
|
|
5
|
+
/** call targets a function that is not defined locally (e.g., the call targets a library function) */
|
|
6
|
+
OnlyGlobal = "global",
|
|
7
|
+
/** call targets a function that is defined locally or globally, but must include a global function */
|
|
8
|
+
MustIncludeGlobal = "must-include-global",
|
|
9
|
+
/** call targets a function that is defined locally */
|
|
10
|
+
OnlyLocal = "local",
|
|
11
|
+
/** call targets a function that is defined locally or globally, but must include a local function */
|
|
12
|
+
MustIncludeLocal = "must-include-local",
|
|
13
|
+
/** call targets a function that is defined locally or globally */
|
|
14
|
+
Any = "any"
|
|
15
|
+
}
|
|
16
|
+
export declare function satisfiesCallTargets(id: NodeId, graph: DataflowGraph, callTarget: CallTargets): NodeId[] | 'no';
|
|
17
|
+
export declare function identifyLinkToLastCallRelation(from: NodeId, cfg: ControlFlowGraph, graph: DataflowGraph, linkTo: RegExp): NodeId[];
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CallTargets = void 0;
|
|
4
|
+
exports.satisfiesCallTargets = satisfiesCallTargets;
|
|
5
|
+
exports.identifyLinkToLastCallRelation = identifyLinkToLastCallRelation;
|
|
6
|
+
const visitor_1 = require("../../../util/cfg/visitor");
|
|
7
|
+
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
8
|
+
const edge_1 = require("../../../dataflow/graph/edge");
|
|
9
|
+
const resolve_by_name_1 = require("../../../dataflow/environments/resolve-by-name");
|
|
10
|
+
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
11
|
+
const built_in_1 = require("../../../dataflow/environments/built-in");
|
|
12
|
+
const assert_1 = require("../../../util/assert");
|
|
13
|
+
var CallTargets;
|
|
14
|
+
(function (CallTargets) {
|
|
15
|
+
/** call targets a function that is not defined locally (e.g., the call targets a library function) */
|
|
16
|
+
CallTargets["OnlyGlobal"] = "global";
|
|
17
|
+
/** call targets a function that is defined locally or globally, but must include a global function */
|
|
18
|
+
CallTargets["MustIncludeGlobal"] = "must-include-global";
|
|
19
|
+
/** call targets a function that is defined locally */
|
|
20
|
+
CallTargets["OnlyLocal"] = "local";
|
|
21
|
+
/** call targets a function that is defined locally or globally, but must include a local function */
|
|
22
|
+
CallTargets["MustIncludeLocal"] = "must-include-local";
|
|
23
|
+
/** call targets a function that is defined locally or globally */
|
|
24
|
+
CallTargets["Any"] = "any";
|
|
25
|
+
})(CallTargets || (exports.CallTargets = CallTargets = {}));
|
|
26
|
+
function satisfiesCallTargets(id, graph, callTarget) {
|
|
27
|
+
const callVertex = graph.get(id);
|
|
28
|
+
if (callVertex === undefined || callVertex[0].tag !== vertex_1.VertexType.FunctionCall) {
|
|
29
|
+
return 'no';
|
|
30
|
+
}
|
|
31
|
+
const [info, outgoing] = callVertex;
|
|
32
|
+
const callTargets = [...outgoing]
|
|
33
|
+
.filter(([, e]) => (0, edge_1.edgeIncludesType)(e.types, edge_1.EdgeType.Calls))
|
|
34
|
+
.map(([t]) => t);
|
|
35
|
+
let builtIn = false;
|
|
36
|
+
if (info.environment === undefined) {
|
|
37
|
+
/* if we have a call with an unbound environment,
|
|
38
|
+
* this only happens if we are sure of built-in relations and want to save references
|
|
39
|
+
*/
|
|
40
|
+
builtIn = true;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
/*
|
|
44
|
+
* for performance and scoping reasons, flowR will not identify the global linkage,
|
|
45
|
+
* including any potential built-in mapping.
|
|
46
|
+
*/
|
|
47
|
+
const reResolved = (0, resolve_by_name_1.resolveByName)(info.name, info.environment, identifier_1.ReferenceType.Unknown);
|
|
48
|
+
if (reResolved?.some(t => t.definedAt === built_in_1.BuiltIn)) {
|
|
49
|
+
builtIn = true;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
switch (callTarget) {
|
|
53
|
+
case CallTargets.Any:
|
|
54
|
+
return callTargets;
|
|
55
|
+
case CallTargets.OnlyGlobal:
|
|
56
|
+
if (callTargets.length === 0) {
|
|
57
|
+
return builtIn ? [built_in_1.BuiltIn] : [];
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
return 'no';
|
|
61
|
+
}
|
|
62
|
+
case CallTargets.MustIncludeGlobal:
|
|
63
|
+
return builtIn || callTargets.length === 0 ? [...callTargets, built_in_1.BuiltIn] : 'no';
|
|
64
|
+
case CallTargets.OnlyLocal:
|
|
65
|
+
return !builtIn && callTargets.length > 0 ? callTargets : 'no';
|
|
66
|
+
case CallTargets.MustIncludeLocal:
|
|
67
|
+
if (callTargets.length > 0) {
|
|
68
|
+
return builtIn ? [...callTargets, built_in_1.BuiltIn] : callTargets;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
return 'no';
|
|
72
|
+
}
|
|
73
|
+
default:
|
|
74
|
+
(0, assert_1.assertUnreachable)(callTarget);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
function identifyLinkToLastCallRelation(from, cfg, graph, linkTo) {
|
|
78
|
+
const found = [];
|
|
79
|
+
(0, visitor_1.visitInReverseOrder)(cfg, from, node => {
|
|
80
|
+
/* we ignore the start id as it cannot be the last call */
|
|
81
|
+
if (node === from) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const vertex = graph.get(node);
|
|
85
|
+
if (vertex === undefined || vertex[0].tag !== vertex_1.VertexType.FunctionCall) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (linkTo.test(vertex[0].name)) {
|
|
89
|
+
const tar = satisfiesCallTargets(vertex[0].id, graph, CallTargets.MustIncludeGlobal);
|
|
90
|
+
if (tar === 'no') {
|
|
91
|
+
return true;
|
|
92
|
+
}
|
|
93
|
+
found.push(node);
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
return found;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=identify-link-to-last-call-relation.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BasicQueryData } from '../../query';
|
|
2
1
|
import type { DataflowClusterQuery, DataflowClusterQueryResult } from './cluster-query-format';
|
|
2
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
3
3
|
export declare function executeDataflowClusterQuery({ graph }: BasicQueryData, queries: readonly DataflowClusterQuery[]): DataflowClusterQueryResult;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import Joi from 'joi';
|
|
2
3
|
import type { DataflowGraphClusters } from '../../../dataflow/cluster';
|
|
4
|
+
import { executeDataflowClusterQuery } from './cluster-query-executor';
|
|
3
5
|
/**
|
|
4
6
|
* Calculates and returns all clusters encountered in the dataflow graph.
|
|
5
7
|
*/
|
|
@@ -10,3 +12,60 @@ export interface DataflowClusterQueryResult extends BaseQueryResult {
|
|
|
10
12
|
/** All clusters found in the respective dataflow */
|
|
11
13
|
readonly clusters: DataflowGraphClusters;
|
|
12
14
|
}
|
|
15
|
+
export declare const ClusterQueryDefinition: {
|
|
16
|
+
readonly executor: typeof executeDataflowClusterQuery;
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
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("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
|
|
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("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
30
|
+
};
|
|
31
|
+
readonly dependencies: readonly [];
|
|
32
|
+
readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
|
|
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("../../../core/steps/all/core/00-parse").ParseStepOutput;
|
|
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
|
+
}) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
+
readonly requiredInput: {};
|
|
58
|
+
readonly name: "dataflow";
|
|
59
|
+
readonly description: "Construct the dataflow graph";
|
|
60
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
61
|
+
readonly printer: {
|
|
62
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
63
|
+
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
64
|
+
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
65
|
+
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
66
|
+
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
67
|
+
};
|
|
68
|
+
readonly dependencies: readonly ["normalize"];
|
|
69
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
71
|
+
};
|
|
@@ -1,3 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ClusterQueryDefinition = void 0;
|
|
7
|
+
const ansi_1 = require("../../../util/ansi");
|
|
8
|
+
const joi_1 = __importDefault(require("joi"));
|
|
9
|
+
const cluster_query_executor_1 = require("./cluster-query-executor");
|
|
10
|
+
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
11
|
+
const query_print_1 = require("../../query-print");
|
|
12
|
+
exports.ClusterQueryDefinition = {
|
|
13
|
+
executor: cluster_query_executor_1.executeDataflowClusterQuery,
|
|
14
|
+
asciiSummarizer: (formatter, processed, queryResults, result) => {
|
|
15
|
+
const out = queryResults;
|
|
16
|
+
result.push(`Query: ${(0, ansi_1.bold)('dataflow-cluster', formatter)} (${out['.meta'].timing.toFixed(0)}ms)`);
|
|
17
|
+
result.push(` ╰ Found ${out.clusters.length} cluster${out.clusters.length === 1 ? '' : 's'}`);
|
|
18
|
+
for (const cluster of out.clusters) {
|
|
19
|
+
const unknownSideEffects = cluster.hasUnknownSideEffects ? '(has unknown side effect)' : '';
|
|
20
|
+
let suffix = '';
|
|
21
|
+
if (formatter === ansi_1.markdownFormatter) {
|
|
22
|
+
suffix = `([marked](${(0, dfg_1.graphToMermaidUrl)(processed.dataflow.graph, false, new Set(cluster.members))}))`;
|
|
23
|
+
}
|
|
24
|
+
result.push(` ╰ ${unknownSideEffects} {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, cluster.members)}} ${suffix}`);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
},
|
|
28
|
+
schema: joi_1.default.object({
|
|
29
|
+
type: joi_1.default.string().valid('dataflow-cluster').required().description('The type of the query.'),
|
|
30
|
+
}).description('The cluster query calculates and returns all clusters in the dataflow graph.')
|
|
31
|
+
};
|
|
3
32
|
//# sourceMappingURL=cluster-query-format.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BasicQueryData } from '../../query';
|
|
2
1
|
import type { DataflowQuery, DataflowQueryResult } from './dataflow-query-format';
|
|
2
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
3
3
|
export declare function executeDataflowQuery({ graph }: BasicQueryData, queries: readonly DataflowQuery[]): DataflowQueryResult;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
3
|
+
import { executeDataflowQuery } from './dataflow-query-executor';
|
|
4
|
+
import Joi from 'joi';
|
|
3
5
|
/**
|
|
4
6
|
* Simple re-returns the dataflow graph of the analysis.
|
|
5
7
|
*/
|
|
@@ -10,3 +12,60 @@ export interface DataflowQueryResult extends BaseQueryResult {
|
|
|
10
12
|
/** Please be aware that this is the graph in its JSON representation, use {@link DataflowGraph#fromJson} if the result is serialized */
|
|
11
13
|
readonly graph: DataflowGraph;
|
|
12
14
|
}
|
|
15
|
+
export declare const DataflowQueryDefinition: {
|
|
16
|
+
readonly executor: typeof executeDataflowQuery;
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/ansi").OutputFormatter, _processed: import("../../../core/steps/pipeline/pipeline").PipelineOutput<import("../../../core/steps/pipeline/pipeline").Pipeline<{
|
|
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("../../../core/steps/all/core/00-parse").ParseRequiredInput>) => Promise<import("../../../core/steps/all/core/00-parse").ParseStepOutput>;
|
|
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("../../../core/steps/all/core/00-parse").ParseStepOutput, config: import("../../../util/quads").QuadSerializationConfiguration) => string;
|
|
30
|
+
};
|
|
31
|
+
readonly dependencies: readonly [];
|
|
32
|
+
readonly requiredInput: import("../../../core/steps/all/core/00-parse").ParseRequiredInput;
|
|
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("../../../core/steps/all/core/00-parse").ParseStepOutput;
|
|
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
|
+
}) => import("../../../dataflow/info").DataflowInformation;
|
|
57
|
+
readonly requiredInput: {};
|
|
58
|
+
readonly name: "dataflow";
|
|
59
|
+
readonly description: "Construct the dataflow graph";
|
|
60
|
+
readonly executed: import("../../../core/steps/pipeline-step").PipelineStepStage.OncePerFile;
|
|
61
|
+
readonly printer: {
|
|
62
|
+
readonly 0: typeof import("../../../core/print/print").internalPrinter;
|
|
63
|
+
readonly 2: typeof import("../../../core/print/dataflow-printer").dataflowGraphToJson;
|
|
64
|
+
readonly 5: typeof import("../../../core/print/dataflow-printer").dataflowGraphToQuads;
|
|
65
|
+
readonly 3: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaid;
|
|
66
|
+
readonly 4: typeof import("../../../core/print/dataflow-printer").dataflowGraphToMermaidUrl;
|
|
67
|
+
};
|
|
68
|
+
readonly dependencies: readonly ["normalize"];
|
|
69
|
+
}>>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
70
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
71
|
+
};
|
|
@@ -1,3 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.DataflowQueryDefinition = void 0;
|
|
7
|
+
const dataflow_query_executor_1 = require("./dataflow-query-executor");
|
|
8
|
+
const ansi_1 = require("../../../util/ansi");
|
|
9
|
+
const time_1 = require("../../../util/time");
|
|
10
|
+
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
11
|
+
const joi_1 = __importDefault(require("joi"));
|
|
12
|
+
exports.DataflowQueryDefinition = {
|
|
13
|
+
executor: dataflow_query_executor_1.executeDataflowQuery,
|
|
14
|
+
asciiSummarizer: (formatter, _processed, queryResults, result) => {
|
|
15
|
+
const out = queryResults;
|
|
16
|
+
result.push(`Query: ${(0, ansi_1.bold)('dataflow', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
17
|
+
result.push(` ╰ [Dataflow Graph](${(0, dfg_1.graphToMermaidUrl)(out.graph)})`);
|
|
18
|
+
return true;
|
|
19
|
+
},
|
|
20
|
+
schema: joi_1.default.object({
|
|
21
|
+
type: joi_1.default.string().valid('dataflow').required().description('The type of the query.'),
|
|
22
|
+
}).description('The dataflow query simply returns the dataflow graph, there is no need to pass it multiple times!')
|
|
23
|
+
};
|
|
3
24
|
//# sourceMappingURL=dataflow-query-format.js.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DependenciesQuery, DependenciesQueryResult } from './dependencies-query-format';
|
|
2
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
+
export declare function executeDependenciesQuery(data: BasicQueryData, queries: readonly DependenciesQuery[]): DependenciesQueryResult;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeDependenciesQuery = executeDependenciesQuery;
|
|
4
|
+
const query_1 = require("../../query");
|
|
5
|
+
const dependencies_query_format_1 = require("./dependencies-query-format");
|
|
6
|
+
const graph_1 = require("../../../dataflow/graph/graph");
|
|
7
|
+
const log_1 = require("../../../util/log");
|
|
8
|
+
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
9
|
+
const retriever_1 = require("../../../r-bridge/retriever");
|
|
10
|
+
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
11
|
+
const visitor_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
12
|
+
const assert_1 = require("../../../util/assert");
|
|
13
|
+
const objects_1 = require("../../../util/objects");
|
|
14
|
+
const SupportedVertexTypes = [type_1.RType.String, type_1.RType.Logical, type_1.RType.Number];
|
|
15
|
+
const Unknown = 'unknown';
|
|
16
|
+
function executeDependenciesQuery(data, queries) {
|
|
17
|
+
if (queries.length !== 1) {
|
|
18
|
+
log_1.log.warn('Dependencies query expects only up to one query, but got ', queries.length, 'only using the first query');
|
|
19
|
+
}
|
|
20
|
+
const now = Date.now();
|
|
21
|
+
const [query] = queries;
|
|
22
|
+
const ignoreDefault = query.ignoreDefaultFunctions ?? false;
|
|
23
|
+
const libraryFunctions = getFunctionsToCheck(query.libraryFunctions, ignoreDefault, dependencies_query_format_1.LibraryFunctions);
|
|
24
|
+
const sourceFunctions = getFunctionsToCheck(query.sourceFunctions, ignoreDefault, dependencies_query_format_1.SourceFunctions);
|
|
25
|
+
const readFunctions = getFunctionsToCheck(query.readFunctions, ignoreDefault, dependencies_query_format_1.ReadFunctions);
|
|
26
|
+
const writeFunctions = getFunctionsToCheck(query.writeFunctions, ignoreDefault, dependencies_query_format_1.WriteFunctions);
|
|
27
|
+
const numberOfFunctions = libraryFunctions.length + sourceFunctions.length + readFunctions.length + writeFunctions.length;
|
|
28
|
+
const results = numberOfFunctions === 0 ? { kinds: {}, '.meta': { timing: 0 } } : (0, query_1.executeQueriesOfSameType)(data, ...makeCallContextQuery(libraryFunctions, 'library'), ...makeCallContextQuery(sourceFunctions, 'source'), ...makeCallContextQuery(readFunctions, 'read'), ...makeCallContextQuery(writeFunctions, 'write'));
|
|
29
|
+
const libraries = getResults(data, results, 'library', libraryFunctions, (id, vertex, argument) => ({
|
|
30
|
+
nodeId: id,
|
|
31
|
+
functionName: vertex.name,
|
|
32
|
+
libraryName: argument ?? Unknown
|
|
33
|
+
}), [type_1.RType.Symbol]);
|
|
34
|
+
if (!ignoreDefault) {
|
|
35
|
+
/* for libraries, we have to additionally track all uses of `::` and `:::`, for this we currently simply traverse all uses */
|
|
36
|
+
(0, visitor_1.visitAst)(data.ast.ast, n => {
|
|
37
|
+
if (n.type === type_1.RType.Symbol && n.namespace) {
|
|
38
|
+
/* we should improve the identification of ':::' */
|
|
39
|
+
libraries.push({
|
|
40
|
+
nodeId: n.info.id,
|
|
41
|
+
functionName: (n.info.fullLexeme ?? n.lexeme).includes(':::') ? ':::' : '::',
|
|
42
|
+
libraryName: n.namespace
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
const sourcedFiles = getResults(data, results, 'source', sourceFunctions, (id, vertex, argument, linkedIds) => ({
|
|
48
|
+
nodeId: id,
|
|
49
|
+
functionName: vertex.name,
|
|
50
|
+
file: argument ?? Unknown,
|
|
51
|
+
linkedIds: (linkedIds?.length ?? 0) > 0 ? linkedIds : undefined
|
|
52
|
+
}));
|
|
53
|
+
const readData = getResults(data, results, 'read', readFunctions, (id, vertex, argument, linkedIds) => ({
|
|
54
|
+
nodeId: id,
|
|
55
|
+
functionName: vertex.name,
|
|
56
|
+
source: argument ?? Unknown,
|
|
57
|
+
linkedIds: (linkedIds?.length ?? 0) > 0 ? linkedIds : undefined
|
|
58
|
+
}));
|
|
59
|
+
const writtenData = getResults(data, results, 'write', writeFunctions, (id, vertex, argument, linkedIds) => ({
|
|
60
|
+
nodeId: id,
|
|
61
|
+
functionName: vertex.name,
|
|
62
|
+
// write functions that don't have argIndex are assumed to write to stdout
|
|
63
|
+
destination: argument ?? ((linkedIds?.length ?? 0) > 0 ? Unknown : 'stdout'),
|
|
64
|
+
linkedIds: (linkedIds?.length ?? 0) > 0 ? linkedIds : undefined
|
|
65
|
+
}));
|
|
66
|
+
return {
|
|
67
|
+
'.meta': {
|
|
68
|
+
timing: Date.now() - now
|
|
69
|
+
},
|
|
70
|
+
libraries, sourcedFiles, readData, writtenData
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
function makeCallContextQuery(functions, kind) {
|
|
74
|
+
return functions.map(f => ({
|
|
75
|
+
type: 'call-context',
|
|
76
|
+
callName: f.name,
|
|
77
|
+
includeAliases: true,
|
|
78
|
+
callNameExact: true,
|
|
79
|
+
subkind: f.name,
|
|
80
|
+
linkTo: f.linkTo ? { type: 'link-to-last-call', callName: f.linkTo } : undefined,
|
|
81
|
+
kind
|
|
82
|
+
}));
|
|
83
|
+
}
|
|
84
|
+
function getResults(data, results, kind, functions, makeInfo, additionalAllowedTypes) {
|
|
85
|
+
return Object.entries(results?.kinds[kind]?.subkinds ?? {}).flatMap(([name, results]) => results.flatMap(({ id, linkedIds }) => {
|
|
86
|
+
const vertex = data.graph.getVertex(id);
|
|
87
|
+
const info = functions.find(f => f.name === name);
|
|
88
|
+
let index = info.argIdx;
|
|
89
|
+
if (info.argName) {
|
|
90
|
+
const arg = vertex?.args.findIndex(arg => arg !== r_function_call_1.EmptyArgument && arg.name === info.argName);
|
|
91
|
+
if (arg >= 0) {
|
|
92
|
+
index = arg;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
const args = index !== undefined ? getArgumentValue(data, vertex, index, additionalAllowedTypes) : undefined;
|
|
96
|
+
if (!args) {
|
|
97
|
+
return (0, objects_1.compactRecord)(makeInfo(id, vertex, undefined, linkedIds));
|
|
98
|
+
}
|
|
99
|
+
return args.flatMap(a => (0, objects_1.compactRecord)(makeInfo(id, vertex, a, linkedIds)));
|
|
100
|
+
})).filter(assert_1.isNotUndefined) ?? [];
|
|
101
|
+
}
|
|
102
|
+
function getArgumentValue({ graph }, vertex, argumentIndex, additionalAllowedTypes) {
|
|
103
|
+
if (vertex) {
|
|
104
|
+
if (argumentIndex === 'unnamed') {
|
|
105
|
+
// return all unnamed arguments
|
|
106
|
+
const references = vertex.args.filter(arg => arg !== r_function_call_1.EmptyArgument && !arg.name).map(graph_1.getReferenceOfArgument);
|
|
107
|
+
return references.map(ref => {
|
|
108
|
+
if (!ref) {
|
|
109
|
+
return undefined;
|
|
110
|
+
}
|
|
111
|
+
let valueNode = graph.idMap?.get(ref);
|
|
112
|
+
if (valueNode?.type === type_1.RType.Argument) {
|
|
113
|
+
valueNode = valueNode.value;
|
|
114
|
+
}
|
|
115
|
+
if (valueNode) {
|
|
116
|
+
const allowedTypes = [...SupportedVertexTypes, ...additionalAllowedTypes ?? []];
|
|
117
|
+
return allowedTypes.includes(valueNode.type) ? (0, retriever_1.removeRQuotes)(valueNode.lexeme) : Unknown;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (vertex.args.length > argumentIndex) {
|
|
122
|
+
const arg = (0, graph_1.getReferenceOfArgument)(vertex.args[argumentIndex]);
|
|
123
|
+
if (arg) {
|
|
124
|
+
let valueNode = graph.idMap?.get(arg);
|
|
125
|
+
if (valueNode?.type === type_1.RType.Argument) {
|
|
126
|
+
valueNode = valueNode.value;
|
|
127
|
+
}
|
|
128
|
+
if (valueNode) {
|
|
129
|
+
const allowedTypes = [...SupportedVertexTypes, ...additionalAllowedTypes ?? []];
|
|
130
|
+
return [allowedTypes.includes(valueNode.type) ? (0, retriever_1.removeRQuotes)(valueNode.lexeme) : Unknown];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
function getFunctionsToCheck(customFunctions, ignoreDefaultFunctions, defaultFunctions) {
|
|
138
|
+
const functions = ignoreDefaultFunctions ? [] : [...defaultFunctions];
|
|
139
|
+
if (customFunctions) {
|
|
140
|
+
functions.push(...customFunctions);
|
|
141
|
+
}
|
|
142
|
+
return functions;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=dependencies-query-executor.js.map
|