@eagleoutice/flowr 2.12.3 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -91
- 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 +10 -0
- package/cli/common/options.js +2 -0
- package/cli/common/scripts-info.d.ts +10 -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-query.js +42 -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 +2 -0
- package/cli/slicer-app.js +2 -1
- package/config.d.ts +54 -6
- package/config.js +133 -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 +29 -16
- package/documentation/wiki-mk/doc-maker.js +1 -1
- package/documentation/wiki-query.js +189 -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 +59 -1
- package/project/context/flowr-analyzer-context.js +118 -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 +32 -0
- package/project/context/flowr-analyzer-files-context.js +132 -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 +166 -0
- package/project/dependency-version-space.js +564 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/flowr-analyzer.d.ts +4 -0
- package/project/flowr-analyzer.js +5 -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 +15 -6
- package/queries/catalog/config-query/config-query-format.d.ts +18 -4
- package/queries/catalog/config-query/config-query-format.js +246 -96
- 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 +277 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +119 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +331 -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 +63 -3
- 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 +16 -0
- package/util/schema.js +89 -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
package/cli/slicer-app.d.ts
CHANGED
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
|
});
|
|
@@ -33,7 +34,7 @@ async function getSlice() {
|
|
|
33
34
|
const config = config_1.FlowrConfig.fromFile();
|
|
34
35
|
await slicer.init(options['input-is-text']
|
|
35
36
|
? { 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']);
|
|
37
|
+
: { 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
38
|
let mappedSlices = [];
|
|
38
39
|
let reconstruct = undefined;
|
|
39
40
|
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,6 +146,12 @@ 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 */
|
|
@@ -142,7 +161,25 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
142
161
|
* unset, flowR derives them (for the assumed R version) from the signature database via `baseRPackages`.
|
|
143
162
|
*/
|
|
144
163
|
basePackages?: string[];
|
|
164
|
+
/**
|
|
165
|
+
* Files a framework loads on its own, without any `source()` call (e.g. `global.R` in a shiny app), in load
|
|
166
|
+
* order. Entries are case-insensitive globs (`R/*.R`) matched against the path, a plain name matches any file
|
|
167
|
+
* with that name; entries matching nothing are warned about. Usually set per {@link ProjectKind} via
|
|
168
|
+
* {@link FlowrConfig.specializeConfig}.
|
|
169
|
+
*/
|
|
170
|
+
implicitSources?: string[];
|
|
171
|
+
};
|
|
172
|
+
/** Linter configuration, usually specialized per {@link ProjectKind} via {@link FlowrConfig.specializeConfig}. */
|
|
173
|
+
readonly linter: {
|
|
174
|
+
/** Rule names excluded from the *default* rule set (a rule requested explicitly still runs). */
|
|
175
|
+
readonly disabledRules: string[];
|
|
145
176
|
};
|
|
177
|
+
/**
|
|
178
|
+
* Overwrite (parts of) this configuration depending on the {@link ProjectKind} flowR detects for the project,
|
|
179
|
+
* e.g. to give a shiny app its implicit sources. An entry may `inherit` another kind's overwrite (merged first,
|
|
180
|
+
* with the entry's own keys winning) to avoid repeating it. Resolve it with {@link FlowrConfig.forKind}.
|
|
181
|
+
*/
|
|
182
|
+
readonly specializeConfig?: Partial<Record<ProjectKind, SpecializeConfigEntry>>;
|
|
146
183
|
/**
|
|
147
184
|
* The engines to use for interacting with R code. Currently, supports {@link TreeSitterEngineConfig} and {@link RShellEngineConfig}.
|
|
148
185
|
* An empty array means all available engines will be used.
|
|
@@ -170,9 +207,9 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
170
207
|
readonly trackEnvironments: boolean;
|
|
171
208
|
/** Resolving `library()`/`use()` exports from a signature database (e.g. the bundled `flowr-sigdb`). */
|
|
172
209
|
readonly sigdb: {
|
|
173
|
-
/** Resolve library exports from a
|
|
210
|
+
/** Resolve library exports from a signature database (default `true`); when `false` no database is consulted. */
|
|
174
211
|
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. */
|
|
212
|
+
/** 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
213
|
readonly loadProjectDependencies: boolean;
|
|
177
214
|
/** Parse the database up front rather than on the first package load (default `false`, ignored if disabled). */
|
|
178
215
|
readonly eagerlyLoad: boolean;
|
|
@@ -205,6 +242,11 @@ export interface FlowrConfig extends MergeableRecord {
|
|
|
205
242
|
/** 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
243
|
readonly versionOverrides?: Record<string, string>;
|
|
207
244
|
};
|
|
245
|
+
/** Policies for reasoning about dependency versions (independent of how the signature database is loaded). */
|
|
246
|
+
readonly versionManagement?: {
|
|
247
|
+
/** 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 `[]`). */
|
|
248
|
+
readonly linkedVersionGroups?: string[][];
|
|
249
|
+
};
|
|
208
250
|
/** These keys are only intended for use within code, allowing to instrument the dataflow analyzer! */
|
|
209
251
|
readonly instrument: {
|
|
210
252
|
/**
|
|
@@ -318,9 +360,6 @@ export type KnownEngines = {
|
|
|
318
360
|
[T in EngineConfig['type']]?: KnownParser;
|
|
319
361
|
};
|
|
320
362
|
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
363
|
export declare const FlowrConfig: {
|
|
325
364
|
readonly name: "FlowrConfig";
|
|
326
365
|
/**
|
|
@@ -351,6 +390,15 @@ export declare const FlowrConfig: {
|
|
|
351
390
|
* This is mostly useful for user-facing features.
|
|
352
391
|
*/
|
|
353
392
|
readonly fromFile: (this: void, configFile?: string, configWorkingDirectory?: string) => FlowrConfig;
|
|
393
|
+
/**
|
|
394
|
+
* Resolves the configuration for the given {@link ProjectKind} by applying the matching
|
|
395
|
+
* {@link FlowrConfig.specializeConfig} entry to every key it names. What you configured wins over the entry, which in
|
|
396
|
+
* turn wins over flowR's default; a value that differs from the default counts as configured.
|
|
397
|
+
* Returns `config` itself if the kind has no entry, so callers can use this freely.
|
|
398
|
+
*/
|
|
399
|
+
readonly forKind: (this: void, config: FlowrConfig, kind: ProjectKind) => FlowrConfig;
|
|
400
|
+
/** The overwrite {@link FlowrConfig.forKind} applies for `kind` (with {@link SpecializeConfigEntry.inherit} resolved), or `undefined`. */
|
|
401
|
+
readonly specializationFor: (this: void, config: FlowrConfig, kind: ProjectKind) => DeepPartial<FlowrConfig> | undefined;
|
|
354
402
|
/**
|
|
355
403
|
* Gets the configuration for the given engine type from the config.
|
|
356
404
|
*/
|
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,23 @@ 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.')
|
|
208
299
|
}).description('Project specific configuration options.'),
|
|
300
|
+
linter: joi_1.default.object({
|
|
301
|
+
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.')
|
|
302
|
+
}).description('Linter configuration options.'),
|
|
303
|
+
specializeConfig: joi_1.default.object().pattern(joi_1.default.string().valid(...Object.values(project_kind_1.ProjectKind)), joi_1.default.object({
|
|
304
|
+
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).')
|
|
305
|
+
}).unknown(true)).optional()
|
|
306
|
+
.description('Overwrite (parts of) the configuration depending on the project kind flowR detects, e.g. to give a shiny app its implicit sources.'),
|
|
209
307
|
engines: joi_1.default.array().items(joi_1.default.alternatives(joi_1.default.object({
|
|
210
308
|
type: joi_1.default.string().required().valid('tree-sitter').description('Use the tree sitter engine.'),
|
|
211
309
|
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 +320,7 @@ exports.FlowrConfig = {
|
|
|
222
320
|
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
321
|
sigdb: joi_1.default.object({
|
|
224
322
|
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.'),
|
|
323
|
+
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
324
|
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
325
|
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
326
|
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 +335,9 @@ exports.FlowrConfig = {
|
|
|
237
335
|
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
336
|
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
337
|
}).description('Resolving library exports from a signature database.'),
|
|
338
|
+
versionManagement: joi_1.default.object({
|
|
339
|
+
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 []).')
|
|
340
|
+
}).description('Policies for reasoning about dependency versions.'),
|
|
240
341
|
instrument: joi_1.default.object({
|
|
241
342
|
dataflowExtractors: joi_1.default.any().optional().description('These keys are only intended for use within code, allowing to instrument the dataflow analyzer!')
|
|
242
343
|
}),
|
|
@@ -246,7 +347,8 @@ exports.FlowrConfig = {
|
|
|
246
347
|
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
348
|
searchPath: joi_1.default.array().items(joi_1.default.string()).description('Additionally search in these paths.'),
|
|
248
349
|
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')
|
|
350
|
+
applyReplacements: joi_1.default.array().items(joi_1.default.object()).description('Provide name replacements for loaded files'),
|
|
351
|
+
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
352
|
}).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
353
|
slicer: joi_1.default.object({
|
|
252
354
|
threshold: joi_1.default.number().optional().description('The maximum number of iterations to perform on a single function call during slicing.'),
|
|
@@ -287,7 +389,7 @@ exports.FlowrConfig = {
|
|
|
287
389
|
const validate = exports.FlowrConfig.Schema.validate(parsed);
|
|
288
390
|
if (!validate.error) {
|
|
289
391
|
// assign default values to all config options except for the specified ones
|
|
290
|
-
return (
|
|
392
|
+
return mergeConfigOntoDefaults(exports.FlowrConfig.default(), parsed);
|
|
291
393
|
}
|
|
292
394
|
else {
|
|
293
395
|
log_1.log.error(`Failed to validate config ${jsonString}: ${validate.error.message}`);
|
|
@@ -319,13 +421,32 @@ exports.FlowrConfig = {
|
|
|
319
421
|
* This is mostly useful for user-facing features.
|
|
320
422
|
*/
|
|
321
423
|
fromFile(configFile, configWorkingDirectory = process.cwd()) {
|
|
424
|
+
let config;
|
|
322
425
|
try {
|
|
323
|
-
|
|
426
|
+
config = loadConfigFromFile(configFile, configWorkingDirectory);
|
|
324
427
|
}
|
|
325
428
|
catch (e) {
|
|
326
429
|
log_1.log.error(`Failed to load config: ${e.message}`);
|
|
327
|
-
|
|
430
|
+
config = exports.FlowrConfig.default();
|
|
328
431
|
}
|
|
432
|
+
if (config.logLevel !== undefined) {
|
|
433
|
+
(0, log_1.setLogLevel)(config.logLevel);
|
|
434
|
+
}
|
|
435
|
+
return config;
|
|
436
|
+
},
|
|
437
|
+
/**
|
|
438
|
+
* Resolves the configuration for the given {@link ProjectKind} by applying the matching
|
|
439
|
+
* {@link FlowrConfig.specializeConfig} entry to every key it names. What you configured wins over the entry, which in
|
|
440
|
+
* turn wins over flowR's default; a value that differs from the default counts as configured.
|
|
441
|
+
* Returns `config` itself if the kind has no entry, so callers can use this freely.
|
|
442
|
+
*/
|
|
443
|
+
forKind(config, kind) {
|
|
444
|
+
const overwrite = exports.FlowrConfig.specializationFor(config, kind);
|
|
445
|
+
return overwrite ? specialize(config, exports.FlowrConfig.default(), overwrite) : config;
|
|
446
|
+
},
|
|
447
|
+
/** The overwrite {@link FlowrConfig.forKind} applies for `kind` (with {@link SpecializeConfigEntry.inherit} resolved), or `undefined`. */
|
|
448
|
+
specializationFor(config, kind) {
|
|
449
|
+
return resolveSpecialization(config.specializeConfig, kind);
|
|
329
450
|
},
|
|
330
451
|
/**
|
|
331
452
|
* 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
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { internalPrinter } from '../../../print/print';
|
|
2
2
|
import { PipelineStepStage } from '../../pipeline-step';
|
|
3
3
|
import type { SliceResult } from '../../../../slicing/static/slicer-types';
|
|
4
|
+
import { type InlineFull } from '../../../../reconstruct/reconstruct';
|
|
4
5
|
import type { NormalizedAst } from '../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
6
|
import type { AutoSelectPredicate } from '../../../../reconstruct/auto-select/auto-select-defaults';
|
|
6
7
|
import type { DataflowInformation } from '../../../../dataflow/info';
|
|
@@ -19,6 +20,11 @@ export interface ReconstructRequiredInput {
|
|
|
19
20
|
* Cyclic and unresolvable `source()` calls are kept verbatim and reported via `reconstruct.inlineWarnings`.
|
|
20
21
|
*/
|
|
21
22
|
inlineSources?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Inline *every* file into the reconstruction, in flowR's loading order (which respects implicit sources).
|
|
25
|
+
* Overrides {@link inlineSources} and {@link reconstructFiles}.
|
|
26
|
+
*/
|
|
27
|
+
inlineFull?: InlineFull;
|
|
22
28
|
}
|
|
23
29
|
declare function processor(results: {
|
|
24
30
|
normalize?: NormalizedAst;
|
|
@@ -6,11 +6,13 @@ const reconstruct_1 = require("../../../../reconstruct/reconstruct");
|
|
|
6
6
|
const source_inline_map_1 = require("../../../../reconstruct/inline/source-inline-map");
|
|
7
7
|
function processor(results, input) {
|
|
8
8
|
const normalize = results.normalize;
|
|
9
|
+
const inline = input.inlineSources || input.inlineFull;
|
|
9
10
|
return (0, reconstruct_1.reconstructToCode)(normalize, {
|
|
10
11
|
nodes: results.slice.result,
|
|
11
12
|
reconstructFiles: input.reconstructFiles,
|
|
12
13
|
inlineSources: input.inlineSources,
|
|
13
|
-
|
|
14
|
+
inlineFull: input.inlineFull,
|
|
15
|
+
sourceMap: inline ? source_inline_map_1.SourceInlineMap.build(normalize, results.dataflow.graph) : undefined
|
|
14
16
|
}, input.autoSelectIf);
|
|
15
17
|
}
|
|
16
18
|
exports.NAIVE_RECONSTRUCT = {
|