@eagleoutice/flowr 2.9.13 → 2.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +52 -28
- package/abstract-interpretation/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/absint-visitor.js +20 -20
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -2
- package/benchmark/slicer.d.ts +1 -1
- package/benchmark/slicer.js +7 -5
- package/benchmark/stats/stats.d.ts +2 -2
- package/cli/repl/commands/repl-dataflow.js +5 -5
- package/cli/repl/parser/slice-query-parser.d.ts +3 -3
- package/cli/repl/parser/slice-query-parser.js +2 -2
- package/cli/repl/server/connection.js +2 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/repl/server/messages/message-slice.js +2 -2
- package/config.d.ts +12 -8
- package/config.js +5 -3
- package/control-flow/extract-cfg.js +2 -2
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +43 -43
- package/control-flow/useless-loop.d.ts +1 -1
- package/control-flow/useless-loop.js +3 -3
- package/core/print/dataflow-printer.d.ts +0 -14
- package/core/print/dataflow-printer.js +0 -21
- package/core/steps/all/core/20-dataflow.d.ts +3 -3
- package/core/steps/all/core/20-dataflow.js +3 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +2 -5
- package/core/steps/all/static-slicing/00-slice.js +6 -8
- package/core/steps/pipeline/default-pipelines.d.ts +89 -89
- package/dataflow/environments/built-in-proc-name.d.ts +83 -0
- package/dataflow/environments/built-in-proc-name.js +88 -0
- package/dataflow/environments/built-in.d.ts +1 -83
- package/dataflow/environments/built-in.js +37 -120
- package/dataflow/environments/default-builtin-config.d.ts +1 -1
- package/dataflow/environments/default-builtin-config.js +75 -75
- package/dataflow/environments/identifier.d.ts +5 -0
- package/dataflow/environments/identifier.js +18 -0
- package/dataflow/eval/resolve/resolve.js +2 -2
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +2 -2
- package/dataflow/graph/call-graph.d.ts +46 -19
- package/dataflow/graph/call-graph.js +95 -114
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/df-helper.d.ts +133 -0
- package/dataflow/graph/df-helper.js +138 -0
- package/dataflow/graph/diff-dataflow-graph.d.ts +5 -10
- package/dataflow/graph/diff-dataflow-graph.js +3 -28
- package/dataflow/graph/edge.d.ts +1 -0
- package/dataflow/graph/edge.js +1 -0
- package/dataflow/graph/graph-helper.d.ts +60 -0
- package/dataflow/graph/graph-helper.js +128 -0
- package/dataflow/graph/graph.d.ts +19 -3
- package/dataflow/graph/graph.js +32 -5
- package/dataflow/graph/vertex.d.ts +3 -1
- package/dataflow/info.d.ts +14 -4
- package/dataflow/info.js +28 -16
- package/dataflow/internal/linker.d.ts +14 -10
- package/dataflow/internal/linker.js +29 -32
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +8 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +7 -7
- 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 +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +6 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +2 -2
- package/dataflow/internal/process/functions/call/common.js +2 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.d.ts +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -1
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.js +6 -6
- package/documentation/doc-readme.js +2 -1
- package/documentation/doc-util/doc-dfg.d.ts +3 -0
- package/documentation/doc-util/doc-dfg.js +5 -7
- package/documentation/doc-util/doc-normalized-ast.d.ts +0 -6
- package/documentation/doc-util/doc-normalized-ast.js +0 -23
- package/documentation/doc-util/doc-structure.js +3 -3
- package/documentation/doc-util/doc-types.js +3 -3
- package/documentation/wiki-core.js +5 -4
- package/documentation/wiki-dataflow-graph.js +14 -12
- package/documentation/wiki-interface.js +3 -3
- package/documentation/wiki-linter.js +6 -0
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/linter/linter-rules.d.ts +49 -1
- package/linter/linter-rules.js +5 -1
- package/linter/rules/problematic-eval.d.ts +44 -0
- package/linter/rules/problematic-eval.js +83 -0
- package/linter/rules/seeded-randomness.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +35 -0
- package/linter/rules/stop-with-call-arg.js +72 -0
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +7 -7
- package/project/cache/flowr-analyzer-cache.d.ts +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/flowr-analyzer-builder.d.ts +3 -0
- package/project/flowr-analyzer.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +2 -2
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +3 -3
- package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +6 -0
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +66 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +36 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +63 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +90 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.js +308 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +2 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- 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-executor.js +3 -3
- 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/location-map-query/location-map-query-executor.js +2 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +3 -3
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +6 -0
- package/queries/catalog/provenance-query/provenance-query-executor.js +34 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +35 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +62 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
- package/queries/query.d.ts +17 -1
- package/queries/query.js +4 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/model.js +10 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +29 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +29 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +2 -0
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-printer.js +3 -3
- package/search/search-executor/search-enrichers.js +2 -2
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/parse.d.ts +43 -18
- package/slicing/criterion/parse.js +68 -63
- package/slicing/static/slicer-types.d.ts +2 -3
- package/slicing/static/static-slicer.d.ts +3 -4
- package/slicing/static/static-slicer.js +32 -12
- package/util/collections/arrays.d.ts +4 -0
- package/util/collections/arrays.js +7 -0
- package/util/diff.d.ts +2 -2
- package/util/mermaid/ast.js +4 -4
- package/util/mermaid/cfg.js +5 -5
- package/util/mermaid/dfg.d.ts +33 -18
- package/util/mermaid/dfg.js +47 -31
- package/util/mermaid/mermaid.d.ts +57 -12
- package/util/mermaid/mermaid.js +74 -67
- package/util/range.d.ts +8 -0
- package/util/range.js +13 -1
- package/util/slice-direction.d.ts +7 -0
- package/util/slice-direction.js +12 -0
- package/util/version.js +1 -1
- package/dataflow/graph/invert-dfg.d.ts +0 -6
- package/dataflow/graph/invert-dfg.js +0 -20
- package/dataflow/graph/resolve-graph.d.ts +0 -8
- package/dataflow/graph/resolve-graph.js +0 -59
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
-
import type {
|
|
2
|
+
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
|
|
3
3
|
import type { ParsedQueryLine } from '../../query';
|
|
4
4
|
import Joi from 'joi';
|
|
5
5
|
import { executeResolveValueQuery } from './origin-query-executor';
|
|
@@ -10,10 +10,10 @@ import type { FlowrConfig } from '../../../config';
|
|
|
10
10
|
export interface OriginQuery extends BaseQueryFormat {
|
|
11
11
|
readonly type: 'origin';
|
|
12
12
|
/** The slicing criteria to use */
|
|
13
|
-
readonly criterion:
|
|
13
|
+
readonly criterion: SlicingCriterion;
|
|
14
14
|
}
|
|
15
15
|
export interface OriginQueryResult extends BaseQueryResult {
|
|
16
|
-
results: Record<
|
|
16
|
+
results: Record<SlicingCriterion, Origin[] | undefined>;
|
|
17
17
|
}
|
|
18
18
|
declare function originQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'origin'>;
|
|
19
19
|
export declare const OriginQueryDefinition: {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
2
|
+
import type { ProvenanceQuery, ProvenanceQueryResult } from './provenance-query-format';
|
|
3
|
+
/**
|
|
4
|
+
* Execute a provenance query collection, {@link Dataflow.provenance}
|
|
5
|
+
*/
|
|
6
|
+
export declare function executeProvenanceQuery({ analyzer }: BasicQueryData, queries: readonly ProvenanceQuery[]): Promise<ProvenanceQueryResult>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeProvenanceQuery = executeProvenanceQuery;
|
|
4
|
+
const log_1 = require("../../../util/log");
|
|
5
|
+
const r_function_definition_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
6
|
+
const parse_1 = require("../../../slicing/criterion/parse");
|
|
7
|
+
const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
8
|
+
const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
|
|
9
|
+
/**
|
|
10
|
+
* Execute a provenance query collection, {@link Dataflow.provenance}
|
|
11
|
+
*/
|
|
12
|
+
async function executeProvenanceQuery({ analyzer }, queries) {
|
|
13
|
+
const start = Date.now();
|
|
14
|
+
const results = {};
|
|
15
|
+
const nast = await analyzer.normalize();
|
|
16
|
+
const df = await analyzer.dataflow();
|
|
17
|
+
for (const query of queries) {
|
|
18
|
+
const key = query.criterion;
|
|
19
|
+
if (results[key]) {
|
|
20
|
+
log_1.log.warn(`Duplicate key for provenance query: ${key}, skipping...`);
|
|
21
|
+
}
|
|
22
|
+
const criterionId = parse_1.SlicingCriterion.tryParse(key, nast.idMap) ?? key;
|
|
23
|
+
const provenanceNode = nast.idMap.get(criterionId);
|
|
24
|
+
const fdef = r_function_definition_1.RFunctionDefinition.wrappingFunctionDefinition(provenanceNode, nast.idMap);
|
|
25
|
+
results[key] = Array.from(df_helper_1.Dataflow.provenance(criterionId, df.graph, fdef ? model_1.RNode.collectAllIds(fdef) : undefined));
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
'.meta': {
|
|
29
|
+
timing: Date.now() - start
|
|
30
|
+
},
|
|
31
|
+
results
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=provenance-query-executor.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
|
|
3
|
+
import type { ParsedQueryLine } from '../../query';
|
|
4
|
+
import Joi from 'joi';
|
|
5
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
|
+
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
7
|
+
import type { FlowrConfig } from '../../../config';
|
|
8
|
+
import { executeProvenanceQuery } from './provenance-query-executor';
|
|
9
|
+
/** Calculates the provenance starting from a given criterion */
|
|
10
|
+
export interface ProvenanceQuery extends BaseQueryFormat {
|
|
11
|
+
readonly type: 'provenance';
|
|
12
|
+
/** The slicing criterion to use as a start*/
|
|
13
|
+
readonly criterion: SlicingCriterion;
|
|
14
|
+
/** Whether to stop on fdef boundaries */
|
|
15
|
+
readonly restrictFdef?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface ProvenanceQueryResult extends BaseQueryResult {
|
|
18
|
+
/**
|
|
19
|
+
* Maps the requested criteria to the returned ids
|
|
20
|
+
*/
|
|
21
|
+
results: Record<string, NodeId[]>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Checks whether the given argument represents a fdef boundary with an `f` suffix.
|
|
25
|
+
*/
|
|
26
|
+
export declare function fdefBoundaryParser(argument: string): boolean;
|
|
27
|
+
declare function provenanceQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'provenance'>;
|
|
28
|
+
export declare const ProvenanceQueryDefinition: {
|
|
29
|
+
readonly executor: typeof executeProvenanceQuery;
|
|
30
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
31
|
+
readonly fromLine: typeof provenanceQueryLineParser;
|
|
32
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
33
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
34
|
+
};
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ProvenanceQueryDefinition = void 0;
|
|
7
|
+
exports.fdefBoundaryParser = fdefBoundaryParser;
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const time_1 = require("../../../util/text/time");
|
|
10
|
+
const joi_1 = __importDefault(require("joi"));
|
|
11
|
+
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
12
|
+
const provenance_query_executor_1 = require("./provenance-query-executor");
|
|
13
|
+
const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
14
|
+
/**
|
|
15
|
+
* Checks whether the given argument represents a fdef boundary with an `f` suffix.
|
|
16
|
+
*/
|
|
17
|
+
function fdefBoundaryParser(argument) {
|
|
18
|
+
const endBracket = argument.indexOf(')');
|
|
19
|
+
return argument[endBracket + 1] === 'f';
|
|
20
|
+
}
|
|
21
|
+
function provenanceQueryLineParser(output, line, _config) {
|
|
22
|
+
const criterion = (0, slice_query_parser_1.sliceCriteriaParser)(line[0]);
|
|
23
|
+
const stopFdef = fdefBoundaryParser(line[0]);
|
|
24
|
+
if (!criterion || criterion.length !== 1) {
|
|
25
|
+
output.stderr(output.formatter.format('Invalid provenance query format, a single slicing criterion must be given in the form "(criterion1)"', { color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }));
|
|
26
|
+
return { query: [] };
|
|
27
|
+
}
|
|
28
|
+
return { query: [{
|
|
29
|
+
type: 'provenance',
|
|
30
|
+
criterion: criterion[0],
|
|
31
|
+
restrictFdef: stopFdef
|
|
32
|
+
}], rCode: line[1] };
|
|
33
|
+
}
|
|
34
|
+
exports.ProvenanceQueryDefinition = {
|
|
35
|
+
executor: provenance_query_executor_1.executeProvenanceQuery,
|
|
36
|
+
asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
|
|
37
|
+
const out = queryResults;
|
|
38
|
+
const df = await analyzer.dataflow();
|
|
39
|
+
result.push(`Query: ${(0, ansi_1.bold)('provenance', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
40
|
+
for (const [key, obj] of Object.entries(out.results)) {
|
|
41
|
+
result.push(` ╰ Provenance for ${key}`);
|
|
42
|
+
const dfg = df_helper_1.Dataflow.reduceGraph(df.graph, new Set(obj));
|
|
43
|
+
result.push(` ╰ [Mermaid Url](${df_helper_1.Dataflow.visualize.mermaid.url(dfg)})`);
|
|
44
|
+
}
|
|
45
|
+
return true;
|
|
46
|
+
},
|
|
47
|
+
fromLine: provenanceQueryLineParser,
|
|
48
|
+
schema: joi_1.default.object({
|
|
49
|
+
type: joi_1.default.string().valid('provenance').required().description('The type of the query.'),
|
|
50
|
+
criterion: joi_1.default.string().required().description('The slicing criterion to use.'),
|
|
51
|
+
restrictFdef: joi_1.default.boolean().required().description('Whether to stop on fdef boundaries.')
|
|
52
|
+
}).description('Provenance query definition'),
|
|
53
|
+
flattenInvolvedNodes: (queryResults) => {
|
|
54
|
+
const flattened = [];
|
|
55
|
+
const out = queryResults;
|
|
56
|
+
for (const obj of Object.values(out.results)) {
|
|
57
|
+
flattened.push(...obj);
|
|
58
|
+
}
|
|
59
|
+
return flattened;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=provenance-query-format.js.map
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.fingerPrintOfQuery = fingerPrintOfQuery;
|
|
4
4
|
exports.executeResolveValueQuery = executeResolveValueQuery;
|
|
5
5
|
const log_1 = require("../../../util/log");
|
|
6
|
-
const parse_1 = require("../../../slicing/criterion/parse");
|
|
7
6
|
const alias_tracking_1 = require("../../../dataflow/eval/resolve/alias-tracking");
|
|
7
|
+
const parse_1 = require("../../../slicing/criterion/parse");
|
|
8
8
|
/**
|
|
9
9
|
* Naive fingerprint to filter out duplicate queries.
|
|
10
10
|
*/
|
|
@@ -25,7 +25,7 @@ async function executeResolveValueQuery({ analyzer }, queries) {
|
|
|
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 =>
|
|
28
|
+
.map(criteria => parse_1.SlicingCriterion.parse(criteria, idMap))
|
|
29
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
|
|
@@ -17,7 +17,7 @@ exports.SearchQueryDefinition = {
|
|
|
17
17
|
const out = queryResults;
|
|
18
18
|
result.push(`Query: ${(0, ansi_1.bold)('search', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
19
19
|
for (const [, { ids, search }] of out.results.entries()) {
|
|
20
|
-
result.push(` ╰ [query](${
|
|
20
|
+
result.push(` ╰ [query](${mermaid_1.Mermaid.codeToUrl((0, flowr_search_printer_1.flowrSearchToMermaid)(search))}): {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, ids)}}`);
|
|
21
21
|
}
|
|
22
22
|
return true;
|
|
23
23
|
},
|
|
@@ -7,7 +7,8 @@ const reconstruct_1 = require("../../../reconstruct/reconstruct");
|
|
|
7
7
|
const auto_select_defaults_1 = require("../../../reconstruct/auto-select/auto-select-defaults");
|
|
8
8
|
const magic_comments_1 = require("../../../reconstruct/auto-select/magic-comments");
|
|
9
9
|
const log_1 = require("../../../util/log");
|
|
10
|
-
const
|
|
10
|
+
const slice_direction_1 = require("../../../util/slice-direction");
|
|
11
|
+
const parse_1 = require("../../../slicing/criterion/parse");
|
|
11
12
|
/**
|
|
12
13
|
* Produce a fingerprint string for a static slice query
|
|
13
14
|
*/
|
|
@@ -30,7 +31,8 @@ async function executeStaticSliceQuery({ analyzer }, queries) {
|
|
|
30
31
|
}
|
|
31
32
|
const { criteria, noReconstruction, noMagicComments } = query;
|
|
32
33
|
const sliceStart = Date.now();
|
|
33
|
-
const
|
|
34
|
+
const n = await analyzer.normalize();
|
|
35
|
+
const slice = (0, static_slicer_1.staticSlice)(analyzer.inspectContext(), await analyzer.dataflow(), n, parse_1.SlicingCriteria.convertAll(criteria, n.idMap), query.direction ?? slice_direction_1.SliceDirection.Backward, analyzer.flowrConfig.solver.slicer?.threshold);
|
|
34
36
|
const sliceEnd = Date.now();
|
|
35
37
|
if (noReconstruction) {
|
|
36
38
|
results[key] = { slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } } };
|
|
@@ -5,11 +5,11 @@ import type { SlicingCriteria } from '../../../slicing/criterion/parse';
|
|
|
5
5
|
import type { ParsedQueryLine } from '../../query';
|
|
6
6
|
import Joi from 'joi';
|
|
7
7
|
import { executeStaticSliceQuery } from './static-slice-query-executor';
|
|
8
|
-
import { SliceDirection } from '../../../core/steps/all/static-slicing/00-slice';
|
|
9
8
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
10
9
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
11
10
|
import type { FlowrConfig } from '../../../config';
|
|
12
|
-
|
|
11
|
+
import { SliceDirection } from '../../../util/slice-direction';
|
|
12
|
+
/** Calculates and returns the static backward or forward slice from the given criteria */
|
|
13
13
|
export interface StaticSliceQuery extends BaseQueryFormat {
|
|
14
14
|
readonly type: 'static-slice';
|
|
15
15
|
/** The slicing criteria to use */
|
|
@@ -9,12 +9,12 @@ const time_1 = require("../../../util/text/time");
|
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const static_slice_query_executor_1 = require("./static-slice-query-executor");
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
|
-
const _00_slice_1 = require("../../../core/steps/all/static-slicing/00-slice");
|
|
13
12
|
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
13
|
+
const slice_direction_1 = require("../../../util/slice-direction");
|
|
14
14
|
function sliceQueryLineParser(output, line, _config) {
|
|
15
15
|
const criteria = (0, slice_query_parser_1.sliceCriteriaParser)(line[0]);
|
|
16
16
|
const direction = (0, slice_query_parser_1.sliceDirectionParser)(line[0]);
|
|
17
|
-
if (!criteria || criteria.length
|
|
17
|
+
if (!criteria || criteria.length === 0) {
|
|
18
18
|
output.stderr(output.formatter.format('Invalid static-slice query format, slicing criteria must be given in the form "(criterion1;criterion2;...)"', { color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }));
|
|
19
19
|
return { query: [] };
|
|
20
20
|
}
|
|
@@ -68,7 +68,7 @@ exports.StaticSliceQueryDefinition = {
|
|
|
68
68
|
criteria: joi_1.default.array().items(joi_1.default.string()).min(0).required().description('The slicing criteria to use.'),
|
|
69
69
|
noReconstruction: joi_1.default.boolean().optional().description('Do not reconstruct the slice into readable code.'),
|
|
70
70
|
noMagicComments: joi_1.default.boolean().optional().description('Should the magic comments (force-including lines within the slice) be ignored?'),
|
|
71
|
-
direction: joi_1.default.string().valid(...Object.values(
|
|
71
|
+
direction: joi_1.default.string().valid(...Object.values(slice_direction_1.SliceDirection)).optional().description('The direction to slice in. Defaults to backward slicing if unset.')
|
|
72
72
|
}).description('Slice query used to slice the dataflow graph'),
|
|
73
73
|
flattenInvolvedNodes: (queryResults) => {
|
|
74
74
|
const flattened = [];
|
package/queries/query.d.ts
CHANGED
|
@@ -33,10 +33,12 @@ import type { CallGraphQuery } from './catalog/call-graph-query/call-graph-query
|
|
|
33
33
|
import type { InspectRecursionQuery } from './catalog/inspect-recursion-query/inspect-recursion-query-format';
|
|
34
34
|
import type { DoesCallQuery } from './catalog/does-call-query/does-call-query-format';
|
|
35
35
|
import type { InspectExceptionQuery } from './catalog/inspect-exceptions-query/inspect-exception-query-format';
|
|
36
|
+
import type { InputSourcesQuery } from './catalog/input-sources-query/input-sources-query-format';
|
|
37
|
+
import type { ProvenanceQuery } from './catalog/provenance-query/provenance-query-format';
|
|
36
38
|
/**
|
|
37
39
|
* These are all queries that can be executed from within flowR
|
|
38
40
|
*/
|
|
39
|
-
export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | DfShapeQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery;
|
|
41
|
+
export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | DfShapeQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | ResolveValueQuery | ProjectQuery | OriginQuery | LinterQuery | ProvenanceQuery | InputSourcesQuery;
|
|
40
42
|
export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
|
|
41
43
|
type: QueryType;
|
|
42
44
|
};
|
|
@@ -156,6 +158,20 @@ export declare const SupportedQueries: {
|
|
|
156
158
|
readonly schema: Joi.ObjectSchema<any>;
|
|
157
159
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
158
160
|
};
|
|
161
|
+
readonly provenance: {
|
|
162
|
+
readonly executor: typeof import("./catalog/provenance-query/provenance-query-executor").executeProvenanceQuery;
|
|
163
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
164
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"provenance">;
|
|
165
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
166
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
167
|
+
};
|
|
168
|
+
readonly 'input-sources': {
|
|
169
|
+
readonly executor: typeof import("./catalog/input-sources-query/input-sources-query-executor").executeInputSourcesQuery;
|
|
170
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
171
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"input-sources">;
|
|
172
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
173
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
174
|
+
};
|
|
159
175
|
readonly dependencies: {
|
|
160
176
|
readonly executor: typeof import("./catalog/dependencies-query/dependencies-query-executor").executeDependenciesQuery;
|
|
161
177
|
readonly asciiSummarizer: (formatter: OutputFormatter, _analyzer: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[], queries: readonly Query[]) => true;
|
package/queries/query.js
CHANGED
|
@@ -40,6 +40,8 @@ const call_graph_query_format_1 = require("./catalog/call-graph-query/call-graph
|
|
|
40
40
|
const inspect_recursion_query_format_1 = require("./catalog/inspect-recursion-query/inspect-recursion-query-format");
|
|
41
41
|
const does_call_query_format_1 = require("./catalog/does-call-query/does-call-query-format");
|
|
42
42
|
const inspect_exception_query_format_1 = require("./catalog/inspect-exceptions-query/inspect-exception-query-format");
|
|
43
|
+
const input_sources_query_format_1 = require("./catalog/input-sources-query/input-sources-query-format");
|
|
44
|
+
const provenance_query_format_1 = require("./catalog/provenance-query/provenance-query-format");
|
|
43
45
|
exports.SupportedQueries = {
|
|
44
46
|
'call-context': call_context_query_format_1.CallContextQueryDefinition,
|
|
45
47
|
'config': config_query_format_1.ConfigQueryDefinition,
|
|
@@ -54,6 +56,8 @@ exports.SupportedQueries = {
|
|
|
54
56
|
'normalized-ast': normalized_ast_query_format_1.NormalizedAstQueryDefinition,
|
|
55
57
|
'dataflow-cluster': cluster_query_format_1.ClusterQueryDefinition,
|
|
56
58
|
'static-slice': static_slice_query_format_1.StaticSliceQueryDefinition,
|
|
59
|
+
'provenance': provenance_query_format_1.ProvenanceQueryDefinition,
|
|
60
|
+
'input-sources': input_sources_query_format_1.InputSourcesDefinition,
|
|
57
61
|
'dependencies': dependencies_query_format_1.DependenciesQueryDefinition,
|
|
58
62
|
'location-map': location_map_query_format_1.LocationMapQueryDefinition,
|
|
59
63
|
'search': search_query_format_1.SearchQueryDefinition,
|
|
@@ -28,6 +28,7 @@ import type { ParentInformation } from './processing/decorate';
|
|
|
28
28
|
import type { NodeId } from './processing/node-id';
|
|
29
29
|
import type { OnEnter, OnExit } from './processing/visitor';
|
|
30
30
|
import type { SingleOrArrayOrNothing } from '../../../../abstract-interpretation/normalized-ast-fold';
|
|
31
|
+
import { getDocumentationOf } from '../../../roxygen2/documentation-provider';
|
|
31
32
|
/** Simply an empty type constraint used to say that there are additional decorations (see {@link RAstNodeBase}). */
|
|
32
33
|
export type NoInfo = object;
|
|
33
34
|
/**
|
|
@@ -218,6 +219,9 @@ export declare const ROther: {
|
|
|
218
219
|
export type RNode<Info = NoInfo> = RExpressionList<Info> | RFunctions<Info> | ROther<Info> | RConstructs<Info> | RNamedAccess<Info> | RIndexAccess<Info> | RUnaryOp<Info> | RBinaryOp<Info> | RSingleNode<Info> | RPipe<Info>;
|
|
219
220
|
/**
|
|
220
221
|
* Helper object to provide helper functions for {@link RNode|RNodes}.
|
|
222
|
+
* For the individual type checks, please consult the individual vertices, e.g. {@link RPipe.is}.
|
|
223
|
+
* Some vertices also have a {@link RPipe.availableFromRVersion} property that indicates from which R version they are available,
|
|
224
|
+
* so you can check for that as well if needed.
|
|
221
225
|
* @see {@link DefaultNormalizedAstFold} - for a more powerful way to traverse the normalized AST
|
|
222
226
|
*/
|
|
223
227
|
export declare const RNode: {
|
|
@@ -287,5 +291,10 @@ export declare const RNode: {
|
|
|
287
291
|
readonly lexeme: <R extends RNode<ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
288
292
|
lexeme: string;
|
|
289
293
|
} ? string : string | undefined;
|
|
294
|
+
/**
|
|
295
|
+
* Return the (roxygen) documentation associated with the given node, if available.
|
|
296
|
+
* @see {@link getDocumentationOf}
|
|
297
|
+
*/
|
|
298
|
+
readonly documentation: typeof getDocumentationOf;
|
|
290
299
|
};
|
|
291
300
|
export type OtherInfoNode = RNode | RDelimiter;
|
|
@@ -6,6 +6,7 @@ const type_1 = require("./type");
|
|
|
6
6
|
const r_access_1 = require("./nodes/r-access");
|
|
7
7
|
const visitor_1 = require("./processing/visitor");
|
|
8
8
|
const assert_1 = require("../../../../util/assert");
|
|
9
|
+
const documentation_provider_1 = require("../../../roxygen2/documentation-provider");
|
|
9
10
|
/**
|
|
10
11
|
* Helper object to provide helper functions for {@link RConstant|RConstants}.
|
|
11
12
|
* @see {@link RNode} - for more general helper functions for all nodes
|
|
@@ -119,6 +120,9 @@ exports.ROther = {
|
|
|
119
120
|
};
|
|
120
121
|
/**
|
|
121
122
|
* Helper object to provide helper functions for {@link RNode|RNodes}.
|
|
123
|
+
* For the individual type checks, please consult the individual vertices, e.g. {@link RPipe.is}.
|
|
124
|
+
* Some vertices also have a {@link RPipe.availableFromRVersion} property that indicates from which R version they are available,
|
|
125
|
+
* so you can check for that as well if needed.
|
|
122
126
|
* @see {@link DefaultNormalizedAstFold} - for a more powerful way to traverse the normalized AST
|
|
123
127
|
*/
|
|
124
128
|
exports.RNode = {
|
|
@@ -260,6 +264,11 @@ exports.RNode = {
|
|
|
260
264
|
*/
|
|
261
265
|
lexeme(node) {
|
|
262
266
|
return node?.info.fullLexeme ?? node?.lexeme;
|
|
263
|
-
}
|
|
267
|
+
},
|
|
268
|
+
/**
|
|
269
|
+
* Return the (roxygen) documentation associated with the given node, if available.
|
|
270
|
+
* @see {@link getDocumentationOf}
|
|
271
|
+
*/
|
|
272
|
+
documentation: documentation_provider_1.getDocumentationOf
|
|
264
273
|
};
|
|
265
274
|
//# sourceMappingURL=model.js.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { RAstNodeBase, Location, NoInfo
|
|
1
|
+
import type { RAstNodeBase, Location, NoInfo } from '../model';
|
|
2
|
+
import { RNode } from '../model';
|
|
2
3
|
import { RType } from '../type';
|
|
3
4
|
import type { RArgument, RUnnamedArgument } from './r-argument';
|
|
4
5
|
import type { EmptyArgument } from './r-function-call';
|
|
@@ -42,5 +43,19 @@ export declare const RAccess: {
|
|
|
42
43
|
* Type guard for {@link RIndexAccess} nodes.
|
|
43
44
|
*/
|
|
44
45
|
readonly isIndex: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RIndexAccess<Info>;
|
|
46
|
+
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
47
|
+
readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
|
|
48
|
+
readonly getType: (this: void, node: RNode) => RType;
|
|
49
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
50
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
|
|
51
|
+
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof EmptyArgument)[];
|
|
52
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
|
|
53
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
|
|
54
|
+
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
|
|
55
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
|
|
56
|
+
readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
57
|
+
lexeme: string;
|
|
58
|
+
} ? string : string | undefined;
|
|
59
|
+
readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
|
|
45
60
|
};
|
|
46
61
|
export {};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RAccess = void 0;
|
|
4
|
+
const model_1 = require("../model");
|
|
4
5
|
const type_1 = require("../type");
|
|
5
6
|
/**
|
|
6
7
|
* Helper for working with {@link RAccess} AST nodes.
|
|
7
8
|
*/
|
|
8
9
|
exports.RAccess = {
|
|
10
|
+
...model_1.RNode,
|
|
9
11
|
name: 'RAccess',
|
|
10
12
|
/**
|
|
11
13
|
* Type guard for {@link RAccess} nodes.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { RAstNodeBase, Location, NoInfo
|
|
1
|
+
import type { RAstNodeBase, Location, NoInfo } from '../model';
|
|
2
|
+
import { RNode } from '../model';
|
|
2
3
|
import { RType } from '../type';
|
|
3
4
|
import type { RSymbol } from './r-symbol';
|
|
4
5
|
import type { ParentInformation } from '../processing/decorate';
|
|
@@ -53,4 +54,18 @@ export declare const RArgument: {
|
|
|
53
54
|
* Retrieve the value of the argument with the given id from the list of arguments.
|
|
54
55
|
*/
|
|
55
56
|
readonly getValue: <OtherInfo>(args: readonly RFunctionArgument<OtherInfo & ParentInformation>[], id: NodeId | undefined) => RNode<OtherInfo> | undefined;
|
|
57
|
+
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
58
|
+
readonly getId: (this: void, node: RNode<ParentInformation>) => NodeId;
|
|
59
|
+
readonly getType: (this: void, node: RNode) => RType;
|
|
60
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
61
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & ParentInformation>>) => Set<NodeId>;
|
|
62
|
+
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof EmptyArgument)[];
|
|
63
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation>, idMap: Map<NodeId, RNode<OtherInfo & ParentInformation>>) => RNode<OtherInfo & ParentInformation> | undefined;
|
|
64
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & ParentInformation> | undefined, idMap: Map<NodeId, RNode<OtherInfo & ParentInformation>>) => Generator<RNode<OtherInfo & ParentInformation>>;
|
|
65
|
+
readonly depth: (this: void, node: RNode<ParentInformation>, idMap: Map<NodeId, RNode<ParentInformation>>) => number;
|
|
66
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & ParentInformation>>, stop: (node: RNode<OtherInfo & ParentInformation>) => boolean) => Set<NodeId>;
|
|
67
|
+
readonly lexeme: <R extends RNode<ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
68
|
+
lexeme: string;
|
|
69
|
+
} ? string : string | undefined;
|
|
70
|
+
readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
|
|
56
71
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RArgument = void 0;
|
|
4
|
+
const model_1 = require("../model");
|
|
4
5
|
const type_1 = require("../type");
|
|
5
6
|
const r_function_call_1 = require("./r-function-call");
|
|
6
7
|
/**
|
|
7
8
|
* Helper for working with {@link RArgument} AST nodes.
|
|
8
9
|
*/
|
|
9
10
|
exports.RArgument = {
|
|
11
|
+
...model_1.RNode,
|
|
10
12
|
name: 'RArgument',
|
|
11
13
|
/**
|
|
12
14
|
* Type guard for {@link RArgument} nodes.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { RAstNodeBase, Location, NoInfo
|
|
1
|
+
import type { RAstNodeBase, Location, NoInfo } from '../model';
|
|
2
|
+
import { RNode } from '../model';
|
|
2
3
|
import { RType } from '../type';
|
|
3
4
|
import type { OperatorInformationValue } from '../operators';
|
|
4
5
|
/**
|
|
@@ -23,4 +24,18 @@ export declare const RBinaryOp: {
|
|
|
23
24
|
* Get the operator information for a binary operator node.
|
|
24
25
|
*/
|
|
25
26
|
readonly getOperatorInfo: <Info = object>(node: RBinaryOp<Info>) => OperatorInformationValue | undefined;
|
|
27
|
+
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
28
|
+
readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
|
|
29
|
+
readonly getType: (this: void, node: RNode) => RType;
|
|
30
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
31
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
|
|
32
|
+
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
|
|
33
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
|
|
34
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
|
|
35
|
+
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
|
|
36
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
|
|
37
|
+
readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
38
|
+
lexeme: string;
|
|
39
|
+
} ? string : string | undefined;
|
|
40
|
+
readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
|
|
26
41
|
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RBinaryOp = void 0;
|
|
4
|
+
const model_1 = require("../model");
|
|
4
5
|
const type_1 = require("../type");
|
|
5
6
|
const operators_1 = require("../operators");
|
|
6
7
|
/**
|
|
7
8
|
* Helper for working with {@link RBinaryOp} AST nodes.
|
|
8
9
|
*/
|
|
9
10
|
exports.RBinaryOp = {
|
|
11
|
+
...model_1.RNode,
|
|
10
12
|
name: 'RBinaryOp',
|
|
11
13
|
/**
|
|
12
14
|
* Type guard for {@link RBinaryOp} nodes.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Leaf, Location, NoInfo } from '../model';
|
|
2
|
+
import { RNode } from '../model';
|
|
2
3
|
import { RType } from '../type';
|
|
3
4
|
/**
|
|
4
5
|
* A `break` statement.
|
|
@@ -15,4 +16,18 @@ export declare const RBreak: {
|
|
|
15
16
|
* Type guard for {@link RBreak} nodes.
|
|
16
17
|
*/
|
|
17
18
|
readonly is: <Info = object>(this: void, node: unknown) => node is RBreak<Info>;
|
|
19
|
+
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
20
|
+
readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
|
|
21
|
+
readonly getType: (this: void, node: RNode) => RType;
|
|
22
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
23
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
|
|
24
|
+
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
|
|
25
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
|
|
26
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
|
|
27
|
+
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
|
|
28
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
|
|
29
|
+
readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
30
|
+
lexeme: string;
|
|
31
|
+
} ? string : string | undefined;
|
|
32
|
+
readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
|
|
18
33
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RBreak = void 0;
|
|
4
|
+
const model_1 = require("../model");
|
|
4
5
|
const type_1 = require("../type");
|
|
5
6
|
/**
|
|
6
7
|
* Helper for working with {@link RBreak} AST nodes.
|
|
7
8
|
*/
|
|
8
9
|
exports.RBreak = {
|
|
10
|
+
...model_1.RNode,
|
|
9
11
|
name: 'RBreak',
|
|
10
12
|
/**
|
|
11
13
|
* Type guard for {@link RBreak} nodes.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Leaf, Location, NoInfo } from '../model';
|
|
2
|
+
import { RNode } from '../model';
|
|
2
3
|
import { RType } from '../type';
|
|
3
4
|
/**
|
|
4
5
|
* ```r
|
|
@@ -17,4 +18,18 @@ export declare const RComment: {
|
|
|
17
18
|
* Type guard for {@link RComment} nodes.
|
|
18
19
|
*/
|
|
19
20
|
readonly is: <Info = object>(this: void, node: unknown) => node is RComment<Info>;
|
|
21
|
+
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
22
|
+
readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
|
|
23
|
+
readonly getType: (this: void, node: RNode) => RType;
|
|
24
|
+
readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
|
|
25
|
+
readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
|
|
26
|
+
readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
|
|
27
|
+
readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
|
|
28
|
+
readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
|
|
29
|
+
readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
|
|
30
|
+
readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
|
|
31
|
+
readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
|
|
32
|
+
lexeme: string;
|
|
33
|
+
} ? string : string | undefined;
|
|
34
|
+
readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
|
|
20
35
|
};
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RComment = void 0;
|
|
4
|
+
const model_1 = require("../model");
|
|
4
5
|
const type_1 = require("../type");
|
|
5
6
|
/**
|
|
6
7
|
* Helper for working with {@link RComment} AST nodes.
|
|
7
8
|
*/
|
|
8
9
|
exports.RComment = {
|
|
10
|
+
...model_1.RNode,
|
|
9
11
|
name: 'RComment',
|
|
10
12
|
/**
|
|
11
13
|
* Type guard for {@link RComment} nodes.
|