@eagleoutice/flowr 2.13.8 → 2.13.10
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/config.d.ts +50 -2
- package/config.js +37 -6
- package/dataflow/cluster.js +48 -24
- package/dataflow/environments/apply-kill.js +4 -4
- package/dataflow/environments/built-in-props.d.ts +28 -4
- package/dataflow/environments/built-in-props.js +31 -8
- package/dataflow/environments/built-in.d.ts +7 -2
- package/dataflow/environments/built-in.js +10 -12
- package/dataflow/environments/default-builtin-config.d.ts +76 -6
- package/dataflow/environments/default-builtin-config.js +39 -16
- package/dataflow/environments/environment.d.ts +16 -0
- package/dataflow/environments/environment.js +70 -18
- package/dataflow/environments/identifier.d.ts +6 -0
- package/dataflow/environments/identifier.js +18 -5
- package/dataflow/environments/query-fn-props.js +34 -2
- package/dataflow/environments/reference-to-maybe.js +1 -1
- package/dataflow/eval/resolve/alias-tracking.js +45 -1
- package/dataflow/eval/resolve/resolve-argument.js +25 -17
- package/dataflow/eval/resolve/resolve-strings.d.ts +17 -0
- package/dataflow/eval/resolve/resolve-strings.js +16 -9
- package/dataflow/eval/resolve/resolve.js +3 -1
- package/dataflow/graph/call-graph.d.ts +7 -0
- package/dataflow/graph/call-graph.js +103 -0
- package/dataflow/graph/df-helper.d.ts +2 -0
- package/dataflow/graph/graph.d.ts +6 -8
- package/dataflow/graph/graph.js +21 -6
- package/dataflow/internal/linker.d.ts +5 -5
- package/dataflow/internal/linker.js +31 -92
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +3 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +4 -30
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +7 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +5 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-with.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +32 -14
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +16 -4
- package/dataflow/internal/process/functions/call/known-call-handling.js +29 -8
- package/documentation/doc-util/doc-sigdb.d.ts +9 -0
- package/documentation/doc-util/doc-sigdb.js +32 -0
- package/documentation/wiki-interface.js +13 -2
- package/documentation/wiki-query.js +3 -0
- package/documentation/wiki-signature-database.js +2 -5
- package/gas.d.ts +6 -0
- package/gas.js +7 -1
- package/package.json +2 -2
- package/project/attached-packages.d.ts +13 -0
- package/project/attached-packages.js +30 -0
- package/project/context/flowr-analyzer-context.d.ts +15 -0
- package/project/context/flowr-analyzer-context.js +14 -3
- package/project/context/flowr-analyzer-files-context.d.ts +11 -0
- package/project/context/flowr-analyzer-files-context.js +3 -0
- package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +4 -0
- package/project/context/flowr-analyzer-incremental-analysis-context.js +69 -0
- package/project/dependency-version-space.d.ts +45 -8
- package/project/dependency-version-space.js +86 -26
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +52 -24
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-library-plugin.d.ts +22 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-library-plugin.js +101 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +30 -11
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +79 -37
- package/project/plugins/package-version-plugins/package.d.ts +2 -0
- package/project/plugins/package-version-plugins/package.js +4 -0
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +2 -0
- package/project/sigdb/manifest.js +9 -5
- package/project/sigdb/signature-match.d.ts +5 -18
- package/project/sigdb/signature-match.js +5 -18
- 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/call-graph-query/call-graph-query-executor.js +3 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +4 -0
- package/queries/catalog/call-graph-query/call-graph-query-format.js +4 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +11 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +13 -5
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +27 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +69 -7
- package/queries/catalog/dependencies-query/function-info/library-functions.js +9 -2
- package/queries/catalog/dependencies-query/function-info/read-functions.js +31 -5
- package/queries/catalog/dependencies-query/function-info/remote-functions.d.ts +18 -0
- package/queries/catalog/dependencies-query/function-info/remote-functions.js +46 -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/visualize-functions.js +52 -2
- package/queries/catalog/dependencies-query/function-info/write-functions.js +28 -5
- package/queries/catalog/dependencies-query/link-devices.d.ts +12 -0
- package/queries/catalog/dependencies-query/link-devices.js +58 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +2 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +25 -6
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +38 -7
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +18 -5
- package/queries/catalog/happens-before-query/happens-before-query-format.js +3 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.js +4 -0
- package/queries/catalog/input-sources-query/input-types.d.ts +10 -0
- package/queries/catalog/input-sources-query/input-types.js +10 -0
- package/queries/catalog/location-map-query/location-map-query-executor.js +16 -6
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +15 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +22 -5
- package/queries/catalog/signature-query/signature-query-executor.js +3 -0
- package/queries/catalog/signature-query/signature-query-format.d.ts +5 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
- package/queries/query.d.ts +1 -1
- package/r-bridge/data/data.d.ts +1 -1
- package/r-bridge/data/data.js +1 -1
- package/r-bridge/lang-4.x/ast/model/model.d.ts +14 -2
- package/r-bridge/lang-4.x/ast/model/model.js +32 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +7 -8
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +9 -46
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +0 -5
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +6 -3
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +1 -1
- package/search/flowr-search-filters.d.ts +17 -1
- package/search/flowr-search-filters.js +23 -0
- package/slicing/criterion/parse.d.ts +6 -25
- package/slicing/criterion/parse.js +50 -19
- package/slicing/static/fingerprint.d.ts +1 -1
- package/slicing/static/fingerprint.js +52 -8
- package/slicing/static/slicer-types.d.ts +10 -0
- package/slicing/static/static-slicer.d.ts +1 -1
- package/slicing/static/static-slicer.js +29 -6
- package/slicing/static/visiting-queue.d.ts +15 -3
- package/slicing/static/visiting-queue.js +37 -3
- package/util/arg-matching.d.ts +18 -0
- package/util/arg-matching.js +70 -0
- package/util/r-regex.js +19 -1
- package/util/range.d.ts +7 -8
- package/util/range.js +10 -11
- package/util/version.js +1 -1
|
@@ -21,12 +21,6 @@ export interface EnvirResolution<OtherInfo> {
|
|
|
21
21
|
/** `true` when this resolves to a real stack environment (`globalenv()`/`.GlobalEnv`), not a tracked custom env. */
|
|
22
22
|
readonly isStackEnv?: boolean;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
* Binds call arguments to formal parameter names using R's matching rules: exact name, then partial (pmatch) name, then remaining unnamed args left-to-right.
|
|
26
|
-
* Pass `paramNames` as the full formal parameter list (excluding `...`) so ambiguous prefixes are rejected.
|
|
27
|
-
* Thin alias for {@link RFunctionCall.matchArgumentsToParameters}, which owns the (pure) matching logic.
|
|
28
|
-
*/
|
|
29
|
-
export declare function bindArgs<OtherInfo>(args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], paramNames: readonly string[]): ReadonlyMap<string, PotentiallyEmptyRArgument<OtherInfo & ParentInformation>>;
|
|
30
24
|
/**
|
|
31
25
|
* The formal parameter names of the qualified call `id` (a `pkg::fn` {@link Identifier}) from the signature
|
|
32
26
|
* database (excluding `...`), or `fallback` when the database is disabled or does not carry the function. Lets a
|
|
@@ -38,10 +32,10 @@ export declare function signatureParamNames<OtherInfo>(data: DataflowProcessorIn
|
|
|
38
32
|
export declare function resolveConstantString<OtherInfo>(node: RNode<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): string | undefined;
|
|
39
33
|
/** The `returnsEnvState` of the first reaching definition that carries one, else `undefined`. */
|
|
40
34
|
export declare function findReturnsEnvState(defs: readonly IdentifierDefinition[] | undefined): REnvironmentInformation | undefined;
|
|
41
|
-
/** Resolves a single already-found argument (e.g. from {@link
|
|
35
|
+
/** Resolves a single already-found argument (e.g. from {@link RFunctionCall.matchArgsToParams}) to an {@link EnvirResolution} when it is a symbol holding a tracked envState. */
|
|
42
36
|
export declare function resolveArgToEnvir<OtherInfo>(arg: PotentiallyEmptyRArgument<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): EnvirResolution<OtherInfo> | undefined;
|
|
43
|
-
/** Resolves the `argName` argument (default `'envir'
|
|
44
|
-
export declare function resolveEnvirArg<OtherInfo>(args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], data: DataflowProcessorInformation<OtherInfo & ParentInformation>, argName?: string
|
|
37
|
+
/** Resolves the `argName` argument (default `'envir'`), named with pmatch, to an {@link EnvirResolution}. */
|
|
38
|
+
export declare function resolveEnvirArg<OtherInfo>(args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], data: DataflowProcessorInformation<OtherInfo & ParentInformation>, argName?: string): EnvirResolution<OtherInfo> | undefined;
|
|
45
39
|
/** Resolves a symbol by name to an {@link EnvirResolution} when it holds a tracked environment. */
|
|
46
40
|
export declare function resolveSymbolToEnvir<OtherInfo>(symbolName: Identifier, nodeId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>): EnvirResolution<OtherInfo> | undefined;
|
|
47
41
|
/** Moves definitions written into a custom environment from the caller's scope into `envDef`'s tracked `envState`, re-defining the holder variable. */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bindArgs = bindArgs;
|
|
4
3
|
exports.signatureParamNames = signatureParamNames;
|
|
5
4
|
exports.resolveConstantString = resolveConstantString;
|
|
6
5
|
exports.findReturnsEnvState = findReturnsEnvState;
|
|
@@ -61,14 +60,6 @@ function resolveDefsToEnvirResolution(defs, nodeId, data) {
|
|
|
61
60
|
};
|
|
62
61
|
return { envirData: { ...data, environment: mergedEnvState }, envDef, envirNodeId: nodeId };
|
|
63
62
|
}
|
|
64
|
-
/**
|
|
65
|
-
* Binds call arguments to formal parameter names using R's matching rules: exact name, then partial (pmatch) name, then remaining unnamed args left-to-right.
|
|
66
|
-
* Pass `paramNames` as the full formal parameter list (excluding `...`) so ambiguous prefixes are rejected.
|
|
67
|
-
* Thin alias for {@link RFunctionCall.matchArgumentsToParameters}, which owns the (pure) matching logic.
|
|
68
|
-
*/
|
|
69
|
-
function bindArgs(args, paramNames) {
|
|
70
|
-
return r_function_call_1.RFunctionCall.matchArgsToParams(args, paramNames);
|
|
71
|
-
}
|
|
72
63
|
/**
|
|
73
64
|
* The formal parameter names of the qualified call `id` (a `pkg::fn` {@link Identifier}) from the signature
|
|
74
65
|
* database (excluding `...`), or `fallback` when the database is disabled or does not carry the function. Lets a
|
|
@@ -107,7 +98,7 @@ function resolveConstantString(node, data) {
|
|
|
107
98
|
function findReturnsEnvState(defs) {
|
|
108
99
|
return defs?.find((d) => d.returnsEnvState !== undefined)?.returnsEnvState;
|
|
109
100
|
}
|
|
110
|
-
/** Resolves a single already-found argument (e.g. from {@link
|
|
101
|
+
/** Resolves a single already-found argument (e.g. from {@link RFunctionCall.matchArgsToParams}) to an {@link EnvirResolution} when it is a symbol holding a tracked envState. */
|
|
111
102
|
function resolveArgToEnvir(arg, data) {
|
|
112
103
|
if (arg === r_function_call_1.EmptyArgument) {
|
|
113
104
|
return undefined;
|
|
@@ -135,30 +126,13 @@ function stackEnvirResolution(envState, nodeId, lexeme, data) {
|
|
|
135
126
|
};
|
|
136
127
|
return { envirData: { ...data, environment: envState }, envDef, envirNodeId: nodeId, isStackEnv: true };
|
|
137
128
|
}
|
|
138
|
-
/** Resolves the `argName` argument (default `'envir'
|
|
139
|
-
function resolveEnvirArg(args, data, argName = 'envir'
|
|
140
|
-
/* named pass: pmatch against the full parameter list */
|
|
129
|
+
/** Resolves the `argName` argument (default `'envir'`), named with pmatch, to an {@link EnvirResolution}. */
|
|
130
|
+
function resolveEnvirArg(args, data, argName = 'envir') {
|
|
141
131
|
for (const arg of args) {
|
|
142
|
-
if (arg
|
|
143
|
-
continue;
|
|
144
|
-
}
|
|
145
|
-
if ((0, prefix_1.findByPrefixIfUnique)(arg.name.content, allParamNames) === argName) {
|
|
132
|
+
if (arg !== r_function_call_1.EmptyArgument && arg.name !== undefined && (0, prefix_1.findByPrefixIfUnique)(arg.name.content, [argName]) === argName) {
|
|
146
133
|
return resolveArgToEnvir(arg, data);
|
|
147
134
|
}
|
|
148
135
|
}
|
|
149
|
-
/* positional fallback (only when no named match existed) */
|
|
150
|
-
if (positionalFallbackIndex !== undefined) {
|
|
151
|
-
let pos = 0;
|
|
152
|
-
for (const arg of args) {
|
|
153
|
-
if (arg === r_function_call_1.EmptyArgument || arg.name !== undefined) {
|
|
154
|
-
continue;
|
|
155
|
-
}
|
|
156
|
-
if (pos === positionalFallbackIndex) {
|
|
157
|
-
return resolveArgToEnvir(arg, data);
|
|
158
|
-
}
|
|
159
|
-
pos++;
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
136
|
return undefined;
|
|
163
137
|
}
|
|
164
138
|
/** Resolves a symbol by name to an {@link EnvirResolution} when it holds a tracked environment. */
|
|
@@ -47,7 +47,8 @@ function processForLoop(name, args, rootId, data) {
|
|
|
47
47
|
const writtenIds = new Set();
|
|
48
48
|
for (const write of writtenVariable) {
|
|
49
49
|
writtenIds.add(write.nodeId);
|
|
50
|
-
headEnvironments = (0, define_1.define)({ ...write, definedAt: name.info.id, type: identifier_1.ReferenceType.Variable
|
|
50
|
+
headEnvironments = (0, define_1.define)({ ...write, definedAt: name.info.id, type: identifier_1.ReferenceType.Variable,
|
|
51
|
+
value: [vectorArg.info.id], iterated: true }, false, headEnvironments);
|
|
51
52
|
}
|
|
52
53
|
data.environment = headEnvironments;
|
|
53
54
|
const body = (0, processor_1.processDataflowFor)(bodyArg, data);
|
|
@@ -484,7 +484,7 @@ function groupBodyWrites(out) {
|
|
|
484
484
|
}
|
|
485
485
|
}
|
|
486
486
|
for (const writes of byName.values()) {
|
|
487
|
-
writes.sort((a, b) => String(
|
|
487
|
+
writes.sort((a, b) => String(b.nodeId).localeCompare(String(a.nodeId)));
|
|
488
488
|
}
|
|
489
489
|
return byName;
|
|
490
490
|
}
|
|
@@ -25,6 +25,7 @@ const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/node
|
|
|
25
25
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
26
26
|
const general_1 = require("../../../../../eval/values/general");
|
|
27
27
|
const package_1 = require("../../../../../../project/plugins/package-version-plugins/package");
|
|
28
|
+
const attached_packages_1 = require("../../../../../../project/attached-packages");
|
|
28
29
|
const flowr_namespace_file_1 = require("../../../../../../project/plugins/file-plugins/files/flowr-namespace-file");
|
|
29
30
|
const common_1 = require("../common");
|
|
30
31
|
const linker_1 = require("../../../../linker");
|
|
@@ -406,7 +407,12 @@ function attachDependencyToEnvironment(dependency, envInfo, ctx, spec = {}, defi
|
|
|
406
407
|
importsEnv = recImports(importsEnv, dependency.namespaceInfo, ctx, new Set());
|
|
407
408
|
const namespaceEnv = new environment_1.Environment(importsEnv).asLibrary(pack, environment_1.EnvType.Namespace)
|
|
408
409
|
.defineAll(exports.map(exp => exportDefinition(pack, exp, definedAt)));
|
|
409
|
-
|
|
410
|
+
const attached = { level: envInfo.level, current: environment_1.REnvironment.attachAt(envInfo.current, namespaceEnv, importsEnv, spec.pos) };
|
|
411
|
+
/* whatever R puts on the search path with it, `pack` first so a dependency cycle stays finite (the guard above stops it) */
|
|
412
|
+
return (0, attached_packages_1.attachedAlongside)(pack, ctx.deps.signatureSources()).reduce((env, alongside) => {
|
|
413
|
+
const dependency = ctx.deps.getDependency(alongside);
|
|
414
|
+
return dependency === undefined ? env : attachDependencyToEnvironment(dependency, env, ctx, spec, definedAt);
|
|
415
|
+
}, attached);
|
|
410
416
|
}
|
|
411
417
|
/** A namespace-only load is subsumed by any layer for `pack`; a full attach ignores a mere {@link EnvType.LoadedNamespace}. */
|
|
412
418
|
function blocksAttach(layer, namespaceOnly) {
|
|
@@ -222,12 +222,12 @@ function sexpTypeToReferenceType(type) {
|
|
|
222
222
|
function getArguments(args, data) {
|
|
223
223
|
// prefer R's real `base::load` signature from the database, falling back to the known formals when it is absent
|
|
224
224
|
const loadParams = (0, built_in_envir_utils_1.signatureParamNames)(data, identifier_1.Identifier.make('load', "base" /* PkgName.Base */), ['file', 'envir', 'verbose']);
|
|
225
|
-
const bound =
|
|
225
|
+
const bound = r_function_call_1.RFunctionCall.matchArgsToParams(args, loadParams);
|
|
226
226
|
const fileArgBound = bound.get('file');
|
|
227
227
|
const envirArg = bound.get('envir');
|
|
228
228
|
const verboseArgBound = bound.get('verbose');
|
|
229
|
-
const fileArg = fileArgBound
|
|
230
|
-
const verboseArg = verboseArgBound
|
|
229
|
+
const fileArg = fileArgBound ? (0, unpack_argument_1.unpackArg)(fileArgBound) : undefined;
|
|
230
|
+
const verboseArg = verboseArgBound ? (0, unpack_argument_1.unpackArg)(verboseArgBound) : undefined;
|
|
231
231
|
return { fileArg, envirArg, verboseArg };
|
|
232
232
|
}
|
|
233
233
|
//# sourceMappingURL=built-in-load.js.map
|
|
@@ -2,7 +2,7 @@ import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
|
2
2
|
import type { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
4
4
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
|
-
import
|
|
5
|
+
import { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
6
|
import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
import type { BrandedIdentifier } from '../../../../../environments/identifier';
|
|
8
8
|
/**
|
|
@@ -6,6 +6,7 @@ const assert_1 = require("../../../../../../util/assert");
|
|
|
6
6
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
7
7
|
const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
8
8
|
const data_masking_functions_1 = require("../../../../../environments/data-masking-functions");
|
|
9
|
+
const r_symbol_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
|
|
9
10
|
const model_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/model");
|
|
10
11
|
const logger_1 = require("../../../../../logger");
|
|
11
12
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
@@ -99,8 +100,11 @@ function processPipe(name, args, rootId, data, { pipePlaceholderName, assignLhs,
|
|
|
99
100
|
if (arg === r_function_call_1.EmptyArgument) {
|
|
100
101
|
continue;
|
|
101
102
|
}
|
|
103
|
+
/* only the symbols may name columns, the rest is evaluated in the caller's frame */
|
|
102
104
|
model_1.RNode.visitAst(arg, node => {
|
|
103
|
-
|
|
105
|
+
if (r_symbol_1.RSymbol.is(node)) {
|
|
106
|
+
information.graph.addEdge(rhs.info.id, node.info.id, edge_1.EdgeType.NonStandardEvaluation);
|
|
107
|
+
}
|
|
104
108
|
return false;
|
|
105
109
|
});
|
|
106
110
|
}
|
|
@@ -14,8 +14,8 @@ import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/proce
|
|
|
14
14
|
* - `with`: writes in `expr` are ephemeral (R's `with` uses a temporary scope and discards them).
|
|
15
15
|
* - `within`: writes in `expr` are persisted back into the tracked envState of `data`.
|
|
16
16
|
*
|
|
17
|
-
* Arguments are resolved
|
|
18
|
-
*
|
|
17
|
+
* Arguments are resolved with {@link RFunctionCall.matchArgsToParams}, so `with(expr=x, data=e)` and
|
|
18
|
+
* `with(dat=e, x)` are handled correctly.
|
|
19
19
|
*
|
|
20
20
|
* Falls back to a normal function-call analysis when the data argument cannot be resolved
|
|
21
21
|
* to a tracked environment.
|
|
@@ -15,7 +15,7 @@ const withParamsFallback = ['data', 'expr'];
|
|
|
15
15
|
/** Normal call analysis, marking the data-masked arguments (columns of the data) as NSE. */
|
|
16
16
|
function markAsMaskedFallback(name, args, rootId, data) {
|
|
17
17
|
const { information, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.With });
|
|
18
|
-
(0, known_call_handling_1.markArgumentsAsNonStandardEvaluation)(information.graph, rootId, processedArguments, known_call_handling_1.NseArguments.AllButFirst);
|
|
18
|
+
(0, known_call_handling_1.markArgumentsAsNonStandardEvaluation)(information.graph, rootId, processedArguments, known_call_handling_1.NseArguments.AllButFirst, known_call_handling_1.NseKind.DataMasked);
|
|
19
19
|
return information;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
@@ -28,8 +28,8 @@ function markAsMaskedFallback(name, args, rootId, data) {
|
|
|
28
28
|
* - `with`: writes in `expr` are ephemeral (R's `with` uses a temporary scope and discards them).
|
|
29
29
|
* - `within`: writes in `expr` are persisted back into the tracked envState of `data`.
|
|
30
30
|
*
|
|
31
|
-
* Arguments are resolved
|
|
32
|
-
*
|
|
31
|
+
* Arguments are resolved with {@link RFunctionCall.matchArgsToParams}, so `with(expr=x, data=e)` and
|
|
32
|
+
* `with(dat=e, x)` are handled correctly.
|
|
33
33
|
*
|
|
34
34
|
* Falls back to a normal function-call analysis when the data argument cannot be resolved
|
|
35
35
|
* to a tracked environment.
|
|
@@ -40,13 +40,12 @@ function processWithEnv(name, args, rootId, data) {
|
|
|
40
40
|
}
|
|
41
41
|
// prefer R's real `base::with` signature from the database, falling back to the known formals when it is absent
|
|
42
42
|
// use the call's own name (`with` or `within`) qualified to base, so each gets its real signature
|
|
43
|
-
const bound =
|
|
43
|
+
const bound = r_function_call_1.RFunctionCall.matchArgsToParams(args, (0, built_in_envir_utils_1.signatureParamNames)(data, identifier_1.Identifier.make(identifier_1.Identifier.getName(name.content), "base" /* PkgName.Base */), withParamsFallback));
|
|
44
44
|
const dataArg = bound.get('data');
|
|
45
45
|
const exprArg = bound.get('expr');
|
|
46
46
|
// when we cannot resolve the data to a tracked environment, `expr` is still data-masked: its symbols name
|
|
47
47
|
// columns of `data`, not variables in scope, so mark the non-data arguments as non-standard-evaluated
|
|
48
|
-
if (dataArg ===
|
|
49
|
-
exprArg === r_function_call_1.EmptyArgument || exprArg?.value === undefined) {
|
|
48
|
+
if (dataArg?.value === undefined || exprArg?.value === undefined) {
|
|
50
49
|
return markAsMaskedFallback(name, args, rootId, data);
|
|
51
50
|
}
|
|
52
51
|
const envirResolution = (0, built_in_envir_utils_1.resolveArgToEnvir)(dataArg, data);
|
|
@@ -136,24 +136,37 @@ function attachedPackages(_id, fdef) {
|
|
|
136
136
|
}
|
|
137
137
|
return packages;
|
|
138
138
|
}
|
|
139
|
-
/** The
|
|
140
|
-
function
|
|
141
|
-
const defs = [];
|
|
142
|
-
// skip the function's own frame; outer-scope definitions escaped
|
|
139
|
+
/** The scopes outside a function's own frame, i.e. those a definition of its body can have escaped into. */
|
|
140
|
+
function* escapeTargetFrames(fdef) {
|
|
143
141
|
for (let e = fdef.subflow.environment.current.parent; e !== undefined && !e.builtInEnv; e = e.parent) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
142
|
+
yield e;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* The non-built-in definitions a function body lets escape to an outer scope (e.g. a `<<-` super-assignment),
|
|
147
|
+
* as a callback for {@link computeCallGraphSummaries}. Nested definitions share their outer frames, and a frame is
|
|
148
|
+
* dominated by the built-ins it holds, so filtering each frame once per pass saves the bulk of the work.
|
|
149
|
+
*/
|
|
150
|
+
function escapedDefinitions() {
|
|
151
|
+
const perFrame = new Map();
|
|
152
|
+
return (_id, fdef) => {
|
|
153
|
+
const defs = [];
|
|
154
|
+
for (const e of escapeTargetFrames(fdef)) {
|
|
155
|
+
let escaped = perFrame.get(e.memory);
|
|
156
|
+
if (escaped === undefined) {
|
|
157
|
+
escaped = [...e.memory.values()].flatMap(ds => ds.filter(d => !node_id_1.NodeId.isBuiltIn(d.nodeId)).map(d => d.nodeId));
|
|
158
|
+
perFrame.set(e.memory, escaped);
|
|
159
|
+
}
|
|
160
|
+
for (const d of escaped) {
|
|
161
|
+
defs.push(d);
|
|
149
162
|
}
|
|
150
163
|
}
|
|
151
|
-
|
|
152
|
-
|
|
164
|
+
return defs;
|
|
165
|
+
};
|
|
153
166
|
}
|
|
154
167
|
/** Emits {@link EdgeType.SideEffectOnCall} edges for definitions that escape a function transitively. */
|
|
155
168
|
function propagateTransitiveDefinitions(graph, environment, ctx) {
|
|
156
|
-
const summary = computeCallGraphSummaries(graph, escapedDefinitions);
|
|
169
|
+
const summary = computeCallGraphSummaries(graph, escapedDefinitions());
|
|
157
170
|
for (const [id, vertex] of graph.vertices(true)) {
|
|
158
171
|
if (vertex.tag !== vertex_1.VertexType.FunctionCall) {
|
|
159
172
|
continue;
|
|
@@ -206,11 +219,16 @@ function propagateTransitivePackages(graph, environment, ctx) {
|
|
|
206
219
|
/** Maps each escaped definition's node id to its full (name-carrying) definition. */
|
|
207
220
|
function escapedDefinitionMap(graph) {
|
|
208
221
|
const map = new Map();
|
|
222
|
+
const seen = new Set();
|
|
209
223
|
for (const [, vertex] of graph.vertices(true)) {
|
|
210
224
|
if (vertex.tag !== vertex_1.VertexType.FunctionDefinition) {
|
|
211
225
|
continue;
|
|
212
226
|
}
|
|
213
|
-
for (
|
|
227
|
+
for (const e of escapeTargetFrames(vertex)) {
|
|
228
|
+
if (seen.has(e.memory)) {
|
|
229
|
+
continue; // a frame shared with an already-visited definition contributes the same entries
|
|
230
|
+
}
|
|
231
|
+
seen.add(e.memory);
|
|
214
232
|
for (const definitions of e.memory.values()) {
|
|
215
233
|
for (const def of definitions) {
|
|
216
234
|
if (!node_id_1.NodeId.isBuiltIn(def.nodeId) && def.name !== undefined) {
|
|
@@ -228,7 +246,7 @@ function escapedDefinitionMap(graph) {
|
|
|
228
246
|
* @returns the enriched environment and whether it grew (so the extractor can re-resolve open reads and re-run).
|
|
229
247
|
*/
|
|
230
248
|
function propagateTransitiveEscapedDefinitions(graph, environment) {
|
|
231
|
-
const summary = computeCallGraphSummaries(graph, escapedDefinitions);
|
|
249
|
+
const summary = computeCallGraphSummaries(graph, escapedDefinitions());
|
|
232
250
|
const defs = escapedDefinitionMap(graph);
|
|
233
251
|
const names = new Set();
|
|
234
252
|
let grew = false;
|
|
@@ -58,11 +58,23 @@ export declare enum NseArguments {
|
|
|
58
58
|
First = "first"
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* Besides the {@link NseArguments} shorthands, the positions may be listed explicitly.
|
|
61
|
+
* How an argument escapes standard evaluation, which decides what is marked
|
|
62
|
+
* {@link EdgeType.NonStandardEvaluation}.
|
|
64
63
|
*/
|
|
65
|
-
export declare
|
|
64
|
+
export declare enum NseKind {
|
|
65
|
+
/** the argument is not evaluated at all (`quote(x + y)`), so nothing within it is */
|
|
66
|
+
Quoted = "quoted",
|
|
67
|
+
/** the argument is evaluated in a data mask (`subset(d, a > k)`), where only its symbols may name columns */
|
|
68
|
+
DataMasked = "data-masked"
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Marks the selected arguments as {@link EdgeType.NonStandardEvaluation}, so they are recognised as not being
|
|
72
|
+
* evaluated the standard way. A {@link NseKind.Quoted|quoted} argument is marked entirely, as none of it is
|
|
73
|
+
* evaluated. A {@link NseKind.DataMasked|data-masked} one is evaluated in the caller's frame, with only the
|
|
74
|
+
* names the mask supplies (those that resolve to nothing else) taken from the data, so only those are marked.
|
|
75
|
+
* Besides the {@link NseArguments} shorthands, the positions may be listed explicitly, `undefined` marks nothing.
|
|
76
|
+
*/
|
|
77
|
+
export declare function markArgumentsAsNonStandardEvaluation(graph: DataflowGraph, rootId: NodeId, processedArguments: readonly (DataflowInformation | undefined)[], which: NseArguments | readonly number[] | undefined, kind?: NseKind): void;
|
|
66
78
|
/**
|
|
67
79
|
* Marks the given arguments as being involved in R's non-standard evaluation.
|
|
68
80
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NseArguments = void 0;
|
|
3
|
+
exports.NseKind = exports.NseArguments = void 0;
|
|
4
4
|
exports.markArgumentsAsNonStandardEvaluation = markArgumentsAsNonStandardEvaluation;
|
|
5
5
|
exports.markNonStandardEvaluationEdges = markNonStandardEvaluationEdges;
|
|
6
6
|
exports.processKnownFunctionCall = processKnownFunctionCall;
|
|
@@ -27,20 +27,41 @@ var NseArguments;
|
|
|
27
27
|
NseArguments["First"] = "first";
|
|
28
28
|
})(NseArguments || (exports.NseArguments = NseArguments = {}));
|
|
29
29
|
/**
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* Besides the {@link NseArguments} shorthands, the positions may be listed explicitly.
|
|
30
|
+
* How an argument escapes standard evaluation, which decides what is marked
|
|
31
|
+
* {@link EdgeType.NonStandardEvaluation}.
|
|
33
32
|
*/
|
|
34
|
-
|
|
33
|
+
var NseKind;
|
|
34
|
+
(function (NseKind) {
|
|
35
|
+
/** the argument is not evaluated at all (`quote(x + y)`), so nothing within it is */
|
|
36
|
+
NseKind["Quoted"] = "quoted";
|
|
37
|
+
/** the argument is evaluated in a data mask (`subset(d, a > k)`), where only its symbols may name columns */
|
|
38
|
+
NseKind["DataMasked"] = "data-masked";
|
|
39
|
+
})(NseKind || (exports.NseKind = NseKind = {}));
|
|
40
|
+
/**
|
|
41
|
+
* Marks the selected arguments as {@link EdgeType.NonStandardEvaluation}, so they are recognised as not being
|
|
42
|
+
* evaluated the standard way. A {@link NseKind.Quoted|quoted} argument is marked entirely, as none of it is
|
|
43
|
+
* evaluated. A {@link NseKind.DataMasked|data-masked} one is evaluated in the caller's frame, with only the
|
|
44
|
+
* names the mask supplies (those that resolve to nothing else) taken from the data, so only those are marked.
|
|
45
|
+
* Besides the {@link NseArguments} shorthands, the positions may be listed explicitly, `undefined` marks nothing.
|
|
46
|
+
*/
|
|
47
|
+
function markArgumentsAsNonStandardEvaluation(graph, rootId, processedArguments, which, kind = NseKind.Quoted) {
|
|
48
|
+
if (which === undefined) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
35
51
|
const end = which === NseArguments.First ? 1 : processedArguments.length;
|
|
36
52
|
for (let i = which === NseArguments.AllButFirst ? 1 : 0; i < end; i++) {
|
|
37
53
|
const arg = processedArguments[i];
|
|
38
54
|
if (arg === undefined || (typeof which !== 'string' && !which.includes(i))) {
|
|
39
55
|
continue;
|
|
40
56
|
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
if (kind === NseKind.Quoted) {
|
|
58
|
+
graph.addEdge(rootId, arg.entryPoint, edge_1.EdgeType.NonStandardEvaluation);
|
|
59
|
+
}
|
|
60
|
+
for (const [vtx, info] of arg.graph.vertices(true)) {
|
|
61
|
+
/* a masked name the caller does not bind is the one the data supplies */
|
|
62
|
+
if (kind === NseKind.Quoted || (vertex_1.UseVertex.is(info) && !arg.graph.outgoingEdges(vtx)?.values().some(e => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Reads)))) {
|
|
63
|
+
graph.addEdge(rootId, vtx, edge_1.EdgeType.NonStandardEvaluation);
|
|
64
|
+
}
|
|
44
65
|
}
|
|
45
66
|
}
|
|
46
67
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** Whether a CRAN signature database is installed, i.e. more than the `base` shard every checkout ships. */
|
|
2
|
+
export declare function cranDatabaseAvailable(): boolean;
|
|
3
|
+
/** The warning shown when a page that documents the signature database is generated without one. */
|
|
4
|
+
export declare function missingSigDbWarning(target: string): string;
|
|
5
|
+
/**
|
|
6
|
+
* Warns that `target` documents the signature database while none is installed, so whatever it would write
|
|
7
|
+
* shows base R alone. Returns whether the database is missing, so a caller can skip the page instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare function warnMissingSigDb(target: string): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cranDatabaseAvailable = cranDatabaseAvailable;
|
|
4
|
+
exports.missingSigDbWarning = missingSigDbWarning;
|
|
5
|
+
exports.warnMissingSigDb = warnMissingSigDb;
|
|
6
|
+
const manifest_1 = require("../../project/sigdb/manifest");
|
|
7
|
+
const ansi_1 = require("../../util/text/ansi");
|
|
8
|
+
/** Whether a CRAN signature database is installed, i.e. more than the `base` shard every checkout ships. */
|
|
9
|
+
function cranDatabaseAvailable() {
|
|
10
|
+
return (0, manifest_1.defaultSigDbPath)('current') !== undefined || (0, manifest_1.defaultSigDbPath)('full') !== undefined;
|
|
11
|
+
}
|
|
12
|
+
/** The warning shown when a page that documents the signature database is generated without one. */
|
|
13
|
+
function missingSigDbWarning(target) {
|
|
14
|
+
const warn = (s) => ansi_1.ansiFormatter.format(s, { color: 3 /* Colors.Yellow */, effect: ansi_1.ColorEffect.Foreground });
|
|
15
|
+
return warn(`
|
|
16
|
+
${(0, ansi_1.bold)('!! no signature database installed !!', ansi_1.ansiFormatter)}
|
|
17
|
+
[${target}] documents the signature database, but only the bundled base shard is present.
|
|
18
|
+
Generating it now would replace the committed page with base-R-only numbers and examples.
|
|
19
|
+
Run ${(0, ansi_1.bold)('npm run sync:sigdb', ansi_1.ansiFormatter)} first (see wiki/Signature Database), or leave the page as it is.`);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Warns that `target` documents the signature database while none is installed, so whatever it would write
|
|
23
|
+
* shows base R alone. Returns whether the database is missing, so a caller can skip the page instead.
|
|
24
|
+
*/
|
|
25
|
+
function warnMissingSigDb(target) {
|
|
26
|
+
if (cranDatabaseAvailable()) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
console.warn(missingSigDbWarning(target));
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=doc-sigdb.js.map
|
|
@@ -301,8 +301,19 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
|
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
303
|
},
|
|
304
|
-
|
|
305
|
-
|
|
304
|
+
incremental: {
|
|
305
|
+
alwaysIncremental: false,
|
|
306
|
+
parsing: {
|
|
307
|
+
activated: false,
|
|
308
|
+
heuristics: {
|
|
309
|
+
activated: true,
|
|
310
|
+
mtime: true,
|
|
311
|
+
linesFrom: 500,
|
|
312
|
+
bytesFrom: 50_000,
|
|
313
|
+
alwaysWithEdits: false,
|
|
314
|
+
minFiles: 1,
|
|
315
|
+
},
|
|
316
|
+
},
|
|
306
317
|
},
|
|
307
318
|
gas: {
|
|
308
319
|
thresholds: {
|
|
@@ -44,6 +44,7 @@ const absint_query_executor_1 = require("../queries/catalog/absint-query/absint-
|
|
|
44
44
|
const dice_query_executor_1 = require("../queries/catalog/dice-query/dice-query-executor");
|
|
45
45
|
const dataflow_lens_query_executor_1 = require("../queries/catalog/dataflow-lens-query/dataflow-lens-query-executor");
|
|
46
46
|
const signature_query_executor_1 = require("../queries/catalog/signature-query/signature-query-executor");
|
|
47
|
+
const doc_sigdb_1 = require("./doc-util/doc-sigdb");
|
|
47
48
|
const guess_dep_versions_query_executor_1 = require("../queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor");
|
|
48
49
|
(0, doc_query_1.registerQueryDocumentation)('call-context', {
|
|
49
50
|
type: 'active',
|
|
@@ -1046,6 +1047,8 @@ class WikiQuery extends doc_maker_1.DocMaker {
|
|
|
1046
1047
|
}
|
|
1047
1048
|
async text({ ctx, shell }) {
|
|
1048
1049
|
(0, doc_query_1.assertAllQueriesDocumented)();
|
|
1050
|
+
/* the signature query documented here answers from the database, so its examples need one */
|
|
1051
|
+
(0, doc_sigdb_1.warnMissingSigDb)(this.getTarget());
|
|
1049
1052
|
for (const [file, content] of Object.entries({
|
|
1050
1053
|
...await (0, doc_query_1.queryPages)(shell, ctx, 'active'),
|
|
1051
1054
|
...await (0, doc_query_1.queryPages)(shell, ctx, 'virtual')
|
|
@@ -18,9 +18,7 @@ const config_1 = require("../config");
|
|
|
18
18
|
const flowr_analyzer_package_versions_sigdb_plugin_1 = require("../project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin");
|
|
19
19
|
const flowr_analyzer_builder_1 = require("../project/flowr-analyzer-builder");
|
|
20
20
|
const flowr_analyzer_dependencies_context_1 = require("../project/context/flowr-analyzer-dependencies-context");
|
|
21
|
-
|
|
22
|
-
return (0, manifest_1.defaultSigDbPath)('current') !== undefined || (0, manifest_1.defaultSigDbPath)('full') !== undefined;
|
|
23
|
-
}
|
|
21
|
+
const doc_sigdb_1 = require("./doc-util/doc-sigdb");
|
|
24
22
|
/** point the resolver at your own database (a file path or manifest) */
|
|
25
23
|
function usePackageDatabase(parser) {
|
|
26
24
|
const sigdb = new flowr_analyzer_package_versions_sigdb_plugin_1.FlowrAnalyzerPackageVersionsSigDbPlugin('/path/to/sigs.manifest.json.br');
|
|
@@ -201,8 +199,7 @@ class WikiSignatureDatabase extends doc_maker_1.DocMaker {
|
|
|
201
199
|
* leaves the committed page untouched, so the workflow reports no change and publishes nothing.
|
|
202
200
|
*/
|
|
203
201
|
async make(args) {
|
|
204
|
-
if (
|
|
205
|
-
console.log(` [${this.getTarget()}] skipped: no CRAN sigdb present (not downloaded); keeping the committed page`);
|
|
202
|
+
if ((0, doc_sigdb_1.warnMissingSigDb)(this.getTarget())) {
|
|
206
203
|
return false;
|
|
207
204
|
}
|
|
208
205
|
return super.make(args);
|
package/gas.d.ts
CHANGED
|
@@ -25,6 +25,12 @@ export declare const GasFeatureKey: {
|
|
|
25
25
|
readonly SideEffectLinking: "side-effect-linking";
|
|
26
26
|
/** Gas key for the linter, checked once per linting rule. Under critical pressure, remaining rules are skipped. */
|
|
27
27
|
readonly Linter: "linter";
|
|
28
|
+
/**
|
|
29
|
+
* Gas key for the static slicer, checked while traversing the dataflow graph. Under critical pressure the
|
|
30
|
+
* traversal stops and the slice is returned as far as it got (`SliceResult.stoppedEarly`), which is the only
|
|
31
|
+
* way to bound the otherwise synchronous traversal from the outside.
|
|
32
|
+
*/
|
|
33
|
+
readonly Slicer: "slicer";
|
|
28
34
|
};
|
|
29
35
|
export type GasFeatureKey = typeof GasFeatureKey[keyof typeof GasFeatureKey];
|
|
30
36
|
/** Paired low/high thresholds used inside {@link FlowrGasThresholds}. */
|
package/gas.js
CHANGED
|
@@ -13,6 +13,12 @@ exports.GasFeatureKey = {
|
|
|
13
13
|
/** Gas key for the side-effect link resolution phase of the dataflow extractor, which matches unknown side effects against call sites via the CFG and can be expensive for large scripts. */
|
|
14
14
|
SideEffectLinking: 'side-effect-linking',
|
|
15
15
|
/** Gas key for the linter, checked once per linting rule. Under critical pressure, remaining rules are skipped. */
|
|
16
|
-
Linter: 'linter'
|
|
16
|
+
Linter: 'linter',
|
|
17
|
+
/**
|
|
18
|
+
* Gas key for the static slicer, checked while traversing the dataflow graph. Under critical pressure the
|
|
19
|
+
* traversal stops and the slice is returned as far as it got (`SliceResult.stoppedEarly`), which is the only
|
|
20
|
+
* way to bound the otherwise synchronous traversal from the outside.
|
|
21
|
+
*/
|
|
22
|
+
Slicer: 'slicer'
|
|
17
23
|
};
|
|
18
24
|
//# sourceMappingURL=gas.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eagleoutice/flowr",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.10",
|
|
4
4
|
"description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
|
|
5
5
|
"types": "dist/src/index.d.ts",
|
|
6
6
|
"repository": {
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
"eslint-plugin-jsdoc": "^62.9.0",
|
|
209
209
|
"eslint-plugin-tsdoc": "^0.5.2",
|
|
210
210
|
"eslint-plugin-unused-imports": "^4.4.1",
|
|
211
|
-
"license-checker-rseidelsohn": "^
|
|
211
|
+
"license-checker-rseidelsohn": "^4.4.2",
|
|
212
212
|
"release-it": "^20.0.0",
|
|
213
213
|
"ts-node": "^10.9.2",
|
|
214
214
|
"typedoc": "^0.28.17",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PackageSignatureSource } from './sigdb/reader';
|
|
2
|
+
/**
|
|
3
|
+
* Packages that attach further packages from their `.onAttach` hook, which no package metadata records: their core
|
|
4
|
+
* set sits in `Imports`, indistinguishable from the packages they merely use. Whoever loads one of them gets the
|
|
5
|
+
* whole set on the search path, so `library(tidyverse)` has to resolve `ggplot()`.
|
|
6
|
+
* `Depends` is handled generally by {@link attachedAlongside} and hence not repeated here.
|
|
7
|
+
*/
|
|
8
|
+
export declare const MetaPackageCores: ReadonlyMap<string, readonly string[]>;
|
|
9
|
+
/**
|
|
10
|
+
* The packages that end up on the search path alongside `pack` when it is attached: everything it `Depends` on
|
|
11
|
+
* (which R attaches with it) and, for a {@link MetaPackageCores|meta-package}, the core set it attaches itself.
|
|
12
|
+
*/
|
|
13
|
+
export declare function attachedAlongside(pack: string, sources: readonly PackageSignatureSource[], version?: string): readonly string[];
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MetaPackageCores = void 0;
|
|
4
|
+
exports.attachedAlongside = attachedAlongside;
|
|
5
|
+
/**
|
|
6
|
+
* Packages that attach further packages from their `.onAttach` hook, which no package metadata records: their core
|
|
7
|
+
* set sits in `Imports`, indistinguishable from the packages they merely use. Whoever loads one of them gets the
|
|
8
|
+
* whole set on the search path, so `library(tidyverse)` has to resolve `ggplot()`.
|
|
9
|
+
* `Depends` is handled generally by {@link attachedAlongside} and hence not repeated here.
|
|
10
|
+
*/
|
|
11
|
+
exports.MetaPackageCores = new Map([
|
|
12
|
+
['tidyverse', ['ggplot2', 'tibble', 'tidyr', 'readr', 'purrr', 'dplyr', 'stringr', 'forcats', 'lubridate']],
|
|
13
|
+
['tidymodels', ['broom', 'dials', 'dplyr', 'ggplot2', 'infer', 'modeldata', 'parsnip', 'purrr', 'recipes',
|
|
14
|
+
'rsample', 'tailor', 'tibble', 'tidyr', 'tune', 'workflows', 'workflowsets', 'yardstick']],
|
|
15
|
+
['easystats', ['bayestestR', 'correlation', 'datawizard', 'effectsize', 'insight', 'modelbased', 'parameters',
|
|
16
|
+
'performance', 'report', 'see']],
|
|
17
|
+
['fpp3', ['tibble', 'dplyr', 'tidyr', 'lubridate', 'ggplot2', 'tsibble', 'tsibbledata', 'ggtime', 'feasts', 'fable']]
|
|
18
|
+
]);
|
|
19
|
+
/**
|
|
20
|
+
* The packages that end up on the search path alongside `pack` when it is attached: everything it `Depends` on
|
|
21
|
+
* (which R attaches with it) and, for a {@link MetaPackageCores|meta-package}, the core set it attaches itself.
|
|
22
|
+
*/
|
|
23
|
+
function attachedAlongside(pack, sources, version) {
|
|
24
|
+
const depends = sources
|
|
25
|
+
.flatMap(src => src.dependencies(pack, version) ?? [])
|
|
26
|
+
.filter(d => d.type === 0 /* DepType.Depends */ && d.name !== 'R')
|
|
27
|
+
.map(d => d.name);
|
|
28
|
+
return [...new Set([...depends, ...exports.MetaPackageCores.get(pack) ?? []])];
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=attached-packages.js.map
|