@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
|
@@ -20,7 +20,7 @@ function analyzerHasTarget(analyzer, input) {
|
|
|
20
20
|
const current = analyzer.inspectContext().files.loadingOrder.getUnorderedRequests();
|
|
21
21
|
return current.length === 1 && current[0].request === requested.request && current[0].content === requested.content;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function printQueryHelp(output) {
|
|
24
24
|
output.stderr(`Format: ${(0, ansi_1.italic)(':query <query> <code>', output.formatter)}`);
|
|
25
25
|
output.stdout('Queries starting with \'@<type>\' are interpreted as a query of the given type.');
|
|
26
26
|
output.stdout(`Start with '?<type>' instead to see documentation on a query, e.g. ${(0, ansi_1.bold)(':query ?guess-dep-versions', output.formatter)} (a bare ${(0, ansi_1.bold)(':query ?', output.formatter)} lists them all).`);
|
|
@@ -31,7 +31,7 @@ function printHelp(output) {
|
|
|
31
31
|
output.stdout('Please have a look at the wiki for more info: https://github.com/flowr-analysis/flowr/wiki/Query-API');
|
|
32
32
|
}
|
|
33
33
|
/** the single boundary cast for Joi's untyped {@link Joi.Description}, shared by the doc and template renderers */
|
|
34
|
-
function
|
|
34
|
+
function describeQuerySchema(schema) {
|
|
35
35
|
return schema.describe();
|
|
36
36
|
}
|
|
37
37
|
/** Print documentation for one query type from its Joi schema (description + each parameter), or list all when no name is given. */
|
|
@@ -46,7 +46,7 @@ function printQueryDoc(output, name) {
|
|
|
46
46
|
output.stderr(`Unknown query ${(0, ansi_1.italic)(name, output.formatter)}; use ${(0, ansi_1.bold)(':query ?', output.formatter)} to list every query.`);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
const desc =
|
|
49
|
+
const desc = describeQuerySchema(def.schema);
|
|
50
50
|
output.stdout(`${(0, ansi_1.bold)('@' + name, output.formatter)}${desc.flags?.description ? ` ${(0, ansi_1.faint)('— ' + desc.flags.description, output.formatter)}` : ''}`);
|
|
51
51
|
const params = Object.entries(desc.keys ?? {}).filter(([key]) => key !== 'type');
|
|
52
52
|
if (params.length === 0) {
|
|
@@ -65,7 +65,7 @@ function printQueryDoc(output, name) {
|
|
|
65
65
|
}
|
|
66
66
|
/** A copy-pasteable JSON template for a query type: its `type` plus each required field as a placeholder. */
|
|
67
67
|
function queryTemplate(type, schema) {
|
|
68
|
-
const keys =
|
|
68
|
+
const keys = describeQuerySchema(schema).keys ?? {};
|
|
69
69
|
const fields = [`\\"type\\": \\"${type}\\"`];
|
|
70
70
|
for (const [key, value] of Object.entries(keys)) {
|
|
71
71
|
if (key !== 'type' && value.flags?.presence === 'required') {
|
|
@@ -104,7 +104,7 @@ async function processQueryArgs(output, analyzer, remainingArgs) {
|
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
if (query === 'help') {
|
|
107
|
-
|
|
107
|
+
printQueryHelp(output);
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
110
|
// `?<type>` (or `? <type>`) documents a query instead of running it; a bare `?` lists them all
|
|
@@ -142,7 +142,7 @@ async function processQueryArgs(output, analyzer, remainingArgs) {
|
|
|
142
142
|
parsedQuery = [{ type: 'call-context', callName: query }];
|
|
143
143
|
}
|
|
144
144
|
if (input) {
|
|
145
|
-
input =
|
|
145
|
+
input = unwrapQuotedInput(input);
|
|
146
146
|
input = (0, path_input_1.handlePathLikeInput)(output, input, analyzer.flowrConfig);
|
|
147
147
|
// reuse a prior analysis (e.g. a dataflow from :df#) when the target is unchanged
|
|
148
148
|
if (!analyzerHasTarget(analyzer, input)) {
|
|
@@ -166,7 +166,7 @@ const ConfigLineRegex = /^(@config)(?:\s+([\s\S]*))?$/;
|
|
|
166
166
|
* generic tokenizer would otherwise strip quotes out of a `+path=["a"]` value.
|
|
167
167
|
* @param line - The input line
|
|
168
168
|
*/
|
|
169
|
-
function
|
|
169
|
+
function parseQueryArgs(line) {
|
|
170
170
|
const configMatch = ConfigLineRegex.exec(line);
|
|
171
171
|
if (configMatch) {
|
|
172
172
|
const [, name, rest] = configMatch;
|
|
@@ -183,7 +183,7 @@ function parseArgs(line) {
|
|
|
183
183
|
* Undoes a wrapping of the whole code in quotes, as `:query \@dependencies "library(x)"` writes it. A quote the
|
|
184
184
|
* code itself contains ends the wrapping early, so it is left alone.
|
|
185
185
|
*/
|
|
186
|
-
function
|
|
186
|
+
function unwrapQuotedInput(code) {
|
|
187
187
|
const quote = code[0];
|
|
188
188
|
if ((quote !== '"' && quote !== '\'') || code.length < 2 || code[code.length - 1] !== quote) {
|
|
189
189
|
return code;
|
|
@@ -218,7 +218,7 @@ exports.queryCommand = {
|
|
|
218
218
|
usageExample: ':query "<query>" <code>',
|
|
219
219
|
aliases: [],
|
|
220
220
|
script: false,
|
|
221
|
-
argsParser:
|
|
221
|
+
argsParser: parseQueryArgs,
|
|
222
222
|
fn: async ({ output, analyzer, remainingArgs }) => {
|
|
223
223
|
const totalStart = Date.now();
|
|
224
224
|
const results = await processQueryArgs(output, analyzer, remainingArgs);
|
|
@@ -234,7 +234,7 @@ exports.queryStarCommand = {
|
|
|
234
234
|
usageExample: ':query* <query> <code>',
|
|
235
235
|
aliases: [],
|
|
236
236
|
script: false,
|
|
237
|
-
argsParser:
|
|
237
|
+
argsParser: parseQueryArgs,
|
|
238
238
|
fn: async ({ output, analyzer, remainingArgs }) => {
|
|
239
239
|
const results = await processQueryArgs(output, analyzer, remainingArgs);
|
|
240
240
|
if (results) {
|
|
@@ -13,14 +13,14 @@ const config_1 = require("../../../config");
|
|
|
13
13
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
14
14
|
const signature_query_executor_1 = require("../../../queries/catalog/signature-query/signature-query-executor");
|
|
15
15
|
/** treat the whole line as arguments, no R code to separate */
|
|
16
|
-
function
|
|
16
|
+
function parseSignatureArgs(line) {
|
|
17
17
|
return { rCode: undefined, remaining: (0, args_1.splitAtEscapeSensitive)(line) };
|
|
18
18
|
}
|
|
19
19
|
/** the (possibly space-containing) path/argument remainder passed to a subcommand */
|
|
20
20
|
function joinArgs(args) {
|
|
21
21
|
return args.filter(a => a.length > 0).join(' ').trim();
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function printSignatureHelp(output) {
|
|
24
24
|
const f = output.formatter;
|
|
25
25
|
output.stdout((0, ansi_1.bold)('Signature Database', f) + (0, ansi_1.italic)(' (inspect and extend the databases that resolve library()/`::` calls)', f));
|
|
26
26
|
output.stdout('');
|
|
@@ -111,7 +111,7 @@ const signatureSubcommands = {
|
|
|
111
111
|
info: runInfo,
|
|
112
112
|
add: runAdd,
|
|
113
113
|
download: runDownload,
|
|
114
|
-
help: output =>
|
|
114
|
+
help: output => printSignatureHelp(output),
|
|
115
115
|
};
|
|
116
116
|
/** the `:signature` subcommand names, offered as completions for its first argument */
|
|
117
117
|
exports.signatureSubcommandNames = Object.keys(signatureSubcommands);
|
|
@@ -138,7 +138,7 @@ exports.signatureCommand = {
|
|
|
138
138
|
script: false,
|
|
139
139
|
// `add` mounts arbitrary local files and `download` fetches from the network and persists into the global config
|
|
140
140
|
localOnly: true,
|
|
141
|
-
argsParser:
|
|
141
|
+
argsParser: parseSignatureArgs,
|
|
142
142
|
fn: async ({ output, analyzer, remainingArgs }) => {
|
|
143
143
|
const [sub = 'help', ...rest] = remainingArgs.filter(a => a.length > 0);
|
|
144
144
|
const handler = signatureSubcommands[sub];
|
|
@@ -28,6 +28,7 @@ export declare class FlowRServerConnection {
|
|
|
28
28
|
private invalidateTokens;
|
|
29
29
|
private sendFileAnalysisResponse;
|
|
30
30
|
private createAnalyzerForRequest;
|
|
31
|
+
private sendError;
|
|
31
32
|
/**
|
|
32
33
|
* Looks up the analysis stored for the given file token, answering with an error message if there is none.
|
|
33
34
|
*/
|
|
@@ -123,12 +123,7 @@ class FlowRServerConnection {
|
|
|
123
123
|
case 'request-query':
|
|
124
124
|
return this.handleQueryRequest(message);
|
|
125
125
|
default:
|
|
126
|
-
(
|
|
127
|
-
id: message.id,
|
|
128
|
-
type: 'error',
|
|
129
|
-
fatal: true,
|
|
130
|
-
reason: `The message type ${JSON.stringify(message.type ?? 'undefined')} is not supported.`
|
|
131
|
-
});
|
|
126
|
+
this.sendError(message.id, `The message type ${JSON.stringify(message.type ?? 'undefined')} is not supported.`, true);
|
|
132
127
|
this.socket.end();
|
|
133
128
|
return Promise.resolve();
|
|
134
129
|
}
|
|
@@ -163,12 +158,7 @@ class FlowRServerConnection {
|
|
|
163
158
|
}
|
|
164
159
|
catch (e) {
|
|
165
160
|
this.logger.error(`[${this.name}] Error while analyzing file ${message.filename ?? 'unknown file'}: ${String(e)}`);
|
|
166
|
-
|
|
167
|
-
id: message.id,
|
|
168
|
-
type: 'error',
|
|
169
|
-
fatal: false,
|
|
170
|
-
reason: `Error while analyzing file ${message.filename ?? 'unknown file'}: ${String(e)}`
|
|
171
|
-
});
|
|
161
|
+
this.sendError(message.id, `Error while analyzing file ${message.filename ?? 'unknown file'}: ${String(e)}`);
|
|
172
162
|
}
|
|
173
163
|
// this is an interestingly named function that means "I am a callback that removes a file" - so this deletes the file
|
|
174
164
|
tempFile.removeCallback();
|
|
@@ -261,18 +251,16 @@ class FlowRServerConnection {
|
|
|
261
251
|
}
|
|
262
252
|
return analyzer;
|
|
263
253
|
}
|
|
254
|
+
sendError(id, reason, fatal = false) {
|
|
255
|
+
(0, send_1.sendMessage)(this.socket, { id, type: 'error', fatal, reason });
|
|
256
|
+
}
|
|
264
257
|
/**
|
|
265
258
|
* Looks up the analysis stored for the given file token, answering with an error message if there is none.
|
|
266
259
|
*/
|
|
267
260
|
getAnalyzedFile(request) {
|
|
268
261
|
const fileInformation = this.fileMap.get(request.filetoken);
|
|
269
262
|
if (!fileInformation) {
|
|
270
|
-
|
|
271
|
-
id: request.id,
|
|
272
|
-
type: 'error',
|
|
273
|
-
fatal: false,
|
|
274
|
-
reason: `The file token ${request.filetoken} has never been analyzed.`
|
|
275
|
-
});
|
|
263
|
+
this.sendError(request.id, `The file token ${request.filetoken} has never been analyzed.`);
|
|
276
264
|
}
|
|
277
265
|
return fileInformation;
|
|
278
266
|
}
|
|
@@ -304,12 +292,7 @@ class FlowRServerConnection {
|
|
|
304
292
|
}
|
|
305
293
|
catch (e) {
|
|
306
294
|
this.logger.error(`[${this.name}] Error while analyzing file for token ${request.filetoken}: ${String(e)}`);
|
|
307
|
-
|
|
308
|
-
id: request.id,
|
|
309
|
-
type: 'error',
|
|
310
|
-
fatal: false,
|
|
311
|
-
reason: `Error while analyzing file for token ${request.filetoken}: ${String(e)}`
|
|
312
|
-
});
|
|
295
|
+
this.sendError(request.id, `Error while analyzing file for token ${request.filetoken}: ${String(e)}`);
|
|
313
296
|
}
|
|
314
297
|
}
|
|
315
298
|
async handleRepl(base) {
|
|
@@ -364,12 +347,7 @@ class FlowRServerConnection {
|
|
|
364
347
|
}
|
|
365
348
|
catch (e) {
|
|
366
349
|
this.logger.error(`[${this.name}] Error while executing query: ${String(e)}`);
|
|
367
|
-
|
|
368
|
-
id: request.id,
|
|
369
|
-
type: 'error',
|
|
370
|
-
fatal: false,
|
|
371
|
-
reason: `Error while executing query: ${String(e)}`
|
|
372
|
-
});
|
|
350
|
+
this.sendError(request.id, `Error while executing query: ${String(e)}`);
|
|
373
351
|
}
|
|
374
352
|
}
|
|
375
353
|
}
|
|
@@ -32,7 +32,7 @@ const jsonSchema = joi_1.default.object({
|
|
|
32
32
|
const compactSchema = joi_1.default.object({
|
|
33
33
|
type: joi_1.default.string().valid('response-file-analysis').required().description('The type of the message.'),
|
|
34
34
|
id: joi_1.default.string().optional().description('The id of the message, if you passed one in the request.'),
|
|
35
|
-
format: joi_1.default.string().valid('
|
|
35
|
+
format: joi_1.default.string().valid('compact').required().description('The format of the results in compact format.'),
|
|
36
36
|
results: joi_1.default.string().required().description('The results of the analysis (one field per step).'),
|
|
37
37
|
cfg: joi_1.default.string().optional().description('The control flow information of the file, only present if requested.')
|
|
38
38
|
});
|
package/config.d.ts
CHANGED
|
@@ -134,6 +134,12 @@ export interface FlowrConfig {
|
|
|
134
134
|
};
|
|
135
135
|
readonly linter: {
|
|
136
136
|
readonly disabledRules: string[];
|
|
137
|
+
/**
|
|
138
|
+
* Rules carrying any of these {@link LintingRuleTag}s are excluded from the default rule set (a rule requested
|
|
139
|
+
* explicitly still runs). The `cmd-check` rules are only enabled for a {@link ProjectKind.Package} this way, so a
|
|
140
|
+
* configured list replaces that default: keep `cmd-check` in it to keep those rules off outside packages.
|
|
141
|
+
*/
|
|
142
|
+
readonly disabledTags?: string[];
|
|
137
143
|
};
|
|
138
144
|
/**
|
|
139
145
|
* Teaches the {@link InputSourcesQuery|input-sources} analysis further frameworks; entries are *added* to what
|
package/config.js
CHANGED
|
@@ -306,11 +306,13 @@ exports.FlowrConfig = {
|
|
|
306
306
|
assumeImplicitEcho: true
|
|
307
307
|
},
|
|
308
308
|
linter: {
|
|
309
|
-
disabledRules: []
|
|
309
|
+
disabledRules: [],
|
|
310
|
+
/* the R CMD check rules only make sense for a package, which re-enables them below */
|
|
311
|
+
disabledTags: ['cmd-check']
|
|
310
312
|
},
|
|
311
313
|
specializeConfig: {
|
|
312
314
|
/* a package's top-level code runs at install time, its results are not echoed to anyone */
|
|
313
|
-
[project_kind_1.ProjectKind.Package]: { project: { assumeImplicitEcho: false }, solver: { resolveSource: { assumeFilesExist: true } } },
|
|
315
|
+
[project_kind_1.ProjectKind.Package]: { project: { assumeImplicitEcho: false }, solver: { resolveSource: { assumeFilesExist: true } }, linter: { disabledTags: [] } },
|
|
314
316
|
[project_kind_1.ProjectKind.Project]: { solver: { resolveSource: { assumeFilesExist: true } } },
|
|
315
317
|
[project_kind_1.ProjectKind.ShinyApp]: {
|
|
316
318
|
/* shiny evaluates global.R before the supporting files in R/, and the app itself last */
|
|
@@ -429,7 +431,8 @@ exports.FlowrConfig = {
|
|
|
429
431
|
}).optional().description('Overrides for the signals flowR uses to classify the project kind.')
|
|
430
432
|
}).description('Project specific configuration options.'),
|
|
431
433
|
linter: joi_1.default.object({
|
|
432
|
-
disabledRules: joi_1.default.array().items(joi_1.default.string()).description('Linting rule names excluded from the default rule set (a rule requested explicitly via a linter query still runs). Usually set per project kind via specializeConfig.')
|
|
434
|
+
disabledRules: joi_1.default.array().items(joi_1.default.string()).description('Linting rule names excluded from the default rule set (a rule requested explicitly via a linter query still runs). Usually set per project kind via specializeConfig.'),
|
|
435
|
+
disabledTags: joi_1.default.array().items(joi_1.default.string()).optional().description('Linting rule tags whose rules are excluded from the default rule set (a rule requested explicitly via a linter query still runs). By default the cmd-check rules are disabled for everything but a package; a configured list replaces that default.')
|
|
433
436
|
}).description('Linter configuration options.'),
|
|
434
437
|
inputSources: joi_1.default.object({
|
|
435
438
|
pure: joi_1.default.array().items(joi_1.default.string()).optional().description('Functions that only pass the constantness of their arguments on.'),
|
|
@@ -612,7 +615,7 @@ exports.FlowrConfig = {
|
|
|
612
615
|
/**
|
|
613
616
|
* Creates a new flowr config that has the updated values.
|
|
614
617
|
*/
|
|
615
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
618
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- amendments usually mutate in place and return nothing
|
|
616
619
|
amend(config, amendmentFunc) {
|
|
617
620
|
const newConfig = exports.FlowrConfig.clone(config);
|
|
618
621
|
return amendmentFunc(newConfig) ?? newConfig;
|
|
@@ -16,6 +16,7 @@ const convert_values_1 = require("../r-bridge/lang-4.x/convert-values");
|
|
|
16
16
|
const r_function_definition_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
17
17
|
const r_if_then_else_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-if-then-else");
|
|
18
18
|
const r_parameter_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-parameter");
|
|
19
|
+
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
19
20
|
class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.SemanticCfgGuidedVisitor {
|
|
20
21
|
cachedConditions = new Map();
|
|
21
22
|
cachedStatements = new Map();
|
|
@@ -72,10 +73,7 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
|
|
|
72
73
|
}
|
|
73
74
|
const og = this.getValue(cause);
|
|
74
75
|
const w = control_flow_graph_1.CfgEdge.unpackWhen(edge);
|
|
75
|
-
if (og === logic_1.Ternary.Always && w === convert_values_1.RFalse) {
|
|
76
|
-
cfg.removeEdge(from, target);
|
|
77
|
-
}
|
|
78
|
-
else if (og === logic_1.Ternary.Never && w === convert_values_1.RTrue) {
|
|
76
|
+
if ((og === logic_1.Ternary.Always && w === convert_values_1.RFalse) || (og === logic_1.Ternary.Never && w === convert_values_1.RTrue)) {
|
|
79
77
|
cfg.removeEdge(from, target);
|
|
80
78
|
}
|
|
81
79
|
}
|
|
@@ -142,21 +140,14 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
|
|
|
142
140
|
if (cached !== undefined) {
|
|
143
141
|
return cached;
|
|
144
142
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const vertex = this.getDataflowGraph(node);
|
|
148
|
-
if (vertex_1.DfgVertex.isFunctionCall(vertex) && Array.isArray(vertex.origin) && vertex.origin.includes(built_in_proc_name_1.BuiltInProcName.Try)) {
|
|
149
|
-
result = true;
|
|
150
|
-
break;
|
|
151
|
-
}
|
|
152
|
-
node = this.getNormalizedAst(node)?.info.parent;
|
|
153
|
-
}
|
|
143
|
+
const result = model_1.RNode.iterateParents(this.getNormalizedAst(id), this.config.normalizedAst.idMap)
|
|
144
|
+
.some(node => vertex_1.DfgVertex.hasOrigin(this.getDataflowGraph(node.info.id), built_in_proc_name_1.BuiltInProcName.Try));
|
|
154
145
|
this.caught.set(id, result);
|
|
155
146
|
return result;
|
|
156
147
|
}
|
|
157
148
|
switchArmDefinitelyNotTaken(cause, from) {
|
|
158
149
|
const v = this.config.dfg.getVertex(cause);
|
|
159
|
-
if (!vertex_1.DfgVertex.isFunctionCall(v) || !
|
|
150
|
+
if (!vertex_1.DfgVertex.isFunctionCall(v) || !vertex_1.DfgVertex.hasOrigin(v, built_in_proc_name_1.BuiltInProcName.Switch)) {
|
|
160
151
|
return false;
|
|
161
152
|
}
|
|
162
153
|
const selected = this.selectedSwitchArm(v);
|
|
@@ -9,12 +9,7 @@ function singleOutgoingFd(outgoing) {
|
|
|
9
9
|
return undefined;
|
|
10
10
|
}
|
|
11
11
|
const next = outgoing.entries().next().value;
|
|
12
|
-
|
|
13
|
-
return next[0];
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
12
|
+
return control_flow_graph_1.CfgEdge.isFlowDependency(next?.[1]) ? next[0] : undefined;
|
|
18
13
|
}
|
|
19
14
|
/**
|
|
20
15
|
* Take a control flow information of a graph without any basic blocks and convert it to a graph with basic blocks.
|
|
@@ -73,7 +73,7 @@ export declare const CfgVertex: {
|
|
|
73
73
|
* @param callTargets - if the vertex calls a function, this links all targets of this call
|
|
74
74
|
* @see {@link CfgVertex#isExpression|isExpression()} - for a way to check whether a vertex is an expression vertex
|
|
75
75
|
*/
|
|
76
|
-
readonly makeExpression: (this: void, id: NodeId,
|
|
76
|
+
readonly makeExpression: (this: void, id: NodeId, info?: {
|
|
77
77
|
children?: NodeId[];
|
|
78
78
|
callTargets?: Set<NodeId>;
|
|
79
79
|
}) => CfgExpressionVertex;
|
|
@@ -84,7 +84,7 @@ export declare const CfgVertex: {
|
|
|
84
84
|
* @param callTargets - if the vertex calls a function, this links all targets of this call
|
|
85
85
|
* @see {@link CfgVertex#isStatement|isStatement()} - for a way to check whether a vertex is a statement vertex
|
|
86
86
|
*/
|
|
87
|
-
readonly makeStatement: (this: void, id: NodeId,
|
|
87
|
+
readonly makeStatement: (this: void, id: NodeId, info?: {
|
|
88
88
|
children?: NodeId[];
|
|
89
89
|
callTargets?: Set<NodeId>;
|
|
90
90
|
}) => CfgStatementVertex;
|
|
@@ -449,14 +449,9 @@ export declare class ControlFlowGraph<Vertex extends CfgVertex = CfgVertex> impl
|
|
|
449
449
|
/**
|
|
450
450
|
* Add a new edge to the control flow graph, in flow order: `to` is evaluated after `from`.
|
|
451
451
|
* @see {@link ControlFlowGraph#addVertex|addVertex()} - to add vertices
|
|
452
|
-
* @see {@link ControlFlowGraph#addEdges|addEdges()} - to add multiple edges at once
|
|
453
452
|
*/
|
|
454
453
|
addEdge(from: NodeId, to: NodeId, edge: CfgEdge): this;
|
|
455
454
|
private reverse;
|
|
456
|
-
/**
|
|
457
|
-
* Add multiple edges from a given source vertex to the control flow graph.
|
|
458
|
-
*/
|
|
459
|
-
addEdges(from: NodeId, to: Map<NodeId, CfgEdge>): this;
|
|
460
455
|
outgoingEdges(node: NodeId): ReadonlyMap<NodeId, CfgEdge> | undefined;
|
|
461
456
|
ingoingEdges(node: NodeId): ReadonlyMap<NodeId, CfgEdge> | undefined;
|
|
462
457
|
/** @see {@link ReadOnlyControlFlowGraph#edgesFrom|edgesFrom()} */
|
|
@@ -495,15 +490,6 @@ export declare class ControlFlowGraph<Vertex extends CfgVertex = CfgVertex> impl
|
|
|
495
490
|
removeEdge(from: NodeId, to: NodeId): this;
|
|
496
491
|
/** merges b into a */
|
|
497
492
|
mergeTwoBasicBlocks(a: NodeId, b: NodeId): this;
|
|
498
|
-
/**
|
|
499
|
-
* **This Operation is in-place and modifies the current graph.**
|
|
500
|
-
* Merge another control flow graph into this one.
|
|
501
|
-
* @param other - the other control flow graph to merge into this one
|
|
502
|
-
* @param forceNested - should the other graph be assumed to be fully nested (e.g., within a function definition).
|
|
503
|
-
*
|
|
504
|
-
* This is the pendant of {@link DataflowGraph#mergeWith|mergeWith()} on a {@link DataflowGraph}.
|
|
505
|
-
*/
|
|
506
|
-
mergeWith(other: ControlFlowGraph<Vertex>, forceNested?: boolean): this;
|
|
507
493
|
}
|
|
508
494
|
/**
|
|
509
495
|
* Summarizes the control information of a program
|
|
@@ -14,6 +14,7 @@ const control_flow_1 = require("../dataflow/internal/control-flow");
|
|
|
14
14
|
const convert_values_1 = require("../r-bridge/lang-4.x/convert-values");
|
|
15
15
|
const assert_1 = require("../util/assert");
|
|
16
16
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
17
|
+
const arrays_1 = require("../util/collections/arrays");
|
|
17
18
|
/**
|
|
18
19
|
* The type of a {@link CfgVertex} in the {@link ControlFlowGraph}.
|
|
19
20
|
*/
|
|
@@ -48,11 +49,8 @@ exports.CfgVertex = {
|
|
|
48
49
|
* @param callTargets - if the vertex calls a function, this links all targets of this call
|
|
49
50
|
* @see {@link CfgVertex#isExpression|isExpression()} - for a way to check whether a vertex is an expression vertex
|
|
50
51
|
*/
|
|
51
|
-
makeExpression(id,
|
|
52
|
-
|
|
53
|
-
return [CfgVertexType.Expression, id];
|
|
54
|
-
}
|
|
55
|
-
return [CfgVertexType.Expression, id, children, callTargets];
|
|
52
|
+
makeExpression(id, info = {}) {
|
|
53
|
+
return exports.CfgVertex.makeExprOrStm(id, CfgVertexType.Expression, info);
|
|
56
54
|
},
|
|
57
55
|
/**
|
|
58
56
|
* Create a new statement vertex with the given id, children, and call targets.
|
|
@@ -61,11 +59,8 @@ exports.CfgVertex = {
|
|
|
61
59
|
* @param callTargets - if the vertex calls a function, this links all targets of this call
|
|
62
60
|
* @see {@link CfgVertex#isStatement|isStatement()} - for a way to check whether a vertex is a statement vertex
|
|
63
61
|
*/
|
|
64
|
-
makeStatement(id,
|
|
65
|
-
|
|
66
|
-
return [CfgVertexType.Statement, id];
|
|
67
|
-
}
|
|
68
|
-
return [CfgVertexType.Statement, id, children, callTargets];
|
|
62
|
+
makeStatement(id, info = {}) {
|
|
63
|
+
return exports.CfgVertex.makeExprOrStm(id, CfgVertexType.Statement, info);
|
|
69
64
|
},
|
|
70
65
|
/**
|
|
71
66
|
* A convenience function to create a new vertex which is either a statement or an expression.
|
|
@@ -434,7 +429,6 @@ class ControlFlowGraph {
|
|
|
434
429
|
/**
|
|
435
430
|
* Add a new edge to the control flow graph, in flow order: `to` is evaluated after `from`.
|
|
436
431
|
* @see {@link ControlFlowGraph#addVertex|addVertex()} - to add vertices
|
|
437
|
-
* @see {@link ControlFlowGraph#addEdges|addEdges()} - to add multiple edges at once
|
|
438
432
|
*/
|
|
439
433
|
addEdge(from, to, edge) {
|
|
440
434
|
this.materialize();
|
|
@@ -455,16 +449,6 @@ class ControlFlowGraph {
|
|
|
455
449
|
}
|
|
456
450
|
return this.revEdgeInfos;
|
|
457
451
|
}
|
|
458
|
-
/**
|
|
459
|
-
* Add multiple edges from a given source vertex to the control flow graph.
|
|
460
|
-
*/
|
|
461
|
-
addEdges(from, to) {
|
|
462
|
-
this.materialize();
|
|
463
|
-
for (const [toNode, edge] of to) {
|
|
464
|
-
this.addEdge(from, toNode, edge);
|
|
465
|
-
}
|
|
466
|
-
return this;
|
|
467
|
-
}
|
|
468
452
|
outgoingEdges(node) {
|
|
469
453
|
if (this.isView) {
|
|
470
454
|
return controlFlowEdges(this.dfg.outgoingEdges(node));
|
|
@@ -551,16 +535,8 @@ class ControlFlowGraph {
|
|
|
551
535
|
if (res || !includeBlocks) {
|
|
552
536
|
return res;
|
|
553
537
|
}
|
|
554
|
-
const block = this.
|
|
555
|
-
|
|
556
|
-
return undefined;
|
|
557
|
-
}
|
|
558
|
-
const blockVertex = this.vtxInfos.get(block);
|
|
559
|
-
if (blockVertex === undefined || !exports.CfgVertex.isBlock(blockVertex)) {
|
|
560
|
-
return undefined;
|
|
561
|
-
}
|
|
562
|
-
const elems = exports.CfgVertex.getBasicBlockElements(blockVertex);
|
|
563
|
-
return elems.find(e => exports.CfgVertex.getId(e) === id);
|
|
538
|
+
const block = this.getBasicBlock(id);
|
|
539
|
+
return block && exports.CfgVertex.getBasicBlockElements(block).find(e => exports.CfgVertex.getId(e) === id);
|
|
564
540
|
}
|
|
565
541
|
hasVertex(id, includeBlocks = true) {
|
|
566
542
|
if (this.isView) {
|
|
@@ -708,40 +684,6 @@ class ControlFlowGraph {
|
|
|
708
684
|
}
|
|
709
685
|
return this;
|
|
710
686
|
}
|
|
711
|
-
/**
|
|
712
|
-
* **This Operation is in-place and modifies the current graph.**
|
|
713
|
-
* Merge another control flow graph into this one.
|
|
714
|
-
* @param other - the other control flow graph to merge into this one
|
|
715
|
-
* @param forceNested - should the other graph be assumed to be fully nested (e.g., within a function definition).
|
|
716
|
-
*
|
|
717
|
-
* This is the pendant of {@link DataflowGraph#mergeWith|mergeWith()} on a {@link DataflowGraph}.
|
|
718
|
-
*/
|
|
719
|
-
mergeWith(other, forceNested = false) {
|
|
720
|
-
this.materialize();
|
|
721
|
-
/* the other graph may be a projection that has not been asked for anything yet */
|
|
722
|
-
other.materialize();
|
|
723
|
-
this._mayBB ||= other._mayBB;
|
|
724
|
-
const roots = other.roots;
|
|
725
|
-
if (this._mayBB) {
|
|
726
|
-
for (const [id, node] of other.vtxInfos) {
|
|
727
|
-
this.addVertex(node, !forceNested && roots.has(id));
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
else {
|
|
731
|
-
for (const [id, node] of other.vtxInfos) {
|
|
732
|
-
this.vtxInfos.set(id, node);
|
|
733
|
-
}
|
|
734
|
-
if (!forceNested) {
|
|
735
|
-
for (const root of roots) {
|
|
736
|
-
this.roots.add(root);
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
for (const [from, edges] of other.edgeInfos) {
|
|
741
|
-
this.addEdges(from, edges);
|
|
742
|
-
}
|
|
743
|
-
return this;
|
|
744
|
-
}
|
|
745
687
|
}
|
|
746
688
|
exports.ControlFlowGraph = ControlFlowGraph;
|
|
747
689
|
/**
|
|
@@ -894,7 +836,7 @@ function extractCfg(dataflow) {
|
|
|
894
836
|
graph,
|
|
895
837
|
/* a program without a single statement (only comments, say) has nothing to enter or leave */
|
|
896
838
|
entryPoints: graph.hasVertex(entry) ? [entry] : [],
|
|
897
|
-
exitPoints:
|
|
839
|
+
exitPoints: (0, arrays_1.uniqueArray)(exitPoints).filter(e => graph.hasVertex(e)),
|
|
898
840
|
returns,
|
|
899
841
|
breaks,
|
|
900
842
|
nexts
|
package/control-flow/diff-cfg.js
CHANGED
|
@@ -20,29 +20,24 @@ function diffOfControlFlowGraphs(left, right, config) {
|
|
|
20
20
|
return ctx.report;
|
|
21
21
|
}
|
|
22
22
|
function diffDataflowGraphs(ctx) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
graph_helper_1.GraphHelper.diff.outgoingEdges(ctx,
|
|
23
|
+
diffCfgRootVertices(ctx);
|
|
24
|
+
diffCfgVertices(ctx);
|
|
25
|
+
graph_helper_1.GraphHelper.diff.outgoingEdges(ctx, diffCfgEdges);
|
|
26
26
|
}
|
|
27
|
-
function
|
|
27
|
+
function diffCfgRootVertices(ctx) {
|
|
28
28
|
(0, diff_1.setDifference)(ctx.left.rootIds(), ctx.right.rootIds(), {
|
|
29
29
|
...ctx,
|
|
30
30
|
position: `${ctx.position}Root vertices differ in graphs. `
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function diffCfgVertices(ctx) {
|
|
34
34
|
const lVert = [...ctx.left.vertices(false).entries()];
|
|
35
35
|
const rVert = [...ctx.right.vertices(false).entries()];
|
|
36
|
-
|
|
37
|
-
|| lVert.length > rVert.length && !ctx.config.rightIsSubgraph) {
|
|
38
|
-
ctx.report.addComment(`Detected different number of vertices! ${ctx.leftname} has ${lVert.length}, ${ctx.rightname} has ${rVert.length}`);
|
|
39
|
-
}
|
|
36
|
+
graph_helper_1.GraphHelper.diff.vertexCount(ctx, lVert.length, rVert.length);
|
|
40
37
|
for (const [id, lInfo] of lVert) {
|
|
41
38
|
const rInfo = ctx.right.getVertex(id, false);
|
|
42
39
|
if (rInfo === undefined) {
|
|
43
|
-
|
|
44
|
-
ctx.report.addComment(`Vertex ${id} is not present in ${ctx.rightname}`, { tag: 'vertex', id });
|
|
45
|
-
}
|
|
40
|
+
graph_helper_1.GraphHelper.diff.missingVertex(ctx, id);
|
|
46
41
|
continue;
|
|
47
42
|
}
|
|
48
43
|
const lType = control_flow_graph_1.CfgVertex.getType(lInfo);
|
|
@@ -68,21 +63,13 @@ function diffVertices(ctx) {
|
|
|
68
63
|
ctx.report.addComment(`Vertex ${id} differs in elems.\n ${ctx.leftname}: ${JSON.stringify(lElems)}\n vs\n ${ctx.rightname}: ${JSON.stringify(rElems)}`, { tag: 'vertex', id });
|
|
69
64
|
}
|
|
70
65
|
}
|
|
71
|
-
const lTargets = control_flow_graph_1.CfgVertex.getCallTargets(lInfo);
|
|
72
|
-
const rTargets = control_flow_graph_1.CfgVertex.getCallTargets(rInfo);
|
|
73
|
-
if (lTargets !== undefined || rTargets !== undefined) {
|
|
74
|
-
(0, diff_1.setDifference)(lTargets ?? new Set(), rTargets ?? new Set(), {
|
|
75
|
-
...ctx,
|
|
76
|
-
position: `${ctx.position}Vertex ${id} differs in call targets. `
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
66
|
(0, diff_1.setDifference)(new Set(control_flow_graph_1.CfgVertex.getChildren(lInfo)), new Set(control_flow_graph_1.CfgVertex.getChildren(rInfo)), {
|
|
80
67
|
...ctx,
|
|
81
68
|
position: `${ctx.position}Vertex ${id} differs in children. `
|
|
82
69
|
});
|
|
83
70
|
}
|
|
84
71
|
}
|
|
85
|
-
function
|
|
72
|
+
function diffCfgEdge(edge, otherEdge, ctx, id, target) {
|
|
86
73
|
const el = control_flow_graph_1.CfgEdge.getType(edge);
|
|
87
74
|
const ol = control_flow_graph_1.CfgEdge.getType(otherEdge);
|
|
88
75
|
if (el !== ol) {
|
|
@@ -99,7 +86,7 @@ function diffEdge(edge, otherEdge, ctx, id, target) {
|
|
|
99
86
|
ctx.report.addComment(`Edge ${id}->${target} differs in when. ${ctx.leftname}: ${JSON.stringify(ew)} vs ${ctx.rightname}: ${JSON.stringify(ow)}`, { tag: 'edge', from: id, to: target });
|
|
100
87
|
}
|
|
101
88
|
}
|
|
102
|
-
function
|
|
103
|
-
graph_helper_1.GraphHelper.diff.edges(ctx, id, lEdges, rEdges,
|
|
89
|
+
function diffCfgEdges(ctx, id, lEdges, rEdges) {
|
|
90
|
+
graph_helper_1.GraphHelper.diff.edges(ctx, id, lEdges, rEdges, diffCfgEdge);
|
|
104
91
|
}
|
|
105
92
|
//# sourceMappingURL=diff-cfg.js.map
|
|
@@ -396,17 +396,11 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
396
396
|
/** Fires for every purrr formula, e.g. `map(df, ~ .x + 1)`. */
|
|
397
397
|
onPurrFormulaCall(_data) { }
|
|
398
398
|
getSourceAndTarget(call) {
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
401
|
-
const
|
|
402
|
-
if (
|
|
403
|
-
|
|
404
|
-
if (targetOut !== undefined) {
|
|
405
|
-
const source = targetOut.entries().filter(([t, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedBy) && t !== call.id).toArray();
|
|
406
|
-
if (source.length === 1) {
|
|
407
|
-
return { target: target[0][0], source: source[0][0] };
|
|
408
|
-
}
|
|
409
|
-
}
|
|
399
|
+
const target = df_helper_1.Dataflow.targetsOf(this.config.dfg, call.id, edge_1.EdgeType.Returns);
|
|
400
|
+
if (target.length === 1) {
|
|
401
|
+
const source = df_helper_1.Dataflow.targetsOf(this.config.dfg, target[0], edge_1.EdgeType.DefinedBy).filter(t => t !== call.id);
|
|
402
|
+
if (source.length === 1) {
|
|
403
|
+
return { target: target[0], source: source[0] };
|
|
410
404
|
}
|
|
411
405
|
}
|
|
412
406
|
return { target: undefined, source: undefined };
|
|
@@ -13,7 +13,7 @@ const queue_1 = require("../util/collections/queue");
|
|
|
13
13
|
* @see {@link visitCfgInOrder} for a traversal in order
|
|
14
14
|
*/
|
|
15
15
|
function visitCfgInReverseOrder(graph, startNodes,
|
|
16
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type --
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- visitors that only observe return nothing, and we never stop for them
|
|
17
17
|
visitor) {
|
|
18
18
|
const visited = new Set();
|
|
19
19
|
const queue = startNodes.slice();
|
|
@@ -48,7 +48,7 @@ visitor) {
|
|
|
48
48
|
* @see {@link visitCfgInReverseOrder} for a traversal in reversed order
|
|
49
49
|
*/
|
|
50
50
|
function visitCfgInOrder(graph, startNodes,
|
|
51
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type --
|
|
51
|
+
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- visitors that only observe return nothing, and we never stop for them
|
|
52
52
|
visitor) {
|
|
53
53
|
const visited = new Set();
|
|
54
54
|
const queue = new queue_1.ArrayQueue(startNodes);
|