@eagleoutice/flowr 2.13.3 → 2.13.5

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 (176) hide show
  1. package/README.md +32 -32
  2. package/abstract-interpretation/absint-visitor.js +2 -2
  3. package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
  4. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +1 -1
  5. package/abstract-interpretation/unsupported-functions.js +1 -1
  6. package/cli/repl/core.js +10 -2
  7. package/config.d.ts +4 -1
  8. package/config.js +10 -1
  9. package/control-flow/cfg-dead-code.js +91 -15
  10. package/control-flow/extract-cfg.js +93 -8
  11. package/control-flow/semantic-cfg-guided-visitor.js +2 -0
  12. package/dataflow/environments/built-in-config.d.ts +6 -3
  13. package/dataflow/environments/built-in-eval-name.d.ts +20 -0
  14. package/dataflow/environments/built-in-eval-name.js +25 -0
  15. package/dataflow/environments/built-in-proc-name.d.ts +4 -0
  16. package/dataflow/environments/built-in-proc-name.js +4 -0
  17. package/dataflow/environments/built-in-props.d.ts +175 -0
  18. package/dataflow/environments/built-in-props.js +207 -0
  19. package/dataflow/environments/built-in.d.ts +28 -20
  20. package/dataflow/environments/built-in.js +39 -8
  21. package/dataflow/environments/default-builtin-config.d.ts +1094 -86
  22. package/dataflow/environments/default-builtin-config.js +496 -212
  23. package/dataflow/environments/identifier.d.ts +25 -1
  24. package/dataflow/environments/identifier.js +24 -2
  25. package/dataflow/environments/query-fn-props.d.ts +102 -0
  26. package/dataflow/environments/query-fn-props.js +188 -0
  27. package/dataflow/eval/resolve/alias-tracking.d.ts +2 -0
  28. package/dataflow/eval/resolve/alias-tracking.js +12 -2
  29. package/dataflow/eval/resolve/match-arguments.d.ts +15 -0
  30. package/dataflow/eval/resolve/match-arguments.js +77 -0
  31. package/dataflow/eval/resolve/resolve-numbers.d.ts +202 -0
  32. package/dataflow/eval/resolve/resolve-numbers.js +163 -0
  33. package/dataflow/eval/resolve/resolve-operators.d.ts +60 -0
  34. package/dataflow/eval/resolve/resolve-operators.js +115 -0
  35. package/dataflow/eval/resolve/resolve-strings.d.ts +98 -0
  36. package/dataflow/eval/resolve/resolve-strings.js +116 -0
  37. package/dataflow/eval/resolve/resolve.d.ts +5 -23
  38. package/dataflow/eval/resolve/resolve.js +56 -87
  39. package/dataflow/fn/higher-order-function.js +3 -3
  40. package/dataflow/fn/recursive-function.js +1 -1
  41. package/dataflow/graph/df-helper.js +1 -1
  42. package/dataflow/graph/vertex.d.ts +32 -25
  43. package/dataflow/graph/vertex.js +40 -36
  44. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -0
  45. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -4
  46. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +14 -0
  47. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +28 -29
  48. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +41 -48
  49. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +14 -0
  50. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +45 -0
  51. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -1
  52. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +30 -0
  53. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +62 -2
  54. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +63 -16
  55. package/dataflow/internal/process/functions/call/built-in/built-in-get.js +29 -9
  56. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +5 -1
  57. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +35 -0
  58. package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +2 -2
  59. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +1 -1
  60. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -0
  61. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +46 -0
  62. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
  63. package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +3 -1
  64. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -1
  65. package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
  66. package/dataflow/internal/process/functions/call/unnamed-call-handling.js +24 -0
  67. package/dataflow/internal/process/functions/process-parameter.js +2 -1
  68. package/documentation/data/faq/faqs.js +11 -0
  69. package/documentation/doc-util/doc-types.js +1 -1
  70. package/documentation/wiki-analyzer.js +75 -0
  71. package/documentation/wiki-core.js +65 -16
  72. package/documentation/wiki-interface.js +3 -0
  73. package/linter/linter-rules.d.ts +10 -11
  74. package/linter/rules/absolute-path.js +1 -1
  75. package/linter/rules/deprecated-functions.js +5 -3
  76. package/linter/rules/function-finder-util.d.ts +2 -2
  77. package/linter/rules/function-finder-util.js +11 -4
  78. package/linter/rules/network-functions.d.ts +25 -5
  79. package/linter/rules/network-functions.js +51 -11
  80. package/linter/rules/no-leaked-credentials.js +1 -1
  81. package/linter/rules/problematic-inputs.d.ts +1 -1
  82. package/linter/rules/problematic-inputs.js +7 -1
  83. package/linter/rules/seeded-randomness.d.ts +5 -8
  84. package/linter/rules/seeded-randomness.js +17 -9
  85. package/linter/rules/undefined-symbol.js +1 -1
  86. package/linter/rules/unused-definition.js +15 -10
  87. package/linter/rules/useless-loop.js +1 -1
  88. package/package.json +3 -2
  89. package/project/cache/flowr-analyzer-cache.d.ts +4 -3
  90. package/project/cache/flowr-analyzer-cache.js +32 -13
  91. package/project/cache/flowr-cache.d.ts +39 -12
  92. package/project/cache/flowr-cache.js +5 -3
  93. package/project/context/flowr-analyzer-context.d.ts +8 -1
  94. package/project/context/flowr-analyzer-context.js +11 -1
  95. package/project/context/flowr-analyzer-dependencies-context.d.ts +4 -2
  96. package/project/context/flowr-analyzer-dependencies-context.js +15 -1
  97. package/project/context/flowr-analyzer-files-context.d.ts +8 -4
  98. package/project/context/flowr-analyzer-files-context.js +20 -1
  99. package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +33 -0
  100. package/project/context/flowr-analyzer-incremental-analysis-context.js +63 -0
  101. package/project/context/flowr-analyzer-meta-context.d.ts +3 -1
  102. package/project/context/flowr-analyzer-meta-context.js +14 -0
  103. package/project/context/flowr-file.d.ts +25 -3
  104. package/project/context/flowr-file.js +24 -2
  105. package/project/dependency-version-space.d.ts +37 -0
  106. package/project/dependency-version-space.js +118 -26
  107. package/project/flowr-analyzer.d.ts +6 -0
  108. package/project/flowr-analyzer.js +6 -2
  109. package/project/incremental/incremental-parse/edit-computation.d.ts +7 -0
  110. package/project/incremental/incremental-parse/edit-computation.js +61 -0
  111. package/project/incremental/incremental-parse/incremental-parse.d.ts +12 -0
  112. package/project/incremental/incremental-parse/incremental-parse.js +37 -0
  113. package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +1 -1
  114. package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +57 -0
  115. package/project/plugins/file-plugins/files/flowr-manifest-files.js +121 -0
  116. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -2
  117. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  118. package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +1 -1
  119. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +33 -0
  120. package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +53 -0
  121. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +1 -1
  122. package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -3
  123. package/project/plugins/package-version-plugins/flowr-analyzer-meta-manifest-file-plugin.d.ts +27 -0
  124. package/project/plugins/package-version-plugins/flowr-analyzer-meta-manifest-file-plugin.js +47 -0
  125. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +7 -0
  126. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +31 -3
  127. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +10 -4
  128. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +17 -4
  129. package/project/plugins/plugin-registry.d.ts +4 -4
  130. package/project/plugins/plugin-registry.js +7 -4
  131. package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +4 -4
  132. package/project/sigdb/reader.d.ts +7 -0
  133. package/project/sigdb/reader.js +12 -0
  134. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +1 -1
  135. package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -1
  136. package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +10 -0
  137. package/queries/catalog/dependencies-query/function-info/derived-functions.js +41 -0
  138. package/queries/catalog/dependencies-query/function-info/read-functions.js +14 -13
  139. package/queries/catalog/dependencies-query/function-info/write-functions.js +28 -36
  140. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +33 -3
  141. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +31 -0
  142. package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +9 -2
  143. package/queries/catalog/input-sources-query/input-source-functions.d.ts +9 -10
  144. package/queries/catalog/input-sources-query/input-source-functions.js +23 -394
  145. package/queries/catalog/input-sources-query/input-sources-query-executor.js +11 -6
  146. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -0
  147. package/queries/catalog/input-sources-query/input-sources-query-format.js +28 -10
  148. package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +14 -1
  149. package/queries/catalog/input-sources-query/simple-input-classifier.js +24 -0
  150. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -1
  151. package/queries/catalog/signature-query/signature-query-executor.js +79 -3
  152. package/queries/catalog/signature-query/signature-query-format.d.ts +27 -0
  153. package/queries/catalog/signature-query/signature-query-render.js +21 -3
  154. package/r-bridge/data/data.d.ts +2 -2
  155. package/r-bridge/data/data.js +2 -2
  156. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +6 -2
  157. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +21 -2
  158. package/r-bridge/parser.d.ts +11 -1
  159. package/r-bridge/parser.js +7 -4
  160. package/r-bridge/shell-executor.d.ts +1 -0
  161. package/r-bridge/shell-executor.js +1 -0
  162. package/r-bridge/shell.d.ts +1 -0
  163. package/r-bridge/shell.js +1 -0
  164. package/reconstruct/inline/source-inline-map.js +1 -1
  165. package/search/flowr-search-filters.d.ts +1 -6
  166. package/search/flowr-search-filters.js +1 -8
  167. package/search/search-executor/search-enrichers.d.ts +2 -0
  168. package/search/search-executor/search-enrichers.js +29 -12
  169. package/util/mermaid/dfg.js +1 -1
  170. package/util/version.js +1 -1
  171. package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +0 -31
  172. package/project/plugins/file-plugins/files/flowr-rproject-file.js +0 -66
  173. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +0 -22
  174. package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +0 -36
  175. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +0 -13
  176. package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +0 -32
@@ -1,66 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowrRProjectFile = exports.rProjectFileLog = void 0;
4
- const flowr_file_1 = require("../../../context/flowr-file");
5
- const package_1 = require("../../package-version-plugins/package");
6
- const smol_toml_1 = require("smol-toml");
7
- const log_1 = require("../../../../util/log");
8
- exports.rProjectFileLog = log_1.log.getSubLogger({ name: 'flowr-rproject-file' });
9
- /**
10
- * Decorates the `rproject.toml` of an [rv](https://a2-ai.github.io/rv-docs/) project and provides access to the
11
- * fields of its `[project]` table. Use the static {@link FlowrRProjectFile.from} method to create instances.
12
- */
13
- class FlowrRProjectFile extends flowr_file_1.FlowrFile {
14
- wrapped;
15
- constructor(file) {
16
- super(file.path(), file.roles);
17
- this.wrapped = file;
18
- }
19
- loadContent() {
20
- try {
21
- const toml = (0, smol_toml_1.parse)(this.wrapped.content().toString());
22
- return toml.project ?? {};
23
- }
24
- catch (e) {
25
- exports.rProjectFileLog.warn(`Could not parse ${this.wrapped.path()}: ${e.message}`);
26
- return {};
27
- }
28
- }
29
- /** rproject lifter, this does not re-create if already an rproject file */
30
- static from(file, role) {
31
- if (role) {
32
- file.assignRole(role);
33
- }
34
- return file instanceof FlowrRProjectFile ? file : new FlowrRProjectFile(file);
35
- }
36
- /** The `name` of the project; unlike a `DESCRIPTION` `Package` this is no namespace, an rv project is not a package. */
37
- projectName() {
38
- const name = this.content().name;
39
- return typeof name === 'string' ? name : undefined;
40
- }
41
- /** The `r_version` the project targets, e.g. `4.5`. */
42
- rVersion() {
43
- const version = this.content().r_version;
44
- return typeof version === 'string' ? version : undefined;
45
- }
46
- /**
47
- * The declared `dependencies`, which are either a plain name or a table carrying the name alongside its
48
- * origin (`{ name = "ggplot2", repository = "new-rspm" }`).
49
- */
50
- dependencies() {
51
- const deps = this.content().dependencies;
52
- if (!Array.isArray(deps)) {
53
- return [];
54
- }
55
- const out = [];
56
- for (const dep of deps) {
57
- const name = typeof dep === 'string' ? dep : dep?.name;
58
- if (typeof name === 'string' && name.length > 0) {
59
- out.push(new package_1.Package({ name, type: 'package' }));
60
- }
61
- }
62
- return out;
63
- }
64
- }
65
- exports.FlowrRProjectFile = FlowrRProjectFile;
66
- //# sourceMappingURL=flowr-rproject-file.js.map
@@ -1,22 +0,0 @@
1
- import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
2
- import { SemVer } from 'semver';
3
- import type { PathLike } from 'fs';
4
- import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
5
- import type { FlowrFileProvider } from '../../context/flowr-file';
6
- /**
7
- * Tags an rv project's `rproject.toml` with the {@link FileRole.Manifest} role and lifts it to a
8
- * {@link FlowrRProjectFile}, so the meta plugin reading it can look it up by role.
9
- */
10
- export declare class FlowrAnalyzerRProjectFilePlugin extends FlowrAnalyzerFilePlugin {
11
- readonly name = "flowr-analyzer-rproject-file-plugin";
12
- readonly description = "Marks the rproject.toml manifest of an rv project.";
13
- readonly version: SemVer;
14
- private readonly pathPattern;
15
- /**
16
- * Creates a new instance of the rproject file plugin.
17
- * @param pathPattern - The pattern to identify the manifest, see {@link RProjectFilePattern} for the default.
18
- */
19
- constructor(pathPattern?: RegExp);
20
- applies(file: PathLike): boolean;
21
- process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): [FlowrFileProvider, true];
22
- }
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowrAnalyzerRProjectFilePlugin = void 0;
4
- const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
5
- const semver_1 = require("semver");
6
- const flowr_file_1 = require("../../context/flowr-file");
7
- const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
8
- const flowr_rproject_file_1 = require("./files/flowr-rproject-file");
9
- /** The manifest of an rv project. */
10
- const RProjectFilePattern = /^rproject\.toml$/i;
11
- /**
12
- * Tags an rv project's `rproject.toml` with the {@link FileRole.Manifest} role and lifts it to a
13
- * {@link FlowrRProjectFile}, so the meta plugin reading it can look it up by role.
14
- */
15
- class FlowrAnalyzerRProjectFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
16
- name = 'flowr-analyzer-rproject-file-plugin';
17
- description = 'Marks the rproject.toml manifest of an rv project.';
18
- version = new semver_1.SemVer('0.1.0');
19
- pathPattern;
20
- /**
21
- * Creates a new instance of the rproject file plugin.
22
- * @param pathPattern - The pattern to identify the manifest, see {@link RProjectFilePattern} for the default.
23
- */
24
- constructor(pathPattern = RProjectFilePattern) {
25
- super();
26
- this.pathPattern = pathPattern;
27
- }
28
- applies(file) {
29
- return this.pathPattern.test((0, built_in_source_1.platformBasename)(file.toString()));
30
- }
31
- process(_ctx, file) {
32
- return [flowr_rproject_file_1.FlowrRProjectFile.from(file, flowr_file_1.FileRole.Manifest), true];
33
- }
34
- }
35
- exports.FlowrAnalyzerRProjectFilePlugin = FlowrAnalyzerRProjectFilePlugin;
36
- //# sourceMappingURL=flowr-analyzer-rproject-file-plugin.js.map
@@ -1,13 +0,0 @@
1
- import { FlowrAnalyzerPackageVersionsPlugin } from './flowr-analyzer-package-versions-plugin';
2
- import { SemVer } from 'semver';
3
- import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
4
- /**
5
- * Extracts the project metadata and the declared dependencies from the `rproject.toml` of an rv project.
6
- * The name is contributed without a namespace: an rv project is no package, so `a::b` must not resolve against it.
7
- */
8
- export declare class FlowrAnalyzerMetaRProjectFilePlugin extends FlowrAnalyzerPackageVersionsPlugin {
9
- readonly name = "flowr-analyzer-meta-rproject-file-plugin";
10
- readonly description = "Extracts project meta information and dependencies from an rproject.toml.";
11
- readonly version: SemVer;
12
- process(ctx: FlowrAnalyzerContext): void;
13
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FlowrAnalyzerMetaRProjectFilePlugin = void 0;
4
- const flowr_analyzer_package_versions_plugin_1 = require("./flowr-analyzer-package-versions-plugin");
5
- const semver_1 = require("semver");
6
- const flowr_file_1 = require("../../context/flowr-file");
7
- const flowr_analyzer_meta_context_1 = require("../../context/flowr-analyzer-meta-context");
8
- /**
9
- * Extracts the project metadata and the declared dependencies from the `rproject.toml` of an rv project.
10
- * The name is contributed without a namespace: an rv project is no package, so `a::b` must not resolve against it.
11
- */
12
- class FlowrAnalyzerMetaRProjectFilePlugin extends flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin {
13
- name = 'flowr-analyzer-meta-rproject-file-plugin';
14
- description = 'Extracts project meta information and dependencies from an rproject.toml.';
15
- version = new semver_1.SemVer('0.1.0');
16
- process(ctx) {
17
- for (const file of ctx.files.getFilesByRole(flowr_file_1.FileRole.Manifest)) {
18
- const deps = file.dependencies();
19
- ctx.meta.contribute({
20
- name: file.projectName(),
21
- rVersion: file.rVersion(),
22
- // rv does not group its dependencies, they are all needed to run the project
23
- declares: { imports: deps }
24
- }, flowr_analyzer_meta_context_1.MetaPriority.Manifest);
25
- for (const pkg of deps) {
26
- ctx.deps.addDeclaredDependency(pkg);
27
- }
28
- }
29
- }
30
- }
31
- exports.FlowrAnalyzerMetaRProjectFilePlugin = FlowrAnalyzerMetaRProjectFilePlugin;
32
- //# sourceMappingURL=flowr-analyzer-meta-rproject-file-plugin.js.map