@eagleoutice/flowr 2.12.2 → 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
|
@@ -20,6 +20,71 @@ const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
|
20
20
|
const r_project_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-project");
|
|
21
21
|
const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
|
|
22
22
|
exports.Unknown = 'unknown';
|
|
23
|
+
/** packages a default R session attaches without an explicit `library()` call, so missing them is not "undeclared" */
|
|
24
|
+
const AttachedBasePackages = ['base', 'stats', 'graphics', 'grDevices', 'utils', 'datasets', 'methods'];
|
|
25
|
+
/** {@link LibraryFunctions} indexed by name, to recognise a library-load call by its called function */
|
|
26
|
+
const LibraryLoadFunctionInfo = new Map(library_functions_1.LibraryFunctions.map(f => [f.name, f]));
|
|
27
|
+
/** the literal package name of a `library()`/`require()`-style argument (a bare symbol or a plain string constant) */
|
|
28
|
+
function literalPackageName(node) {
|
|
29
|
+
if (node?.type === type_1.RType.String) {
|
|
30
|
+
return node.content.str;
|
|
31
|
+
}
|
|
32
|
+
else if (node?.type === type_1.RType.Symbol) {
|
|
33
|
+
return identifier_1.Identifier.getName(node.content);
|
|
34
|
+
}
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
/** the argument value(s) of a library-load call that (statically) name the package(s) to load, per the matching {@link FunctionInfo} */
|
|
38
|
+
function libraryCallArgumentValues(args, info) {
|
|
39
|
+
const values = [];
|
|
40
|
+
let position = 0;
|
|
41
|
+
for (const arg of args) {
|
|
42
|
+
if (typeof arg !== 'string' && arg.value !== undefined) {
|
|
43
|
+
if (info.argIdx === 'unnamed') {
|
|
44
|
+
if (arg.name === undefined) {
|
|
45
|
+
values.push(arg.value);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (arg.name !== undefined ? identifier_1.Identifier.getName(arg.name.content) === info.argName : position === info.argIdx) {
|
|
49
|
+
values.push(arg.value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
position++;
|
|
53
|
+
}
|
|
54
|
+
return values;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The packages used by the code: attached via a `library()`-style call, or referenced via `::`/`:::`.
|
|
58
|
+
* Maps each package name to the node id of one representative use site.
|
|
59
|
+
*
|
|
60
|
+
* This deliberately re-walks the AST instead of depending on the `library` category's result array: categories
|
|
61
|
+
* run concurrently (see the executor's `Promise.all`), so another category's finished results are not available.
|
|
62
|
+
* Only statically known package names are picked up (a bare symbol or string literal argument), matching the
|
|
63
|
+
* `library` category's own `::`/`:::` detection in spirit but staying independent of it.
|
|
64
|
+
*/
|
|
65
|
+
async function collectUsedPackages(data) {
|
|
66
|
+
const used = new Map();
|
|
67
|
+
r_project_1.RProject.visitAst((await data.analyzer.normalize()).ast, node => {
|
|
68
|
+
if (node.type === type_1.RType.Symbol) {
|
|
69
|
+
const ns = identifier_1.Identifier.getNamespace(node.content);
|
|
70
|
+
if (ns !== undefined && !used.has(ns)) {
|
|
71
|
+
used.set(ns, node.info.id);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
else if (node.type === type_1.RType.FunctionCall && node.named) {
|
|
75
|
+
const info = LibraryLoadFunctionInfo.get(identifier_1.Identifier.getName(node.functionName.content));
|
|
76
|
+
if (info !== undefined) {
|
|
77
|
+
for (const value of libraryCallArgumentValues(node.arguments, info)) {
|
|
78
|
+
const pkg = literalPackageName(value);
|
|
79
|
+
if (pkg !== undefined && !used.has(pkg)) {
|
|
80
|
+
used.set(pkg, node.info.id);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
return used;
|
|
87
|
+
}
|
|
23
88
|
exports.DefaultDependencyCategories = {
|
|
24
89
|
'library': {
|
|
25
90
|
queryDisplayName: 'Libraries',
|
|
@@ -68,27 +133,58 @@ exports.DefaultDependencyCategories = {
|
|
|
68
133
|
'test': {
|
|
69
134
|
queryDisplayName: 'Tests',
|
|
70
135
|
functions: test_functions_1.TestFunctions
|
|
136
|
+
},
|
|
137
|
+
'undeclared': {
|
|
138
|
+
queryDisplayName: 'Undeclared Dependencies',
|
|
139
|
+
functions: [],
|
|
140
|
+
/* packages that are used (via `library()`/`require()` or `::`/`:::`) but never declared as a project dependency */
|
|
141
|
+
additionalAnalysis: async (data, ignoreDefault, _functions, _queryResults, result) => {
|
|
142
|
+
if (ignoreDefault) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
const deps = data.analyzer.inspectContext().deps;
|
|
146
|
+
const declared = new Set(deps.getDependencies().map(p => p.name));
|
|
147
|
+
for (const [pkg, nodeId] of await collectUsedPackages(data)) {
|
|
148
|
+
if (!declared.has(pkg) && !AttachedBasePackages.includes(pkg)) {
|
|
149
|
+
result.push({ nodeId, functionName: pkg, value: pkg });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
'unused': {
|
|
155
|
+
queryDisplayName: 'Unused Dependencies',
|
|
156
|
+
functions: [],
|
|
157
|
+
/* packages declared as a project dependency but never used (via `library()`/`require()` or `::`/`:::`) */
|
|
158
|
+
additionalAnalysis: async (data, ignoreDefault, _functions, _queryResults, result) => {
|
|
159
|
+
if (ignoreDefault) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
const deps = data.analyzer.inspectContext().deps;
|
|
163
|
+
const used = await collectUsedPackages(data);
|
|
164
|
+
const nodeId = (await data.analyzer.normalize()).ast.files[0]?.root.info.id;
|
|
165
|
+
if (nodeId === undefined) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
for (const pkg of deps.getDependencies()) {
|
|
169
|
+
if (!used.has(pkg.name)) {
|
|
170
|
+
result.push({ nodeId, functionName: pkg.name, value: pkg.name });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
71
174
|
}
|
|
72
175
|
};
|
|
73
|
-
function printResultSection(title, infos, result) {
|
|
176
|
+
function printResultSection(title, infos, result, formatter) {
|
|
74
177
|
if (infos.length <= 0) {
|
|
75
178
|
return;
|
|
76
179
|
}
|
|
77
|
-
result.push(`
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
groups.set(key, [i]);
|
|
86
|
-
}
|
|
87
|
-
return groups;
|
|
88
|
-
}, new Map());
|
|
89
|
-
for (const [functionName, infos] of grouped) {
|
|
90
|
-
result.push(` ╰ \`${functionName}\``);
|
|
91
|
-
result.push(infos.map(i => ` ╰ Node Id: ${i.nodeId}${i.value !== undefined ? `, \`${i.value}\`` : ''}${i.derivedVersion !== undefined ? `, Version: \`${i.derivedVersion.format()}\`` : ''}${i.linkedIds ? `, linked: [${i.linkedIds.join(', ')}]` : ''}`).join('\n'));
|
|
180
|
+
result.push(` ${(0, ansi_1.bold)(title, formatter)} ${(0, ansi_1.faint)(`(${infos.length})`, formatter)}`);
|
|
181
|
+
// one line per dependency: the value (package/file) up front, its function + node as a faint provenance suffix
|
|
182
|
+
for (const i of infos) {
|
|
183
|
+
const fn = identifier_1.Identifier.getName(i.functionName);
|
|
184
|
+
const value = i.value !== undefined ? (0, ansi_1.bold)(i.value, formatter) : (0, ansi_1.faint)('<unresolved>', formatter);
|
|
185
|
+
const version = i.derivedVersion !== undefined ? ` ${(0, ansi_1.faint)(i.derivedVersion.format(), formatter)}` : '';
|
|
186
|
+
const linked = i.linkedIds ? `, linked ${i.linkedIds.join(', ')}` : '';
|
|
187
|
+
result.push(` ${value}${version} ${(0, ansi_1.faint)(`via ${fn} (node ${i.nodeId}${linked})`, formatter)}`);
|
|
92
188
|
}
|
|
93
189
|
}
|
|
94
190
|
/**
|
|
@@ -110,12 +206,16 @@ const functionInfoSchema = joi_1.default.array().items(joi_1.default.object({
|
|
|
110
206
|
argName: joi_1.default.string().optional().description('The name of the argument that contains the library name.'),
|
|
111
207
|
})).optional();
|
|
112
208
|
exports.DependenciesQueryDefinition = {
|
|
209
|
+
title: 'Dependencies Query',
|
|
113
210
|
executor: dependencies_query_executor_1.executeDependenciesQuery,
|
|
114
211
|
asciiSummarizer: (formatter, _analyzer, queryResults, result, queries) => {
|
|
115
212
|
const out = queryResults;
|
|
116
213
|
result.push(`Query: ${(0, ansi_1.bold)('dependencies', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
117
214
|
for (const [category, value] of Object.entries(getAllCategories(queries))) {
|
|
118
|
-
|
|
215
|
+
if (category === 'unused') {
|
|
216
|
+
continue; // the unused-dependency detection is unreliable; omit it from the summary for now
|
|
217
|
+
}
|
|
218
|
+
printResultSection(value.queryDisplayName ?? category, out[category] ?? [], result, formatter);
|
|
119
219
|
}
|
|
120
220
|
return true;
|
|
121
221
|
},
|
|
@@ -2,10 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeDiceQuery = executeDiceQuery;
|
|
4
4
|
const static_slicer_1 = require("../../../slicing/static/static-slicer");
|
|
5
|
-
const
|
|
6
|
-
const auto_select_defaults_1 = require("../../../reconstruct/auto-select/auto-select-defaults");
|
|
7
|
-
const magic_comments_1 = require("../../../reconstruct/auto-select/magic-comments");
|
|
8
|
-
const parse_1 = require("../../../slicing/criterion/parse");
|
|
5
|
+
const slice_query_options_1 = require("../slice-query-options");
|
|
9
6
|
const log_1 = require("../../../util/log");
|
|
10
7
|
/**
|
|
11
8
|
* Execute dice queries. Each dice computes the intersection of a forward slice from `from`
|
|
@@ -23,18 +20,18 @@ async function executeDiceQuery({ analyzer }, queries) {
|
|
|
23
20
|
log_1.log.warn(`Duplicate key for dice-query: ${key}, skipping...`);
|
|
24
21
|
continue;
|
|
25
22
|
}
|
|
26
|
-
const { from, to, noReconstruction,
|
|
27
|
-
const startIds =
|
|
28
|
-
const endIds =
|
|
23
|
+
const { from, to, noReconstruction, includeCallees } = query;
|
|
24
|
+
const startIds = (0, slice_query_options_1.resolveSliceCriteria)(from, ast);
|
|
25
|
+
const endIds = (0, slice_query_options_1.resolveSliceCriteria)(to, ast);
|
|
29
26
|
const sliceStart = Date.now();
|
|
30
|
-
const slice = (0, static_slicer_1.staticDice)(analyzer.inspectContext(), df, ast, startIds, endIds, analyzer.flowrConfig.solver.slicer?.threshold);
|
|
27
|
+
const slice = (0, static_slicer_1.staticDice)(analyzer.inspectContext(), df, ast, startIds, endIds, analyzer.flowrConfig.solver.slicer?.threshold, includeCallees);
|
|
31
28
|
const sliceEnd = Date.now();
|
|
32
29
|
if (noReconstruction) {
|
|
33
30
|
results[key] = { slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } } };
|
|
34
31
|
}
|
|
35
32
|
else {
|
|
36
33
|
const reconstructStart = Date.now();
|
|
37
|
-
const reconstruct = (0,
|
|
34
|
+
const reconstruct = (0, slice_query_options_1.reconstructSlice)(ast, df.graph, slice.result, query);
|
|
38
35
|
const reconstructEnd = Date.now();
|
|
39
36
|
results[key] = {
|
|
40
37
|
slice: { ...slice, '.meta': { timing: sliceEnd - sliceStart } },
|
|
@@ -7,20 +7,17 @@ import { executeDiceQuery } from './dice-query-executor';
|
|
|
7
7
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
8
|
import type { CommandCompletions } from '../../../cli/repl/core';
|
|
9
9
|
import type { FlowrConfig } from '../../../config';
|
|
10
|
+
import { type SliceQueryOptions } from '../slice-query-options';
|
|
10
11
|
/**
|
|
11
12
|
* Computes a program dice: only those parts that lie on a path from the given start nodes to the given end nodes.
|
|
12
13
|
* Equivalent to the intersection of a forward slice from `from` and a backward slice from `to`.
|
|
13
14
|
*/
|
|
14
|
-
export interface DiceQuery extends BaseQueryFormat {
|
|
15
|
+
export interface DiceQuery extends BaseQueryFormat, SliceQueryOptions {
|
|
15
16
|
readonly type: 'dice';
|
|
16
17
|
/** Slicing criteria for the start of the dice (forward slice seeds) */
|
|
17
18
|
readonly from: SlicingCriteria;
|
|
18
19
|
/** Slicing criteria for the end of the dice (backward slice seeds) */
|
|
19
20
|
readonly to: SlicingCriteria;
|
|
20
|
-
/** Do not reconstruct the dice into readable code */
|
|
21
|
-
readonly noReconstruction?: boolean;
|
|
22
|
-
/** Should magic comments be ignored? */
|
|
23
|
-
readonly noMagicComments?: boolean;
|
|
24
21
|
}
|
|
25
22
|
export interface DiceQueryResult extends BaseQueryResult {
|
|
26
23
|
results: Record<string, {
|
|
@@ -43,10 +40,12 @@ export interface DiceQueryResult extends BaseQueryResult {
|
|
|
43
40
|
declare function diceQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'dice'>;
|
|
44
41
|
declare function diceQueryCompleter(line: readonly string[], startingNewArg: boolean, _config: FlowrConfig): CommandCompletions;
|
|
45
42
|
export declare const DiceQueryDefinition: {
|
|
43
|
+
readonly title: "Dice Query";
|
|
46
44
|
readonly executor: typeof executeDiceQuery;
|
|
47
45
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
48
46
|
readonly fromLine: typeof diceQueryLineParser;
|
|
49
47
|
readonly completer: typeof diceQueryCompleter;
|
|
48
|
+
readonly syntax: "@dice (<crit>;...->crit;...)[iIcB] <code | file://path>";
|
|
50
49
|
readonly schema: Joi.ObjectSchema<any>;
|
|
51
50
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
52
51
|
};
|
|
@@ -10,6 +10,7 @@ const joi_1 = __importDefault(require("joi"));
|
|
|
10
10
|
const dice_query_executor_1 = require("./dice-query-executor");
|
|
11
11
|
const query_print_1 = require("../../query-print");
|
|
12
12
|
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
13
|
+
const slice_query_options_1 = require("../slice-query-options");
|
|
13
14
|
const diceFormat = '(from1;from2->to1;to2)';
|
|
14
15
|
function diceQueryLineParser(output, line, _config) {
|
|
15
16
|
const parsed = (0, slice_query_parser_1.diceCriteriaParser)(line[0]);
|
|
@@ -17,9 +18,10 @@ function diceQueryLineParser(output, line, _config) {
|
|
|
17
18
|
output.stderr(output.formatter.format(`Invalid dice query format. Expected ${diceFormat}, e.g. (2@x->12@x) or (1@a;2@b->5@c).`, { color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }));
|
|
18
19
|
return { query: [] };
|
|
19
20
|
}
|
|
21
|
+
(0, slice_query_parser_1.warnAboutSliceFlags)(output, line[0], slice_query_parser_1.SharedSliceFlags);
|
|
20
22
|
return {
|
|
21
|
-
query: [{ type: 'dice', from: parsed.from, to: parsed.to }],
|
|
22
|
-
rCode: line
|
|
23
|
+
query: [{ type: 'dice', from: parsed.from, to: parsed.to, ...(0, slice_query_parser_1.sliceQueryOptionsParser)(line[0]) }],
|
|
24
|
+
rCode: (0, slice_query_parser_1.queryLineCode)(line)
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
function diceQueryCompleter(line, startingNewArg, _config) {
|
|
@@ -30,8 +32,9 @@ function diceQueryCompleter(line, startingNewArg, _config) {
|
|
|
30
32
|
return { completions: [] };
|
|
31
33
|
}
|
|
32
34
|
const arg = line[0];
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
const flags = (0, slice_query_parser_1.sliceFlagCompletions)(arg, slice_query_parser_1.SharedSliceFlags);
|
|
36
|
+
if (flags) {
|
|
37
|
+
return flags;
|
|
35
38
|
}
|
|
36
39
|
const hasArrow = arg.includes('->');
|
|
37
40
|
const side = hasArrow ? arg.slice(arg.indexOf('->') + 2) : arg.slice(1);
|
|
@@ -45,6 +48,7 @@ function diceQueryCompleter(line, startingNewArg, _config) {
|
|
|
45
48
|
return { completions: [] };
|
|
46
49
|
}
|
|
47
50
|
exports.DiceQueryDefinition = {
|
|
51
|
+
title: 'Dice Query',
|
|
48
52
|
executor: dice_query_executor_1.executeDiceQuery,
|
|
49
53
|
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
50
54
|
const out = queryResults;
|
|
@@ -83,12 +87,12 @@ exports.DiceQueryDefinition = {
|
|
|
83
87
|
},
|
|
84
88
|
fromLine: diceQueryLineParser,
|
|
85
89
|
completer: diceQueryCompleter,
|
|
90
|
+
syntax: '@dice (<crit>;...->crit;...)[iIcB] <code | file://path>',
|
|
86
91
|
schema: joi_1.default.object({
|
|
87
92
|
type: joi_1.default.string().valid('dice').required().description('The type of the query.'),
|
|
88
93
|
from: joi_1.default.array().items(joi_1.default.string()).min(1).required().description('Slicing criteria for the start of the dice (forward slice seeds).'),
|
|
89
94
|
to: joi_1.default.array().items(joi_1.default.string()).min(1).required().description('Slicing criteria for the end of the dice (backward slice seeds).'),
|
|
90
|
-
|
|
91
|
-
noMagicComments: joi_1.default.boolean().optional().description('Should the magic comments be ignored?'),
|
|
95
|
+
...slice_query_options_1.SliceQueryOptionsSchema
|
|
92
96
|
}).description('Dice query: selects only paths from the given start nodes that reach the given end nodes.'),
|
|
93
97
|
flattenInvolvedNodes: (queryResults) => {
|
|
94
98
|
const flattened = [];
|
|
@@ -5,6 +5,7 @@ const log_1 = require("../../../util/log");
|
|
|
5
5
|
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
6
6
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
7
7
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
8
|
+
const expand_library_internals_1 = require("../call-graph-query/expand-library-internals");
|
|
8
9
|
/**
|
|
9
10
|
* Execute does call queries on the given analyzer.
|
|
10
11
|
*/
|
|
@@ -12,6 +13,7 @@ async function executeDoesCallQuery({ analyzer }, queries) {
|
|
|
12
13
|
const start = Date.now();
|
|
13
14
|
const cg = await analyzer.callGraph();
|
|
14
15
|
const idMap = (await analyzer.normalize()).idMap;
|
|
16
|
+
const deps = analyzer.inspectContext().deps;
|
|
15
17
|
const results = {};
|
|
16
18
|
for (const query of queries) {
|
|
17
19
|
const id = query.queryId ?? JSON.stringify(query);
|
|
@@ -25,7 +27,7 @@ async function executeDoesCallQuery({ analyzer }, queries) {
|
|
|
25
27
|
continue;
|
|
26
28
|
}
|
|
27
29
|
const c = makeCallMatcher(query.calls);
|
|
28
|
-
results[id] = findCallersMatchingConstraints(cg, nodeId, c);
|
|
30
|
+
results[id] = findCallersMatchingConstraints(cg, nodeId, c, query.expandLibraryInternals ? deps : undefined);
|
|
29
31
|
}
|
|
30
32
|
return {
|
|
31
33
|
'.meta': {
|
|
@@ -68,7 +70,7 @@ function makeCallMatcher(constraint) {
|
|
|
68
70
|
}
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
|
-
function findCallersMatchingConstraints(cg, start, constraints) {
|
|
73
|
+
function findCallersMatchingConstraints(cg, start, constraints, expandDeps) {
|
|
72
74
|
const visited = new Set();
|
|
73
75
|
const toVisit = [start];
|
|
74
76
|
while (toVisit.length > 0) {
|
|
@@ -82,6 +84,9 @@ function findCallersMatchingConstraints(cg, start, constraints) {
|
|
|
82
84
|
if (constraints({ id: cur, name }, cg)) {
|
|
83
85
|
return { call: start };
|
|
84
86
|
}
|
|
87
|
+
if (expandDeps && matchesExpandedLibraryInternals(cur, constraints, cg, expandDeps)) {
|
|
88
|
+
return { call: start };
|
|
89
|
+
}
|
|
85
90
|
continue;
|
|
86
91
|
}
|
|
87
92
|
const vtx = cg.getVertex(cur);
|
|
@@ -98,4 +103,12 @@ function findCallersMatchingConstraints(cg, start, constraints) {
|
|
|
98
103
|
}
|
|
99
104
|
return false;
|
|
100
105
|
}
|
|
106
|
+
/** whether `constraints` matches any internal callee of the library/built-in leaf call `cur`, expanded via the signature database */
|
|
107
|
+
function matchesExpandedLibraryInternals(cur, constraints, cg, deps) {
|
|
108
|
+
const expansion = (0, expand_library_internals_1.transitiveLibraryCallees)(cur, deps);
|
|
109
|
+
if (expansion === undefined) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
return expansion.callees.some(name => constraints({ id: cur, name }, cg));
|
|
113
|
+
}
|
|
101
114
|
//# sourceMappingURL=does-call-query-executor.js.map
|
|
@@ -32,6 +32,12 @@ export interface DoesCallQuery extends BaseQueryFormat {
|
|
|
32
32
|
readonly queryId?: string;
|
|
33
33
|
readonly call: SlicingCriterion;
|
|
34
34
|
readonly calls: CallsConstraint;
|
|
35
|
+
/**
|
|
36
|
+
* If set, when the walk reaches a library/built-in leaf call, expand it into its internal callees using the
|
|
37
|
+
* signature database's `transitiveCallees` and match the constraints against those as well (a no-op if no
|
|
38
|
+
* signature database is loaded). Default false.
|
|
39
|
+
*/
|
|
40
|
+
readonly expandLibraryInternals?: boolean;
|
|
35
41
|
}
|
|
36
42
|
export interface FindAllCallsResult {
|
|
37
43
|
readonly call: NodeId;
|
|
@@ -42,9 +48,11 @@ export interface DoesCallQueryResult extends BaseQueryResult {
|
|
|
42
48
|
}
|
|
43
49
|
declare function doesCallQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'does-call'>;
|
|
44
50
|
export declare const DoesCallQueryDefinition: {
|
|
51
|
+
readonly title: "Does-Call Query";
|
|
45
52
|
readonly executor: typeof executeDoesCallQuery;
|
|
46
53
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
47
54
|
readonly fromLine: typeof doesCallQueryLineParser;
|
|
55
|
+
readonly syntax: "@does-call (<criterion>:$<id>|\"<name>\") <code | file://path>";
|
|
48
56
|
readonly schema: Joi.ObjectSchema<any>;
|
|
49
57
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
50
58
|
};
|
|
@@ -68,6 +68,7 @@ function doesCallQueryLineParser(output, line, _config) {
|
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
exports.DoesCallQueryDefinition = {
|
|
71
|
+
title: 'Does-Call Query',
|
|
71
72
|
executor: does_call_query_executor_1.executeDoesCallQuery,
|
|
72
73
|
asciiSummarizer: async (formatter, processed, queryResults, result) => {
|
|
73
74
|
const out = queryResults;
|
|
@@ -86,11 +87,13 @@ exports.DoesCallQueryDefinition = {
|
|
|
86
87
|
return true;
|
|
87
88
|
},
|
|
88
89
|
fromLine: doesCallQueryLineParser,
|
|
90
|
+
syntax: '@does-call (<criterion>:$<id>|"<name>") <code | file://path>',
|
|
89
91
|
schema: joi_1.default.object({
|
|
90
92
|
type: joi_1.default.string().valid('does-call').required().description('The type of the query.'),
|
|
91
93
|
queryId: joi_1.default.string().optional().description('An optional unique identifier for this query, to identify it in the output.'),
|
|
92
94
|
call: joi_1.default.string().description('The function from which calls are being made. This is a slicing criterion that resolves to a function definition node.'),
|
|
93
|
-
calls: joi_1.default.object().required().description('The constraints on which functions are being called. This can be a combination of name-based or id-based constraints, combined with logical operators (and, or, one-of).')
|
|
95
|
+
calls: joi_1.default.object().required().description('The constraints on which functions are being called. This can be a combination of name-based or id-based constraints, combined with logical operators (and, or, one-of).'),
|
|
96
|
+
expandLibraryInternals: joi_1.default.boolean().optional().description('Expand a reached library/built-in leaf call into its internal callees via the signature database and match constraints against those too (default false).')
|
|
94
97
|
}).description('Either returns all function definitions alongside whether they are recursive, or just those matching the filters.'),
|
|
95
98
|
flattenInvolvedNodes: (queryResults) => {
|
|
96
99
|
const out = queryResults;
|
|
@@ -27,10 +27,12 @@ export interface FilesQueryResult extends BaseQueryResult {
|
|
|
27
27
|
declare function filesQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'files'>;
|
|
28
28
|
declare function filesQueryCompleter(line: readonly string[], startingNewArg: boolean, _config: FlowrConfig): CommandCompletions;
|
|
29
29
|
export declare const FilesQueryDefinition: {
|
|
30
|
+
readonly title: "Files Query";
|
|
30
31
|
readonly executor: typeof executeFileQuery;
|
|
31
32
|
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
32
33
|
readonly completer: typeof filesQueryCompleter;
|
|
33
34
|
readonly fromLine: typeof filesQueryLineParser;
|
|
35
|
+
readonly syntax: "@files [role:<r1>,<r2>,...] <code | file://path>";
|
|
34
36
|
readonly schema: Joi.ObjectSchema<any>;
|
|
35
37
|
readonly flattenInvolvedNodes: (_: BaseQueryResult) => NodeId[];
|
|
36
38
|
};
|
|
@@ -101,6 +101,7 @@ function guessProto(obj) {
|
|
|
101
101
|
return undefined;
|
|
102
102
|
}
|
|
103
103
|
exports.FilesQueryDefinition = {
|
|
104
|
+
title: 'Files Query',
|
|
104
105
|
executor: files_query_executor_1.executeFileQuery,
|
|
105
106
|
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
106
107
|
const out = queryResults;
|
|
@@ -118,6 +119,7 @@ exports.FilesQueryDefinition = {
|
|
|
118
119
|
},
|
|
119
120
|
completer: filesQueryCompleter,
|
|
120
121
|
fromLine: filesQueryLineParser,
|
|
122
|
+
syntax: '@files [role:<r1>,<r2>,...] <code | file://path>',
|
|
121
123
|
schema: joi_1.default.object({
|
|
122
124
|
type: joi_1.default.string().valid('files').required().description('The type of the query.'),
|
|
123
125
|
roles: joi_1.default.array().optional().items(joi_1.default.string().valid(...Object.values(flowr_file_1.FileRole))).description('Optional roles of the files to query. If not provided, all roles are considered.'),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
2
|
+
import { type GuessDepVersionsQuery, type GuessDepVersionsQueryResult } from './guess-dep-versions-query-format';
|
|
3
|
+
/**
|
|
4
|
+
* Executes a guess-dep-versions query.
|
|
5
|
+
*/
|
|
6
|
+
export declare function executeGuessDepVersionsQuery({ analyzer }: BasicQueryData, queries: readonly GuessDepVersionsQuery[]): Promise<GuessDepVersionsQueryResult>;
|