@eagleoutice/flowr 2.13.15 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -37
- package/abstract-interpretation/absint-visitor.js +1 -1
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
- package/abstract-interpretation/data-frame/mappers/arguments.js +7 -4
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +18 -17
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +6 -6
- package/abstract-interpretation/data-frame/resolve-args.d.ts +9 -4
- package/abstract-interpretation/data-frame/resolve-args.js +10 -5
- package/abstract-interpretation/unsupported-functions.d.ts +1 -0
- package/abstract-interpretation/unsupported-functions.js +1 -0
- package/benchmark/calibration.d.ts +12 -5
- package/benchmark/calibration.js +42 -14
- package/benchmark/slicer.d.ts +1 -1
- package/benchmark/slicer.js +5 -4
- package/benchmark/stats/size-of.js +1 -1
- package/benchmark/summarizer/first-phase/process.d.ts +2 -0
- package/benchmark/summarizer/first-phase/process.js +2 -0
- package/cli/common/options.d.ts +0 -31
- package/cli/common/options.js +1 -8
- package/cli/common/scripts-info.d.ts +0 -38
- package/cli/common/scripts-info.js +0 -8
- package/cli/repl/commands/repl-query.js +37 -2
- package/cli/repl/core.js +6 -3
- package/cli/repl/parser/slice-query-parser.js +1 -1
- package/cli/repl/print-version.js +2 -2
- package/config.d.ts +16 -0
- package/config.js +79 -0
- package/control-flow/control-flow-graph.d.ts +2 -0
- package/control-flow/control-flow-graph.js +2 -0
- package/control-flow/extract-cfg.js +1 -1
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +1 -1
- package/control-flow/useless-loop.js +1 -1
- package/core/print/slice-diff-ansi.js +1 -1
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/dataflow/cluster.js +2 -2
- package/dataflow/environments/built-in-props.d.ts +8 -1
- package/dataflow/environments/built-in-props.js +18 -0
- package/dataflow/environments/built-in.d.ts +7 -1
- package/dataflow/environments/built-in.js +42 -3
- package/dataflow/environments/default-builtin-config.d.ts +442 -10
- package/dataflow/environments/default-builtin-config.js +188 -18
- package/dataflow/environments/environment.d.ts +1 -1
- package/dataflow/environments/identifier.d.ts +7 -2
- package/dataflow/environments/identifier.js +6 -1
- package/dataflow/environments/query-fn-props.js +2 -2
- package/dataflow/environments/reference-to-maybe.js +5 -5
- package/dataflow/environments/resolve-by-name.d.ts +3 -0
- package/dataflow/environments/resolve-by-name.js +30 -5
- package/dataflow/environments/resolve-helper.d.ts +6 -0
- package/dataflow/environments/resolve-helper.js +6 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +5 -0
- package/dataflow/eval/resolve/alias-tracking.js +21 -14
- package/dataflow/eval/resolve/node-value.d.ts +6 -0
- package/dataflow/eval/resolve/node-value.js +15 -9
- package/dataflow/eval/resolve/resolve-argument.js +2 -2
- package/dataflow/eval/resolve/resolve-numbers.js +2 -2
- package/dataflow/eval/resolve/resolve-operators.js +4 -3
- package/dataflow/eval/resolve/resolve-strings.js +3 -3
- package/dataflow/eval/resolve/resolve-working-directory.js +2 -1
- package/dataflow/eval/resolve/resolve.d.ts +5 -5
- package/dataflow/eval/resolve/resolve.js +10 -11
- package/dataflow/eval/values/general.d.ts +4 -1
- package/dataflow/eval/values/general.js +4 -1
- package/dataflow/extractor.js +2 -1
- package/dataflow/fn/exceptions-of-function.js +5 -4
- package/dataflow/fn/higher-order-function.d.ts +1 -1
- package/dataflow/fn/higher-order-function.js +22 -2
- package/dataflow/graph/call-graph.d.ts +1 -1
- package/dataflow/graph/call-graph.js +15 -15
- package/dataflow/graph/df-helper.d.ts +17 -2
- package/dataflow/graph/df-helper.js +11 -5
- package/dataflow/graph/diff-dataflow-graph.js +6 -6
- package/dataflow/graph/edge.d.ts +27 -0
- package/dataflow/graph/edge.js +33 -0
- package/dataflow/graph/graph-helper.d.ts +4 -4
- package/dataflow/graph/graph-helper.js +5 -5
- package/dataflow/graph/graph.d.ts +11 -1
- package/dataflow/graph/graph.js +16 -5
- package/dataflow/graph/vertex.d.ts +47 -6
- package/dataflow/graph/vertex.js +47 -6
- package/dataflow/internal/linker.d.ts +1 -0
- package/dataflow/internal/linker.js +11 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +19 -18
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -1
- 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.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
- 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-new-generic.js +3 -3
- 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 +8 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +15 -12
- package/dataflow/internal/process/functions/call/common.d.ts +9 -1
- package/dataflow/internal/process/functions/call/common.js +17 -6
- package/dataflow/internal/process/functions/call/deferred.d.ts +7 -0
- package/dataflow/internal/process/functions/call/deferred.js +24 -1
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +6 -3
- package/dataflow/internal/process/functions/call/named-call-handling.js +44 -12
- package/dataflow/internal/process/functions/call/nse.d.ts +34 -5
- package/dataflow/internal/process/functions/call/nse.js +114 -6
- package/dataflow/internal/process/functions/call/quoted.d.ts +6 -0
- package/dataflow/internal/process/functions/call/quoted.js +26 -11
- package/dataflow/origin/dfg-get-origin.d.ts +1 -0
- package/dataflow/origin/dfg-get-origin.js +9 -6
- package/documentation/data/faq/faqs.js +88 -88
- package/documentation/data/faq/recommended-configs.js +1 -1
- package/documentation/data/faq/wiki-faq-store.js +1 -1
- package/documentation/doc-capabilities.js +1 -1
- package/documentation/doc-readme.js +1 -1
- package/documentation/doc-util/doc-auto-gen.js +6 -2
- package/documentation/doc-util/doc-functions.js +1 -1
- package/documentation/wiki-cfg.js +2 -2
- package/documentation/wiki-create-linting-rules.js +45 -45
- package/documentation/wiki-dataflow-graph.js +25 -18
- package/documentation/wiki-linting-and-testing.js +93 -5
- package/documentation/wiki-mk/doc-maker.js +1 -1
- package/documentation/wiki-overview.js +12 -1
- package/documentation/wiki-signature-database.js +3 -0
- package/linter/linter-format.d.ts +1 -0
- package/linter/linter-format.js +1 -0
- package/linter/rules/file-path-validity.js +1 -1
- package/linter/rules/function-finder-util.js +1 -1
- package/linter/rules/naming-convention.js +1 -1
- package/linter/rules/no-leaked-credentials.js +2 -1
- package/linter/rules/stop-with-call-arg.js +4 -4
- package/linter/rules/undefined-symbol-util.d.ts +1 -1
- package/linter/rules/undefined-symbol-util.js +5 -4
- package/linter/rules/undefined-symbol.js +3 -3
- package/linter/rules/unused-definition.js +2 -1
- package/package.json +35 -45
- package/project/context/flowr-analyzer-environment-context.d.ts +23 -0
- package/project/context/flowr-analyzer-environment-context.js +25 -0
- package/project/dependency-version-space.js +1 -2
- package/project/flowr-analyzer.js +1 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +3 -3
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +3 -1
- package/project/sigdb/build.js +16 -16
- package/project/sigdb/codec.d.ts +1 -1
- package/project/sigdb/codec.js +13 -13
- package/project/sigdb/decompress.d.ts +1 -1
- package/project/sigdb/decompress.js +33 -33
- package/project/sigdb/index-format.js +2 -2
- package/project/sigdb/manifest.js +21 -21
- package/project/sigdb/memory-source.d.ts +64 -0
- package/project/sigdb/memory-source.js +133 -0
- package/project/sigdb/reader.js +13 -13
- package/queries/catalog/absint-query/absint-query-format.js +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
- package/queries/catalog/dependencies-query/link-devices.js +2 -2
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
- package/queries/catalog/does-call-query/does-call-query-format.js +2 -1
- package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.js +4 -4
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -1
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +2 -2
- package/queries/catalog/origin-query/origin-query-format.js +1 -1
- package/queries/catalog/provenance-query/provenance-query-format.js +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -0
- package/queries/catalog/signature-query/signature-query-executor.js +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
- package/r-bridge/retriever.d.ts +2 -1
- package/r-bridge/retriever.js +3 -2
- package/r-bridge/roxygen2/documentation-provider.d.ts +1 -0
- package/r-bridge/roxygen2/documentation-provider.js +1 -0
- package/r-bridge/roxygen2/roxygen-parse.d.ts +1 -1
- package/r-bridge/roxygen2/roxygen-parse.js +1 -1
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-filters.js +2 -2
- package/search/search-executor/search-enrichers.js +4 -4
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/parse.d.ts +1 -0
- package/slicing/criterion/parse.js +4 -3
- package/slicing/static/slice-call.d.ts +1 -1
- package/slicing/static/slice-call.js +2 -2
- package/slicing/static/static-slicer.js +4 -3
- package/util/assert.js +1 -1
- package/util/log.d.ts +4 -1
- package/util/log.js +15 -2
- package/util/logic.js +2 -2
- package/util/mermaid/cfg.js +1 -1
- package/util/mermaid/dfg.js +6 -6
- package/util/mermaid/mermaid.js +3 -1
- package/util/quads.js +19 -6
- package/util/r-version.d.ts +2 -0
- package/util/r-version.js +2 -0
- package/util/record.d.ts +1 -0
- package/util/record.js +1 -0
- package/util/schema.js +2 -2
- package/util/text/ansi.d.ts +2 -0
- package/util/text/ansi.js +8 -0
- package/util/text/name-rank.d.ts +29 -0
- package/util/text/name-rank.js +39 -0
- package/util/text/url-encoding.d.ts +15 -0
- package/util/text/url-encoding.js +59 -0
- package/util/version.js +1 -1
- package/cli/export-quads-app.d.ts +0 -7
- package/cli/export-quads-app.js +0 -44
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { PackageSignatureSource } from './reader';
|
|
2
|
+
import type { VersionRelease } from './sigdb-version';
|
|
3
|
+
import type { LibraryExports } from './schema';
|
|
4
|
+
import type { ResolvedDependency } from './decode';
|
|
5
|
+
import { RVersion } from '../../util/r-version';
|
|
6
|
+
/**
|
|
7
|
+
* One package as {@link MemorySignatureSource} carries it: the exports are what attaching it brings, the rest
|
|
8
|
+
* is what the answers below need to stay honest. Everything but the name and the exports is optional, so a
|
|
9
|
+
* caller may ship no more than it has.
|
|
10
|
+
*/
|
|
11
|
+
export interface MemoryPackage {
|
|
12
|
+
readonly version?: string;
|
|
13
|
+
readonly exported: readonly string[];
|
|
14
|
+
readonly deprecated?: readonly string[];
|
|
15
|
+
readonly s3Classes?: readonly string[];
|
|
16
|
+
readonly s4Classes?: readonly string[];
|
|
17
|
+
readonly downloads?: number;
|
|
18
|
+
readonly deps?: readonly ResolvedDependency[];
|
|
19
|
+
/** when that version was released, which is what makes it a release rather than a label */
|
|
20
|
+
readonly released?: Date;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A signature source held entirely in memory, for the places that cannot open a database file: a browser
|
|
24
|
+
* (the playground bundles its packages rather than reading them) and a test that wants to state a package's
|
|
25
|
+
* exports outright. It answers what a package brings into scope; the per-function view a real database
|
|
26
|
+
* decodes from its blobs is not part of what it can say, so those answers stay empty.
|
|
27
|
+
* @see {@link SigDatabase} - the file-backed source
|
|
28
|
+
*/
|
|
29
|
+
export declare class MemorySignatureSource implements PackageSignatureSource {
|
|
30
|
+
private readonly packages;
|
|
31
|
+
/** reverse index `class -> owning package`, built on first use (see {@link classOwner}) */
|
|
32
|
+
private classIndex;
|
|
33
|
+
constructor(packages: Readonly<Record<string, MemoryPackage>> | ReadonlyMap<string, MemoryPackage>);
|
|
34
|
+
has(pkg: string): boolean;
|
|
35
|
+
hasVersion(pkg: string, version: string): boolean;
|
|
36
|
+
isCranVersion(pkg: string, version: string): boolean;
|
|
37
|
+
lookup(pkg: string, version?: string): LibraryExports | undefined;
|
|
38
|
+
packagesExporting(name: string): readonly string[];
|
|
39
|
+
classOwner(className: string, version?: string): string | undefined;
|
|
40
|
+
/** no blobs to decode, so the rich per-function view has nothing to give */
|
|
41
|
+
functions(): undefined;
|
|
42
|
+
functionByName(): undefined;
|
|
43
|
+
transitiveCallees(): undefined;
|
|
44
|
+
dependencies(pkg: string, version?: string): ResolvedDependency[] | undefined;
|
|
45
|
+
packageNames(): string[];
|
|
46
|
+
isBaseR(pkg: string): boolean;
|
|
47
|
+
downloads(pkg: string): number;
|
|
48
|
+
/** the R releases a base package shipped with are a property of the database, which this source has none of */
|
|
49
|
+
coreVersions(): undefined;
|
|
50
|
+
releaseDate(pkg: string): Date | undefined;
|
|
51
|
+
releaseDates(pkg: string): VersionRelease[];
|
|
52
|
+
latestVersion(pkg: string): RVersion | undefined;
|
|
53
|
+
/** nothing is held open */
|
|
54
|
+
close(): void;
|
|
55
|
+
/** whether the package answers a lookup for `version`, which an unversioned one always does */
|
|
56
|
+
private answersFor;
|
|
57
|
+
private versionOf;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* A {@link MemorySignatureSource} from what a page can carry: `package -> [version, release date, ...exports]`.
|
|
61
|
+
* The version is what the exports were read from, so recording it is what keeps a consumer from being told
|
|
62
|
+
* the package is unknown when only its history is.
|
|
63
|
+
*/
|
|
64
|
+
export declare function memorySourceOfPackages(packages: Readonly<Record<string, readonly string[]>>): MemorySignatureSource;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MemorySignatureSource = void 0;
|
|
4
|
+
exports.memorySourceOfPackages = memorySourceOfPackages;
|
|
5
|
+
const r_version_1 = require("../../util/r-version");
|
|
6
|
+
const reader_1 = require("./reader");
|
|
7
|
+
const r_base_packages_1 = require("../../util/r-base-packages");
|
|
8
|
+
/** what {@link LibraryExports.version} says when the source was given no version to claim */
|
|
9
|
+
const UnknownVersion = '';
|
|
10
|
+
/**
|
|
11
|
+
* A signature source held entirely in memory, for the places that cannot open a database file: a browser
|
|
12
|
+
* (the playground bundles its packages rather than reading them) and a test that wants to state a package's
|
|
13
|
+
* exports outright. It answers what a package brings into scope; the per-function view a real database
|
|
14
|
+
* decodes from its blobs is not part of what it can say, so those answers stay empty.
|
|
15
|
+
* @see {@link SigDatabase} - the file-backed source
|
|
16
|
+
*/
|
|
17
|
+
class MemorySignatureSource {
|
|
18
|
+
packages;
|
|
19
|
+
/** reverse index `class -> owning package`, built on first use (see {@link classOwner}) */
|
|
20
|
+
classIndex;
|
|
21
|
+
constructor(packages) {
|
|
22
|
+
this.packages = packages instanceof Map ? packages : new Map(Object.entries(packages));
|
|
23
|
+
}
|
|
24
|
+
has(pkg) {
|
|
25
|
+
return this.packages.has(pkg);
|
|
26
|
+
}
|
|
27
|
+
hasVersion(pkg, version) {
|
|
28
|
+
const known = this.versionOf(pkg);
|
|
29
|
+
return known !== UnknownVersion && known === version;
|
|
30
|
+
}
|
|
31
|
+
isCranVersion(pkg, version) {
|
|
32
|
+
return this.hasVersion(pkg, version);
|
|
33
|
+
}
|
|
34
|
+
lookup(pkg, version) {
|
|
35
|
+
const found = this.packages.get(pkg);
|
|
36
|
+
/* a source given no version has one answer and gives it whatever is asked for: it cannot say no */
|
|
37
|
+
if (found === undefined || !this.answersFor(pkg, version)) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
version: this.versionOf(pkg),
|
|
42
|
+
exported: found.exported,
|
|
43
|
+
internal: [],
|
|
44
|
+
deprecated: found.deprecated ?? [],
|
|
45
|
+
s3Classes: found.s3Classes ?? [],
|
|
46
|
+
s4Classes: found.s4Classes ?? [],
|
|
47
|
+
cran: true
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
packagesExporting(name) {
|
|
51
|
+
return [...this.packages]
|
|
52
|
+
.filter(([, p]) => p.exported.includes(name))
|
|
53
|
+
.sort(([an, a], [bn, b]) => (b.downloads ?? 0) - (a.downloads ?? 0) || an.localeCompare(bn))
|
|
54
|
+
.map(([pkg]) => pkg);
|
|
55
|
+
}
|
|
56
|
+
classOwner(className, version) {
|
|
57
|
+
if (version !== undefined) {
|
|
58
|
+
return this.packageNames().find(pkg => {
|
|
59
|
+
const lib = this.lookup(pkg, version);
|
|
60
|
+
return (lib?.s3Classes.includes(className) ?? false) || (lib?.s4Classes.includes(className) ?? false);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
this.classIndex ??= (0, reader_1.classOwnerIndexFor)(this, this.packageNames());
|
|
64
|
+
return this.classIndex.get(className);
|
|
65
|
+
}
|
|
66
|
+
/** no blobs to decode, so the rich per-function view has nothing to give */
|
|
67
|
+
functions() {
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
functionByName() {
|
|
71
|
+
return undefined;
|
|
72
|
+
}
|
|
73
|
+
transitiveCallees() {
|
|
74
|
+
return undefined;
|
|
75
|
+
}
|
|
76
|
+
dependencies(pkg, version) {
|
|
77
|
+
const found = this.packages.get(pkg);
|
|
78
|
+
if (found === undefined || !this.answersFor(pkg, version)) {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
return [...found.deps ?? []];
|
|
82
|
+
}
|
|
83
|
+
packageNames() {
|
|
84
|
+
return [...this.packages.keys()];
|
|
85
|
+
}
|
|
86
|
+
isBaseR(pkg) {
|
|
87
|
+
return (0, r_base_packages_1.baseRPackages)().includes(pkg);
|
|
88
|
+
}
|
|
89
|
+
downloads(pkg) {
|
|
90
|
+
return this.packages.get(pkg)?.downloads ?? 0;
|
|
91
|
+
}
|
|
92
|
+
/** the R releases a base package shipped with are a property of the database, which this source has none of */
|
|
93
|
+
coreVersions() {
|
|
94
|
+
return undefined;
|
|
95
|
+
}
|
|
96
|
+
releaseDate(pkg) {
|
|
97
|
+
return this.packages.get(pkg)?.released;
|
|
98
|
+
}
|
|
99
|
+
releaseDates(pkg) {
|
|
100
|
+
const version = this.latestVersion(pkg);
|
|
101
|
+
const date = this.releaseDate(pkg);
|
|
102
|
+
return version === undefined || date === undefined ? [] : [{ version, date }];
|
|
103
|
+
}
|
|
104
|
+
latestVersion(pkg) {
|
|
105
|
+
const known = this.versionOf(pkg);
|
|
106
|
+
return known === UnknownVersion ? undefined : r_version_1.RVersion.parse(known);
|
|
107
|
+
}
|
|
108
|
+
/** nothing is held open */
|
|
109
|
+
close() {
|
|
110
|
+
/* nothing to release */
|
|
111
|
+
}
|
|
112
|
+
/** whether the package answers a lookup for `version`, which an unversioned one always does */
|
|
113
|
+
answersFor(pkg, version) {
|
|
114
|
+
return version === undefined || this.versionOf(pkg) === UnknownVersion || this.versionOf(pkg) === version;
|
|
115
|
+
}
|
|
116
|
+
versionOf(pkg) {
|
|
117
|
+
return this.packages.get(pkg)?.version ?? UnknownVersion;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.MemorySignatureSource = MemorySignatureSource;
|
|
121
|
+
/**
|
|
122
|
+
* A {@link MemorySignatureSource} from what a page can carry: `package -> [version, release date, ...exports]`.
|
|
123
|
+
* The version is what the exports were read from, so recording it is what keeps a consumer from being told
|
|
124
|
+
* the package is unknown when only its history is.
|
|
125
|
+
*/
|
|
126
|
+
function memorySourceOfPackages(packages) {
|
|
127
|
+
return new MemorySignatureSource(Object.fromEntries(Object.entries(packages).map(([pkg, [version = '', released = '', ...exported]]) => [pkg, {
|
|
128
|
+
exported,
|
|
129
|
+
version: version.length > 0 ? version : undefined,
|
|
130
|
+
released: released.length > 0 ? new Date(released) : undefined
|
|
131
|
+
}])));
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=memory-source.js.map
|
package/project/sigdb/reader.js
CHANGED
|
@@ -17,9 +17,9 @@ exports.verifyShardedDatabase = verifyShardedDatabase;
|
|
|
17
17
|
* whole-bundle reading, and the post-write verification gate. This is the surface the package-version plugin
|
|
18
18
|
* uses; the format/codec/writer building blocks live in the sibling `sigdb/*` modules (imported directly).
|
|
19
19
|
*/
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
20
|
+
const fs_1 = __importDefault(require("fs"));
|
|
21
|
+
const path_1 = __importDefault(require("path"));
|
|
22
|
+
const readline_1 = __importDefault(require("readline"));
|
|
23
23
|
const r_version_1 = require("../../util/r-version");
|
|
24
24
|
const schema_1 = require("./schema");
|
|
25
25
|
const sigdb_version_1 = require("./sigdb-version");
|
|
@@ -52,7 +52,7 @@ function readDictSection(buf, strings) {
|
|
|
52
52
|
}
|
|
53
53
|
/** stream-read a whole bundle into a {@link SigDb} (any size; never one string). Prefer {@link SigDatabase} for partial access. */
|
|
54
54
|
async function readSignatureDb(file) {
|
|
55
|
-
const rl =
|
|
55
|
+
const rl = readline_1.default.createInterface({ input: (0, decompress_1.sigDbStream)(file), crlfDelay: Infinity });
|
|
56
56
|
let header;
|
|
57
57
|
const strings = [];
|
|
58
58
|
const blobs = [];
|
|
@@ -316,9 +316,9 @@ class SigDatabase {
|
|
|
316
316
|
throw new Error('SigDatabase.openSync needs the plain .sigs.ndjson; use open() for .br/.zst/.gz');
|
|
317
317
|
}
|
|
318
318
|
const index = opts.index ?? (0, index_format_1.readSigDbIndex)(plainFile);
|
|
319
|
-
const fd =
|
|
319
|
+
const fd = fs_1.default.openSync(plainFile, 'r');
|
|
320
320
|
const head = Buffer.allocUnsafe(Math.min(65536, index.byteCount));
|
|
321
|
-
|
|
321
|
+
fs_1.default.readSync(fd, head, 0, head.length, 0);
|
|
322
322
|
const header = (0, decompress_1.parseHeader)(head.toString('utf8'));
|
|
323
323
|
let strings = opts.strings;
|
|
324
324
|
if (!strings) {
|
|
@@ -326,7 +326,7 @@ class SigDatabase {
|
|
|
326
326
|
const [dictStart, dictBytes] = index.dict;
|
|
327
327
|
if (dictBytes > 0) {
|
|
328
328
|
const buf = Buffer.allocUnsafe(dictBytes);
|
|
329
|
-
|
|
329
|
+
fs_1.default.readSync(fd, buf, 0, dictBytes, dictStart);
|
|
330
330
|
readDictSection(buf, strings);
|
|
331
331
|
}
|
|
332
332
|
}
|
|
@@ -427,7 +427,7 @@ class SigDatabase {
|
|
|
427
427
|
/** seek to a byte range, read + decode the package blob there (no caching) */
|
|
428
428
|
readBlobAt([start, bytes]) {
|
|
429
429
|
const buf = Buffer.allocUnsafe(bytes);
|
|
430
|
-
|
|
430
|
+
fs_1.default.readSync(this.fd, buf, 0, bytes, start);
|
|
431
431
|
const [, , tuple] = JSON.parse(buf.toString('utf8'));
|
|
432
432
|
return (0, decode_1.tupleToBlob)(tuple);
|
|
433
433
|
}
|
|
@@ -592,7 +592,7 @@ class SigDatabase {
|
|
|
592
592
|
this.blobCache.clear();
|
|
593
593
|
this.classIndex = undefined;
|
|
594
594
|
if (this.fd !== NoFile) {
|
|
595
|
-
|
|
595
|
+
fs_1.default.closeSync(this.fd);
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
}
|
|
@@ -636,7 +636,7 @@ class SigDatabaseSet {
|
|
|
636
636
|
}
|
|
637
637
|
/** read + validate a manifest and apply the include/exclude shard filter */
|
|
638
638
|
static prepManifest(manifestFile, opts) {
|
|
639
|
-
const baseDir =
|
|
639
|
+
const baseDir = path_1.default.dirname(manifestFile);
|
|
640
640
|
const full = (0, manifest_1.readManifestFile)(manifestFile);
|
|
641
641
|
if (full.format !== manifest_1.SigDbManifestMagic) {
|
|
642
642
|
throw new Error(`not a ${manifest_1.SigDbManifestMagic} (got ${String(full.format)})`);
|
|
@@ -698,15 +698,15 @@ class SigDatabaseSet {
|
|
|
698
698
|
}
|
|
699
699
|
const plain = (0, decompress_1.ensurePlainSync)((0, decompress_1.resolveSource)(this.baseDir, ref.path), { cacheDir: this.cacheDir, hash: ref.hash, indexless: true });
|
|
700
700
|
const strings = [];
|
|
701
|
-
const fd =
|
|
701
|
+
const fd = fs_1.default.openSync(plain, 'r');
|
|
702
702
|
try {
|
|
703
703
|
const [start, bytes] = ref.range;
|
|
704
704
|
const buf = Buffer.allocUnsafe(bytes);
|
|
705
|
-
|
|
705
|
+
fs_1.default.readSync(fd, buf, 0, bytes, start);
|
|
706
706
|
readDictSection(buf, strings);
|
|
707
707
|
}
|
|
708
708
|
finally {
|
|
709
|
-
|
|
709
|
+
fs_1.default.closeSync(fd);
|
|
710
710
|
}
|
|
711
711
|
this.dictCache.set(dictId, strings);
|
|
712
712
|
return strings;
|
|
@@ -50,7 +50,7 @@ function absintQueryLineParser(output, line, _config) {
|
|
|
50
50
|
output.stderr(output.formatter.format(`Invalid slicing criteria "${line[1]}"`, { color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }));
|
|
51
51
|
return { query: [] };
|
|
52
52
|
}
|
|
53
|
-
const code = criteria ?
|
|
53
|
+
const code = (0, slice_query_parser_1.queryLineCode)(line, criteria ? 2 : 1);
|
|
54
54
|
return {
|
|
55
55
|
query: {
|
|
56
56
|
type: 'absint',
|
|
@@ -132,7 +132,7 @@ function retrieveAllCallAliases(nodeId, graph) {
|
|
|
132
132
|
continue;
|
|
133
133
|
}
|
|
134
134
|
const [info, outgoing] = vertex;
|
|
135
|
-
if (
|
|
135
|
+
if (!vertex_1.FunctionCallVertex.is(info)) {
|
|
136
136
|
const wantedTypes = edge_1.EdgeType.Reads | edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall;
|
|
137
137
|
const x = outgoing.entries()
|
|
138
138
|
.filter(([, e]) => edge_1.DfEdge.includesType(e, wantedTypes))
|
|
@@ -10,12 +10,12 @@ const graph_1 = require("../../../dataflow/graph/graph");
|
|
|
10
10
|
const simple_visitor_1 = require("../../../control-flow/simple-visitor");
|
|
11
11
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
12
12
|
const edge_1 = require("../../../dataflow/graph/edge");
|
|
13
|
-
const resolve_by_name_1 = require("../../../dataflow/environments/resolve-by-name");
|
|
14
13
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
15
14
|
const assert_1 = require("../../../util/assert");
|
|
16
15
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
17
16
|
const cascade_action_1 = require("./cascade-action");
|
|
18
17
|
const cfg_kind_1 = require("../../../project/cfg-kind");
|
|
18
|
+
const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
|
|
19
19
|
var CallTargets;
|
|
20
20
|
(function (CallTargets) {
|
|
21
21
|
/** call targets a function that is not defined locally in the script (e.g., the call targets a library function) */
|
|
@@ -55,7 +55,7 @@ function satisfiesCallTargets(info, graph, callTarget) {
|
|
|
55
55
|
* for performance and scoping reasons, flowR will not identify the global linkage,
|
|
56
56
|
* including any potential built-in mapping.
|
|
57
57
|
*/
|
|
58
|
-
const reResolved =
|
|
58
|
+
const reResolved = resolve_helper_1.Resolve.byName(info.name, info.environment);
|
|
59
59
|
if (reResolved?.some(t => node_id_1.NodeId.isBuiltIn(t.definedAt))) {
|
|
60
60
|
builtIn = true;
|
|
61
61
|
}
|
|
@@ -242,7 +242,7 @@ function collectValuesFromLinks(args, data, linkedIds) {
|
|
|
242
242
|
}
|
|
243
243
|
// collect this one!
|
|
244
244
|
const vertex = data.dataflow.graph.getVertex(linkedId.id);
|
|
245
|
-
if (
|
|
245
|
+
if (!vertex_1.FunctionCallVertex.is(vertex)) {
|
|
246
246
|
continue;
|
|
247
247
|
}
|
|
248
248
|
const args = (0, resolve_argument_1.getArgumentStringValue)(data.config.solver.variables, data.dataflow.graph, vertex, info.argIdx, info.argName, info.resolveValue, data.ctx);
|
|
@@ -261,7 +261,7 @@ function collectValuesFromLinks(args, data, linkedIds) {
|
|
|
261
261
|
}
|
|
262
262
|
function getFunctionsToCheck(customFunctions, functionFlag, enabled, ignoreDefaultFunctions, defaultFunctions) {
|
|
263
263
|
// "If unset or empty, all function types are searched for."
|
|
264
|
-
if (enabled !== undefined && (enabled?.length === 0 || enabled.
|
|
264
|
+
if (enabled !== undefined && (enabled?.length === 0 || !enabled.includes(functionFlag))) {
|
|
265
265
|
return [];
|
|
266
266
|
}
|
|
267
267
|
let functions = ignoreDefaultFunctions ? [] : defaultFunctions.slice();
|
|
@@ -101,7 +101,7 @@ exports.DefaultDependencyCategories = {
|
|
|
101
101
|
continue;
|
|
102
102
|
}
|
|
103
103
|
const vertex = dataflow.graph.getVertex(statement.info.id);
|
|
104
|
-
const functionName =
|
|
104
|
+
const functionName = vertex_1.FunctionCallVertex.is(vertex)
|
|
105
105
|
? df_helper_1.Dataflow.qualify(statement.info.id, dataflow.graph, false) ?? vertex.name : undefined;
|
|
106
106
|
if (functionName === undefined) {
|
|
107
107
|
continue;
|
|
@@ -9,7 +9,7 @@ const range_1 = require("../../../util/range");
|
|
|
9
9
|
/** the {@link CallProp} bits of the call `id` makes */
|
|
10
10
|
function propsOf(id, { graph, environment }) {
|
|
11
11
|
const vertex = graph.getVertex(id);
|
|
12
|
-
if (
|
|
12
|
+
if (!vertex_1.FunctionCallVertex.is(vertex)) {
|
|
13
13
|
return 0;
|
|
14
14
|
}
|
|
15
15
|
const name = df_helper_1.Dataflow.qualify(id, graph, false) ?? vertex.name;
|
|
@@ -32,7 +32,7 @@ function linkPlotsToDevices(written, plots, dataflow, ast) {
|
|
|
32
32
|
.filter(w => w.value !== undefined && (propsOf(w.nodeId, dataflow) & built_in_props_1.CallProp.Graphics) !== 0)
|
|
33
33
|
.map(w => [w.nodeId, w.value]));
|
|
34
34
|
const closed = new Set(dataflow.graph.vertices(true)
|
|
35
|
-
.filter(([id, v]) =>
|
|
35
|
+
.filter(([id, v]) => vertex_1.FunctionCallVertex.is(v) && (propsOf(id, dataflow) & built_in_props_1.CallProp.Closes) !== 0)
|
|
36
36
|
.map(([id]) => id));
|
|
37
37
|
const plotAt = new Map(plots.map((p, index) => [p.nodeId, index]));
|
|
38
38
|
const located = [...opened.keys(), ...closed, ...plotAt.keys()]
|
|
@@ -6,6 +6,7 @@ const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-
|
|
|
6
6
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
7
7
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
8
8
|
const expand_library_internals_1 = require("../call-graph-query/expand-library-internals");
|
|
9
|
+
const graph_1 = require("../../../dataflow/graph/graph");
|
|
9
10
|
/**
|
|
10
11
|
* Execute does call queries on the given analyzer.
|
|
11
12
|
*/
|
|
@@ -97,7 +98,7 @@ function findCallersMatchingConstraints(cg, start, constraints, expandDeps) {
|
|
|
97
98
|
if (constraints(vtx, cg)) {
|
|
98
99
|
return { call: start };
|
|
99
100
|
}
|
|
100
|
-
for (const out of cg.outgoingEdges(cur) ??
|
|
101
|
+
for (const out of cg.outgoingEdges(cur) ?? graph_1.NoEdges) {
|
|
101
102
|
toVisit.push(out[0]);
|
|
102
103
|
}
|
|
103
104
|
}
|
|
@@ -10,6 +10,7 @@ const does_call_query_executor_1 = require("./does-call-query-executor");
|
|
|
10
10
|
const args_1 = require("../../../util/text/args");
|
|
11
11
|
const strings_1 = require("../../../util/text/strings");
|
|
12
12
|
const range_1 = require("../../../util/range");
|
|
13
|
+
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
13
14
|
const FormatError = 'Invalid constraint format, expected format "(left:$id/"regex")"';
|
|
14
15
|
/**
|
|
15
16
|
* Parses a constraint from a string argument.
|
|
@@ -64,7 +65,7 @@ function doesCallQueryLineParser(output, line, _config) {
|
|
|
64
65
|
calls: constraint.constraint,
|
|
65
66
|
}
|
|
66
67
|
],
|
|
67
|
-
rCode: line
|
|
68
|
+
rCode: (0, slice_query_parser_1.queryLineCode)(line)
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
71
|
exports.DoesCallQueryDefinition = {
|
|
@@ -59,7 +59,7 @@ function inputSourcesQueryLineParser(output, line, _config) {
|
|
|
59
59
|
return { query: [{
|
|
60
60
|
type: 'input-sources',
|
|
61
61
|
criterion: criterion[0],
|
|
62
|
-
}], rCode: line
|
|
62
|
+
}], rCode: (0, slice_query_parser_1.queryLineCode)(line) };
|
|
63
63
|
}
|
|
64
64
|
exports.InputSourcesDefinition = {
|
|
65
65
|
title: 'Input Sources Query',
|
|
@@ -173,10 +173,10 @@ class InputClassifier {
|
|
|
173
173
|
if (vtx === undefined) {
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
else if (
|
|
176
|
+
else if (vertex_1.FunctionDefinitionVertex.is(vtx)) {
|
|
177
177
|
yield vtx.id;
|
|
178
178
|
}
|
|
179
|
-
else if (
|
|
179
|
+
else if (vertex_1.VariableDefinitionVertex.is(vtx)) {
|
|
180
180
|
for (const source of vtx.source ?? []) {
|
|
181
181
|
yield* this.functionDefinitionsAt(source, depth + 1);
|
|
182
182
|
}
|
|
@@ -538,7 +538,7 @@ class InputClassifier {
|
|
|
538
538
|
acc.allPure = false;
|
|
539
539
|
}
|
|
540
540
|
// if this is a variable definition that is a parameter, classify as Parameter
|
|
541
|
-
if (
|
|
541
|
+
if (vertex_1.VariableDefinitionVertex.is(v) && this.dfg.idMap?.get(v.id)?.info.role === "param-n" /* RoleInParent.ParameterName */) {
|
|
542
542
|
acc.types.push(this.matchWholeLinkedObject(v.id)?.type ?? input_types_1.InputType.Parameter);
|
|
543
543
|
acc.values.push(undefined);
|
|
544
544
|
return;
|
|
@@ -657,7 +657,7 @@ function classifyInput(id, dfg, config, fullDfg, packages) {
|
|
|
657
657
|
return [];
|
|
658
658
|
}
|
|
659
659
|
const c = new InputClassifier(dfg, config, fullDfg, packages);
|
|
660
|
-
if (
|
|
660
|
+
if (vertex_1.FunctionCallVertex.is(vtx)) {
|
|
661
661
|
const ret = [];
|
|
662
662
|
const args = vtx.args;
|
|
663
663
|
for (const arg of args) {
|
|
@@ -18,7 +18,7 @@ function inspectExceptionLineParser(_output, line, _config) {
|
|
|
18
18
|
type: 'inspect-exception',
|
|
19
19
|
filter: criteria
|
|
20
20
|
},
|
|
21
|
-
rCode: criteria ?
|
|
21
|
+
rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
exports.InspectExceptionQueryDefinition = {
|
|
@@ -17,7 +17,7 @@ function inspectHoLineParser(_output, line, _config) {
|
|
|
17
17
|
type: 'inspect-higher-order',
|
|
18
18
|
filter: criteria
|
|
19
19
|
},
|
|
20
|
-
rCode: criteria ?
|
|
20
|
+
rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
exports.InspectHigherOrderQueryDefinition = {
|
|
@@ -17,7 +17,7 @@ function inspectRecLineParser(output, line, _config) {
|
|
|
17
17
|
type: 'inspect-recursion',
|
|
18
18
|
filter: criteria
|
|
19
19
|
},
|
|
20
|
-
rCode: criteria ?
|
|
20
|
+
rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
23
|
exports.InspectRecursionQueryDefinition = {
|
|
@@ -33,7 +33,7 @@ function locationMapLineParser(_output, line, _config) {
|
|
|
33
33
|
ids: criteria,
|
|
34
34
|
...(span ? { span } : {})
|
|
35
35
|
},
|
|
36
|
-
rCode: span ?
|
|
36
|
+
rCode: (0, slice_query_parser_1.queryLineCode)(rest, span ? 1 : 0)
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
exports.LocationMapQueryDefinition = {
|
|
@@ -46,7 +46,7 @@ exports.LocationMapQueryDefinition = {
|
|
|
46
46
|
for (const [id, file] of Object.entries(out.map.files)) {
|
|
47
47
|
result.push(` ╰ ${id}: \`${file}\``);
|
|
48
48
|
}
|
|
49
|
-
result.push(` ╰ Id List: {${(0, query_print_1.summarizeIdsIfTooLong)(formatter,
|
|
49
|
+
result.push(` ╰ Id List: {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, Object.keys(out.map.ids))}}`);
|
|
50
50
|
return true;
|
|
51
51
|
},
|
|
52
52
|
fromLine: locationMapLineParser,
|
|
@@ -29,7 +29,7 @@ function provenanceQueryLineParser(output, line, _config) {
|
|
|
29
29
|
type: 'provenance',
|
|
30
30
|
criterion: criterion[0],
|
|
31
31
|
restrictFdef: stopFdef
|
|
32
|
-
}], rCode: line
|
|
32
|
+
}], rCode: (0, slice_query_parser_1.queryLineCode)(line) };
|
|
33
33
|
}
|
|
34
34
|
exports.ProvenanceQueryDefinition = {
|
|
35
35
|
title: 'Provenance Query',
|
|
@@ -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 alias_tracking_1 = require("../../../dataflow/eval/resolve/alias-tracking");
|
|
7
6
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
7
|
+
const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
|
|
8
8
|
/**
|
|
9
9
|
* Naive fingerprint to filter out duplicate queries.
|
|
10
10
|
*/
|
|
@@ -26,7 +26,7 @@ async function executeResolveValueQuery({ analyzer }, queries) {
|
|
|
26
26
|
}
|
|
27
27
|
const values = query.criteria
|
|
28
28
|
.map(criteria => parse_1.SlicingCriterion.parse(criteria, idMap))
|
|
29
|
-
.flatMap(ident =>
|
|
29
|
+
.flatMap(ident => resolve_helper_1.Resolve.toValue(ident, { graph, full: true, idMap, resolve: analyzer.flowrConfig.solver.variables, ctx: analyzer.inspectContext() }));
|
|
30
30
|
results[key] = {
|
|
31
31
|
values: values
|
|
32
32
|
};
|
|
@@ -13,6 +13,8 @@ export declare function cranMirrorSourceUrl(pkg: string, version: string | undef
|
|
|
13
13
|
* is unknown.
|
|
14
14
|
*/
|
|
15
15
|
export declare function rSourceRef(version: string | undefined): string;
|
|
16
|
+
/** deep-link a base-R definition into the R sources mirror at the release series of `version` */
|
|
17
|
+
export declare function rSourceUrl(pkg: string, version: string | undefined, file: string, line?: number): string;
|
|
16
18
|
/** best-effort rdrr.io documentation link: `/r/<pkg>/<fn>` for base R, `/cran/<pkg>/man/<fn>` for CRAN */
|
|
17
19
|
export declare function rdrrDocUrl(pkg: string, fn: string, opts: {
|
|
18
20
|
base: boolean;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.cranPageUrl = cranPageUrl;
|
|
4
4
|
exports.cranMirrorSourceUrl = cranMirrorSourceUrl;
|
|
5
5
|
exports.rSourceRef = rSourceRef;
|
|
6
|
+
exports.rSourceUrl = rSourceUrl;
|
|
6
7
|
exports.rdrrDocUrl = rdrrDocUrl;
|
|
7
8
|
exports.signatureFunctionInfo = signatureFunctionInfo;
|
|
8
9
|
exports.signaturePackageInfo = signaturePackageInfo;
|
|
@@ -15,12 +16,12 @@ const schema_1 = require("../../../project/sigdb/schema");
|
|
|
15
16
|
const attached_packages_1 = require("../../../project/attached-packages");
|
|
16
17
|
const manifest_1 = require("../../../project/sigdb/manifest");
|
|
17
18
|
const query_fn_props_1 = require("../../../dataflow/environments/query-fn-props");
|
|
18
|
-
const resolve_by_name_1 = require("../../../dataflow/environments/resolve-by-name");
|
|
19
19
|
const built_in_props_1 = require("../../../dataflow/environments/built-in-props");
|
|
20
20
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
21
21
|
const r_version_1 = require("../../../util/r-version");
|
|
22
22
|
const r_base_packages_1 = require("../../../util/r-base-packages");
|
|
23
23
|
const mermaid_1 = require("../../../util/mermaid/mermaid");
|
|
24
|
+
const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
|
|
24
25
|
/** the CRAN package landing page (only meaningful for CRAN packages, not base R) */
|
|
25
26
|
function cranPageUrl(pkg) {
|
|
26
27
|
return `https://cran.r-project.org/package=${encodeURIComponent(pkg)}`;
|
|
@@ -219,7 +220,7 @@ function flowrOnlyFunctionInfo(env, pkg, name) {
|
|
|
219
220
|
if (env === undefined) {
|
|
220
221
|
return undefined;
|
|
221
222
|
}
|
|
222
|
-
const resolved =
|
|
223
|
+
const resolved = resolve_helper_1.Resolve.byNameAndType(pkg === undefined ? name : identifier_1.Identifier.make(name, pkg), env, identifier_1.ReferenceType.Function);
|
|
223
224
|
const definition = resolved?.find(d => d.type === identifier_1.ReferenceType.BuiltInFunction);
|
|
224
225
|
if (definition === undefined) {
|
|
225
226
|
return undefined;
|
|
@@ -84,7 +84,7 @@ exports.NodeId = {
|
|
|
84
84
|
*/
|
|
85
85
|
mapBuiltInProc(proc) {
|
|
86
86
|
const bi = 'builtin:';
|
|
87
|
-
return exports.NodeId.toBuiltIn(proc.startsWith(bi) ? proc.
|
|
87
|
+
return exports.NodeId.toBuiltIn(proc.startsWith(bi) ? proc.slice(bi.length) : proc);
|
|
88
88
|
},
|
|
89
89
|
/**
|
|
90
90
|
* Recovers the built-in function or operator name from a built-in id by removing the built-in prefix.
|
|
@@ -108,7 +108,7 @@ function recoverName(id, idMap) {
|
|
|
108
108
|
*/
|
|
109
109
|
function recoverContent(id, graph) {
|
|
110
110
|
const vertex = graph.getVertex(id);
|
|
111
|
-
if (vertex &&
|
|
111
|
+
if (vertex && vertex_1.FunctionCallVertex.is(vertex) && vertex.name) {
|
|
112
112
|
return identifier_1.Identifier.toString(vertex.name);
|
|
113
113
|
}
|
|
114
114
|
const node = graph.idMap?.get(id);
|
|
@@ -116,7 +116,7 @@ function recoverContent(id, graph) {
|
|
|
116
116
|
return undefined;
|
|
117
117
|
}
|
|
118
118
|
const lexeme = node.lexeme ?? node.info.fullLexeme ?? '';
|
|
119
|
-
if (
|
|
119
|
+
if (vertex_1.UseVertex.is(vertex)) {
|
|
120
120
|
return (0, retriever_1.removeRQuotes)(lexeme);
|
|
121
121
|
}
|
|
122
122
|
return lexeme;
|