@eagleoutice/flowr 2.13.7 → 2.13.9
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 +23 -23
- package/dataflow/cluster.js +48 -24
- package/dataflow/environments/default-builtin-config.d.ts +30 -0
- package/dataflow/environments/default-builtin-config.js +9 -0
- package/dataflow/graph/df-helper.d.ts +13 -0
- package/dataflow/graph/df-helper.js +21 -0
- package/dataflow/graph/graph.d.ts +1 -0
- package/dataflow/graph/graph.js +21 -6
- package/linter/rules/undefined-symbol-util.d.ts +4 -1
- package/linter/rules/undefined-symbol-util.js +6 -3
- package/package.json +2 -2
- package/project/dependency-version-space.d.ts +18 -3
- package/project/dependency-version-space.js +40 -6
- package/project/plugins/package-version-plugins/package.d.ts +2 -0
- package/project/plugins/package-version-plugins/package.js +4 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +1 -9
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +4 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +25 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +11 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +3 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +8 -0
- package/queries/catalog/dependencies-query/dependencies-query-format.js +47 -5
- package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +26 -0
- package/queries/catalog/dependencies-query/function-info/test-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/test-functions.js +33 -31
- package/queries/catalog/dependencies-query/function-info/write-functions.js +20 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +3 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
- package/r-bridge/data/data.d.ts +1 -1
- package/r-bridge/data/data.js +1 -1
- package/slicing/criterion/parse.d.ts +2 -1
- package/slicing/criterion/parse.js +37 -1
- package/slicing/static/fingerprint.d.ts +1 -1
- package/slicing/static/fingerprint.js +40 -8
- package/slicing/static/static-slicer.js +1 -1
- package/slicing/static/visiting-queue.d.ts +4 -2
- package/slicing/static/visiting-queue.js +10 -1
- package/util/version.js +1 -1
|
@@ -7,19 +7,51 @@ exports.envFingerprint = envFingerprint;
|
|
|
7
7
|
exports.fingerprint = fingerprint;
|
|
8
8
|
const object_hash_1 = __importDefault(require("object-hash"));
|
|
9
9
|
const environment_1 = require("../../dataflow/environments/environment");
|
|
10
|
+
const HashOptions = {
|
|
11
|
+
algorithm: 'md5',
|
|
12
|
+
excludeKeys: (key) => key === 'id' || key === 'value',
|
|
13
|
+
respectFunctionProperties: false,
|
|
14
|
+
respectFunctionNames: false,
|
|
15
|
+
ignoreUnknown: true,
|
|
16
|
+
replacer: (v) => (0, environment_1.isDefaultBuiltInEnvironment)(v) ? undefined : v
|
|
17
|
+
};
|
|
18
|
+
/* definitions and frames are shared across the environments a slice builds, and a definition may hold a whole
|
|
19
|
+
* environment of its own (`envState`), so each is hashed once instead of on every fingerprint */
|
|
20
|
+
const definitionHashes = new WeakMap();
|
|
21
|
+
const frameHashes = new WeakMap();
|
|
22
|
+
function definitionHash(definition) {
|
|
23
|
+
let hash = definitionHashes.get(definition);
|
|
24
|
+
if (hash === undefined) {
|
|
25
|
+
hash = (0, object_hash_1.default)(definition, HashOptions);
|
|
26
|
+
definitionHashes.set(definition, hash);
|
|
27
|
+
}
|
|
28
|
+
return hash;
|
|
29
|
+
}
|
|
30
|
+
function frameHash(frame) {
|
|
31
|
+
let hash = frameHashes.get(frame);
|
|
32
|
+
if (hash === undefined) {
|
|
33
|
+
const entries = [];
|
|
34
|
+
for (const [name, definitions] of frame.memory) {
|
|
35
|
+
entries.push(`${String(name)}=${definitions.map(definitionHash).join(',')}`);
|
|
36
|
+
}
|
|
37
|
+
entries.sort();
|
|
38
|
+
hash = (0, object_hash_1.default)([frame.n, frame.t, frame.closure, frame.globalEnv === true, entries], HashOptions);
|
|
39
|
+
frameHashes.set(frame, hash);
|
|
40
|
+
}
|
|
41
|
+
return hash;
|
|
42
|
+
}
|
|
10
43
|
/**
|
|
11
44
|
* Calculate a fingerprint for the given R environment information
|
|
12
45
|
* @see {@link fingerprint}
|
|
13
46
|
*/
|
|
14
47
|
function envFingerprint(env) {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
48
|
+
const parts = [String(env.level)];
|
|
49
|
+
let frame = env.current;
|
|
50
|
+
while (frame !== undefined && !frame.builtInEnv) {
|
|
51
|
+
parts.push(frameHash(frame));
|
|
52
|
+
frame = frame.parent;
|
|
53
|
+
}
|
|
54
|
+
return parts.join('|');
|
|
23
55
|
}
|
|
24
56
|
/**
|
|
25
57
|
* Calculate a fingerprint for the given node id and environment fingerprint
|
|
@@ -39,7 +39,7 @@ function staticSlice(options) {
|
|
|
39
39
|
graph = df_helper_1.Dataflow.invertGraph(graph, ctx.env.makeCleanEnv());
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
const queue = new visiting_queue_1.VisitingQueue(threshold, cache);
|
|
42
|
+
const queue = new visiting_queue_1.VisitingQueue(threshold, cache, id => graph.hasVertex(id));
|
|
43
43
|
let minNesting = Number.MAX_SAFE_INTEGER;
|
|
44
44
|
const sliceSeedIds = new Set();
|
|
45
45
|
// every node ships the call environment which registers the calling environment
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Fingerprint } from './fingerprint';
|
|
2
2
|
import type { NodeToSlice, SliceResult } from './slicer-types';
|
|
3
3
|
import type { REnvironmentInformation } from '../../dataflow/environments/environment';
|
|
4
|
-
import
|
|
4
|
+
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
5
5
|
import type { DataflowGraphVertexInfo } from '../../dataflow/graph/vertex';
|
|
6
6
|
export declare class VisitingQueue {
|
|
7
7
|
private readonly threshold;
|
|
@@ -13,7 +13,9 @@ export declare class VisitingQueue {
|
|
|
13
13
|
private readonly cache?;
|
|
14
14
|
potentialAdditions: Map<NodeId, [NodeId, NodeToSlice]>;
|
|
15
15
|
private cachedCallTargets;
|
|
16
|
-
|
|
16
|
+
/** whether the dataflow graph has a vertex for an id, i.e. whether the traversal could continue from it */
|
|
17
|
+
private readonly isGraphVertex?;
|
|
18
|
+
constructor(threshold: number, cache?: Map<Fingerprint, Set<NodeId>>, isGraphVertex?: (id: NodeId) => boolean);
|
|
17
19
|
/**
|
|
18
20
|
* Adds a node to the queue if it has not been seen before.
|
|
19
21
|
* @param target - the node to add
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VisitingQueue = void 0;
|
|
4
4
|
const fingerprint_1 = require("./fingerprint");
|
|
5
|
+
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
5
6
|
class VisitingQueue {
|
|
6
7
|
threshold;
|
|
7
8
|
timesHitThreshold = 0;
|
|
@@ -14,9 +15,12 @@ class VisitingQueue {
|
|
|
14
15
|
// additionally it holds which node id added the addition so we can separate their inclusion on the structure
|
|
15
16
|
potentialAdditions = new Map();
|
|
16
17
|
cachedCallTargets = new Map();
|
|
17
|
-
|
|
18
|
+
/** whether the dataflow graph has a vertex for an id, i.e. whether the traversal could continue from it */
|
|
19
|
+
isGraphVertex;
|
|
20
|
+
constructor(threshold, cache, isGraphVertex) {
|
|
18
21
|
this.threshold = threshold;
|
|
19
22
|
this.cache = cache;
|
|
23
|
+
this.isGraphVertex = isGraphVertex;
|
|
20
24
|
}
|
|
21
25
|
/**
|
|
22
26
|
* Adds a node to the queue if it has not been seen before.
|
|
@@ -26,6 +30,11 @@ class VisitingQueue {
|
|
|
26
30
|
* @param onlyForSideEffects - whether the node is only used for its side effects
|
|
27
31
|
*/
|
|
28
32
|
add(target, env, envFingerprint, onlyForSideEffects) {
|
|
33
|
+
/* a built-in without a vertex is R's own definition (`x <- 1` reads `built-in:<-`), a dead end the traversal
|
|
34
|
+
* would drop right back out of, so it only ever widened the result */
|
|
35
|
+
if (node_id_1.NodeId.isBuiltIn(target) && this.isGraphVertex?.(target) === false) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
29
38
|
const idCounter = this.idThreshold.get(target) ?? 0;
|
|
30
39
|
if (idCounter > this.threshold) {
|
|
31
40
|
this.timesHitThreshold++;
|
package/util/version.js
CHANGED
|
@@ -42,7 +42,7 @@ const assert_1 = require("./assert");
|
|
|
42
42
|
const sigdb_download_1 = require("../project/sigdb/sigdb-download");
|
|
43
43
|
const doc_files_1 = require("../documentation/doc-util/doc-files");
|
|
44
44
|
// this is automatically replaced with the current version by release-it
|
|
45
|
-
const version = '2.13.
|
|
45
|
+
const version = '2.13.9';
|
|
46
46
|
// this is automatically replaced with the release date by release-it (regex-bumper, see package.json)
|
|
47
47
|
const versionDate = '2026-07-15T07:13:44Z';
|
|
48
48
|
/**
|