@eagleoutice/flowr 2.12.3 → 2.13.1
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 +42 -95
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +3 -3
- package/abstract-interpretation/data-frame/dataframe-domain.js +14 -6
- package/abstract-interpretation/data-frame/semantics.js +12 -16
- package/abstract-interpretation/domains/abstract-domain.d.ts +46 -44
- package/abstract-interpretation/domains/abstract-domain.js +146 -6
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +16 -25
- package/abstract-interpretation/domains/bounded-set-domain.js +22 -69
- package/abstract-interpretation/domains/interval-domain.d.ts +27 -36
- package/abstract-interpretation/domains/interval-domain.js +111 -146
- package/abstract-interpretation/domains/lattice.d.ts +3 -3
- package/abstract-interpretation/domains/multi-value-state-domain.js +3 -3
- package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -19
- package/abstract-interpretation/domains/partial-product-domain.js +21 -54
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +8 -12
- package/abstract-interpretation/domains/positive-interval-domain.js +21 -50
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/product-domain.js +4 -4
- package/abstract-interpretation/domains/set-range-domain.d.ts +60 -56
- package/abstract-interpretation/domains/set-range-domain.js +141 -200
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +17 -23
- package/abstract-interpretation/domains/set-upper-bound-domain.js +59 -103
- package/abstract-interpretation/domains/singleton-domain.d.ts +15 -18
- package/abstract-interpretation/domains/singleton-domain.js +33 -72
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +12 -16
- package/abstract-interpretation/domains/state-abstract-domain.js +36 -126
- package/abstract-interpretation/domains/state-domain-like.d.ts +2 -2
- package/abstract-interpretation/domains/value-abstract-domain.d.ts +120 -0
- package/abstract-interpretation/domains/{satisfiable-domain.js → value-abstract-domain.js} +14 -2
- package/benchmark/slicer.d.ts +2 -2
- package/benchmark/slicer.js +6 -5
- package/cli/common/options.d.ts +20 -0
- package/cli/common/options.js +4 -0
- package/cli/common/scripts-info.d.ts +20 -0
- package/cli/flowr-main-options.d.ts +4 -0
- package/cli/flowr-main-options.js +5 -0
- package/cli/flowr.d.ts +5 -0
- package/cli/flowr.js +15 -7
- package/cli/repl/commands/repl-commands.d.ts +8 -0
- package/cli/repl/commands/repl-commands.js +16 -3
- package/cli/repl/commands/repl-query.js +50 -20
- package/cli/repl/commands/repl-signature.js +2 -2
- package/cli/repl/core.d.ts +14 -5
- package/cli/repl/core.js +32 -17
- package/cli/repl/parser/slice-query-parser.d.ts +69 -8
- package/cli/repl/parser/slice-query-parser.js +82 -13
- package/cli/repl/path-input.d.ts +6 -0
- package/cli/repl/path-input.js +41 -0
- package/cli/repl/print-version.js +3 -5
- package/cli/slicer-app.d.ts +4 -0
- package/cli/slicer-app.js +4 -2
- package/config.d.ts +56 -6
- package/config.js +134 -12
- package/control-flow/control-flow-graph.d.ts +3 -2
- package/control-flow/control-flow-graph.js +34 -14
- package/control-flow/semantic-cfg-guided-visitor.d.ts +3 -0
- package/control-flow/semantic-cfg-guided-visitor.js +3 -0
- package/core/steps/all/static-slicing/10-reconstruct.d.ts +6 -0
- package/core/steps/all/static-slicing/10-reconstruct.js +3 -1
- package/data/r-base-packages.generated.d.ts +1 -1
- package/data/r-base-packages.generated.js +3 -3
- package/data/sigdb/sigdb.remote.json +53 -53
- package/dataflow/environments/built-in-proc-name.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.js +2 -0
- package/dataflow/environments/built-in.d.ts +2 -0
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +3 -5
- package/dataflow/environments/default-builtin-config.js +2 -2
- package/dataflow/environments/environment.d.ts +9 -0
- package/dataflow/environments/environment.js +28 -7
- package/dataflow/environments/identifier.d.ts +1 -2
- package/dataflow/environments/identifier.js +1 -5
- package/dataflow/extractor.js +1 -2
- package/dataflow/graph/dataflowgraph-builder.js +42 -3
- package/dataflow/graph/df-helper.d.ts +15 -0
- package/dataflow/graph/df-helper.js +20 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +57 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +12 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +233 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +5 -3
- package/documentation/data/faq/faqs.js +12 -1
- package/documentation/doc-readme.js +1 -1
- package/documentation/doc-util/doc-files.d.ts +2 -2
- package/documentation/doc-util/doc-files.js +4 -7
- package/documentation/doc-util/doc-query.d.ts +12 -9
- package/documentation/doc-util/doc-query.js +63 -28
- package/documentation/wiki-absint.js +1 -4
- package/documentation/wiki-analyzer.js +8 -3
- package/documentation/wiki-cfg.js +3 -2
- package/documentation/wiki-dataflow-graph.js +14 -4
- package/documentation/wiki-interface.js +30 -16
- package/documentation/wiki-mk/doc-maker.js +1 -1
- package/documentation/wiki-query.js +190 -30
- package/documentation/wiki-signature-database.d.ts +1 -1
- package/documentation/wiki-signature-database.js +53 -27
- package/linter/linter-output.d.ts +24 -0
- package/linter/linter-output.js +117 -0
- package/linter/linter-rules.d.ts +2 -4
- package/linter/rules/dataframe-access-validation.js +4 -4
- package/linter/rules/deprecated-functions.d.ts +2 -4
- package/linter/rules/deprecated-functions.js +58 -3
- package/linter/rules/undefined-symbol.js +18 -10
- package/linter/rules/unused-definition.js +24 -0
- package/package.json +5 -2
- package/project/context/flowr-analyzer-context.d.ts +61 -1
- package/project/context/flowr-analyzer-context.js +124 -3
- package/project/context/flowr-analyzer-dependencies-context.d.ts +32 -7
- package/project/context/flowr-analyzer-dependencies-context.js +33 -3
- package/project/context/flowr-analyzer-files-context.d.ts +40 -0
- package/project/context/flowr-analyzer-files-context.js +171 -14
- package/project/context/flowr-analyzer-loading-order-context.d.ts +6 -0
- package/project/context/flowr-analyzer-loading-order-context.js +20 -0
- package/project/context/flowr-analyzer-meta-context.d.ts +92 -10
- package/project/context/flowr-analyzer-meta-context.js +64 -23
- package/project/context/flowr-file.d.ts +7 -0
- package/project/context/flowr-file.js +7 -0
- package/project/context/project-kind.d.ts +22 -0
- package/project/context/project-kind.js +27 -0
- package/project/dependency-version-space.d.ts +168 -0
- package/project/dependency-version-space.js +570 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/flowr-analyzer.d.ts +7 -0
- package/project/flowr-analyzer.js +9 -0
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +7 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +5 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +739 -0
- package/project/plugins/file-plugins/files/flowr-rda-file.js +2407 -0
- package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +31 -0
- package/project/plugins/file-plugins/files/flowr-rproject-file.js +66 -0
- package/project/plugins/file-plugins/files/r-fun-tab.d.ts +828 -0
- package/project/plugins/file-plugins/files/r-fun-tab.js +1039 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +26 -0
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +38 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +17 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +30 -0
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +36 -0
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +3 -4
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +5 -6
- package/project/plugins/flowr-analyzer-plugin.js +5 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.d.ts +14 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.js +53 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.d.ts +15 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +18 -13
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +13 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +32 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +8 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +70 -7
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.d.ts +18 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +62 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +5 -13
- package/project/plugins/package-version-plugins/package.d.ts +4 -1
- package/project/plugins/package-version-plugins/package.js +8 -5
- package/project/plugins/plugin-registry.d.ts +11 -3
- package/project/plugins/plugin-registry.js +24 -5
- package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.d.ts +51 -0
- package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.js +101 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +10 -5
- package/project/sigdb/build.js +12 -2
- package/project/sigdb/decode.d.ts +7 -0
- package/project/sigdb/decode.js +35 -4
- package/project/sigdb/decompress.d.ts +2 -0
- package/project/sigdb/decompress.js +5 -0
- package/project/sigdb/manifest.d.ts +5 -0
- package/project/sigdb/manifest.js +37 -6
- package/project/sigdb/reader.d.ts +82 -2
- package/project/sigdb/reader.js +226 -14
- package/project/sigdb/schema.d.ts +31 -5
- package/project/sigdb/schema.js +7 -3
- package/project/sigdb/{version.d.ts → sigdb-version.d.ts} +21 -1
- package/project/sigdb/sigdb-version.js +119 -0
- package/queries/catalog/absint-query/absint-query-format.d.ts +2 -0
- package/queries/catalog/absint-query/absint-query-format.js +2 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +30 -3
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -0
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/call-graph-query/call-graph-query-executor.js +3 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +6 -0
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -0
- package/queries/catalog/call-graph-query/expand-library-internals.d.ts +19 -0
- package/queries/catalog/call-graph-query/expand-library-internals.js +59 -0
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -0
- package/queries/catalog/cluster-query/cluster-query-format.js +1 -0
- package/queries/catalog/config-query/config-query-executor.js +17 -5
- package/queries/catalog/config-query/config-query-format.d.ts +19 -3
- package/queries/catalog/config-query/config-query-format.js +258 -98
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.js +1 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +13 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +117 -17
- package/queries/catalog/dice-query/dice-query-executor.js +6 -9
- package/queries/catalog/dice-query/dice-query-format.d.ts +4 -5
- package/queries/catalog/dice-query/dice-query-format.js +10 -6
- package/queries/catalog/does-call-query/does-call-query-executor.js +15 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +8 -0
- package/queries/catalog/does-call-query/does-call-query-format.js +4 -1
- package/queries/catalog/files-query/files-query-format.d.ts +2 -0
- package/queries/catalog/files-query/files-query-format.js +2 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +6 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +293 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +121 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +345 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -0
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -0
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -0
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -0
- package/queries/catalog/linter-query/linter-query-executor.js +11 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +9 -4
- package/queries/catalog/linter-query/linter-query-format.js +44 -21
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +2 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
- package/queries/catalog/origin-query/origin-query-format.js +2 -0
- package/queries/catalog/project-query/project-query-executor.d.ts +0 -15
- package/queries/catalog/project-query/project-query-executor.js +19 -62
- package/queries/catalog/project-query/project-query-format.d.ts +7 -18
- package/queries/catalog/project-query/project-query-format.js +3 -18
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -0
- package/queries/catalog/search-query/search-query-format.d.ts +1 -0
- package/queries/catalog/search-query/search-query-format.js +1 -0
- package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -0
- package/queries/catalog/signature-query/signature-query-executor.js +267 -57
- package/queries/catalog/signature-query/signature-query-format.d.ts +37 -6
- package/queries/catalog/signature-query/signature-query-format.js +41 -5
- package/queries/catalog/signature-query/signature-query-render.js +48 -6
- package/queries/catalog/slice-query-options.d.ts +49 -0
- package/queries/catalog/slice-query-options.js +50 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -12
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -15
- package/queries/catalog/static-slice-query/static-slice-query-format.js +9 -10
- package/queries/query-print.js +3 -1
- package/queries/query.d.ts +62 -2
- package/queries/query.js +9 -2
- package/r-bridge/data/data.d.ts +16 -0
- package/r-bridge/data/data.js +20 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +19 -16
- package/reconstruct/reconstruct.d.ts +18 -1
- package/reconstruct/reconstruct.js +42 -19
- package/slicing/criterion/parse.d.ts +4 -0
- package/slicing/criterion/parse.js +4 -0
- package/slicing/static/slice-call.js +17 -9
- package/slicing/static/static-slicer.d.ts +1 -1
- package/slicing/static/static-slicer.js +5 -4
- package/util/files.d.ts +19 -1
- package/util/files.js +45 -3
- package/util/glob.d.ts +19 -0
- package/util/glob.js +67 -0
- package/util/log.d.ts +12 -0
- package/util/log.js +17 -1
- package/util/logic.d.ts +6 -0
- package/util/logic.js +31 -1
- package/util/mermaid/dfg.js +17 -12
- package/util/mermaid/mermaid.js +2 -2
- package/util/objects.d.ts +5 -0
- package/util/objects.js +8 -0
- package/util/r-version.d.ts +9 -1
- package/util/r-version.js +27 -2
- package/util/schema.d.ts +18 -0
- package/util/schema.js +102 -4
- package/util/text/ansi.d.ts +4 -0
- package/util/text/ansi.js +27 -3
- package/util/text/strings.d.ts +9 -0
- package/util/text/strings.js +29 -0
- package/util/version.js +79 -6
- package/abstract-interpretation/domains/satisfiable-domain.d.ts +0 -29
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +0 -22
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +0 -52
- package/project/sigdb/version.js +0 -55
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.watchProtocol = void 0;
|
|
7
|
+
exports.handlePathLikeInput = handlePathLikeInput;
|
|
8
|
+
/**
|
|
9
|
+
* Handling of repl inputs that name a file, shared by every command that takes R code.
|
|
10
|
+
* @module
|
|
11
|
+
*/
|
|
12
|
+
const fs_1 = __importDefault(require("fs"));
|
|
13
|
+
const retriever_1 = require("../../r-bridge/retriever");
|
|
14
|
+
const ansi_1 = require("../../util/text/ansi");
|
|
15
|
+
/** Prefix of an input that is to be re-analyzed whenever the file changes, the counterpart of {@link fileProtocol}. */
|
|
16
|
+
exports.watchProtocol = 'watch://';
|
|
17
|
+
/** Whether `s` looks like a filesystem path the user likely meant to load via {@link fileProtocol}. */
|
|
18
|
+
function looksLikePath(s) {
|
|
19
|
+
if (s.startsWith(retriever_1.fileProtocol) || s.startsWith(exports.watchProtocol)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (/^(~|\.{0,2}\/|[a-zA-Z]:[\\/])/.test(s)) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
// a single path-like token (a separator, no R-code punctuation) that actually exists on disk
|
|
26
|
+
return /^[^\s()]+\/[^\s()]+$/.test(s) && fs_1.default.existsSync(s);
|
|
27
|
+
}
|
|
28
|
+
/** The input to analyze: one that looks like a path gets the {@link fileProtocol}, unless the repl config says not to. */
|
|
29
|
+
function handlePathLikeInput(output, input, config) {
|
|
30
|
+
if (!looksLikePath(input)) {
|
|
31
|
+
return input;
|
|
32
|
+
}
|
|
33
|
+
const asFile = retriever_1.fileProtocol + input;
|
|
34
|
+
if (config.repl.autoUseFileProtocol) {
|
|
35
|
+
output.stdout((0, ansi_1.ansiInfo)(`'${input}' looks like a path, analyzing ${(0, ansi_1.bold)(asFile, output.formatter)} (${(0, ansi_1.bold)('repl.autoUseFileProtocol', output.formatter)} is set).`));
|
|
36
|
+
return asFile;
|
|
37
|
+
}
|
|
38
|
+
output.stdout((0, ansi_1.ansiInfo)(`'${input}' looks like a path. To analyze it, use ${(0, ansi_1.bold)(asFile, output.formatter)} (or ${(0, ansi_1.bold)(exports.watchProtocol + input, output.formatter)} to re-run on changes), or re-enable ${(0, ansi_1.bold)('repl.autoUseFileProtocol', output.formatter)} to have flowR do this for you. Use ${(0, ansi_1.bold)(':help', output.formatter)} for more.`));
|
|
39
|
+
return input;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=path-input.js.map
|
|
@@ -17,7 +17,7 @@ async function versionReplString(parser) {
|
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Compact, dimmed note on the bundled signature databases (merged into the engine parenthesis): one linked ref per
|
|
20
|
-
* scope present on disk (`current`, `full-history`) with its last update
|
|
20
|
+
* scope present on disk (`current`, `base`, `full-history`) with its last update.
|
|
21
21
|
* The full history is on disk as `history.*` (mounted alongside `current.*`), or a merged `full.*` in a baked container.
|
|
22
22
|
*/
|
|
23
23
|
function sigDbSummaryString() {
|
|
@@ -29,16 +29,14 @@ function sigDbSummaryString() {
|
|
|
29
29
|
}
|
|
30
30
|
let date;
|
|
31
31
|
try {
|
|
32
|
-
date = (0, manifest_1.
|
|
32
|
+
date = (0, manifest_1.readManifestDate)(file);
|
|
33
33
|
}
|
|
34
34
|
catch { /* a corrupt/unreadable manifest must not break --version */ }
|
|
35
35
|
entries.push({ label, file, date });
|
|
36
36
|
};
|
|
37
37
|
add('current', (0, manifest_1.defaultSigDbPath)('current'));
|
|
38
|
+
add('base', (0, manifest_1.defaultSigDbPath)('base'));
|
|
38
39
|
add('full-history', (0, manifest_1.defaultSigDbPath)('full') ?? (0, manifest_1.defaultSigDbPath)('history'));
|
|
39
|
-
if (entries.length === 0) {
|
|
40
|
-
add('base', (0, manifest_1.defaultSigDbPath)('base'));
|
|
41
|
-
}
|
|
42
40
|
if (entries.length === 0) {
|
|
43
41
|
return it('no sigdb');
|
|
44
42
|
}
|
package/cli/slicer-app.d.ts
CHANGED
|
@@ -10,5 +10,9 @@ export interface SlicerCliOptions {
|
|
|
10
10
|
api: boolean;
|
|
11
11
|
'no-magic-comments': boolean;
|
|
12
12
|
inline: boolean;
|
|
13
|
+
'inline-full': boolean;
|
|
14
|
+
'inline-banner': boolean;
|
|
13
15
|
'include-callees': boolean;
|
|
16
|
+
'config-file': string | undefined;
|
|
17
|
+
'config-json': string | undefined;
|
|
14
18
|
}
|
package/cli/slicer-app.js
CHANGED
|
@@ -23,6 +23,7 @@ const options = (0, script_1.processCommandLineArgs)('slicer', ['input', 'criter
|
|
|
23
23
|
'{bold -c} {italic "3@a"} {bold -r} {italic "a <- 3\\\\nb <- 4\\\\nprint(a)"} {bold --diff}',
|
|
24
24
|
'{bold -i} {italic example.R} {bold --stats} {bold --criterion} {italic "8:3;3:1;12@product"}',
|
|
25
25
|
'{bold -c} {italic "5@result"} {bold --inline} {italic main.R}',
|
|
26
|
+
'{bold -c} {italic ""} {bold --inline-full} {bold --inline-banner} {italic app.R}',
|
|
26
27
|
'{bold --help}'
|
|
27
28
|
]
|
|
28
29
|
});
|
|
@@ -30,10 +31,11 @@ async function getSlice() {
|
|
|
30
31
|
const slicer = new slicer_1.BenchmarkSlicer('r-shell');
|
|
31
32
|
(0, assert_1.guard)(options.input !== undefined, 'input must be given');
|
|
32
33
|
(0, assert_1.guard)(options.criterion !== undefined, 'a slicing criterion must be given');
|
|
33
|
-
const config = config_1.FlowrConfig.
|
|
34
|
+
const config = (options['config-json'] ? config_1.FlowrConfig.parse(options['config-json']) : undefined)
|
|
35
|
+
?? config_1.FlowrConfig.fromFile(options['config-file']);
|
|
34
36
|
await slicer.init(options['input-is-text']
|
|
35
37
|
? { request: 'text', content: options.input.replaceAll('\\n', '\n') }
|
|
36
|
-
: { request: 'file', content: options.input }, config, options['no-magic-comments'] ? auto_select_defaults_1.doNotAutoSelect : (0, magic_comments_1.makeMagicCommentHandler)(auto_select_defaults_1.doNotAutoSelect), undefined, options.inline, options['include-callees']);
|
|
38
|
+
: { request: 'file', content: options.input }, config, options['no-magic-comments'] ? auto_select_defaults_1.doNotAutoSelect : (0, magic_comments_1.makeMagicCommentHandler)(auto_select_defaults_1.doNotAutoSelect), undefined, options.inline, options['include-callees'], options['inline-full'] ? (options['inline-banner'] ? 'banner' : true) : undefined);
|
|
37
39
|
let mappedSlices = [];
|
|
38
40
|
let reconstruct = undefined;
|
|
39
41
|
const doSlicing = options.criterion.trim() !== '';
|
package/config.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type MergeableRecord } from './util/objects';
|
|
2
|
+
import { type LogLevelName } from './util/log';
|
|
2
3
|
import Joi from 'joi';
|
|
3
4
|
import type { BuiltInDefinitions } from './dataflow/environments/built-in-config';
|
|
4
5
|
import type { KnownParser } from './r-bridge/parser';
|
|
5
|
-
import type { DeepWritable, Paths, PathValue } from 'ts-essentials';
|
|
6
|
+
import type { DeepPartial, DeepWritable, Paths, PathValue } from 'ts-essentials';
|
|
6
7
|
import type { DataflowProcessors } from './dataflow/processor';
|
|
7
8
|
import type { ParentInformation } from './r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
8
9
|
import type { FlowrAnalyzerContext } from './project/context/flowr-analyzer-context';
|
|
10
|
+
import { ProjectKind } from './project/context/project-kind';
|
|
9
11
|
import type { BuiltInFlowrPluginArgs, BuiltInFlowrPluginName } from './project/plugins/plugin-registry';
|
|
10
12
|
import { type FlowrGasConfig } from './gas';
|
|
11
13
|
export declare enum VariableResolve {
|
|
@@ -96,18 +98,29 @@ export interface FlowrLaxSourcingOptions extends MergeableRecord {
|
|
|
96
98
|
* - `faa-bar.R` (replaced spaces and oo)
|
|
97
99
|
*/
|
|
98
100
|
readonly applyReplacements?: Record<string, string>[];
|
|
101
|
+
/** Assume a sourced file is always there, making what it defines certain instead of conditional on the `source` call. */
|
|
102
|
+
readonly assumeFilesExist?: boolean;
|
|
99
103
|
}
|
|
100
104
|
export type ConfigPlugin<T extends BuiltInFlowrPluginName | string> = T | string | (T extends BuiltInFlowrPluginName ? [T, BuiltInFlowrPluginArgs<T>] : [string, unknown[]]);
|
|
105
|
+
/** One {@link FlowrConfig.specializeConfig} entry: a config overwrite, optionally `inherit`ing another kind's overwrite (own keys win). */
|
|
106
|
+
export type SpecializeConfigEntry = DeepPartial<FlowrConfig> & {
|
|
107
|
+
readonly inherit?: ProjectKind;
|
|
108
|
+
};
|
|
101
109
|
/**
|
|
102
110
|
* The configuration file format for flowR.
|
|
103
111
|
* @see {@link FlowrConfig.default} for the default configuration.
|
|
104
112
|
* @see {@link FlowrConfig.Schema} for the Joi schema for validation.
|
|
105
113
|
*/
|
|
106
114
|
export interface FlowrConfig extends MergeableRecord {
|
|
115
|
+
readonly logLevel?: LogLevelName;
|
|
107
116
|
/**
|
|
108
117
|
* Whether source calls should be ignored, causing {@link processSourceCall}'s behavior to be skipped
|
|
109
118
|
*/
|
|
110
119
|
readonly ignoreSourceCalls: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Whether load calls should be ignored, causing {@link processLoadCall}'s behavior to be skipped
|
|
122
|
+
*/
|
|
123
|
+
readonly ignoreLoadCalls: boolean;
|
|
111
124
|
/** Configure language semantics and how flowR handles them */
|
|
112
125
|
readonly semantics: {
|
|
113
126
|
/** Semantics regarding the handling of the environment */
|
|
@@ -133,16 +146,42 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
133
146
|
hints: boolean;
|
|
134
147
|
/** Plugins to load in REPL mode */
|
|
135
148
|
plugins: (ConfigPlugin<string> | 'flowr:default')[];
|
|
149
|
+
/** Automatically use the file protocol for inputs that look like paths (default `true`) */
|
|
150
|
+
autoUseFileProtocol?: boolean;
|
|
151
|
+
/** Whether `:query` closes with the line stating how long the queries took (default `true`, `:query*` never prints it) */
|
|
152
|
+
queryStats?: boolean;
|
|
153
|
+
/** Whether `:version` grays out the plugins that did not activate during the last analysis (default `false`) */
|
|
154
|
+
showPlugins?: boolean;
|
|
136
155
|
};
|
|
137
156
|
readonly project: {
|
|
138
157
|
/** Whether to resolve unknown paths loaded by the r project disk when trying to source/analyze files */
|
|
139
158
|
resolveUnknownPathsOnDisk: boolean;
|
|
159
|
+
/** Overwrite the {@link ProjectKind} flowR would otherwise infer from the analyzed files, e.g. when auto-detection guesses wrong. */
|
|
160
|
+
useProjectType?: ProjectKind;
|
|
140
161
|
/**
|
|
141
162
|
* The packages considered part of R itself, used e.g. by the project query to classify dependencies. If
|
|
142
163
|
* unset, flowR derives them (for the assumed R version) from the signature database via `baseRPackages`.
|
|
143
164
|
*/
|
|
144
165
|
basePackages?: string[];
|
|
166
|
+
/**
|
|
167
|
+
* Files a framework loads on its own, without any `source()` call (e.g. `global.R` in a shiny app), in load
|
|
168
|
+
* order. Entries are case-insensitive globs (`R/*.R`) matched against the path, a plain name matches any file
|
|
169
|
+
* with that name; entries matching nothing are warned about. Usually set per {@link ProjectKind} via
|
|
170
|
+
* {@link FlowrConfig.specializeConfig}.
|
|
171
|
+
*/
|
|
172
|
+
implicitSources?: string[];
|
|
173
|
+
};
|
|
174
|
+
/** Linter configuration, usually specialized per {@link ProjectKind} via {@link FlowrConfig.specializeConfig}. */
|
|
175
|
+
readonly linter: {
|
|
176
|
+
/** Rule names excluded from the *default* rule set (a rule requested explicitly still runs). */
|
|
177
|
+
readonly disabledRules: string[];
|
|
145
178
|
};
|
|
179
|
+
/**
|
|
180
|
+
* Overwrite (parts of) this configuration depending on the {@link ProjectKind} flowR detects for the project,
|
|
181
|
+
* e.g. to give a shiny app its implicit sources. An entry may `inherit` another kind's overwrite (merged first,
|
|
182
|
+
* with the entry's own keys winning) to avoid repeating it. Resolve it with {@link FlowrConfig.forKind}.
|
|
183
|
+
*/
|
|
184
|
+
readonly specializeConfig?: Partial<Record<ProjectKind, SpecializeConfigEntry>>;
|
|
146
185
|
/**
|
|
147
186
|
* The engines to use for interacting with R code. Currently, supports {@link TreeSitterEngineConfig} and {@link RShellEngineConfig}.
|
|
148
187
|
* An empty array means all available engines will be used.
|
|
@@ -170,9 +209,9 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
170
209
|
readonly trackEnvironments: boolean;
|
|
171
210
|
/** Resolving `library()`/`use()` exports from a signature database (e.g. the bundled `flowr-sigdb`). */
|
|
172
211
|
readonly sigdb: {
|
|
173
|
-
/** Resolve library exports from a
|
|
212
|
+
/** Resolve library exports from a signature database (default `true`); when `false` no database is consulted. */
|
|
174
213
|
readonly enabled: boolean;
|
|
175
|
-
/** Load the project's declared dependencies from its metadata files (`DESCRIPTION` Imports/Depends, `renv.lock`, `rv.lock`) into the dependency context (default `true`); when `false` these files are not read, so neither the undefined-symbol linter nor {@link linkDescriptionDependencies} sees any project-declared dependency. */
|
|
214
|
+
/** Load the project's declared dependencies from its metadata files (`DESCRIPTION` Imports/Depends, `rproject.toml`, `renv.lock`, `rv.lock`) into the dependency context (default `true`); when `false` these files are not read, so neither the undefined-symbol linter nor {@link linkDescriptionDependencies} sees any project-declared dependency. */
|
|
176
215
|
readonly loadProjectDependencies: boolean;
|
|
177
216
|
/** Parse the database up front rather than on the first package load (default `false`, ignored if disabled). */
|
|
178
217
|
readonly eagerlyLoad: boolean;
|
|
@@ -205,6 +244,11 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
205
244
|
/** Force an exact version for specific packages (mapping a package name to a version), overriding both the project constraint and the {@link versionSelection} policy; a version missing from the database falls back with a warning (default `{}`). */
|
|
206
245
|
readonly versionOverrides?: Record<string, string>;
|
|
207
246
|
};
|
|
247
|
+
/** Policies for reasoning about dependency versions (independent of how the signature database is loaded). */
|
|
248
|
+
readonly versionManagement?: {
|
|
249
|
+
/** Groups of packages that must resolve to the same version (like the base packages, which share the R version); version guessing intersects each group so its members stay mutually compatible (default `[]`). */
|
|
250
|
+
readonly linkedVersionGroups?: string[][];
|
|
251
|
+
};
|
|
208
252
|
/** These keys are only intended for use within code, allowing to instrument the dataflow analyzer! */
|
|
209
253
|
readonly instrument: {
|
|
210
254
|
/**
|
|
@@ -318,9 +362,6 @@ export type KnownEngines = {
|
|
|
318
362
|
[T in EngineConfig['type']]?: KnownParser;
|
|
319
363
|
};
|
|
320
364
|
export declare const FlowrDefaultPlugins: string[];
|
|
321
|
-
/**
|
|
322
|
-
* Helper Object to work with {@link FlowrConfig}, provides the default config and the Joi schema for validation.
|
|
323
|
-
*/
|
|
324
365
|
export declare const FlowrConfig: {
|
|
325
366
|
readonly name: "FlowrConfig";
|
|
326
367
|
/**
|
|
@@ -351,6 +392,15 @@ export declare const FlowrConfig: {
|
|
|
351
392
|
* This is mostly useful for user-facing features.
|
|
352
393
|
*/
|
|
353
394
|
readonly fromFile: (this: void, configFile?: string, configWorkingDirectory?: string) => FlowrConfig;
|
|
395
|
+
/**
|
|
396
|
+
* Resolves the configuration for the given {@link ProjectKind} by applying the matching
|
|
397
|
+
* {@link FlowrConfig.specializeConfig} entry to every key it names. What you configured wins over the entry, which in
|
|
398
|
+
* turn wins over flowR's default; a value that differs from the default counts as configured.
|
|
399
|
+
* Returns `config` itself if the kind has no entry, so callers can use this freely.
|
|
400
|
+
*/
|
|
401
|
+
readonly forKind: (this: void, config: FlowrConfig, kind: ProjectKind) => FlowrConfig;
|
|
402
|
+
/** The overwrite {@link FlowrConfig.forKind} applies for `kind` (with {@link SpecializeConfigEntry.inherit} resolved), or `undefined`. */
|
|
403
|
+
readonly specializationFor: (this: void, config: FlowrConfig, kind: ProjectKind) => DeepPartial<FlowrConfig> | undefined;
|
|
354
404
|
/**
|
|
355
405
|
* Gets the configuration for the given engine type from the config.
|
|
356
406
|
*/
|
package/config.js
CHANGED
|
@@ -12,6 +12,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
12
12
|
const log_1 = require("./util/log");
|
|
13
13
|
const files_1 = require("./util/files");
|
|
14
14
|
const joi_1 = __importDefault(require("joi"));
|
|
15
|
+
const project_kind_1 = require("./project/context/project-kind");
|
|
15
16
|
const object_path_1 = __importDefault(require("object-path"));
|
|
16
17
|
const gas_1 = require("./gas");
|
|
17
18
|
var VariableResolve;
|
|
@@ -95,25 +96,89 @@ exports.FlowrDefaultPlugins = [
|
|
|
95
96
|
'file:description',
|
|
96
97
|
'versions:description',
|
|
97
98
|
'versions:sigdb',
|
|
99
|
+
'versions:namespace',
|
|
98
100
|
'versions:renv',
|
|
99
101
|
'versions:rv',
|
|
102
|
+
'versions:packrat',
|
|
103
|
+
'versions:session-info',
|
|
100
104
|
'loading-order:description',
|
|
105
|
+
'loading-order:implicit-sources',
|
|
106
|
+
'loading-order:rprofile',
|
|
101
107
|
'meta:description',
|
|
102
|
-
'
|
|
103
|
-
'
|
|
104
|
-
'
|
|
108
|
+
'meta:rproject',
|
|
109
|
+
'file-roles:vignette',
|
|
110
|
+
'file-roles:test',
|
|
111
|
+
'file-roles:inst',
|
|
105
112
|
'file:rmd',
|
|
106
113
|
'file:qmd',
|
|
107
114
|
'file:rnw',
|
|
108
115
|
'file:ipynb',
|
|
109
116
|
'file:namespace',
|
|
110
117
|
'file:news',
|
|
118
|
+
'file:rda',
|
|
111
119
|
'file:license',
|
|
112
120
|
'file:virtualenv',
|
|
121
|
+
'file:rproject',
|
|
122
|
+
'file:rprofile',
|
|
113
123
|
];
|
|
124
|
+
/** deep-merge two config overwrites with `own` winning; objects merge, arrays/scalars replace (matching {@link specialize}'s array-as-leaf treatment) */
|
|
125
|
+
function mergeOverwrite(parent, own) {
|
|
126
|
+
const result = { ...parent };
|
|
127
|
+
for (const [key, value] of Object.entries(own)) {
|
|
128
|
+
const prev = parent[key];
|
|
129
|
+
result[key] = (0, objects_1.isPlainObject)(prev) && (0, objects_1.isPlainObject)(value) ? mergeOverwrite(prev, value) : value;
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
/** The effective overwrite for `kind`, following {@link SpecializeConfigEntry.inherit} (cycle-guarded; own keys win, `inherit` stripped), or `undefined` when nothing is overwritten. */
|
|
134
|
+
function resolveSpecialization(specializeConfig, kind, seen = new Set()) {
|
|
135
|
+
const entry = specializeConfig?.[kind];
|
|
136
|
+
if (!entry || seen.has(kind)) {
|
|
137
|
+
return undefined;
|
|
138
|
+
}
|
|
139
|
+
seen.add(kind);
|
|
140
|
+
const { inherit, ...own } = entry;
|
|
141
|
+
const parent = inherit !== undefined ? resolveSpecialization(specializeConfig, inherit, seen) : undefined;
|
|
142
|
+
const resolved = parent !== undefined ? mergeOverwrite(parent, own) : own;
|
|
143
|
+
return Object.keys(resolved).length > 0 ? resolved : undefined;
|
|
144
|
+
}
|
|
114
145
|
/**
|
|
115
|
-
*
|
|
146
|
+
* Applies `overwrite` to `current`, key by key, keeping every value that differs from `base`: only a value nobody
|
|
147
|
+
* configured is left to the overwrite. An array is replaced, never appended to.
|
|
116
148
|
*/
|
|
149
|
+
function specialize(current, base, overwrite) {
|
|
150
|
+
if (overwrite === undefined) {
|
|
151
|
+
return current;
|
|
152
|
+
}
|
|
153
|
+
else if ((0, objects_1.isPlainObject)(current) && (0, objects_1.isPlainObject)(overwrite)) {
|
|
154
|
+
const result = { ...current };
|
|
155
|
+
for (const [key, value] of Object.entries(overwrite)) {
|
|
156
|
+
result[key] = specialize(current[key], (0, objects_1.isPlainObject)(base) ? base[key] : undefined, value);
|
|
157
|
+
}
|
|
158
|
+
return result;
|
|
159
|
+
}
|
|
160
|
+
return JSON.stringify(current) === JSON.stringify(base) ? overwrite : current;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Merge a user config onto the defaults. Unlike {@link deepMergeObject}, an array in the user config replaces the
|
|
164
|
+
* default one instead of being appended to it, so options such as `defaultPlugins` can be reduced and not just extended.
|
|
165
|
+
*/
|
|
166
|
+
function mergeConfigOntoDefaults(base, addon) {
|
|
167
|
+
const merge = (b, a) => {
|
|
168
|
+
if (a === undefined) {
|
|
169
|
+
return b;
|
|
170
|
+
}
|
|
171
|
+
if (!(0, objects_1.isPlainObject)(a) || !(0, objects_1.isPlainObject)(b)) {
|
|
172
|
+
return a;
|
|
173
|
+
}
|
|
174
|
+
const out = { ...b };
|
|
175
|
+
for (const [key, value] of Object.entries(a)) {
|
|
176
|
+
out[key] = merge(out[key], value);
|
|
177
|
+
}
|
|
178
|
+
return out;
|
|
179
|
+
};
|
|
180
|
+
return merge(base, addon);
|
|
181
|
+
}
|
|
117
182
|
exports.FlowrConfig = {
|
|
118
183
|
name: 'FlowrConfig',
|
|
119
184
|
/**
|
|
@@ -123,6 +188,7 @@ exports.FlowrConfig = {
|
|
|
123
188
|
default() {
|
|
124
189
|
return {
|
|
125
190
|
ignoreSourceCalls: false,
|
|
191
|
+
ignoreLoadCalls: false,
|
|
126
192
|
semantics: {
|
|
127
193
|
environment: {
|
|
128
194
|
overwriteBuiltIns: {
|
|
@@ -137,10 +203,27 @@ exports.FlowrConfig = {
|
|
|
137
203
|
dfProcessorHeat: false,
|
|
138
204
|
hints: true,
|
|
139
205
|
plugins: ['flowr:default'],
|
|
206
|
+
autoUseFileProtocol: true,
|
|
207
|
+
queryStats: true,
|
|
208
|
+
showPlugins: false,
|
|
140
209
|
},
|
|
141
210
|
project: {
|
|
142
211
|
resolveUnknownPathsOnDisk: true
|
|
143
212
|
},
|
|
213
|
+
linter: {
|
|
214
|
+
disabledRules: []
|
|
215
|
+
},
|
|
216
|
+
specializeConfig: {
|
|
217
|
+
[project_kind_1.ProjectKind.Package]: { solver: { resolveSource: { assumeFilesExist: true } } },
|
|
218
|
+
[project_kind_1.ProjectKind.Project]: { solver: { resolveSource: { assumeFilesExist: true } } },
|
|
219
|
+
[project_kind_1.ProjectKind.ShinyApp]: {
|
|
220
|
+
project: { implicitSources: ['global.R', 'ui.R', 'server.R', 'app.R'] },
|
|
221
|
+
solver: { resolveSource: { assumeFilesExist: true } }
|
|
222
|
+
},
|
|
223
|
+
[project_kind_1.ProjectKind.Script]: { inherit: project_kind_1.ProjectKind.Unknown },
|
|
224
|
+
[project_kind_1.ProjectKind.Notebook]: { inherit: project_kind_1.ProjectKind.Unknown },
|
|
225
|
+
[project_kind_1.ProjectKind.Unknown]: { linter: { disabledRules: ['software-has-license', 'software-has-tests'] } }
|
|
226
|
+
},
|
|
144
227
|
engines: [],
|
|
145
228
|
defaultEngine: 'tree-sitter',
|
|
146
229
|
solver: {
|
|
@@ -148,12 +231,14 @@ exports.FlowrConfig = {
|
|
|
148
231
|
evalStrings: true,
|
|
149
232
|
trackEnvironments: true,
|
|
150
233
|
sigdb: { enabled: true, loadProjectDependencies: true, eagerlyLoad: false, eagerlyLoadExports: false, assumedRVersion: 'auto', linkBaseR: false, linkDescriptionDependencies: false, linkBaseRCalls: false, linkPackageCalls: false, warmInBackground: false, additionalPaths: [], autoSync: false, versionSelection: VersionSelection.Newest, versionOverrides: {} },
|
|
234
|
+
versionManagement: { linkedVersionGroups: [] },
|
|
151
235
|
resolveSource: {
|
|
152
236
|
dropPaths: DropPathsOption.No,
|
|
153
237
|
ignoreCapitalization: true,
|
|
154
238
|
inferWorkingDirectory: InferWorkingDirectory.ActiveScript,
|
|
155
239
|
searchPath: [],
|
|
156
|
-
repeatedSourceLimit: 2
|
|
240
|
+
repeatedSourceLimit: 2,
|
|
241
|
+
assumeFilesExist: false
|
|
157
242
|
},
|
|
158
243
|
instrument: {
|
|
159
244
|
dataflowExtractors: undefined
|
|
@@ -186,7 +271,9 @@ exports.FlowrConfig = {
|
|
|
186
271
|
* The Joi schema for validating a config file, use this to validate your config file before using it. You can also use this to generate documentation for the config file format.
|
|
187
272
|
*/
|
|
188
273
|
Schema: joi_1.default.object({
|
|
274
|
+
logLevel: joi_1.default.string().valid(...Object.keys(log_1.LogLevelNames)).optional().description('flowR\'s global minimum log level, applied when the config is loaded.'),
|
|
189
275
|
ignoreSourceCalls: joi_1.default.boolean().optional().description('Whether source calls should be ignored, causing {@link processSourceCall}\'s behavior to be skipped.'),
|
|
276
|
+
ignoreLoadCalls: joi_1.default.boolean().optional().description('Whether load calls should be ignored, causing {@link processLoadCall}\'s behavior to be skipped.'),
|
|
190
277
|
semantics: joi_1.default.object({
|
|
191
278
|
environment: joi_1.default.object({
|
|
192
279
|
overwriteBuiltIns: joi_1.default.object({
|
|
@@ -200,12 +287,24 @@ exports.FlowrConfig = {
|
|
|
200
287
|
quickStats: joi_1.default.boolean().optional().description('Whether to show quick stats in the REPL after each evaluation.'),
|
|
201
288
|
dfProcessorHeat: joi_1.default.boolean().optional().description('This instruments the dataflow processors to count how often each processor is called.'),
|
|
202
289
|
hints: joi_1.default.boolean().optional().description('Whether to show dim inline hints on the empty prompt (automatically disabled on non-interactive terminals).'),
|
|
203
|
-
plugins: joi_1.default.array().items(joi_1.default.alternatives().try(joi_1.default.string(), joi_1.default.array().ordered(joi_1.default.string(), joi_1.default.array().items(joi_1.default.any())).length(2))).optional().description('The plugins to load in REPL mode')
|
|
290
|
+
plugins: joi_1.default.array().items(joi_1.default.alternatives().try(joi_1.default.string(), joi_1.default.array().ordered(joi_1.default.string(), joi_1.default.array().items(joi_1.default.any())).length(2))).optional().description('The plugins to load in REPL mode'),
|
|
291
|
+
autoUseFileProtocol: joi_1.default.boolean().optional().description('Prepend the file protocol to a repl input that looks like a path, instead of only warning about it.'),
|
|
292
|
+
queryStats: joi_1.default.boolean().optional().description('Whether `:query` closes with the line stating how long the queries took (`:query*` never prints it).'),
|
|
293
|
+
showPlugins: joi_1.default.boolean().optional().description('Whether `:version` grays out the plugins that did not activate during the last analysis.')
|
|
204
294
|
}).description('Configuration options for the REPL.'),
|
|
205
295
|
project: joi_1.default.object({
|
|
206
296
|
resolveUnknownPathsOnDisk: joi_1.default.boolean().optional().description('Whether to resolve unknown paths loaded by the r project disk when trying to source/analyze files.'),
|
|
207
|
-
basePackages: joi_1.default.array().items(joi_1.default.string()).optional().description('The packages considered part of R itself (base and recommended); if unset, flowR uses its built-in list.')
|
|
297
|
+
basePackages: joi_1.default.array().items(joi_1.default.string()).optional().description('The packages considered part of R itself (base and recommended); if unset, flowR uses its built-in list.'),
|
|
298
|
+
implicitSources: joi_1.default.array().items(joi_1.default.string()).optional().description('Files a framework loads on its own, without any source() call (e.g. global.R in a shiny app), in the order they are loaded; flowR orders the matching project files accordingly and analyzes them as one program. Entries are case-insensitive globs matched against the file path, a plain name matches any file with that name, and entries matching no project file are warned about. Usually set per project kind via specializeConfig.'),
|
|
299
|
+
useProjectType: joi_1.default.string().valid(...Object.values(project_kind_1.ProjectKind)).optional().description('Overwrite the project kind flowR would otherwise infer from the analyzed files, e.g. when auto-detection guesses wrong.')
|
|
208
300
|
}).description('Project specific configuration options.'),
|
|
301
|
+
linter: joi_1.default.object({
|
|
302
|
+
disabledRules: joi_1.default.array().items(joi_1.default.string()).description('Linting rule names excluded from the default rule set (a rule requested explicitly via a linter query still runs). Usually set per project kind via specializeConfig.')
|
|
303
|
+
}).description('Linter configuration options.'),
|
|
304
|
+
specializeConfig: joi_1.default.object().pattern(joi_1.default.string().valid(...Object.values(project_kind_1.ProjectKind)), joi_1.default.object({
|
|
305
|
+
inherit: joi_1.default.string().valid(...Object.values(project_kind_1.ProjectKind)).optional().description('Inherit another kind\'s overwrite first (merged before this entry\'s own keys, which win).')
|
|
306
|
+
}).unknown(true)).optional()
|
|
307
|
+
.description('Overwrite (parts of) the configuration depending on the project kind flowR detects, e.g. to give a shiny app its implicit sources.'),
|
|
209
308
|
engines: joi_1.default.array().items(joi_1.default.alternatives(joi_1.default.object({
|
|
210
309
|
type: joi_1.default.string().required().valid('tree-sitter').description('Use the tree sitter engine.'),
|
|
211
310
|
wasmPath: joi_1.default.string().optional().description('The path to the tree-sitter-r WASM binary to use. If this is undefined, this uses the default path.'),
|
|
@@ -222,7 +321,7 @@ exports.FlowrConfig = {
|
|
|
222
321
|
trackEnvironments: joi_1.default.boolean().optional().description('Track user-created environments (new.env, assign/get/local with envir=, dollar-assign, attach). When false, all envir-style calls fall through conservatively.'),
|
|
223
322
|
sigdb: joi_1.default.object({
|
|
224
323
|
enabled: joi_1.default.boolean().optional().description('Resolve library()/use() exports from a signature database (default true); when false no database is consulted.'),
|
|
225
|
-
loadProjectDependencies: joi_1.default.boolean().optional().description('Load the project\'s declared dependencies from its metadata files (DESCRIPTION Imports/Depends, renv.lock, rv.lock) (default true); when false these files are not read for dependencies.'),
|
|
324
|
+
loadProjectDependencies: joi_1.default.boolean().optional().description('Load the project\'s declared dependencies from its metadata files (DESCRIPTION Imports/Depends, rproject.toml, renv.lock, rv.lock) (default true); when false these files are not read for dependencies.'),
|
|
226
325
|
eagerlyLoad: joi_1.default.boolean().optional().description('Parse the database up front rather than on the first package load (default false, ignored if disabled).'),
|
|
227
326
|
eagerlyLoadExports: joi_1.default.boolean().optional().description('Add a vertex for every export on load rather than on demand (default false); keeps the dataflow graph small.'),
|
|
228
327
|
assumedRVersion: joi_1.default.string().optional().description('R version assumed when resolving versioned (base-R) exports: a pin like "4.5" or "auto" to detect the installed R (default "auto").'),
|
|
@@ -237,6 +336,9 @@ exports.FlowrConfig = {
|
|
|
237
336
|
versionSelection: joi_1.default.string().valid(...Object.values(VersionSelection)).optional().description('When a project constrains a dependency, resolve to the newest (default), oldest, or system-installed version satisfying it; system needs R and falls back to newest. Base-R packages always resolve against the assumed R version.'),
|
|
238
337
|
versionOverrides: joi_1.default.object().pattern(joi_1.default.string(), joi_1.default.string()).optional().description('Force an exact version for specific packages (name -> version), overriding both the project constraint and the versionSelection policy (default {}).')
|
|
239
338
|
}).description('Resolving library exports from a signature database.'),
|
|
339
|
+
versionManagement: joi_1.default.object({
|
|
340
|
+
linkedVersionGroups: joi_1.default.array().items(joi_1.default.array().items(joi_1.default.string())).optional().description('Groups of packages that must resolve to the same version; version guessing intersects each group so its members stay mutually compatible (default []).')
|
|
341
|
+
}).description('Policies for reasoning about dependency versions.'),
|
|
240
342
|
instrument: joi_1.default.object({
|
|
241
343
|
dataflowExtractors: joi_1.default.any().optional().description('These keys are only intended for use within code, allowing to instrument the dataflow analyzer!')
|
|
242
344
|
}),
|
|
@@ -246,7 +348,8 @@ exports.FlowrConfig = {
|
|
|
246
348
|
inferWorkingDirectory: joi_1.default.string().valid(...Object.values(InferWorkingDirectory)).description('Try to infer the working directory from the main or any script to analyze.'),
|
|
247
349
|
searchPath: joi_1.default.array().items(joi_1.default.string()).description('Additionally search in these paths.'),
|
|
248
350
|
repeatedSourceLimit: joi_1.default.number().optional().description('How often the same file can be sourced within a single run? Please be aware: in case of cyclic sources this may not reach a fixpoint so give this a sensible limit.'),
|
|
249
|
-
applyReplacements: joi_1.default.array().items(joi_1.default.object()).description('Provide name replacements for loaded files')
|
|
351
|
+
applyReplacements: joi_1.default.array().items(joi_1.default.object()).description('Provide name replacements for loaded files'),
|
|
352
|
+
assumeFilesExist: joi_1.default.boolean().optional().description('Assume a sourced file is always there, making what it defines certain instead of conditional on the source call.')
|
|
250
353
|
}).optional().description('If lax source calls are active, flowR searches for sourced files much more freely, based on the configurations you give it. This option is only in effect if `ignoreSourceCalls` is set to false.'),
|
|
251
354
|
slicer: joi_1.default.object({
|
|
252
355
|
threshold: joi_1.default.number().optional().description('The maximum number of iterations to perform on a single function call during slicing.'),
|
|
@@ -287,7 +390,7 @@ exports.FlowrConfig = {
|
|
|
287
390
|
const validate = exports.FlowrConfig.Schema.validate(parsed);
|
|
288
391
|
if (!validate.error) {
|
|
289
392
|
// assign default values to all config options except for the specified ones
|
|
290
|
-
return (
|
|
393
|
+
return mergeConfigOntoDefaults(exports.FlowrConfig.default(), parsed);
|
|
291
394
|
}
|
|
292
395
|
else {
|
|
293
396
|
log_1.log.error(`Failed to validate config ${jsonString}: ${validate.error.message}`);
|
|
@@ -319,13 +422,32 @@ exports.FlowrConfig = {
|
|
|
319
422
|
* This is mostly useful for user-facing features.
|
|
320
423
|
*/
|
|
321
424
|
fromFile(configFile, configWorkingDirectory = process.cwd()) {
|
|
425
|
+
let config;
|
|
322
426
|
try {
|
|
323
|
-
|
|
427
|
+
config = loadConfigFromFile(configFile, configWorkingDirectory);
|
|
324
428
|
}
|
|
325
429
|
catch (e) {
|
|
326
430
|
log_1.log.error(`Failed to load config: ${e.message}`);
|
|
327
|
-
|
|
431
|
+
config = exports.FlowrConfig.default();
|
|
328
432
|
}
|
|
433
|
+
if (config.logLevel !== undefined) {
|
|
434
|
+
(0, log_1.setLogLevel)(config.logLevel);
|
|
435
|
+
}
|
|
436
|
+
return config;
|
|
437
|
+
},
|
|
438
|
+
/**
|
|
439
|
+
* Resolves the configuration for the given {@link ProjectKind} by applying the matching
|
|
440
|
+
* {@link FlowrConfig.specializeConfig} entry to every key it names. What you configured wins over the entry, which in
|
|
441
|
+
* turn wins over flowR's default; a value that differs from the default counts as configured.
|
|
442
|
+
* Returns `config` itself if the kind has no entry, so callers can use this freely.
|
|
443
|
+
*/
|
|
444
|
+
forKind(config, kind) {
|
|
445
|
+
const overwrite = exports.FlowrConfig.specializationFor(config, kind);
|
|
446
|
+
return overwrite ? specialize(config, exports.FlowrConfig.default(), overwrite) : config;
|
|
447
|
+
},
|
|
448
|
+
/** The overwrite {@link FlowrConfig.forKind} applies for `kind` (with {@link SpecializeConfigEntry.inherit} resolved), or `undefined`. */
|
|
449
|
+
specializationFor(config, kind) {
|
|
450
|
+
return resolveSpecialization(config.specializeConfig, kind);
|
|
329
451
|
},
|
|
330
452
|
/**
|
|
331
453
|
* Gets the configuration for the given engine type from the config.
|
|
@@ -477,8 +477,8 @@ export declare class ControlFlowGraph<Vertex extends CfgVertex = CfgVertex> impl
|
|
|
477
477
|
private readonly bbChildren;
|
|
478
478
|
/** basic block agnostic edges */
|
|
479
479
|
private readonly edgeInfos;
|
|
480
|
-
/** reverse edges for bidirectional mapping */
|
|
481
|
-
private
|
|
480
|
+
/** reverse edges for bidirectional mapping, derived from `edgeInfos` on the first ingoing lookup */
|
|
481
|
+
private revEdgeInfos;
|
|
482
482
|
/** used as an optimization to avoid unnecessary lookups */
|
|
483
483
|
private _mayBB;
|
|
484
484
|
/**
|
|
@@ -492,6 +492,7 @@ export declare class ControlFlowGraph<Vertex extends CfgVertex = CfgVertex> impl
|
|
|
492
492
|
* @see {@link ControlFlowGraph#addEdges|addEdges()} - to add multiple edges at once
|
|
493
493
|
*/
|
|
494
494
|
addEdge(from: NodeId, to: NodeId, edge: CfgEdge): this;
|
|
495
|
+
private reverse;
|
|
495
496
|
/**
|
|
496
497
|
* Add multiple edges from a given source vertex to the control flow graph.
|
|
497
498
|
*/
|
|
@@ -554,8 +554,8 @@ class ControlFlowGraph {
|
|
|
554
554
|
bbChildren = new Map();
|
|
555
555
|
/** basic block agnostic edges */
|
|
556
556
|
edgeInfos = new Map();
|
|
557
|
-
/** reverse edges for bidirectional mapping */
|
|
558
|
-
revEdgeInfos
|
|
557
|
+
/** reverse edges for bidirectional mapping, derived from `edgeInfos` on the first ingoing lookup */
|
|
558
|
+
revEdgeInfos;
|
|
559
559
|
/** used as an optimization to avoid unnecessary lookups */
|
|
560
560
|
_mayBB = false;
|
|
561
561
|
/**
|
|
@@ -596,15 +596,34 @@ class ControlFlowGraph {
|
|
|
596
596
|
else {
|
|
597
597
|
edgesFrom.set(to, edge);
|
|
598
598
|
}
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
599
|
+
if (this.revEdgeInfos) {
|
|
600
|
+
const edgesTo = this.revEdgeInfos.get(to);
|
|
601
|
+
if (!edgesTo) {
|
|
602
|
+
this.revEdgeInfos.set(to, new Map([[from, edge]]));
|
|
603
|
+
}
|
|
604
|
+
else {
|
|
605
|
+
edgesTo.set(from, edge);
|
|
606
|
+
}
|
|
605
607
|
}
|
|
606
608
|
return this;
|
|
607
609
|
}
|
|
610
|
+
reverse() {
|
|
611
|
+
if (this.revEdgeInfos === undefined) {
|
|
612
|
+
this.revEdgeInfos = new Map();
|
|
613
|
+
for (const [from, edges] of this.edgeInfos) {
|
|
614
|
+
for (const [to, edge] of edges) {
|
|
615
|
+
const edgesTo = this.revEdgeInfos.get(to);
|
|
616
|
+
if (!edgesTo) {
|
|
617
|
+
this.revEdgeInfos.set(to, new Map([[from, edge]]));
|
|
618
|
+
}
|
|
619
|
+
else {
|
|
620
|
+
edgesTo.set(from, edge);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
return this.revEdgeInfos;
|
|
626
|
+
}
|
|
608
627
|
/**
|
|
609
628
|
* Add multiple edges from a given source vertex to the control flow graph.
|
|
610
629
|
*/
|
|
@@ -618,7 +637,7 @@ class ControlFlowGraph {
|
|
|
618
637
|
return this.edgeInfos.get(node);
|
|
619
638
|
}
|
|
620
639
|
ingoingEdges(node) {
|
|
621
|
-
return this.
|
|
640
|
+
return this.reverse().get(node);
|
|
622
641
|
}
|
|
623
642
|
rootIds() {
|
|
624
643
|
return this.roots;
|
|
@@ -689,15 +708,16 @@ class ControlFlowGraph {
|
|
|
689
708
|
* @see {@link ControlFlowGraph#removeEdge|removeEdge()} - to remove a specific edge
|
|
690
709
|
*/
|
|
691
710
|
removeVertex(id) {
|
|
711
|
+
const rev = this.reverse();
|
|
692
712
|
for (const to of this.edgeInfos.get(id)?.keys() ?? []) {
|
|
693
|
-
|
|
713
|
+
rev.get(to)?.delete(id);
|
|
694
714
|
}
|
|
695
|
-
for (const from of
|
|
715
|
+
for (const from of rev.get(id)?.keys() ?? []) {
|
|
696
716
|
this.edgeInfos.get(from)?.delete(id);
|
|
697
717
|
}
|
|
698
718
|
this.vtxInfos.delete(id);
|
|
699
719
|
this.edgeInfos.delete(id);
|
|
700
|
-
|
|
720
|
+
rev.delete(id);
|
|
701
721
|
this.bbChildren.delete(id);
|
|
702
722
|
// remove all bbChildren with id as target
|
|
703
723
|
for (const [a, b] of this.bbChildren.entries()) {
|
|
@@ -721,11 +741,11 @@ class ControlFlowGraph {
|
|
|
721
741
|
this.edgeInfos.delete(from);
|
|
722
742
|
}
|
|
723
743
|
}
|
|
724
|
-
const edgesTo = this.revEdgeInfos
|
|
744
|
+
const edgesTo = this.revEdgeInfos?.get(to);
|
|
725
745
|
if (edgesTo) {
|
|
726
746
|
edgesTo.delete(from);
|
|
727
747
|
if (edgesTo.size === 0) {
|
|
728
|
-
this.revEdgeInfos
|
|
748
|
+
this.revEdgeInfos?.delete(to);
|
|
729
749
|
}
|
|
730
750
|
}
|
|
731
751
|
return this;
|
|
@@ -265,6 +265,8 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
265
265
|
case built_in_proc_name_1.BuiltInProcName.S7MakeConstructor:
|
|
266
266
|
case built_in_proc_name_1.BuiltInProcName.DefineArgument:
|
|
267
267
|
return this.onDefaultFunctionCall({ call });
|
|
268
|
+
case built_in_proc_name_1.BuiltInProcName.Load:
|
|
269
|
+
return this.onLoadCall({ call });
|
|
268
270
|
default:
|
|
269
271
|
(0, assert_1.assertUnreachable)(origin);
|
|
270
272
|
}
|
|
@@ -642,6 +644,7 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
642
644
|
}
|
|
643
645
|
return { target: undefined, source: undefined };
|
|
644
646
|
}
|
|
647
|
+
onLoadCall(_param) { }
|
|
645
648
|
}
|
|
646
649
|
exports.SemanticCfgGuidedVisitor = SemanticCfgGuidedVisitor;
|
|
647
650
|
//# sourceMappingURL=semantic-cfg-guided-visitor.js.map
|