@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.
Files changed (225) hide show
  1. package/README.md +31 -37
  2. package/abstract-interpretation/absint-visitor.js +1 -1
  3. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  4. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -4
  5. package/abstract-interpretation/data-frame/mappers/function-mapper.js +18 -17
  6. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +6 -6
  7. package/abstract-interpretation/data-frame/resolve-args.d.ts +9 -4
  8. package/abstract-interpretation/data-frame/resolve-args.js +10 -5
  9. package/abstract-interpretation/unsupported-functions.d.ts +1 -0
  10. package/abstract-interpretation/unsupported-functions.js +1 -0
  11. package/benchmark/calibration.d.ts +12 -5
  12. package/benchmark/calibration.js +42 -14
  13. package/benchmark/slicer.d.ts +1 -1
  14. package/benchmark/slicer.js +5 -4
  15. package/benchmark/stats/size-of.js +1 -1
  16. package/benchmark/summarizer/first-phase/process.d.ts +2 -0
  17. package/benchmark/summarizer/first-phase/process.js +2 -0
  18. package/cli/common/options.d.ts +0 -31
  19. package/cli/common/options.js +1 -8
  20. package/cli/common/scripts-info.d.ts +0 -38
  21. package/cli/common/scripts-info.js +0 -8
  22. package/cli/repl/commands/repl-query.js +37 -2
  23. package/cli/repl/core.js +6 -3
  24. package/cli/repl/parser/slice-query-parser.js +1 -1
  25. package/cli/repl/print-version.js +2 -2
  26. package/config.d.ts +16 -0
  27. package/config.js +79 -0
  28. package/control-flow/control-flow-graph.d.ts +2 -0
  29. package/control-flow/control-flow-graph.js +2 -0
  30. package/control-flow/extract-cfg.js +1 -1
  31. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  32. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  33. package/control-flow/useless-loop.js +1 -1
  34. package/core/print/slice-diff-ansi.js +1 -1
  35. package/core/steps/pipeline/create-pipeline.js +1 -1
  36. package/dataflow/cluster.js +2 -2
  37. package/dataflow/environments/built-in-props.d.ts +8 -1
  38. package/dataflow/environments/built-in-props.js +18 -0
  39. package/dataflow/environments/built-in.d.ts +7 -1
  40. package/dataflow/environments/built-in.js +42 -3
  41. package/dataflow/environments/default-builtin-config.d.ts +442 -10
  42. package/dataflow/environments/default-builtin-config.js +188 -18
  43. package/dataflow/environments/environment.d.ts +1 -1
  44. package/dataflow/environments/identifier.d.ts +7 -2
  45. package/dataflow/environments/identifier.js +6 -1
  46. package/dataflow/environments/query-fn-props.js +2 -2
  47. package/dataflow/environments/reference-to-maybe.js +5 -5
  48. package/dataflow/environments/resolve-by-name.d.ts +3 -0
  49. package/dataflow/environments/resolve-by-name.js +30 -5
  50. package/dataflow/environments/resolve-helper.d.ts +6 -0
  51. package/dataflow/environments/resolve-helper.js +6 -0
  52. package/dataflow/eval/resolve/alias-tracking.d.ts +5 -0
  53. package/dataflow/eval/resolve/alias-tracking.js +21 -14
  54. package/dataflow/eval/resolve/node-value.d.ts +6 -0
  55. package/dataflow/eval/resolve/node-value.js +15 -9
  56. package/dataflow/eval/resolve/resolve-argument.js +2 -2
  57. package/dataflow/eval/resolve/resolve-numbers.js +2 -2
  58. package/dataflow/eval/resolve/resolve-operators.js +4 -3
  59. package/dataflow/eval/resolve/resolve-strings.js +3 -3
  60. package/dataflow/eval/resolve/resolve-working-directory.js +2 -1
  61. package/dataflow/eval/resolve/resolve.d.ts +5 -5
  62. package/dataflow/eval/resolve/resolve.js +10 -11
  63. package/dataflow/eval/values/general.d.ts +4 -1
  64. package/dataflow/eval/values/general.js +4 -1
  65. package/dataflow/extractor.js +2 -1
  66. package/dataflow/fn/exceptions-of-function.js +5 -4
  67. package/dataflow/fn/higher-order-function.d.ts +1 -1
  68. package/dataflow/fn/higher-order-function.js +22 -2
  69. package/dataflow/graph/call-graph.d.ts +1 -1
  70. package/dataflow/graph/call-graph.js +15 -15
  71. package/dataflow/graph/df-helper.d.ts +17 -2
  72. package/dataflow/graph/df-helper.js +11 -5
  73. package/dataflow/graph/diff-dataflow-graph.js +6 -6
  74. package/dataflow/graph/edge.d.ts +27 -0
  75. package/dataflow/graph/edge.js +33 -0
  76. package/dataflow/graph/graph-helper.d.ts +4 -4
  77. package/dataflow/graph/graph-helper.js +5 -5
  78. package/dataflow/graph/graph.d.ts +11 -1
  79. package/dataflow/graph/graph.js +16 -5
  80. package/dataflow/graph/vertex.d.ts +47 -6
  81. package/dataflow/graph/vertex.js +47 -6
  82. package/dataflow/internal/linker.d.ts +1 -0
  83. package/dataflow/internal/linker.js +11 -9
  84. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
  85. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
  86. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -5
  87. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +2 -2
  88. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -7
  89. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -6
  90. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -0
  91. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +19 -18
  92. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -1
  93. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  94. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +2 -2
  95. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
  96. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -5
  97. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
  98. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -3
  99. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  100. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
  101. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
  102. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  103. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +8 -2
  104. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +1 -1
  105. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +3 -1
  107. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +15 -12
  108. package/dataflow/internal/process/functions/call/common.d.ts +9 -1
  109. package/dataflow/internal/process/functions/call/common.js +17 -6
  110. package/dataflow/internal/process/functions/call/deferred.d.ts +7 -0
  111. package/dataflow/internal/process/functions/call/deferred.js +24 -1
  112. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -1
  113. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -3
  114. package/dataflow/internal/process/functions/call/named-call-handling.js +44 -12
  115. package/dataflow/internal/process/functions/call/nse.d.ts +34 -5
  116. package/dataflow/internal/process/functions/call/nse.js +114 -6
  117. package/dataflow/internal/process/functions/call/quoted.d.ts +6 -0
  118. package/dataflow/internal/process/functions/call/quoted.js +26 -11
  119. package/dataflow/origin/dfg-get-origin.d.ts +1 -0
  120. package/dataflow/origin/dfg-get-origin.js +9 -6
  121. package/documentation/data/faq/faqs.js +88 -88
  122. package/documentation/data/faq/recommended-configs.js +1 -1
  123. package/documentation/data/faq/wiki-faq-store.js +1 -1
  124. package/documentation/doc-capabilities.js +1 -1
  125. package/documentation/doc-readme.js +1 -1
  126. package/documentation/doc-util/doc-auto-gen.js +6 -2
  127. package/documentation/doc-util/doc-functions.js +1 -1
  128. package/documentation/wiki-cfg.js +2 -2
  129. package/documentation/wiki-create-linting-rules.js +45 -45
  130. package/documentation/wiki-dataflow-graph.js +25 -18
  131. package/documentation/wiki-linting-and-testing.js +93 -5
  132. package/documentation/wiki-mk/doc-maker.js +1 -1
  133. package/documentation/wiki-overview.js +12 -1
  134. package/documentation/wiki-signature-database.js +3 -0
  135. package/linter/linter-format.d.ts +1 -0
  136. package/linter/linter-format.js +1 -0
  137. package/linter/rules/file-path-validity.js +1 -1
  138. package/linter/rules/function-finder-util.js +1 -1
  139. package/linter/rules/naming-convention.js +1 -1
  140. package/linter/rules/no-leaked-credentials.js +2 -1
  141. package/linter/rules/stop-with-call-arg.js +4 -4
  142. package/linter/rules/undefined-symbol-util.d.ts +1 -1
  143. package/linter/rules/undefined-symbol-util.js +5 -4
  144. package/linter/rules/undefined-symbol.js +3 -3
  145. package/linter/rules/unused-definition.js +2 -1
  146. package/package.json +35 -45
  147. package/project/context/flowr-analyzer-environment-context.d.ts +23 -0
  148. package/project/context/flowr-analyzer-environment-context.js +25 -0
  149. package/project/dependency-version-space.js +1 -2
  150. package/project/flowr-analyzer.js +1 -1
  151. package/project/plugins/file-plugins/files/flowr-rda-file.js +3 -3
  152. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  153. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +3 -1
  154. package/project/sigdb/build.js +16 -16
  155. package/project/sigdb/codec.d.ts +1 -1
  156. package/project/sigdb/codec.js +13 -13
  157. package/project/sigdb/decompress.d.ts +1 -1
  158. package/project/sigdb/decompress.js +33 -33
  159. package/project/sigdb/index-format.js +2 -2
  160. package/project/sigdb/manifest.js +21 -21
  161. package/project/sigdb/memory-source.d.ts +64 -0
  162. package/project/sigdb/memory-source.js +133 -0
  163. package/project/sigdb/reader.js +13 -13
  164. package/queries/catalog/absint-query/absint-query-format.js +1 -1
  165. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  166. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
  167. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  168. package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
  169. package/queries/catalog/dependencies-query/link-devices.js +2 -2
  170. package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
  171. package/queries/catalog/does-call-query/does-call-query-format.js +2 -1
  172. package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -1
  173. package/queries/catalog/input-sources-query/simple-input-classifier.js +4 -4
  174. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -1
  175. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -1
  176. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
  177. package/queries/catalog/location-map-query/location-map-query-format.js +2 -2
  178. package/queries/catalog/origin-query/origin-query-format.js +1 -1
  179. package/queries/catalog/provenance-query/provenance-query-format.js +1 -1
  180. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
  181. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
  182. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -0
  183. package/queries/catalog/signature-query/signature-query-executor.js +3 -2
  184. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  185. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  186. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +3 -3
  187. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
  188. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
  189. package/r-bridge/retriever.d.ts +2 -1
  190. package/r-bridge/retriever.js +3 -2
  191. package/r-bridge/roxygen2/documentation-provider.d.ts +1 -0
  192. package/r-bridge/roxygen2/documentation-provider.js +1 -0
  193. package/r-bridge/roxygen2/roxygen-parse.d.ts +1 -1
  194. package/r-bridge/roxygen2/roxygen-parse.js +1 -1
  195. package/search/flowr-search-filters.d.ts +1 -1
  196. package/search/flowr-search-filters.js +2 -2
  197. package/search/search-executor/search-enrichers.js +4 -4
  198. package/search/search-executor/search-generators.js +1 -1
  199. package/slicing/criterion/parse.d.ts +1 -0
  200. package/slicing/criterion/parse.js +4 -3
  201. package/slicing/static/slice-call.d.ts +1 -1
  202. package/slicing/static/slice-call.js +2 -2
  203. package/slicing/static/static-slicer.js +4 -3
  204. package/util/assert.js +1 -1
  205. package/util/log.d.ts +4 -1
  206. package/util/log.js +15 -2
  207. package/util/logic.js +2 -2
  208. package/util/mermaid/cfg.js +1 -1
  209. package/util/mermaid/dfg.js +6 -6
  210. package/util/mermaid/mermaid.js +3 -1
  211. package/util/quads.js +19 -6
  212. package/util/r-version.d.ts +2 -0
  213. package/util/r-version.js +2 -0
  214. package/util/record.d.ts +1 -0
  215. package/util/record.js +1 -0
  216. package/util/schema.js +2 -2
  217. package/util/text/ansi.d.ts +2 -0
  218. package/util/text/ansi.js +8 -0
  219. package/util/text/name-rank.d.ts +29 -0
  220. package/util/text/name-rank.js +39 -0
  221. package/util/text/url-encoding.d.ts +15 -0
  222. package/util/text/url-encoding.js +59 -0
  223. package/util/version.js +1 -1
  224. package/cli/export-quads-app.d.ts +0 -7
  225. 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
@@ -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 node_fs_1 = __importDefault(require("node:fs"));
21
- const node_path_1 = __importDefault(require("node:path"));
22
- const node_readline_1 = __importDefault(require("node:readline"));
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 = node_readline_1.default.createInterface({ input: (0, decompress_1.sigDbStream)(file), crlfDelay: Infinity });
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 = node_fs_1.default.openSync(plainFile, 'r');
319
+ const fd = fs_1.default.openSync(plainFile, 'r');
320
320
  const head = Buffer.allocUnsafe(Math.min(65536, index.byteCount));
321
- node_fs_1.default.readSync(fd, head, 0, head.length, 0);
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
- node_fs_1.default.readSync(fd, buf, 0, dictBytes, dictStart);
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
- node_fs_1.default.readSync(this.fd, buf, 0, bytes, start);
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
- node_fs_1.default.closeSync(this.fd);
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 = node_path_1.default.dirname(manifestFile);
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 = node_fs_1.default.openSync(plain, 'r');
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
- node_fs_1.default.readSync(fd, buf, 0, bytes, start);
705
+ fs_1.default.readSync(fd, buf, 0, bytes, start);
706
706
  readDictSection(buf, strings);
707
707
  }
708
708
  finally {
709
- node_fs_1.default.closeSync(fd);
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 ? line[2] : line[1];
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 (info.tag !== vertex_1.VertexType.FunctionCall) {
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 = (0, resolve_by_name_1.resolveByNameAnyType)(info.name, info.environment);
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 (vertex?.tag !== vertex_1.VertexType.FunctionCall) {
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.indexOf(functionFlag) < 0)) {
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 = vertex?.tag === vertex_1.VertexType.FunctionCall
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 (vertex?.tag !== vertex_1.VertexType.FunctionCall) {
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]) => v.tag === vertex_1.VertexType.FunctionCall && (propsOf(id, dataflow) & built_in_props_1.CallProp.Closes) !== 0)
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[1]
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[1] };
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 (vtx.tag === vertex_1.VertexType.FunctionDefinition) {
176
+ else if (vertex_1.FunctionDefinitionVertex.is(vtx)) {
177
177
  yield vtx.id;
178
178
  }
179
- else if (vtx.tag === vertex_1.VertexType.VariableDefinition) {
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 (v.tag === vertex_1.VertexType.VariableDefinition && this.dfg.idMap?.get(v.id)?.info.role === "param-n" /* RoleInParent.ParameterName */) {
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 (vtx.tag === vertex_1.VertexType.FunctionCall) {
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 ? line[1] : line[0]
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 ? line[1] : line[0]
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 ? line[1] : line[0]
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 ? rest[1] : rest[0]
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, [...Object.keys(out.map.ids)])}}`);
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,
@@ -20,7 +20,7 @@ function originQueryLineParser(output, line, _config) {
20
20
  type: 'origin',
21
21
  criterion: criterion
22
22
  },
23
- rCode: line[1]
23
+ rCode: (0, slice_query_parser_1.queryLineCode)(line)
24
24
  };
25
25
  }
26
26
  exports.OriginQueryDefinition = {
@@ -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[1] };
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 => (0, alias_tracking_1.resolveIdToValue)(ident, { graph, full: true, idMap, resolve: analyzer.flowrConfig.solver.variables, ctx: analyzer.inspectContext() }));
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
  };
@@ -23,7 +23,7 @@ function resolveValueLineParser(output, line, _config) {
23
23
  criteria: criteria,
24
24
  }
25
25
  ],
26
- rCode: line[1]
26
+ rCode: (0, slice_query_parser_1.queryLineCode)(line)
27
27
  };
28
28
  }
29
29
  exports.ResolveValueQueryDefinition = {
@@ -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 = (0, resolve_by_name_1.resolveByName)(pkg === undefined ? name : identifier_1.Identifier.make(name, pkg), env, identifier_1.ReferenceType.Function);
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;
@@ -15,6 +15,7 @@ export interface RDelimiter extends MergeableRecord, Location {
15
15
  * Helper for working with {@link RDelimiter} AST nodes.
16
16
  */
17
17
  export declare const RDelimiter: {
18
+ readonly name: "RDelimiter";
18
19
  /**
19
20
  * Type guard for {@link RDelimiter} nodes.
20
21
  */
@@ -6,6 +6,7 @@ const type_1 = require("../../type");
6
6
  * Helper for working with {@link RDelimiter} AST nodes.
7
7
  */
8
8
  exports.RDelimiter = {
9
+ name: 'RDelimiter',
9
10
  /**
10
11
  * Type guard for {@link RDelimiter} nodes.
11
12
  */
@@ -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.substring(bi.length) : 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 && vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name) {
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 (vertex?.tag === vertex_1.VertexType.Use) {
119
+ if (vertex_1.UseVertex.is(vertex)) {
120
120
  return (0, retriever_1.removeRQuotes)(lexeme);
121
121
  }
122
122
  return lexeme;