@eagleoutice/flowr 2.16.1 → 2.16.3
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 +10 -10
- package/abstract-interpretation/data-frame/arguments.js +4 -3
- package/abstract-interpretation/data-frame/dataframe-semantics.js +1 -2
- package/abstract-interpretation/data-frame/semantics.d.ts +2 -2
- package/abstract-interpretation/data-frame/semantics.js +2 -6
- package/benchmark/slicer.js +1 -3
- package/benchmark/summarizer/first-phase/input.js +1 -12
- package/benchmark/summarizer/second-phase/process.d.ts +7 -0
- package/benchmark/summarizer/second-phase/process.js +15 -12
- package/cli/repl/commands/repl-cfg.js +18 -49
- package/cli/repl/commands/repl-clipboard.d.ts +2 -0
- package/cli/repl/commands/repl-clipboard.js +5 -0
- package/cli/repl/commands/repl-commands.js +2 -2
- package/cli/repl/commands/repl-dataflow.js +21 -55
- package/cli/repl/commands/repl-normalize.js +15 -28
- package/cli/repl/commands/repl-parse.js +2 -2
- package/cli/repl/commands/repl-query.js +10 -10
- package/cli/repl/commands/repl-signature.js +4 -4
- package/cli/repl/server/connection.d.ts +1 -0
- package/cli/repl/server/connection.js +8 -30
- package/cli/repl/server/messages/message-analysis.js +1 -1
- package/config.d.ts +6 -0
- package/config.js +7 -4
- package/control-flow/cfg-dead-code.js +5 -14
- package/control-flow/cfg-to-basic-blocks.js +1 -6
- package/control-flow/control-flow-graph.d.ts +2 -16
- package/control-flow/control-flow-graph.js +8 -66
- package/control-flow/diff-cfg.js +10 -23
- package/control-flow/semantic-cfg-guided-visitor.js +5 -11
- package/control-flow/simple-visitor.js +2 -2
- package/core/steps/pipeline/default-pipelines.d.ts +138 -138
- package/data/r-base-packages.generated.js +0 -1
- package/data/r-base-primitives.generated.js +0 -1
- package/data/r-s3-generics.generated.d.ts +5 -0
- package/data/r-s3-generics.generated.js +103 -0
- package/dataflow/cluster.js +2 -1
- package/dataflow/environments/append.d.ts +1 -0
- package/dataflow/environments/built-in-props.d.ts +15 -2
- package/dataflow/environments/built-in-props.js +31 -4
- package/dataflow/environments/built-in.js +15 -9
- package/dataflow/environments/clone.d.ts +1 -0
- package/dataflow/environments/clone.js +1 -0
- package/dataflow/environments/default-builtin-config.d.ts +385 -25
- package/dataflow/environments/default-builtin-config.js +186 -106
- package/dataflow/environments/define.d.ts +1 -0
- package/dataflow/environments/define.js +1 -0
- package/dataflow/environments/environment.d.ts +27 -0
- package/dataflow/environments/environment.js +37 -16
- package/dataflow/environments/frame-memory.d.ts +9 -1
- package/dataflow/environments/frame-memory.js +12 -1
- package/dataflow/environments/identifier.d.ts +1 -2
- package/dataflow/environments/identifier.js +5 -7
- package/dataflow/environments/overwrite.js +1 -0
- package/dataflow/environments/query-fn-props.d.ts +3 -0
- package/dataflow/environments/query-fn-props.js +7 -0
- package/dataflow/environments/resolve-by-name.js +11 -4
- package/dataflow/environments/scoping.d.ts +3 -0
- package/dataflow/environments/scoping.js +3 -0
- package/dataflow/eval/resolve/alias-tracking.js +3 -3
- package/dataflow/eval/resolve/resolve-argument.d.ts +7 -3
- package/dataflow/eval/resolve/resolve-argument.js +21 -12
- package/dataflow/eval/resolve/resolve-numbers.js +5 -2
- package/dataflow/eval/resolve/resolve-strings.d.ts +1 -1
- package/dataflow/eval/resolve/resolve-working-directory.js +2 -2
- package/dataflow/eval/resolve/resolve.js +1 -2
- package/dataflow/eval/values/intervals/interval-constants.js +1 -6
- package/dataflow/eval/values/r-value.js +1 -6
- package/dataflow/extractor.js +17 -17
- package/dataflow/fn/argument-roles.js +15 -15
- package/dataflow/fn/class-declaration.js +7 -7
- package/dataflow/fn/frame-reflection.d.ts +1 -23
- package/dataflow/fn/frame-reflection.js +8 -95
- package/dataflow/fn/function-props.d.ts +0 -3
- package/dataflow/fn/function-props.js +9 -11
- package/dataflow/fn/function-semantics.d.ts +1 -0
- package/dataflow/fn/strict-function.js +15 -14
- package/dataflow/graph/call-graph.d.ts +8 -0
- package/dataflow/graph/call-graph.js +40 -25
- package/dataflow/graph/dataflowgraph-builder.d.ts +0 -60
- package/dataflow/graph/dataflowgraph-builder.js +15 -135
- package/dataflow/graph/df-helper.d.ts +56 -4
- package/dataflow/graph/df-helper.js +116 -1
- package/dataflow/graph/diff-dataflow-graph.js +13 -15
- package/dataflow/graph/graph-helper.d.ts +20 -0
- package/dataflow/graph/graph-helper.js +18 -0
- package/dataflow/graph/graph.js +15 -8
- package/dataflow/graph/match-args.d.ts +1 -1
- package/dataflow/graph/match-args.js +3 -3
- package/dataflow/internal/linker.d.ts +4 -10
- package/dataflow/internal/linker.js +21 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +39 -22
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +6 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +27 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +33 -35
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +6 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +12 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +7 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +14 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +5 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +8 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +36 -38
- package/dataflow/internal/process/functions/call/common.d.ts +3 -1
- package/dataflow/internal/process/functions/call/common.js +6 -7
- package/dataflow/internal/process/functions/call/deferred.js +8 -8
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +11 -4
- package/dataflow/internal/process/functions/call/known-call-handling.js +11 -7
- package/dataflow/internal/process/functions/call/named-call-handling.js +64 -11
- package/dataflow/internal/process/functions/call/nse.js +4 -4
- package/dataflow/internal/process/functions/call/quoted.js +16 -14
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +2 -2
- package/dataflow/internal/process/process-named-call.js +1 -1
- package/dataflow/origin/dfg-get-origin.js +2 -2
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -0
- package/dataflow/origin/dfg-get-symbol-refs.js +3 -8
- package/documentation/data/faq/wiki-faq-store.js +2 -2
- package/documentation/doc-capabilities.js +2 -1
- package/documentation/doc-util/doc-functions.js +2 -2
- package/documentation/doc-util/doc-repl.js +4 -4
- package/documentation/doc-util/doc-types.js +2 -2
- package/documentation/wiki-absint.js +2 -1
- package/documentation/wiki-cfg.js +2 -1
- package/documentation/wiki-create-linting-rules.js +1 -1
- package/documentation/wiki-dataflow-graph.js +6 -6
- package/documentation/wiki-interface.js +3 -2
- package/documentation/wiki-linter.js +54 -4
- package/documentation/wiki-mk/doc-maker.js +1 -2
- package/documentation/wiki-query.js +25 -0
- package/documentation/wiki-search.js +2 -1
- package/documentation/wiki-signature-database.js +0 -2
- package/linter/linter-executor.js +4 -0
- package/linter/linter-rules.d.ts +526 -4
- package/linter/linter-rules.js +39 -1
- package/linter/linter-tags.d.ts +6 -0
- package/linter/linter-tags.js +6 -0
- package/linter/rules/absolute-path.js +4 -3
- package/linter/rules/cmd-check/bogus-return.d.ts +29 -0
- package/linter/rules/cmd-check/bogus-return.js +63 -0
- package/linter/rules/cmd-check/call-arguments.d.ts +63 -0
- package/linter/rules/cmd-check/call-arguments.js +211 -0
- package/linter/rules/cmd-check/class-string-comparison.d.ts +48 -0
- package/linter/rules/cmd-check/class-string-comparison.js +135 -0
- package/linter/rules/cmd-check/cmd-check-util.d.ts +67 -0
- package/linter/rules/cmd-check/cmd-check-util.js +169 -0
- package/linter/rules/cmd-check/compiled-code.d.ts +86 -0
- package/linter/rules/cmd-check/compiled-code.js +350 -0
- package/linter/rules/cmd-check/conformance.d.ts +47 -0
- package/linter/rules/cmd-check/conformance.js +166 -0
- package/linter/rules/cmd-check/dependency-declaration.d.ts +95 -0
- package/linter/rules/cmd-check/dependency-declaration.js +299 -0
- package/linter/rules/cmd-check/description-metadata.d.ts +63 -0
- package/linter/rules/cmd-check/description-metadata.js +393 -0
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +54 -0
- package/linter/rules/cmd-check/documentation-mismatch.js +407 -0
- package/linter/rules/cmd-check/file-checks.d.ts +29 -0
- package/linter/rules/cmd-check/file-checks.js +34 -0
- package/linter/rules/cmd-check/foreign-function-calls.d.ts +54 -0
- package/linter/rules/cmd-check/foreign-function-calls.js +115 -0
- package/linter/rules/cmd-check/global-environment-modification.d.ts +61 -0
- package/linter/rules/cmd-check/global-environment-modification.js +237 -0
- package/linter/rules/cmd-check/namespace-tampering.d.ts +52 -0
- package/linter/rules/cmd-check/namespace-tampering.js +162 -0
- package/linter/rules/cmd-check/non-ascii-code.d.ts +51 -0
- package/linter/rules/cmd-check/non-ascii-code.js +112 -0
- package/linter/rules/cmd-check/package-code.d.ts +30 -0
- package/linter/rules/cmd-check/package-code.js +141 -0
- package/linter/rules/cmd-check/package-data.d.ts +49 -0
- package/linter/rules/cmd-check/package-data.js +181 -0
- package/linter/rules/cmd-check/package-files.d.ts +41 -0
- package/linter/rules/cmd-check/package-files.js +157 -0
- package/linter/rules/cmd-check/package-hooks.d.ts +57 -0
- package/linter/rules/cmd-check/package-hooks.js +165 -0
- package/linter/rules/cmd-check/package-metafiles.d.ts +49 -0
- package/linter/rules/cmd-check/package-metafiles.js +292 -0
- package/linter/rules/cmd-check/package-runtime.d.ts +67 -0
- package/linter/rules/cmd-check/package-runtime.js +284 -0
- package/linter/rules/cmd-check/package-structure.d.ts +85 -0
- package/linter/rules/cmd-check/package-structure.js +320 -0
- package/linter/rules/cmd-check/rd-files.d.ts +67 -0
- package/linter/rules/cmd-check/rd-files.js +621 -0
- package/linter/rules/cmd-check/s-three-method-consistency.d.ts +72 -0
- package/linter/rules/cmd-check/s-three-method-consistency.js +206 -0
- package/linter/rules/cmd-check/true-false-abbreviation.d.ts +45 -0
- package/linter/rules/cmd-check/true-false-abbreviation.js +121 -0
- package/linter/rules/deprecated-functions.js +4 -4
- package/linter/rules/function-finder-util.d.ts +1 -1
- package/linter/rules/function-finder-util.js +1 -3
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +13 -14
- package/linter/rules/network-functions.d.ts +4 -3
- package/linter/rules/network-functions.js +14 -12
- package/linter/rules/no-leaked-credentials.d.ts +8 -3
- package/linter/rules/no-leaked-credentials.js +134 -36
- package/linter/rules/problematic-inputs.d.ts +1 -1
- package/linter/rules/problematic-inputs.js +21 -14
- package/linter/rules/seeded-randomness.js +5 -5
- package/linter/rules/software-has-license.d.ts +1 -1
- package/linter/rules/software-has-license.js +1 -1
- package/linter/rules/unclosed-connection.js +3 -3
- package/linter/rules/undefined-symbol-util.js +16 -32
- package/linter/rules/undefined-symbol.d.ts +2 -0
- package/linter/rules/undefined-symbol.js +33 -3
- package/linter/rules/unescaped-arguments.d.ts +13 -2
- package/linter/rules/unescaped-arguments.js +104 -15
- package/linter/rules/unused-definition.js +13 -19
- package/package.json +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/context/flowr-analyzer-context.js +1 -1
- package/project/context/flowr-analyzer-environment-context.d.ts +1 -1
- package/project/context/flowr-analyzer-files-context.d.ts +6 -0
- package/project/context/flowr-analyzer-files-context.js +3 -0
- package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +0 -2
- package/project/context/flowr-analyzer-incremental-analysis-context.js +0 -4
- package/project/context/flowr-file.d.ts +4 -0
- package/project/context/flowr-file.js +4 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/plugins/file-plugins/files/flowr-description-file.js +2 -2
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +4 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +11 -14
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +3 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +25 -15
- package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +44 -0
- package/project/plugins/file-plugins/files/flowr-rd-file.js +130 -61
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +0 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -16
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +4 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +4 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +0 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -5
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +3 -7
- package/project/sigdb/build.js +16 -30
- package/project/sigdb/dict.d.ts +4 -6
- package/project/sigdb/dict.js +125 -31
- package/project/sigdb/reader.js +2 -18
- package/project/sigdb/sigdb-download.js +14 -23
- package/queries/base-query-format.d.ts +2 -0
- package/queries/base-query-format.js +10 -2
- package/queries/catalog/absint-query/absint-query-format.d.ts +1 -1
- package/queries/catalog/absint-query/absint-query-format.js +5 -7
- package/queries/catalog/call-context-query/call-context-query-executor.js +26 -33
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -3
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -4
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -4
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -3
- package/queries/catalog/config-query/config-query-format.js +3 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -3
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -3
- package/queries/catalog/dependencies-query/data-flow.d.ts +43 -0
- package/queries/catalog/dependencies-query/data-flow.js +173 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +18 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +108 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +17 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +14 -11
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +2 -1
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/library-functions.js +13 -13
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/remote-functions.js +3 -3
- package/queries/catalog/dependencies-query/function-info/source-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/test-functions.js +8 -8
- package/queries/catalog/dependencies-query/function-info/transform-functions.d.ts +8 -0
- package/queries/catalog/dependencies-query/function-info/transform-functions.js +17 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.js +4 -0
- package/queries/catalog/dependencies-query/implicit-echo.d.ts +5 -3
- package/queries/catalog/dependencies-query/implicit-echo.js +33 -34
- package/queries/catalog/dependencies-query/link-devices.d.ts +3 -2
- package/queries/catalog/dependencies-query/link-devices.js +9 -6
- package/queries/catalog/dependencies-query/plot-description.d.ts +10 -0
- package/queries/catalog/dependencies-query/plot-description.js +119 -0
- package/queries/catalog/dependencies-query/plot-objects.d.ts +13 -0
- package/queries/catalog/dependencies-query/plot-objects.js +61 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +2 -2
- package/queries/catalog/dice-query/dice-query-format.js +3 -40
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
- package/queries/catalog/does-call-query/does-call-query-format.js +2 -2
- package/queries/catalog/function-info-query/function-info-query-format.js +2 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +2 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -3
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +6 -4
- package/queries/catalog/input-sources-query/input-source-functions.js +11 -6
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +3 -3
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -5
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +12 -4
- package/queries/catalog/input-sources-query/simple-input-classifier.js +237 -40
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +4 -7
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +1 -1
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +3 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +2 -2
- package/queries/catalog/linter-query/linter-query-executor.js +10 -3
- package/queries/catalog/linter-query/linter-query-format.d.ts +4 -1
- package/queries/catalog/linter-query/linter-query-format.js +32 -21
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -3
- package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.js +4 -5
- package/queries/catalog/project-query/project-query-format.js +2 -2
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -4
- package/queries/catalog/search-query/search-query-format.js +1 -3
- package/queries/catalog/signature-query/signature-query-executor.js +3 -3
- package/queries/catalog/signature-query/signature-query-format.js +2 -2
- package/queries/catalog/slice-query-options.d.ts +16 -0
- package/queries/catalog/slice-query-options.js +28 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -42
- package/queries/query-print.d.ts +4 -0
- package/queries/query-print.js +17 -1
- package/queries/query.d.ts +3 -3
- package/queries/query.js +3 -4
- package/r-bridge/lang-4.x/ast/model/model.d.ts +27 -3
- package/r-bridge/lang-4.x/ast/model/model.js +28 -1
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +20 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +25 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +18 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +15 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +17 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +20 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/operators.js +0 -2
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -6
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -6
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -3
- package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +4 -20
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -9
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -10
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +3 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +6 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +7 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +0 -10
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +30 -82
- package/r-bridge/retriever.d.ts +0 -4
- package/r-bridge/retriever.js +0 -13
- package/r-bridge/roxygen2/documentation-provider.js +3 -7
- package/r-bridge/shell.js +3 -8
- package/reconstruct/auto-select/magic-comments.js +8 -7
- package/reconstruct/inline/source-inline-map.d.ts +3 -0
- package/reconstruct/inline/source-inline-map.js +8 -7
- package/reconstruct/reconstruct.d.ts +1 -1
- package/reconstruct/reconstruct.js +33 -109
- package/search/flowr-search-printer.js +4 -15
- package/search/search-executor/search-enrichers.js +5 -3
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/filters/all-variables.js +1 -2
- package/slicing/static/fingerprint.js +11 -2
- package/slicing/static/slice-call.d.ts +2 -8
- package/slicing/static/slice-call.js +8 -18
- package/slicing/static/static-slicer.js +81 -6
- package/util/collections/arrays.js +1 -1
- package/util/collections/set.js +1 -1
- package/util/diff-graph.d.ts +4 -0
- package/util/diff-graph.js +12 -0
- package/util/files.js +2 -6
- package/util/json.js +1 -15
- package/util/mermaid/cfg.js +10 -17
- package/util/mermaid/dfg.js +6 -8
- package/util/objects.d.ts +1 -1
- package/util/quads.js +4 -13
- package/util/r-author.js +5 -5
- package/util/range.d.ts +9 -0
- package/util/range.js +11 -0
- package/util/schema.js +3 -3
- package/util/simple-df/dfg-view.js +2 -1
- package/util/text/ansi.js +1 -2
- package/util/text/playground-link.js +2 -1
- package/util/text/r-highlight.js +2 -1
- package/util/text/strings.d.ts +2 -0
- package/util/text/strings.js +5 -0
- package/util/text/time.js +1 -2
- package/util/version.js +4 -3
- package/dataflow/fn/recursive-function.d.ts +0 -6
- package/dataflow/fn/recursive-function.js +0 -32
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +0 -16
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +0 -27
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
+
import type { ParentInformation } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
3
|
+
import type { DataflowInformation } from '../../../dataflow/info';
|
|
4
|
+
import { Identifier } from '../../../dataflow/environments/identifier';
|
|
5
|
+
import type { RNode } from '../../../r-bridge/lang-4.x/ast/model/model';
|
|
6
|
+
import { RFunctionCall } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
7
|
+
/** the name the call goes by, with its package when it has one */
|
|
8
|
+
export declare function callIdentifierOf(node: RFunctionCall<ParentInformation>, dataflow: DataflowInformation): Identifier | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Whether the value is a plot, which printing draws rather than writes: a call returning one, a `+` chain adding
|
|
11
|
+
* to one (as ggplot builds them), or a variable bound to either.
|
|
12
|
+
*/
|
|
13
|
+
export declare function isPlot(node: RNode<ParentInformation> | undefined, dataflow: DataflowInformation, seen?: Set<NodeId>, memo?: Map<NodeId, boolean>): boolean;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.callIdentifierOf = callIdentifierOf;
|
|
4
|
+
exports.isPlot = isPlot;
|
|
5
|
+
const function_semantics_1 = require("../../../dataflow/fn/function-semantics");
|
|
6
|
+
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
7
|
+
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
|
+
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
9
|
+
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
10
|
+
const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
11
|
+
const edge_1 = require("../../../dataflow/graph/edge");
|
|
12
|
+
const query_fn_props_1 = require("../../../dataflow/environments/query-fn-props");
|
|
13
|
+
const built_in_props_1 = require("../../../dataflow/environments/built-in-props");
|
|
14
|
+
const default_builtin_config_1 = require("../../../dataflow/environments/default-builtin-config");
|
|
15
|
+
/** the name the call goes by, with its package when it has one */
|
|
16
|
+
function callIdentifierOf(node, dataflow) {
|
|
17
|
+
const vertex = dataflow.graph.getVertex(node.info.id);
|
|
18
|
+
return vertex_1.DfgVertex.isFunctionCall(vertex)
|
|
19
|
+
? df_helper_1.Dataflow.qualify(node.info.id, dataflow.graph, false) ?? vertex.name : undefined;
|
|
20
|
+
}
|
|
21
|
+
const GgPlotComponents = new Set(default_builtin_config_1.GgPlotImplicitAddons);
|
|
22
|
+
/**
|
|
23
|
+
* Whether the value is a plot, which printing draws rather than writes: a call returning one, a `+` chain adding
|
|
24
|
+
* to one (as ggplot builds them), or a variable bound to either.
|
|
25
|
+
*/
|
|
26
|
+
function isPlot(node, dataflow, seen = new Set(), memo) {
|
|
27
|
+
if (node === undefined || seen.has(node.info.id)) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
const known = memo?.get(node.info.id);
|
|
31
|
+
if (known !== undefined) {
|
|
32
|
+
return known;
|
|
33
|
+
}
|
|
34
|
+
/* a value cut short by a cycle may answer differently from elsewhere, so only the outermost answer is kept */
|
|
35
|
+
const outermost = seen.size === 0;
|
|
36
|
+
seen.add(node.info.id);
|
|
37
|
+
const plot = isPlotNode(node, dataflow, seen, memo);
|
|
38
|
+
if (outermost) {
|
|
39
|
+
memo?.set(node.info.id, plot);
|
|
40
|
+
}
|
|
41
|
+
return plot;
|
|
42
|
+
}
|
|
43
|
+
function isPlotNode(node, dataflow, seen, memo) {
|
|
44
|
+
switch (node.type) {
|
|
45
|
+
case type_1.RType.FunctionCall:
|
|
46
|
+
return isPlotCall(node, dataflow, default_builtin_config_1.PlotObjectCreate);
|
|
47
|
+
case type_1.RType.BinaryOp:
|
|
48
|
+
return node.operator === '+' && [node.lhs, node.rhs].some(o => isPlot(o, dataflow, seen, memo) || isPlotCall(o, dataflow, GgPlotComponents));
|
|
49
|
+
case type_1.RType.Symbol:
|
|
50
|
+
return df_helper_1.Dataflow.targetsOf(dataflow.graph, node.info.id, edge_1.EdgeType.Reads).some(def => df_helper_1.Dataflow.targetsOf(dataflow.graph, def, edge_1.EdgeType.DefinedBy).some(value => isPlot(dataflow.graph.idMap?.get(value), dataflow, seen, memo)));
|
|
51
|
+
default:
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** whether the node calls one of the given graphics functions */
|
|
56
|
+
function isPlotCall(node, dataflow, among) {
|
|
57
|
+
const name = r_function_call_1.RFunctionCall.is(node) ? callIdentifierOf(node, dataflow) : undefined;
|
|
58
|
+
return name !== undefined && among.has(identifier_1.Identifier.getName(name))
|
|
59
|
+
&& function_semantics_1.FunctionSemantics.call.props.hasAny((0, query_fn_props_1.queryFnProps)(name, { environment: dataflow.environment }), [built_in_props_1.SemanticCallTag.Graphics]);
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=plot-objects.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BaseQueryFormat, type BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import type { SlicingCriteria } from '../../../slicing/criterion/parse';
|
|
3
3
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
4
4
|
import type { ParsedQueryLine } from '../../query';
|
|
@@ -44,7 +44,7 @@ declare function diceQueryCompleter(line: readonly string[], startingNewArg: boo
|
|
|
44
44
|
export declare const DiceQueryDefinition: {
|
|
45
45
|
readonly title: "Dice Query";
|
|
46
46
|
readonly executor: typeof executeDiceQuery;
|
|
47
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) =>
|
|
47
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => boolean;
|
|
48
48
|
readonly fromLine: typeof diceQueryLineParser;
|
|
49
49
|
readonly completer: typeof diceQueryCompleter;
|
|
50
50
|
readonly syntax: "@dice (<crit>;...->crit;...)[iIcB] <code | file://path>";
|
|
@@ -4,19 +4,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DiceQueryDefinition = void 0;
|
|
7
|
-
const
|
|
8
|
-
const time_1 = require("../../../util/text/time");
|
|
7
|
+
const base_query_format_1 = require("../../base-query-format");
|
|
9
8
|
const joi_1 = __importDefault(require("joi"));
|
|
10
9
|
const dice_query_executor_1 = require("./dice-query-executor");
|
|
11
|
-
const query_print_1 = require("../../query-print");
|
|
12
10
|
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
13
11
|
const slice_query_options_1 = require("../slice-query-options");
|
|
14
12
|
const diceFormat = '(from1;from2->to1;to2)';
|
|
15
13
|
function diceQueryLineParser(output, line, _config) {
|
|
16
14
|
const parsed = (0, slice_query_parser_1.diceCriteriaParser)(line[0]);
|
|
17
15
|
if (!parsed) {
|
|
18
|
-
|
|
19
|
-
return { query: [] };
|
|
16
|
+
return (0, base_query_format_1.invalidQueryLine)(output, `Invalid dice query format. Expected ${diceFormat}, e.g. (2@x->12@x) or (1@a;2@b->5@c).`);
|
|
20
17
|
}
|
|
21
18
|
(0, slice_query_parser_1.warnAboutSliceFlags)(output, line[0], slice_query_parser_1.SharedSliceFlags);
|
|
22
19
|
return {
|
|
@@ -50,41 +47,7 @@ function diceQueryCompleter(line, startingNewArg, _config) {
|
|
|
50
47
|
exports.DiceQueryDefinition = {
|
|
51
48
|
title: 'Dice Query',
|
|
52
49
|
executor: dice_query_executor_1.executeDiceQuery,
|
|
53
|
-
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
54
|
-
const out = queryResults;
|
|
55
|
-
if (Object.keys(out.results).length === 1) {
|
|
56
|
-
const [, obj] = Object.entries(out.results)[0];
|
|
57
|
-
const rec = obj.reconstruct;
|
|
58
|
-
if (rec !== undefined) {
|
|
59
|
-
const code = Array.isArray(rec.code) ? rec.code : [rec.code];
|
|
60
|
-
if (code.length === 1) {
|
|
61
|
-
result.push(code[0]);
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
result.push(`Query: ${(0, ansi_1.bold)('dice', formatter)} (${(0, time_1.printAsMs)(out['.meta'].timing, 0)})`);
|
|
67
|
-
for (const [fingerprint, obj] of Object.entries(out.results)) {
|
|
68
|
-
const { from, to, noReconstruction, noMagicComments } = JSON.parse(fingerprint);
|
|
69
|
-
const addons = [];
|
|
70
|
-
if (noReconstruction) {
|
|
71
|
-
addons.push('no reconstruction');
|
|
72
|
-
}
|
|
73
|
-
if (noMagicComments) {
|
|
74
|
-
addons.push('no magic comments');
|
|
75
|
-
}
|
|
76
|
-
result.push(` ╰ Dice from {${from.join(', ')}} to {${to.join(', ')}} ${addons.join(', ')}`);
|
|
77
|
-
const rec = obj.reconstruct;
|
|
78
|
-
if (rec !== undefined) {
|
|
79
|
-
const code = Array.isArray(rec.code) ? rec.code : [rec.code];
|
|
80
|
-
result.push(' ╰ Code (newline as <code>\n</code>): <code>' + code.flatMap(c => c.split('\n')).join('\\n') + '</code>');
|
|
81
|
-
}
|
|
82
|
-
else {
|
|
83
|
-
result.push(` ╰ Id List: {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, [...obj.slice.result])}}`);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
return true;
|
|
87
|
-
},
|
|
50
|
+
asciiSummarizer: (formatter, _analyzer, queryResults, result) => (0, slice_query_options_1.summarizeSliceResults)(formatter, 'dice', queryResults, result, (_, q) => q ? `Dice from {${q.from.join(', ')}} to {${q.to.join(', ')}}` : 'Dice'),
|
|
88
51
|
fromLine: diceQueryLineParser,
|
|
89
52
|
completer: diceQueryCompleter,
|
|
90
53
|
syntax: '@dice (<crit>;...->crit;...)[iIcB] <code | file://path>',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BaseQueryFormat, type BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import Joi from 'joi';
|
|
3
3
|
import type { ParsedQueryLine } from '../../query';
|
|
4
4
|
import { executeDoesCallQuery } from './does-call-query-executor';
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DoesCallQueryDefinition = void 0;
|
|
7
|
+
const base_query_format_1 = require("../../base-query-format");
|
|
7
8
|
const ansi_1 = require("../../../util/text/ansi");
|
|
8
9
|
const joi_1 = __importDefault(require("joi"));
|
|
9
10
|
const does_call_query_executor_1 = require("./does-call-query-executor");
|
|
@@ -53,8 +54,7 @@ function constraintParser(argument) {
|
|
|
53
54
|
function doesCallQueryLineParser(output, line, _config) {
|
|
54
55
|
const constraint = constraintParser(line[0]);
|
|
55
56
|
if (!constraint || typeof constraint === 'string') {
|
|
56
|
-
|
|
57
|
-
return { query: [] };
|
|
57
|
+
return (0, base_query_format_1.invalidQueryLine)(output, `Invalid does-call query format:\n ${constraint}`);
|
|
58
58
|
}
|
|
59
59
|
return {
|
|
60
60
|
query: [
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FunctionInfoQueryDefinition = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
const query_print_1 = require("../../query-print");
|
|
8
9
|
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
-
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const function_info_query_executor_1 = require("./function-info-query-executor");
|
|
11
11
|
function functionInfoLineParser(_output, line, _config) {
|
|
12
12
|
const [name, ...packages] = line.filter(t => t.length > 0);
|
|
@@ -22,7 +22,7 @@ exports.FunctionInfoQueryDefinition = {
|
|
|
22
22
|
syntax: '@function-info <name> [<package>...]',
|
|
23
23
|
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
24
24
|
const out = queryResults;
|
|
25
|
-
result.push(
|
|
25
|
+
result.push((0, query_print_1.queryHeader)('function-info', formatter, out['.meta'].timing));
|
|
26
26
|
if (out.packages.length === 0 && out.builtin.length === 0) {
|
|
27
27
|
result.push(` ╰ ${(0, ansi_1.italic)(`No package or built-in definition known for ${out.name}`, formatter)}`);
|
|
28
28
|
return true;
|
|
@@ -7,6 +7,7 @@ const r_version_1 = require("../../../util/r-version");
|
|
|
7
7
|
const objects_1 = require("../../../util/objects");
|
|
8
8
|
const visualize_functions_1 = require("../dependencies-query/function-info/visualize-functions");
|
|
9
9
|
const dependency_version_space_1 = require("../../../project/dependency-version-space");
|
|
10
|
+
const range_1 = require("../../../util/range");
|
|
10
11
|
/** flowR's curated builtin-library function to package map (e.g. `ggplot` to `ggplot2`), disambiguating an orphan call several packages re-export */
|
|
11
12
|
const BuiltinLibraryByFunction = new Map(visualize_functions_1.VisualizeFunctions.filter(f => f.package !== undefined).map(f => [f.name, f.package]));
|
|
12
13
|
/** the sources `query` disables: `clean` is sugar for disabling `declared`+`transitive`, `disabled` adds any others by name */
|
|
@@ -19,7 +20,7 @@ function disabledSources(query) {
|
|
|
19
20
|
function locatorOf(idMap) {
|
|
20
21
|
return id => {
|
|
21
22
|
const node = id === undefined ? undefined : idMap.get(id);
|
|
22
|
-
const at = node
|
|
23
|
+
const at = range_1.SourceRange.ownFromNode(node);
|
|
23
24
|
return at === undefined ? undefined : `${node?.info.file ? node.info.file + ':' : ''}${at[0]}:${at[1]}`;
|
|
24
25
|
};
|
|
25
26
|
}
|
|
@@ -5,8 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.GuessDepVersionsQueryDefinition = exports.DefaultCandidateCap = void 0;
|
|
7
7
|
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
const query_print_1 = require("../../query-print");
|
|
8
9
|
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
-
const time_1 = require("../../../util/text/time");
|
|
10
10
|
const r_version_1 = require("../../../util/r-version");
|
|
11
11
|
const arrays_1 = require("../../../util/collections/arrays");
|
|
12
12
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
@@ -230,7 +230,7 @@ exports.GuessDepVersionsQueryDefinition = {
|
|
|
230
230
|
executor: guess_dep_versions_query_executor_1.executeGuessDepVersionsQuery,
|
|
231
231
|
asciiSummarizer: (formatter, _analyzer, queryResults, result, _query) => {
|
|
232
232
|
const out = queryResults;
|
|
233
|
-
result.push(
|
|
233
|
+
result.push((0, query_print_1.queryHeader)('guess-dep-versions', formatter, out['.meta'].timing));
|
|
234
234
|
if (out.dateCutoff) {
|
|
235
235
|
result.push(` ╰ up to ${(0, ansi_1.italic)(out.dateCutoff, formatter)}${out.rVersion ? `, R ${rVersionText(out, formatter)}` : ''}`);
|
|
236
236
|
}
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.HappensBeforeQueryDefinition = exports.HappensBeforeKey = void 0;
|
|
7
7
|
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
-
const
|
|
8
|
+
const query_print_1 = require("../../query-print");
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const happens_before_query_executor_1 = require("./happens-before-query-executor");
|
|
11
11
|
/**
|
|
@@ -30,7 +30,7 @@ exports.HappensBeforeQueryDefinition = {
|
|
|
30
30
|
executor: happens_before_query_executor_1.executeHappensBefore,
|
|
31
31
|
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
32
32
|
const out = queryResults;
|
|
33
|
-
result.push(
|
|
33
|
+
result.push((0, query_print_1.queryHeader)('happens-before', formatter, out['.meta'].timing));
|
|
34
34
|
for (const [fingerprint, value] of Object.entries(out.results)) {
|
|
35
35
|
const { a, b } = exports.HappensBeforeKey.criteria(fingerprint);
|
|
36
36
|
result.push(` ╰ ${(0, ansi_1.bold)(a, formatter)} happens before ${(0, ansi_1.bold)(b, formatter)}: ${value}`);
|
|
@@ -5,8 +5,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.IdMapQueryDefinition = void 0;
|
|
7
7
|
const id_map_query_executor_1 = require("./id-map-query-executor");
|
|
8
|
-
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
-
const time_1 = require("../../../util/text/time");
|
|
10
8
|
const joi_1 = __importDefault(require("joi"));
|
|
11
9
|
const query_print_1 = require("../../query-print");
|
|
12
10
|
exports.IdMapQueryDefinition = {
|
|
@@ -14,7 +12,7 @@ exports.IdMapQueryDefinition = {
|
|
|
14
12
|
executor: id_map_query_executor_1.executeIdMapQuery,
|
|
15
13
|
asciiSummarizer: (formatter, _analyzer, queryResults, result) => {
|
|
16
14
|
const out = queryResults;
|
|
17
|
-
result.push(
|
|
15
|
+
result.push((0, query_print_1.queryHeader)('id-map', formatter, out['.meta'].timing));
|
|
18
16
|
result.push(` ╰ Id List: {${(0, query_print_1.summarizeIdsIfTooLong)(formatter, Array.from(out.idMap.keys()))}}`);
|
|
19
17
|
return true;
|
|
20
18
|
},
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Identifier } from '../../../dataflow/environments/identifier';
|
|
1
2
|
import type { LinkedInputEntryPoint, LinkedInputObject, NarrowingFunction } from './simple-input-classifier';
|
|
2
3
|
import type { BuiltInIndex } from '../../../dataflow/environments/query-fn-props';
|
|
3
4
|
/**
|
|
@@ -8,12 +9,13 @@ import type { BuiltInIndex } from '../../../dataflow/environments/query-fn-props
|
|
|
8
9
|
*/
|
|
9
10
|
export declare const LinkedInputObjects: readonly LinkedInputObject[];
|
|
10
11
|
/**
|
|
11
|
-
* The
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* built-in `Narrows` (in the {@link DefaultBuiltinConfig} or your own definitions) and it shows up here.
|
|
12
|
+
* The {@link SemanticCallTag.Narrows} built-ins with an {@link ArgProp.Bounds} parameter, whose result is one of
|
|
13
|
+
* that argument's values (`match.arg` and its `choices`). Label a built-in `Narrows` with such a parameter
|
|
14
|
+
* (in the {@link DefaultBuiltinConfig} or your own definitions) and it shows up here.
|
|
15
15
|
*/
|
|
16
16
|
export declare function narrowingFunctions(index: BuiltInIndex): readonly NarrowingFunction[];
|
|
17
|
+
/** The {@link SemanticCallTag.Narrows} built-ins without an {@link ArgProp.Bounds} parameter: counts and logicals free of their arguments' content. */
|
|
18
|
+
export declare function contentFreeFunctions(index: BuiltInIndex): readonly Identifier[];
|
|
17
19
|
/**
|
|
18
20
|
* Calls that hand a function to a framework which binds its parameters by position.
|
|
19
21
|
* @see {@link LinkedInputEntryPoint}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LinkedInputEntryPoints = exports.LinkedInputObjects = void 0;
|
|
4
4
|
exports.narrowingFunctions = narrowingFunctions;
|
|
5
|
+
exports.contentFreeFunctions = contentFreeFunctions;
|
|
5
6
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
6
7
|
const simple_input_classifier_1 = require("./simple-input-classifier");
|
|
7
8
|
const built_in_props_1 = require("../../../dataflow/environments/built-in-props");
|
|
@@ -28,18 +29,22 @@ exports.LinkedInputObjects = [
|
|
|
28
29
|
{ name: 'session', type: simple_input_classifier_1.InputType.User, withParams: ['input', 'output'], requires: 'shiny', fields: ['clientData', 'request'] }
|
|
29
30
|
];
|
|
30
31
|
/**
|
|
31
|
-
* The
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* built-in `Narrows` (in the {@link DefaultBuiltinConfig} or your own definitions) and it shows up here.
|
|
32
|
+
* The {@link SemanticCallTag.Narrows} built-ins with an {@link ArgProp.Bounds} parameter, whose result is one of
|
|
33
|
+
* that argument's values (`match.arg` and its `choices`). Label a built-in `Narrows` with such a parameter
|
|
34
|
+
* (in the {@link DefaultBuiltinConfig} or your own definitions) and it shows up here.
|
|
35
35
|
*/
|
|
36
36
|
function narrowingFunctions(index) {
|
|
37
37
|
const bounds = new Map(index.params(built_in_props_1.ArgProp.Bounds).map(p => [identifier_1.Identifier.getName(p.call), p]));
|
|
38
|
-
return index.with(built_in_props_1.SemanticCallTag.Narrows).
|
|
38
|
+
return index.with(built_in_props_1.SemanticCallTag.Narrows).flatMap(call => {
|
|
39
39
|
const bound = bounds.get(identifier_1.Identifier.getName(call));
|
|
40
|
-
return bound === undefined ?
|
|
40
|
+
return bound === undefined ? [] : [{ call, argName: bound.name, argIdx: bound.index }];
|
|
41
41
|
});
|
|
42
42
|
}
|
|
43
|
+
/** The {@link SemanticCallTag.Narrows} built-ins without an {@link ArgProp.Bounds} parameter: counts and logicals free of their arguments' content. */
|
|
44
|
+
function contentFreeFunctions(index) {
|
|
45
|
+
const bounded = new Set(index.params(built_in_props_1.ArgProp.Bounds).map(p => identifier_1.Identifier.getName(p.call)));
|
|
46
|
+
return index.with(built_in_props_1.SemanticCallTag.Narrows).filter(call => !bounded.has(identifier_1.Identifier.getName(call)));
|
|
47
|
+
}
|
|
43
48
|
/** shiny binds `input`, `output`, and `session` positionally, so their names are up to whoever writes the server */
|
|
44
49
|
const ShinyServerParams = ['input', undefined, 'session'];
|
|
45
50
|
/**
|
|
@@ -23,7 +23,7 @@ async function executeInputSourcesQuery({ analyzer }, queries) {
|
|
|
23
23
|
const df = await analyzer.dataflow();
|
|
24
24
|
const ctx = analyzer.inspectContext();
|
|
25
25
|
const defaultConfig = addAll(await resolveSearches(analyzer, (0, input_sources_query_format_1.defaultInputClassifierConfig)(ctx)), await resolveSearches(analyzer, ctx.config.inputSources ?? {}));
|
|
26
|
-
const packages =
|
|
26
|
+
const packages = unqualifiedPackages(analyzer, df.environment);
|
|
27
27
|
for (const query of queries) {
|
|
28
28
|
const criteria = Array.isArray(query.criterion)
|
|
29
29
|
? query.criterion
|
|
@@ -52,7 +52,7 @@ async function executeInputSourcesQuery({ analyzer }, queries) {
|
|
|
52
52
|
* The packages whose exports are usable without a namespace: those R has on its search path at the end of the
|
|
53
53
|
* program, the ones the project declares, and the base packages R attaches on startup.
|
|
54
54
|
*/
|
|
55
|
-
function
|
|
55
|
+
function unqualifiedPackages(analyzer, environment) {
|
|
56
56
|
return new Set([
|
|
57
57
|
...environment_1.REnvironment.attachedPackages(environment.current),
|
|
58
58
|
...analyzer.inspectContext().deps.getDependencies().map(d => d.name),
|
|
@@ -70,7 +70,7 @@ function addAll(base, extra) {
|
|
|
70
70
|
return result;
|
|
71
71
|
}
|
|
72
72
|
/** Config fields that hold structured values (not function searches) and are carried over verbatim. */
|
|
73
|
-
const StructuredConfigKeys = ['linkedObjects', 'linkedEntryPoints', 'narrowing'];
|
|
73
|
+
const StructuredConfigKeys = ['linkedObjects', 'linkedEntryPoints', 'narrowing', 'templates'];
|
|
74
74
|
function isStructuredConfigKey(key) {
|
|
75
75
|
return StructuredConfigKeys.includes(key);
|
|
76
76
|
}
|
|
@@ -23,7 +23,7 @@ export interface InputSourcesQuery extends BaseQueryFormat {
|
|
|
23
23
|
/**
|
|
24
24
|
* Which functions belong to which input type is stated with the functions themselves, in the built-in configuration
|
|
25
25
|
* the analyzer registered (see {@link ReadOnlyFlowrAnalyzerEnvironmentContext#builtInDefinitions}):
|
|
26
|
-
* a function that states its props and carries none of the {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a {@link SemanticCallTag.Narrows} one
|
|
26
|
+
* a function that states its props and carries none of the {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a {@link SemanticCallTag.Narrows} one with an {@link ArgProp.Bounds} parameter is classified by that argument alone. Add a function there (or override its props with your own built-in definitions) and it shows up here.
|
|
27
27
|
*/
|
|
28
28
|
export declare const defaultInputClassifierConfig: (ctx: ReadOnlyFlowrAnalyzerContext) => InputClassifierConfig;
|
|
29
29
|
export interface InputSourcesQueryResult extends BaseQueryResult {
|
|
@@ -5,8 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.InputSourcesDefinition = exports.defaultInputClassifierConfig = void 0;
|
|
7
7
|
const base_query_format_1 = require("../../base-query-format");
|
|
8
|
-
const
|
|
9
|
-
const time_1 = require("../../../util/text/time");
|
|
8
|
+
const query_print_1 = require("../../query-print");
|
|
10
9
|
const joi_1 = __importDefault(require("joi"));
|
|
11
10
|
const simple_input_classifier_1 = require("./simple-input-classifier");
|
|
12
11
|
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
@@ -21,7 +20,7 @@ const built_in_props_1 = require("../../../dataflow/environments/built-in-props"
|
|
|
21
20
|
/**
|
|
22
21
|
* Which functions belong to which input type is stated with the functions themselves, in the built-in configuration
|
|
23
22
|
* the analyzer registered (see {@link ReadOnlyFlowrAnalyzerEnvironmentContext#builtInDefinitions}):
|
|
24
|
-
* a function that states its props and carries none of the {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a {@link SemanticCallTag.Narrows} one
|
|
23
|
+
* a function that states its props and carries none of the {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a {@link SemanticCallTag.Narrows} one with an {@link ArgProp.Bounds} parameter is classified by that argument alone. Add a function there (or override its props with your own built-in definitions) and it shows up here.
|
|
25
24
|
*/
|
|
26
25
|
const defaultInputClassifierConfig = (ctx) => ctx.env.derive(inputClassifierConfigOf);
|
|
27
26
|
exports.defaultInputClassifierConfig = defaultInputClassifierConfig;
|
|
@@ -37,9 +36,13 @@ const inputClassifierConfigOf = (env) => {
|
|
|
37
36
|
[simple_input_classifier_1.InputType.System]: builtIns.with(built_in_props_1.SemanticCallTag.Process),
|
|
38
37
|
[simple_input_classifier_1.InputType.Ffi]: builtIns.with(built_in_props_1.CallProp.Ffi),
|
|
39
38
|
[simple_input_classifier_1.InputType.Lang]: builtIns.with(built_in_props_1.CallProp.Lang),
|
|
40
|
-
[simple_input_classifier_1.InputType.Options]: builtIns.with(built_in_props_1.CallProp.Ambient),
|
|
39
|
+
[simple_input_classifier_1.InputType.Options]: builtIns.with([built_in_props_1.CallProp.Ambient, built_in_props_1.SemanticCallTag.LoadsPackage, built_in_props_1.SemanticCallTag.ChecksPackage]),
|
|
41
40
|
[simple_input_classifier_1.InputType.CommandLine]: builtIns.with(built_in_props_1.SemanticCallTag.CommandLine),
|
|
42
41
|
[simple_input_classifier_1.InputType.User]: builtIns.with(built_in_props_1.SemanticCallTag.User),
|
|
42
|
+
[simple_input_classifier_1.InputType.Unknown]: builtIns.with(built_in_props_1.CallProp.NonDet),
|
|
43
|
+
evaluating: builtIns.with(built_in_props_1.SemanticCallTag.Eval),
|
|
44
|
+
editing: builtIns.with(built_in_props_1.SemanticCallTag.Edits),
|
|
45
|
+
templates: builtIns.params(built_in_props_1.ArgProp.Injectable).map(p => ({ call: p.call, argName: p.name, argIdx: p.index })),
|
|
43
46
|
linkedObjects: input_source_functions_1.LinkedInputObjects,
|
|
44
47
|
linkedEntryPoints: input_source_functions_1.LinkedInputEntryPoints,
|
|
45
48
|
narrowing: (0, input_source_functions_1.narrowingFunctions)(builtIns)
|
|
@@ -50,7 +53,7 @@ exports.InputSourcesDefinition = {
|
|
|
50
53
|
executor: input_sources_query_executor_1.executeInputSourcesQuery,
|
|
51
54
|
asciiSummarizer: async (formatter, analyzer, queryResults, result) => {
|
|
52
55
|
const out = queryResults;
|
|
53
|
-
result.push(
|
|
56
|
+
result.push((0, query_print_1.queryHeader)('input-sources', formatter, out['.meta'].timing));
|
|
54
57
|
const nast = (await analyzer.normalize()).idMap;
|
|
55
58
|
for (const [key, sources] of Object.entries(out.results)) {
|
|
56
59
|
result.push(` ╰ Input Sources for ${key}`);
|
|
@@ -87,6 +90,9 @@ exports.InputSourcesDefinition = {
|
|
|
87
90
|
[simple_input_classifier_1.InputType.Options]: joi_1.default.array().items(joi_1.default.string()).optional().description('Functions that access or set global options (e.g., options, getOption).'),
|
|
88
91
|
[simple_input_classifier_1.InputType.CommandLine]: joi_1.default.array().items(joi_1.default.string()).optional().description('Functions that hand back what the program was invoked with (e.g., commandArgs).'),
|
|
89
92
|
[simple_input_classifier_1.InputType.User]: joi_1.default.array().items(joi_1.default.string()).optional().description('Functions that read interactive user input (e.g., file.choose, readline, menu, askYesNo).'),
|
|
93
|
+
sanitizers: joi_1.default.array().items(joi_1.default.string()).optional().description('Functions whose result counts as a derived constant whatever flows in (e.g., an escaping function).'),
|
|
94
|
+
evaluating: joi_1.default.array().items(joi_1.default.string()).optional().description('Functions that evaluate code or look up names at run time, whose result is unknown (e.g., eval, do.call, exists).'),
|
|
95
|
+
editing: joi_1.default.array().items(joi_1.default.string()).optional().description('Functions that cut or replace parts of a string, undoing what a sanitizer escaped (e.g., gsub, substr).'),
|
|
90
96
|
linkedObjects: joi_1.default.array().items(joi_1.default.object({
|
|
91
97
|
name: joi_1.default.string().required().description('Name of the object, e.g. input.'),
|
|
92
98
|
type: joi_1.default.string().valid(...record_1.Record.values(simple_input_classifier_1.InputType)).required().description('How reads of the object (or of its fields) are classified.'),
|
|
@@ -53,10 +53,10 @@ export interface LinkedInputEntryPoint {
|
|
|
53
53
|
/** A function whose result is bounded by one argument (e.g. `match.arg` by its `choices`), classified by that argument alone. */
|
|
54
54
|
export interface NarrowingFunction {
|
|
55
55
|
readonly call: Identifier;
|
|
56
|
-
/** the name of the bounding argument
|
|
57
|
-
readonly argName
|
|
58
|
-
/** the index of the bounding argument
|
|
59
|
-
readonly argIdx
|
|
56
|
+
/** the name of the bounding argument */
|
|
57
|
+
readonly argName: string;
|
|
58
|
+
/** the index of the bounding argument when it is passed positionally */
|
|
59
|
+
readonly argIdx: number;
|
|
60
60
|
}
|
|
61
61
|
/**
|
|
62
62
|
* Scalar R constant values representable in TypeScript.
|
|
@@ -116,6 +116,14 @@ export interface InputClassifierConfig<Functions extends InputClassifierFunction
|
|
|
116
116
|
* @see {@link NarrowingFunction}
|
|
117
117
|
*/
|
|
118
118
|
narrowing?: readonly NarrowingFunction[];
|
|
119
|
+
/** Functions whose result counts as a {@link InputType.DerivedConstant} whatever flows in, like a linter's escaping functions. */
|
|
120
|
+
sanitizers?: Functions;
|
|
121
|
+
/** The arguments a {@link sanitizers|sanitizer} takes as code rather than escaping, like the template of `sqlInterpolate`, whose data still flows. */
|
|
122
|
+
templates?: readonly NarrowingFunction[];
|
|
123
|
+
/** Functions that evaluate code or look names up at run time (`eval`, `do.call`, `exists`), so their result is never constant. */
|
|
124
|
+
evaluating?: Functions;
|
|
125
|
+
/** Functions that cut or replace parts of a string (`gsub`), undoing what a {@link sanitizers|sanitizer} escaped. */
|
|
126
|
+
editing?: Functions;
|
|
119
127
|
}
|
|
120
128
|
/**
|
|
121
129
|
* Takes the given id which is expected to either be:
|