@eagleoutice/flowr 2.16.2 → 2.16.4
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 +15 -15
- 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 +10 -0
- package/dataflow/environments/built-in-props.js +25 -1
- 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 +188 -14
- package/dataflow/environments/default-builtin-config.js +125 -65
- 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 +0 -2
- package/dataflow/environments/identifier.js +5 -7
- package/dataflow/environments/overwrite.js +1 -0
- package/dataflow/environments/query-fn-props.js +4 -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 +16 -11
- 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 +3 -8
- 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 +3 -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 +5 -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 +4 -3
- 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-query.d.ts +1 -1
- package/documentation/doc-util/doc-query.js +3 -1
- package/documentation/doc-util/doc-repl.js +4 -4
- package/documentation/doc-util/doc-timings.js +3 -2
- 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 +2 -2
- package/documentation/wiki-dataflow-graph.js +6 -6
- package/documentation/wiki-interface.js +3 -2
- package/documentation/wiki-linter.d.ts +14 -0
- package/documentation/wiki-linter.js +353 -88
- 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 +552 -35
- 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.d.ts +1 -1
- package/linter/rules/absolute-path.js +9 -6
- 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 +216 -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 +51 -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 +60 -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 +51 -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 +173 -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 +83 -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/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +1 -1
- package/linter/rules/dead-code.d.ts +4 -4
- package/linter/rules/dead-code.js +19 -4
- package/linter/rules/deprecated-functions.d.ts +1 -1
- package/linter/rules/deprecated-functions.js +5 -5
- package/linter/rules/file-path-validity.d.ts +6 -2
- package/linter/rules/file-path-validity.js +7 -3
- package/linter/rules/namespace-access.d.ts +3 -3
- package/linter/rules/namespace-access.js +12 -3
- package/linter/rules/naming-convention.d.ts +2 -2
- package/linter/rules/naming-convention.js +14 -15
- package/linter/rules/network-functions.d.ts +1 -1
- package/linter/rules/network-functions.js +1 -1
- package/linter/rules/no-leaked-credentials.d.ts +1 -1
- package/linter/rules/no-leaked-credentials.js +5 -5
- package/linter/rules/problematic-inputs.d.ts +2 -2
- package/linter/rules/problematic-inputs.js +4 -3
- package/linter/rules/roxygen-arguments.d.ts +2 -2
- package/linter/rules/roxygen-arguments.js +2 -2
- package/linter/rules/seeded-randomness.d.ts +2 -2
- package/linter/rules/seeded-randomness.js +7 -7
- package/linter/rules/software-has-license.d.ts +3 -3
- package/linter/rules/software-has-license.js +3 -3
- package/linter/rules/software-has-tests.d.ts +2 -2
- package/linter/rules/software-has-tests.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +3 -3
- package/linter/rules/stop-with-call-arg.js +21 -4
- package/linter/rules/syntactically-valid.d.ts +1 -1
- package/linter/rules/syntactically-valid.js +1 -1
- package/linter/rules/unclosed-connection.d.ts +2 -2
- package/linter/rules/unclosed-connection.js +5 -5
- package/linter/rules/undefined-symbol-util.js +16 -32
- package/linter/rules/undefined-symbol.d.ts +3 -1
- package/linter/rules/undefined-symbol.js +34 -4
- package/linter/rules/unescaped-arguments.d.ts +1 -1
- package/linter/rules/unescaped-arguments.js +11 -10
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/unused-definition.js +14 -20
- package/linter/rules/unused-import.d.ts +1 -1
- package/linter/rules/unused-import.js +1 -1
- package/linter/rules/useless-loop.d.ts +1 -1
- package/linter/rules/useless-loop.js +1 -1
- 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 +2 -2
- package/project/context/flowr-analyzer-environment-context.js +2 -1
- package/project/context/flowr-analyzer-files-context.d.ts +6 -0
- package/project/context/flowr-analyzer-files-context.js +15 -11
- 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/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
- 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 +24 -32
- 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 +45 -0
- package/queries/catalog/dependencies-query/data-flow.js +179 -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 +36 -35
- 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-sources-query-executor.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -3
- package/queries/catalog/input-sources-query/simple-input-classifier.js +28 -29
- 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-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
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ It offers a wide variety of features, for example:
|
|
|
38
38
|
|
|
39
39
|
```shell
|
|
40
40
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
41
|
-
flowR repl v2.16.
|
|
41
|
+
flowR repl v2.16.3, R grammar v14 (tree-sitter engine)
|
|
42
42
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ It offers a wide variety of features, for example:
|
|
|
46
46
|
<summary style='color:gray'>Output</summary>
|
|
47
47
|
|
|
48
48
|
```text
|
|
49
|
-
Query: linter (
|
|
49
|
+
Query: linter (18 ms)
|
|
50
50
|
╰ Deprecated Functions (deprecated-functions): no findings
|
|
51
51
|
╰ File Path Validity (file-path-validity): no findings
|
|
52
52
|
╰ Seeded Randomness (seeded-randomness): no findings
|
|
@@ -56,8 +56,8 @@ It offers a wide variety of features, for example:
|
|
|
56
56
|
╰ Dataframe Access Validation (dataframe-access-validation): no findings
|
|
57
57
|
╰ Dead Code (dead-code): no findings
|
|
58
58
|
╰ Useless Loops (useless-loop): no findings
|
|
59
|
-
╰ Problematic
|
|
60
|
-
╰ Stop
|
|
59
|
+
╰ Problematic Inputs (problematic-inputs): no findings
|
|
60
|
+
╰ Stop Without Call (stop-call): no findings
|
|
61
61
|
╰ Roxygen Arguments (roxygen-arguments): no findings
|
|
62
62
|
╰ No Leaked Credentials (no-leaked-credentials): no findings
|
|
63
63
|
╰ Undefined Symbol (undefined-symbol): no findings
|
|
@@ -65,7 +65,7 @@ It offers a wide variety of features, for example:
|
|
|
65
65
|
╰ Unclosed Connection (unclosed-connection): no findings
|
|
66
66
|
╰ Unescaped Arguments (unescaped-arguments): no findings
|
|
67
67
|
╰ Namespace Access Validity (namespace-access): no findings
|
|
68
|
-
All queries together required ≈
|
|
68
|
+
All queries together required ≈18 ms (1ms accuracy, total 18 ms)
|
|
69
69
|
```
|
|
70
70
|
|
|
71
71
|
The linter will analyze the code and return any issues found.
|
|
@@ -79,7 +79,7 @@ It offers a wide variety of features, for example:
|
|
|
79
79
|
|
|
80
80
|
_Results (prettified and summarized):_
|
|
81
81
|
|
|
82
|
-
Query: **linter** (
|
|
82
|
+
Query: **linter** (30 ms)\
|
|
83
83
|
╰ **Deprecated Functions** (deprecated-functions): _no findings_\
|
|
84
84
|
╰ **File Path Validity** (file-path-validity):\
|
|
85
85
|
╰ certain:\
|
|
@@ -93,8 +93,8 @@ It offers a wide variety of features, for example:
|
|
|
93
93
|
╰ **Dataframe Access Validation** (dataframe-access-validation): _no findings_\
|
|
94
94
|
╰ **Dead Code** (dead-code): _no findings_\
|
|
95
95
|
╰ **Useless Loops** (useless-loop): _no findings_\
|
|
96
|
-
╰ **Problematic
|
|
97
|
-
╰ **Stop
|
|
96
|
+
╰ **Problematic Inputs** (problematic-inputs): _no findings_\
|
|
97
|
+
╰ **Stop Without Call** (stop-call): _no findings_\
|
|
98
98
|
╰ **Roxygen Arguments** (roxygen-arguments): _no findings_\
|
|
99
99
|
╰ **No Leaked Credentials** (no-leaked-credentials): _no findings_\
|
|
100
100
|
╰ **Undefined Symbol** (undefined-symbol): _no findings_\
|
|
@@ -102,7 +102,7 @@ It offers a wide variety of features, for example:
|
|
|
102
102
|
╰ **Unclosed Connection** (unclosed-connection): _no findings_\
|
|
103
103
|
╰ **Unescaped Arguments** (unescaped-arguments): _no findings_\
|
|
104
104
|
╰ **Namespace Access Validity** (namespace-access): _no findings_\
|
|
105
|
-
_All queries together required ≈
|
|
105
|
+
_All queries together required ≈30 ms (1ms accuracy, total 30 ms)_
|
|
106
106
|
|
|
107
107
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
108
108
|
|
|
@@ -133,13 +133,13 @@ It offers a wide variety of features, for example:
|
|
|
133
133
|
"problematic-inputs": {"results":[],".meta":{}},
|
|
134
134
|
"stop-call": {"results":[],".meta":{"consideredNodes":0}},
|
|
135
135
|
"roxygen-arguments": {"results":[],".meta":{}},
|
|
136
|
-
"no-leaked-credentials": {"results":[],".meta":{"totalChecked":
|
|
136
|
+
"no-leaked-credentials": {"results":[],".meta":{"totalChecked":1}},
|
|
137
137
|
"undefined-symbol": {
|
|
138
138
|
"results": [],
|
|
139
139
|
".meta": {
|
|
140
140
|
"totalFunctionCalls": 1,
|
|
141
141
|
"totalVariableUses": 0,
|
|
142
|
-
"suppressed": {"installed":0,"loadedPackage":0,"enclosingScope":0,"nonStandardEval":0,"subscript":0,"unresolvedLibrary":0}
|
|
142
|
+
"suppressed": {"installed":0,"loadedPackage":0,"enclosingScope":0,"nonStandardEval":0,"subscript":0,"unresolvedLibrary":0,"declaredGlobal":0}
|
|
143
143
|
}
|
|
144
144
|
},
|
|
145
145
|
"unused-import": {"results":[],".meta":{"totalConsidered":0,"totalUnresolved":0,"totalMultiPackage":0,"totalUnused":0}},
|
|
@@ -193,7 +193,7 @@ It offers a wide variety of features, for example:
|
|
|
193
193
|
|
|
194
194
|
```shell
|
|
195
195
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
196
|
-
flowR repl v2.16.
|
|
196
|
+
flowR repl v2.16.3, R grammar v14 (tree-sitter engine)
|
|
197
197
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
198
198
|
```
|
|
199
199
|
|
|
@@ -206,7 +206,7 @@ It offers a wide variety of features, for example:
|
|
|
206
206
|
N <- 10
|
|
207
207
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
208
208
|
sum
|
|
209
|
-
All queries together required ≈
|
|
209
|
+
All queries together required ≈6 ms (1ms accuracy, total 6 ms)
|
|
210
210
|
```
|
|
211
211
|
|
|
212
212
|
</details>
|
|
@@ -214,7 +214,7 @@ It offers a wide variety of features, for example:
|
|
|
214
214
|
</details>
|
|
215
215
|
|
|
216
216
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
217
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
217
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">137.3 ms</span></i> (as of Oct 19, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
218
218
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
219
219
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph#perspectives-cg).
|
|
220
220
|
( [▶ Explore in Browser](https://flowr-analysis.github.io/flowr/wiki/playground/#c=zDYSwRgTghhCeAUATADsWECUAoLBnAxlMAKYD6ALgPakC2UAHgAQA8AtIwGYCuAdvuSEo949DIyYB6RnXojsWaAHdGKlW0aIo5KADoO0GsXghEjALyMAjAC4AbABpGANyJdi5xvngBmRwA5HAHZHACZHAE5HABYMbHwSKB5VdQ4QYHJiCHglRxdgN0YAPkYQuISeABICImJTdWqSCmoZeHjiRIq8t3lcLho6OFJcbXJcFnZe-pgQXCM2xMdDRI8l4Qba2KxeLlnEJu1gNQm%2B7KhFTtdieUUIEAydfFwneEmB2CGR3EcAIleYWAeT2%2B2FQlHIrXKVUIJEQIMoIB4owh7UqJgwQA&p=13:1 "run this script in flowR's playground, no setup") )
|
|
@@ -245,7 +245,7 @@ It offers a wide variety of features, for example:
|
|
|
245
245
|
|
|
246
246
|
```shell
|
|
247
247
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
248
|
-
flowR repl v2.16.
|
|
248
|
+
flowR repl v2.16.3, R grammar v14 (tree-sitter engine)
|
|
249
249
|
R> :dataflow* test/testfiles/example.R
|
|
250
250
|
```
|
|
251
251
|
|
|
@@ -13,7 +13,6 @@ exports.isRNull = isRNull;
|
|
|
13
13
|
exports.isValidColName = isValidColName;
|
|
14
14
|
exports.parseRequestContent = parseRequestContent;
|
|
15
15
|
const edge_1 = require("../../dataflow/graph/edge");
|
|
16
|
-
const frame_reflection_1 = require("../../dataflow/fn/frame-reflection");
|
|
17
16
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
18
17
|
const function_semantics_1 = require("../../dataflow/fn/function-semantics");
|
|
19
18
|
const resolve_helper_1 = require("../../dataflow/environments/resolve-helper");
|
|
@@ -27,6 +26,8 @@ const convert_values_1 = require("../../r-bridge/lang-4.x/convert-values");
|
|
|
27
26
|
const assert_1 = require("../../util/assert");
|
|
28
27
|
const files_1 = require("../../util/files");
|
|
29
28
|
const resolve_args_1 = require("./resolve-args");
|
|
29
|
+
const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
30
|
+
const strings_1 = require("../../util/text/strings");
|
|
30
31
|
/** Regular expression representing valid columns names, e.g. for `data.frame` */
|
|
31
32
|
const ColNamesRegex = /^[A-Za-z.][A-Za-z0-9_.]*$/;
|
|
32
33
|
/** Regular expression representing line terminations (LF, CRLF, CR) */
|
|
@@ -42,7 +43,7 @@ function escapeRegExp(text, allowTokens = false) {
|
|
|
42
43
|
return text.replace(/[.*+?^${}()|[\]]|\\[^stn]/g, '\\$&');
|
|
43
44
|
}
|
|
44
45
|
else {
|
|
45
|
-
return
|
|
46
|
+
return (0, strings_1.escapeRegex)(text);
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
/**
|
|
@@ -150,7 +151,7 @@ function getUnresolvedSymbolsInExpression(expression, dfg) {
|
|
|
150
151
|
const symbolName = (0, resolve_args_1.unquoteArgument)(identifier_1.Identifier.getName(node.content));
|
|
151
152
|
// ignore symbols named ".", as they are used as argument placeholder in magrittr pipe operations
|
|
152
153
|
/* a masked name a call runs, like the function in `across(everything(), as.character)`, falls back to the function without such a column */
|
|
153
|
-
const masked = function_semantics_1.FunctionSemantics.call.nse.maskedName(dfg, node.info.id) &&
|
|
154
|
+
const masked = function_semantics_1.FunctionSemantics.call.nse.maskedName(dfg, node.info.id) && df_helper_1.Dataflow.sourcesOf(dfg, node.info.id, edge_1.EdgeType.Calls).length === 0;
|
|
154
155
|
if (vertex_1.DfgVertex.isUse(vertex) && (edges?.size === 0 || masked) && symbolNamespace === undefined && symbolName !== '.') {
|
|
155
156
|
unresolvedSymbols.push(symbolName);
|
|
156
157
|
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DataFrameShapeSemantics = void 0;
|
|
4
4
|
const config_1 = require("../../config");
|
|
5
5
|
const built_in_proc_name_1 = require("../../dataflow/environments/built-in-proc-name");
|
|
6
|
-
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
7
6
|
const resolve_helper_1 = require("../../dataflow/environments/resolve-helper");
|
|
8
7
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
9
8
|
const make_argument_1 = require("../../dataflow/internal/process/functions/call/argument/make-argument");
|
|
@@ -1598,7 +1597,7 @@ function getSelectedColumns(args, info) {
|
|
|
1598
1597
|
const joinColumns = (columns1, columns2) => columns1 !== undefined && columns2 !== undefined ? [...columns1, ...columns2] : undefined;
|
|
1599
1598
|
for (const arg of args) {
|
|
1600
1599
|
if (arg !== undefined && r_argument_1.RArgument.isNotEmpty(arg)) {
|
|
1601
|
-
if (r_function_call_1.RFunctionCall.isNamed(arg.value
|
|
1600
|
+
if (r_function_call_1.RFunctionCall.isNamed(arg.value, 'c')) {
|
|
1602
1601
|
const result = getSelectedColumns(arg.value.arguments, info);
|
|
1603
1602
|
selectedCols = joinColumns(selectedCols, result.selectedCols);
|
|
1604
1603
|
unselectedCols = joinColumns(unselectedCols, result.unselectedCols);
|
|
@@ -201,6 +201,6 @@ declare function applyJoinSemantics(value: DataFrameDomain, { other, by }: {
|
|
|
201
201
|
join?: 'inner' | 'left' | 'right' | 'full';
|
|
202
202
|
natural?: boolean;
|
|
203
203
|
}): DataFrameDomain;
|
|
204
|
-
declare function applyIdentitySemantics(value: DataFrameDomain, _args:
|
|
205
|
-
declare function applyUnknownSemantics(value: DataFrameDomain, _args:
|
|
204
|
+
declare function applyIdentitySemantics(value: DataFrameDomain, _args: object): DataFrameDomain;
|
|
205
|
+
declare function applyUnknownSemantics(value: DataFrameDomain, _args: object): DataFrameDomain;
|
|
206
206
|
export {};
|
|
@@ -357,14 +357,10 @@ function applyJoinSemantics(value, { other, by }, options) {
|
|
|
357
357
|
rows: productRows ? productInterval(rows, value.rows, other.rows) : rows
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
|
-
function applyIdentitySemantics(value,
|
|
361
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
362
|
-
_args) {
|
|
360
|
+
function applyIdentitySemantics(value, _args) {
|
|
363
361
|
return value;
|
|
364
362
|
}
|
|
365
|
-
function applyUnknownSemantics(value,
|
|
366
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
367
|
-
_args) {
|
|
363
|
+
function applyUnknownSemantics(value, _args) {
|
|
368
364
|
return value.top();
|
|
369
365
|
}
|
|
370
366
|
function setRange(colnames) {
|
package/benchmark/slicer.js
CHANGED
|
@@ -24,7 +24,6 @@ const tree_sitter_types_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitte
|
|
|
24
24
|
const tree_sitter_executor_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor");
|
|
25
25
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
26
26
|
const edge_1 = require("../dataflow/graph/edge");
|
|
27
|
-
const graph_1 = require("../dataflow/graph/graph");
|
|
28
27
|
const arrays_1 = require("../util/collections/arrays");
|
|
29
28
|
const config_1 = require("../config");
|
|
30
29
|
const control_flow_graph_1 = require("../control-flow/control-flow-graph");
|
|
@@ -130,8 +129,7 @@ class BenchmarkSlicer {
|
|
|
130
129
|
let numberOfCalls = 0;
|
|
131
130
|
let numberOfDefinitions = 0;
|
|
132
131
|
for (const [n, info] of vertices) {
|
|
133
|
-
const
|
|
134
|
-
for (const [, edge] of outgoingEdges ?? graph_1.NoEdges) {
|
|
132
|
+
for (const [, edge] of this.dataflow.graph.edgesFrom(n)) {
|
|
135
133
|
/* the control flow lives in the very same graph, so it is counted on its own to stay comparable */
|
|
136
134
|
if (edge_1.DfEdge.includesType(edge, edge_1.ControlFlowEdgeTypes)) {
|
|
137
135
|
numberOfControlFlowEdges++;
|
|
@@ -23,18 +23,7 @@ async function processRunMeasurement(line, fileNum, lineNum, textOutputAppendPat
|
|
|
23
23
|
...got,
|
|
24
24
|
stats: {
|
|
25
25
|
...got.stats,
|
|
26
|
-
|
|
27
|
-
.map(([k, v]) => [k, v])),
|
|
28
|
-
commonMeasurements: new Map(got.stats.commonMeasurements
|
|
29
|
-
.map(([k, v]) => {
|
|
30
|
-
(0, assert_1.guard)(v.endsWith('n'), 'Expected a bigint');
|
|
31
|
-
return [k, BigInt(v.slice(0, -1))];
|
|
32
|
-
})),
|
|
33
|
-
additionalMeasurements: new Map((got.stats.additionalMeasurements ?? [])
|
|
34
|
-
.map(([k, v]) => {
|
|
35
|
-
(0, assert_1.guard)(v.endsWith('n'), 'Expected a bigint');
|
|
36
|
-
return [k, BigInt(v.slice(0, -1))];
|
|
37
|
-
})),
|
|
26
|
+
...(0, process_1.restoreMeasurementMaps)(got.stats),
|
|
38
27
|
perSliceMeasurements: new Map(got.stats.perSliceMeasurements
|
|
39
28
|
.map(([k, v]) => mapPerSliceStats(k, v))),
|
|
40
29
|
dataFrameShape: got.stats.dataFrameShape !== undefined ? {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SummarizedSlicerStats, UltimateSlicerStats } from '../data';
|
|
2
|
+
import { type BenchmarkMemoryMeasurement } from '../../stats/stats';
|
|
2
3
|
/**
|
|
3
4
|
* This big function summarizes multiple summarized stats into one ultimate stat.
|
|
4
5
|
*/
|
|
@@ -7,6 +8,12 @@ export declare function summarizeAllSummarizedStats(stats: SummarizedSlicerStats
|
|
|
7
8
|
* This big function summarizes multiple ultimate stats into one.
|
|
8
9
|
*/
|
|
9
10
|
export declare function summarizeAllUltimateStats(stats: UltimateSlicerStats[]): UltimateSlicerStats;
|
|
11
|
+
/** Restores the maps and bigints of serialized measurements. */
|
|
12
|
+
export declare function restoreMeasurementMaps(stats: object): {
|
|
13
|
+
memory: Map<"total" | "initialize R session" | "retrieve AST from R code" | "normalize R AST" | "produce dataflow information" | "close R session" | "extract control flow graph" | "infer data frame shapes" | "extract call graph", BenchmarkMemoryMeasurement<number>>;
|
|
14
|
+
commonMeasurements: Map<"total" | "initialize R session" | "retrieve AST from R code" | "normalize R AST" | "produce dataflow information" | "close R session" | "extract control flow graph" | "infer data frame shapes" | "extract call graph", bigint>;
|
|
15
|
+
additionalMeasurements: Map<"dependencies query" | "linter run" | "calibration", bigint>;
|
|
16
|
+
};
|
|
10
17
|
/**
|
|
11
18
|
* Processes the next summary line.
|
|
12
19
|
*/
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.summarizeAllSummarizedStats = summarizeAllSummarizedStats;
|
|
4
4
|
exports.summarizeAllUltimateStats = summarizeAllUltimateStats;
|
|
5
|
+
exports.restoreMeasurementMaps = restoreMeasurementMaps;
|
|
5
6
|
exports.processNextSummary = processNextSummary;
|
|
6
7
|
exports.processNextUltimateSummary = processNextUltimateSummary;
|
|
7
8
|
const process_1 = require("../first-phase/process");
|
|
@@ -292,6 +293,19 @@ function summarizeAllUltimateStats(stats) {
|
|
|
292
293
|
} : undefined
|
|
293
294
|
};
|
|
294
295
|
}
|
|
296
|
+
/** Restores the maps and bigints of serialized measurements. */
|
|
297
|
+
function restoreMeasurementMaps(stats) {
|
|
298
|
+
const { memory, commonMeasurements, additionalMeasurements } = stats;
|
|
299
|
+
const bigints = (entries) => new Map(entries.map(([k, v]) => {
|
|
300
|
+
(0, assert_1.guard)(v.endsWith('n'), 'Expected a bigint');
|
|
301
|
+
return [k, BigInt(v.slice(0, -1))];
|
|
302
|
+
}));
|
|
303
|
+
return {
|
|
304
|
+
memory: new Map(memory),
|
|
305
|
+
commonMeasurements: bigints(commonMeasurements),
|
|
306
|
+
additionalMeasurements: bigints(additionalMeasurements ?? [])
|
|
307
|
+
};
|
|
308
|
+
}
|
|
295
309
|
/**
|
|
296
310
|
* Processes the next summary line.
|
|
297
311
|
*/
|
|
@@ -301,18 +315,7 @@ function processNextSummary(line, allSummarized) {
|
|
|
301
315
|
summarize: {
|
|
302
316
|
...got.summarize,
|
|
303
317
|
// restore maps
|
|
304
|
-
|
|
305
|
-
.map(([k, v]) => [k, v])),
|
|
306
|
-
commonMeasurements: new Map(got.summarize.commonMeasurements
|
|
307
|
-
.map(([k, v]) => {
|
|
308
|
-
(0, assert_1.guard)(v.endsWith('n'), 'Expected a bigint');
|
|
309
|
-
return [k, BigInt(v.slice(0, -1))];
|
|
310
|
-
})),
|
|
311
|
-
additionalMeasurements: new Map((got.summarize.additionalMeasurements ?? [])
|
|
312
|
-
.map(([k, v]) => {
|
|
313
|
-
(0, assert_1.guard)(v.endsWith('n'), 'Expected a bigint');
|
|
314
|
-
return [k, BigInt(v.slice(0, -1))];
|
|
315
|
-
})),
|
|
318
|
+
...restoreMeasurementMaps(got.summarize),
|
|
316
319
|
perSliceMeasurements: {
|
|
317
320
|
...got.summarize.perSliceMeasurements,
|
|
318
321
|
// restore maps
|
|
@@ -2,61 +2,30 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.controlflowBbStarCommand = exports.controlflowBbCommand = exports.controlflowStarCommand = exports.controlflowCommand = void 0;
|
|
4
4
|
const cfg_1 = require("../../../util/mermaid/cfg");
|
|
5
|
-
const ansi_1 = require("../../../util/text/ansi");
|
|
6
5
|
const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
|
|
7
6
|
const core_1 = require("../core");
|
|
8
7
|
const repl_clipboard_1 = require("./repl-clipboard");
|
|
9
|
-
function formatInfo(out, type) {
|
|
10
|
-
return out.formatter.format(`Copied ${type} to clipboard.`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
11
|
-
}
|
|
12
8
|
async function produceAndPrintCfg(analyzer, output, simplifications, cfgConverter) {
|
|
13
9
|
const cfg = await analyzer.controlflow([...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications]);
|
|
14
10
|
const normalizedAst = await analyzer.normalize();
|
|
15
11
|
const mermaid = cfgConverter(cfg, normalizedAst);
|
|
16
|
-
await repl_clipboard_1.ReplClipboard.print(output, mermaid,
|
|
12
|
+
await repl_clipboard_1.ReplClipboard.print(output, mermaid, repl_clipboard_1.ReplClipboard.note(output, 'mermaid code'));
|
|
13
|
+
}
|
|
14
|
+
function cfgCommand(description, usageExample, aliases, simplifications, cfgConverter) {
|
|
15
|
+
return {
|
|
16
|
+
description,
|
|
17
|
+
isCodeCommand: true,
|
|
18
|
+
usageExample,
|
|
19
|
+
aliases,
|
|
20
|
+
script: false,
|
|
21
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
22
|
+
fn: async ({ output, analyzer }) => {
|
|
23
|
+
await produceAndPrintCfg(analyzer, output, simplifications, cfgConverter);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
17
26
|
}
|
|
18
|
-
exports.controlflowCommand =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
aliases: ['cfg', 'cf'],
|
|
23
|
-
script: false,
|
|
24
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
25
|
-
fn: async ({ output, analyzer }) => {
|
|
26
|
-
await produceAndPrintCfg(analyzer, output, [], cfg_1.cfgToMermaid);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
exports.controlflowStarCommand = {
|
|
30
|
-
description: 'Returns the URL to mermaid.live',
|
|
31
|
-
isCodeCommand: true,
|
|
32
|
-
usageExample: ':controlflow*',
|
|
33
|
-
aliases: ['cfg*', 'cf*'],
|
|
34
|
-
script: false,
|
|
35
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
36
|
-
fn: async ({ output, analyzer }) => {
|
|
37
|
-
await produceAndPrintCfg(analyzer, output, [], cfg_1.cfgToMermaidUrl);
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
exports.controlflowBbCommand = {
|
|
41
|
-
description: 'Get mermaid code for the control-flow graph with basic blocks',
|
|
42
|
-
isCodeCommand: true,
|
|
43
|
-
usageExample: ':controlflowbb',
|
|
44
|
-
aliases: ['cfgb', 'cfb'],
|
|
45
|
-
script: false,
|
|
46
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
47
|
-
fn: async ({ output, analyzer }) => {
|
|
48
|
-
await produceAndPrintCfg(analyzer, output, ['to-basic-blocks'], cfg_1.cfgToMermaid);
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
exports.controlflowBbStarCommand = {
|
|
52
|
-
description: 'Returns the URL to mermaid.live',
|
|
53
|
-
isCodeCommand: true,
|
|
54
|
-
usageExample: ':controlflowbb*',
|
|
55
|
-
aliases: ['cfgb*', 'cfb*'],
|
|
56
|
-
script: false,
|
|
57
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
58
|
-
fn: async ({ output, analyzer }) => {
|
|
59
|
-
await produceAndPrintCfg(analyzer, output, ['to-basic-blocks'], cfg_1.cfgToMermaidUrl);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
27
|
+
exports.controlflowCommand = cfgCommand('Get mermaid code for the control-flow graph of R code', ':controlflow', ['cfg', 'cf'], [], cfg_1.cfgToMermaid);
|
|
28
|
+
exports.controlflowStarCommand = cfgCommand('Returns the URL to mermaid.live', ':controlflow*', ['cfg*', 'cf*'], [], cfg_1.cfgToMermaidUrl);
|
|
29
|
+
exports.controlflowBbCommand = cfgCommand('Get mermaid code for the control-flow graph with basic blocks', ':controlflowbb', ['cfgb', 'cfb'], ['to-basic-blocks'], cfg_1.cfgToMermaid);
|
|
30
|
+
exports.controlflowBbStarCommand = cfgCommand('Returns the URL to mermaid.live', ':controlflowbb*', ['cfgb*', 'cfb*'], ['to-basic-blocks'], cfg_1.cfgToMermaidUrl);
|
|
62
31
|
//# sourceMappingURL=repl-cfg.js.map
|
|
@@ -5,6 +5,8 @@ import type { ReplOutput } from './repl-main';
|
|
|
5
5
|
*/
|
|
6
6
|
export declare const ReplClipboard: {
|
|
7
7
|
readonly name: "ReplClipboard";
|
|
8
|
+
/** The note that `type` was copied, mentioning how long the given pipeline `step` took if known. */
|
|
9
|
+
readonly note: (this: void, output: ReplOutput, type: string, step?: string, timing?: number) => string;
|
|
8
10
|
/** Prints `text` and, if the output allows it, copies it to the clipboard and reports `note` afterwards. */
|
|
9
11
|
readonly print: (this: void, output: ReplOutput, text: string, note: string) => Promise<void>;
|
|
10
12
|
};
|
|
@@ -35,12 +35,17 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.ReplClipboard = void 0;
|
|
37
37
|
const secure_mode_1 = require("../../../util/secure-mode");
|
|
38
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
38
39
|
/**
|
|
39
40
|
* Output that the user most likely wants on their clipboard as well.
|
|
40
41
|
* @helper output
|
|
41
42
|
*/
|
|
42
43
|
exports.ReplClipboard = {
|
|
43
44
|
name: 'ReplClipboard',
|
|
45
|
+
/** The note that `type` was copied, mentioning how long the given pipeline `step` took if known. */
|
|
46
|
+
note(output, type, step, timing) {
|
|
47
|
+
return output.formatter.format(`Copied ${type} to clipboard${step === undefined ? '' : ` (${step}: ${timing}ms)`}.`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
48
|
+
},
|
|
44
49
|
/** Prints `text` and, if the output allows it, copies it to the clipboard and reports `note` afterwards. */
|
|
45
50
|
async print(output, text, note) {
|
|
46
51
|
output.stdout(text);
|
|
@@ -52,7 +52,7 @@ function wrapAfter(prefix, content) {
|
|
|
52
52
|
}
|
|
53
53
|
return prefix + lines.map((l, i) => i === 0 ? l : pad + l).join('\n');
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function scriptHelpText(script, f, starredVersion) {
|
|
56
56
|
let content = script[1].description;
|
|
57
57
|
if (starredVersion) {
|
|
58
58
|
content += ` ${(0, ansi_1.italic)(`(star: ${starredVersion.description})`, f)}`;
|
|
@@ -85,7 +85,7 @@ function printCommandHelp(formatter) {
|
|
|
85
85
|
}
|
|
86
86
|
const lines = [];
|
|
87
87
|
for (const entry of bases.filter(([name]) => shortestPrefixCommand(name) === name).sort((a, b) => a[0].localeCompare(b[0]))) {
|
|
88
|
-
lines.push(
|
|
88
|
+
lines.push(scriptHelpText(entry, formatter, cmds[entry[0] + '*']));
|
|
89
89
|
const variants = children.get(entry[0]);
|
|
90
90
|
if (variants) {
|
|
91
91
|
lines.push(printFamilyVariants(variants.sort(), cmds, formatter));
|
|
@@ -10,9 +10,6 @@ const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
|
10
10
|
const config_1 = require("../../../config");
|
|
11
11
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
12
12
|
const range_1 = require("../../../util/range");
|
|
13
|
-
function formatInfo(out, type, meta) {
|
|
14
|
-
return out.formatter.format(`Copied ${type} to clipboard (dataflow: ${meta['.meta'].timing + 'ms'}).`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
15
|
-
}
|
|
16
13
|
function referenceRow(ref, idMap) {
|
|
17
14
|
const name = ref.name === undefined ? '<anonymous>' : identifier_1.Identifier.toString(ref.name);
|
|
18
15
|
const node = idMap.get(ref.nodeId);
|
|
@@ -90,32 +87,25 @@ function printReferenceSections(output, sections) {
|
|
|
90
87
|
output.stdout(output.formatter.format('Empty: ', { style: 3 /* FontStyles.Italic */ }) + `${empty.map(s => `${s.title} (${count(0)})`).join(', ')}`);
|
|
91
88
|
}
|
|
92
89
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
113
|
-
fn: async ({ output, analyzer }) => {
|
|
114
|
-
const result = await analyzer.dataflow();
|
|
115
|
-
const mermaid = df_helper_1.Dataflow.visualize.mermaid.url(result.graph, false, undefined, false, (0, config_1.isSigDbEnabled)(analyzer.flowrConfig));
|
|
116
|
-
await repl_clipboard_1.ReplClipboard.print(output, mermaid, formatInfo(output, 'mermaid url', result));
|
|
117
|
-
}
|
|
118
|
-
};
|
|
90
|
+
function mermaidCommand(description, usageExample, aliases, url, simplified) {
|
|
91
|
+
return {
|
|
92
|
+
description,
|
|
93
|
+
isCodeCommand: true,
|
|
94
|
+
usageExample,
|
|
95
|
+
aliases,
|
|
96
|
+
script: false,
|
|
97
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
98
|
+
fn: async ({ output, analyzer }) => {
|
|
99
|
+
const result = await analyzer.dataflow();
|
|
100
|
+
const qualifyBaseR = (0, config_1.isSigDbEnabled)(analyzer.flowrConfig);
|
|
101
|
+
const mermaid = url ? df_helper_1.Dataflow.visualize.mermaid.url(result.graph, false, undefined, simplified, qualifyBaseR)
|
|
102
|
+
: df_helper_1.Dataflow.visualize.mermaid.convert({ graph: result.graph, includeEnvironments: false, simplified: simplified || undefined, qualifyBaseR }).string;
|
|
103
|
+
await repl_clipboard_1.ReplClipboard.print(output, mermaid, repl_clipboard_1.ReplClipboard.note(output, url ? 'mermaid url' : 'mermaid code', 'dataflow', result['.meta'].timing));
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
exports.dataflowCommand = mermaidCommand('Get mermaid code for the dataflow graph', ':dataflow', ['d', 'df'], false, false);
|
|
108
|
+
exports.dataflowStarCommand = mermaidCommand('Returns the URL to mermaid.live', ':dataflow*', ['d*', 'df*'], true, false);
|
|
119
109
|
exports.dataflowAsciiCommand = {
|
|
120
110
|
description: 'Returns an ASCII representation of the dataflow graph',
|
|
121
111
|
isCodeCommand: true,
|
|
@@ -158,30 +148,6 @@ exports.dataflowSilentCommand = {
|
|
|
158
148
|
]);
|
|
159
149
|
}
|
|
160
150
|
};
|
|
161
|
-
exports.dataflowSimplifiedCommand =
|
|
162
|
-
|
|
163
|
-
isCodeCommand: true,
|
|
164
|
-
usageExample: ':dataflowsimple',
|
|
165
|
-
aliases: ['ds', 'dfs'],
|
|
166
|
-
script: false,
|
|
167
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
168
|
-
fn: async ({ output, analyzer }) => {
|
|
169
|
-
const result = await analyzer.dataflow();
|
|
170
|
-
const mermaid = df_helper_1.Dataflow.visualize.mermaid.convert({ graph: result.graph, includeEnvironments: false, simplified: true, qualifyBaseR: (0, config_1.isSigDbEnabled)(analyzer.flowrConfig) }).string;
|
|
171
|
-
await repl_clipboard_1.ReplClipboard.print(output, mermaid, formatInfo(output, 'mermaid code', result));
|
|
172
|
-
}
|
|
173
|
-
};
|
|
174
|
-
exports.dataflowSimpleStarCommand = {
|
|
175
|
-
description: 'Returns the URL to mermaid.live',
|
|
176
|
-
isCodeCommand: true,
|
|
177
|
-
usageExample: ':dataflowsimple*',
|
|
178
|
-
aliases: ['ds*', 'dfs*'],
|
|
179
|
-
script: false,
|
|
180
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
181
|
-
fn: async ({ output, analyzer }) => {
|
|
182
|
-
const result = await analyzer.dataflow();
|
|
183
|
-
const mermaid = df_helper_1.Dataflow.visualize.mermaid.url(result.graph, false, undefined, true, (0, config_1.isSigDbEnabled)(analyzer.flowrConfig));
|
|
184
|
-
await repl_clipboard_1.ReplClipboard.print(output, mermaid, formatInfo(output, 'mermaid url', result));
|
|
185
|
-
}
|
|
186
|
-
};
|
|
151
|
+
exports.dataflowSimplifiedCommand = mermaidCommand('Get mermaid code for the simplified dataflow graph', ':dataflowsimple', ['ds', 'dfs'], false, true);
|
|
152
|
+
exports.dataflowSimpleStarCommand = mermaidCommand('Returns the URL to mermaid.live', ':dataflowsimple*', ['ds*', 'dfs*'], true, true);
|
|
187
153
|
//# sourceMappingURL=repl-dataflow.js.map
|
|
@@ -7,35 +7,22 @@ const core_1 = require("../core");
|
|
|
7
7
|
const repl_clipboard_1 = require("./repl-clipboard");
|
|
8
8
|
const defaultmap_1 = require("../../../util/collections/defaultmap");
|
|
9
9
|
const r_project_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-project");
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function normalizeMermaidCommand(description, usageExample, aliases, convert) {
|
|
11
|
+
return {
|
|
12
|
+
description,
|
|
13
|
+
isCodeCommand: true,
|
|
14
|
+
usageExample,
|
|
15
|
+
aliases,
|
|
16
|
+
script: false,
|
|
17
|
+
argsParser: (args) => (0, core_1.handleString)(args),
|
|
18
|
+
fn: async ({ output, analyzer }) => {
|
|
19
|
+
const result = await analyzer.normalize();
|
|
20
|
+
await repl_clipboard_1.ReplClipboard.print(output, convert(result.ast), repl_clipboard_1.ReplClipboard.note(output, 'mermaid url', 'normalize', result['.meta'].timing));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
12
23
|
}
|
|
13
|
-
exports.normalizeCommand =
|
|
14
|
-
|
|
15
|
-
isCodeCommand: true,
|
|
16
|
-
usageExample: ':normalize',
|
|
17
|
-
aliases: ['n'],
|
|
18
|
-
script: false,
|
|
19
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
20
|
-
fn: async ({ output, analyzer }) => {
|
|
21
|
-
const result = await analyzer.normalize();
|
|
22
|
-
const mermaid = (0, ast_1.normalizedAstToMermaid)(result.ast);
|
|
23
|
-
await repl_clipboard_1.ReplClipboard.print(output, mermaid, formatInfo(output, 'mermaid url', result));
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
exports.normalizeStarCommand = {
|
|
27
|
-
description: 'Returns the URL to mermaid.live',
|
|
28
|
-
isCodeCommand: true,
|
|
29
|
-
usageExample: ':normalize*',
|
|
30
|
-
aliases: ['n*'],
|
|
31
|
-
script: false,
|
|
32
|
-
argsParser: (args) => (0, core_1.handleString)(args),
|
|
33
|
-
fn: async ({ output, analyzer }) => {
|
|
34
|
-
const result = await analyzer.normalize();
|
|
35
|
-
const mermaid = (0, ast_1.normalizedAstToMermaidUrl)(result.ast);
|
|
36
|
-
await repl_clipboard_1.ReplClipboard.print(output, mermaid, formatInfo(output, 'mermaid url', result));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
24
|
+
exports.normalizeCommand = normalizeMermaidCommand('Get mermaid code for the normalized AST of R code', ':normalize', ['n'], ast_1.normalizedAstToMermaid);
|
|
25
|
+
exports.normalizeStarCommand = normalizeMermaidCommand('Returns the URL to mermaid.live', ':normalize*', ['n*'], ast_1.normalizedAstToMermaidUrl);
|
|
39
26
|
exports.normalizeHashCommand = {
|
|
40
27
|
description: 'Returns summarization stats for the normalized AST',
|
|
41
28
|
isCodeCommand: true,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseCommand = void 0;
|
|
4
|
+
const r_string_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
4
5
|
const format_1 = require("../../../r-bridge/lang-4.x/ast/parser/json/format");
|
|
5
6
|
const normalize_meta_1 = require("../../../r-bridge/lang-4.x/ast/parser/main/normalize-meta");
|
|
6
|
-
const retriever_1 = require("../../../r-bridge/retriever");
|
|
7
7
|
const flowr_file_1 = require("../../../project/context/flowr-file");
|
|
8
8
|
/** shared pre-order-to-depth-list traversal, `toEntry` converts a node and `children` reads its (mutable) child array */
|
|
9
9
|
function toDepthList(root, toEntry, children) {
|
|
@@ -133,7 +133,7 @@ exports.parseCommand = {
|
|
|
133
133
|
argsParser: (line) => {
|
|
134
134
|
return {
|
|
135
135
|
// Threat the whole input line as R code
|
|
136
|
-
rCode:
|
|
136
|
+
rCode: r_string_1.RString.unquote(line.trim()),
|
|
137
137
|
remaining: []
|
|
138
138
|
};
|
|
139
139
|
},
|