@eagleoutice/flowr 2.14.1 → 2.14.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 +142 -87
- package/abstract-interpretation/absint-visitor.d.ts +132 -25
- package/abstract-interpretation/absint-visitor.js +459 -99
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/arguments.js +1 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +107 -254
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +5 -5
- package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -1
- package/abstract-interpretation/data-frame/resolve-args.js +6 -4
- package/abstract-interpretation/data-frame/shape-inference.d.ts +4 -9
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -0
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -0
- package/abstract-interpretation/domains/partial-product-domain.js +1 -1
- package/abstract-interpretation/domains/set-range-domain.d.ts +3 -2
- package/abstract-interpretation/domains/set-range-domain.js +3 -2
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +3 -2
- package/abstract-interpretation/domains/set-upper-bound-domain.js +3 -2
- package/benchmark/calibration.d.ts +11 -6
- package/benchmark/calibration.js +19 -8
- package/benchmark/slicer.d.ts +7 -1
- package/benchmark/slicer.js +38 -34
- package/benchmark/stats/count-comments.d.ts +16 -0
- package/benchmark/stats/count-comments.js +30 -0
- package/benchmark/stats/print.js +2 -0
- package/benchmark/stats/size-of.d.ts +7 -3
- package/benchmark/stats/size-of.js +7 -3
- package/benchmark/stats/stats.d.ts +7 -0
- package/benchmark/summarizer/first-phase/process.js +2 -19
- package/benchmark/summarizer/second-phase/graph.js +13 -3
- package/benchmark/summarizer/second-phase/process.js +2 -0
- package/cli/repl/commands/repl-dataflow.js +70 -27
- package/cli/repl/core.d.ts +1 -1
- package/cli/repl/core.js +1 -1
- package/cli/repl/parser/slice-query-parser.js +2 -1
- package/cli/repl/server/connection.d.ts +4 -0
- package/cli/repl/server/connection.js +19 -16
- package/cli/repl/server/messages/message-analysis.d.ts +1 -1
- package/config.d.ts +21 -8
- package/config.js +12 -5
- package/control-flow/basic-cfg-guided-visitor.d.ts +7 -2
- package/control-flow/basic-cfg-guided-visitor.js +37 -24
- package/control-flow/cfg-dead-code.js +44 -33
- package/control-flow/cfg-properties.js +2 -2
- package/control-flow/cfg-simplification.js +6 -5
- package/control-flow/cfg-to-basic-blocks.js +11 -13
- package/control-flow/control-flow-graph.d.ts +179 -189
- package/control-flow/control-flow-graph.js +400 -263
- package/control-flow/dfg-cfg-guided-visitor.d.ts +21 -3
- package/control-flow/dfg-cfg-guided-visitor.js +17 -13
- package/control-flow/diff-cfg.js +6 -14
- package/control-flow/happens-before.js +5 -4
- package/control-flow/semantic-cfg-guided-visitor.d.ts +44 -101
- package/control-flow/semantic-cfg-guided-visitor.js +6 -3
- package/control-flow/simple-visitor.js +14 -15
- package/control-flow/syntax-cfg-guided-visitor.d.ts +2 -1
- package/control-flow/useless-loop.js +18 -14
- package/core/steps/all/core/20-dataflow.d.ts +1 -3
- package/core/steps/pipeline/default-pipelines.d.ts +141 -157
- package/dataflow/cluster.js +7 -0
- package/dataflow/environments/apply-kill.d.ts +6 -0
- package/dataflow/environments/apply-kill.js +63 -31
- package/dataflow/environments/built-in-props.d.ts +5 -1
- package/dataflow/environments/built-in-props.js +4 -0
- package/dataflow/environments/built-in.d.ts +6 -3
- package/dataflow/environments/built-in.js +8 -5
- package/dataflow/environments/clone.d.ts +3 -3
- package/dataflow/environments/clone.js +5 -5
- package/dataflow/environments/default-builtin-config.d.ts +114 -3
- package/dataflow/environments/default-builtin-config.js +137 -35
- package/dataflow/environments/environment.d.ts +5 -5
- package/dataflow/environments/environment.js +5 -5
- package/dataflow/environments/identifier.d.ts +11 -1
- package/dataflow/environments/identifier.js +4 -1
- package/dataflow/environments/resolve-by-name.d.ts +7 -0
- package/dataflow/environments/resolve-by-name.js +12 -0
- package/dataflow/environments/resolve-helper.d.ts +3 -1
- package/dataflow/environments/resolve-helper.js +2 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +3 -3
- package/dataflow/eval/resolve/alias-tracking.js +3 -3
- package/dataflow/eval/resolve/match-arguments.js +7 -5
- package/dataflow/eval/resolve/node-value.d.ts +3 -1
- package/dataflow/eval/resolve/node-value.js +12 -0
- package/dataflow/eval/resolve/resolve-argument.js +5 -4
- package/dataflow/eval/resolve/resolve-operators.js +9 -6
- package/dataflow/eval/resolve/resolve-strings.js +2 -2
- package/dataflow/eval/resolve/resolve-working-directory.js +4 -3
- package/dataflow/eval/resolve/resolve.js +3 -2
- package/dataflow/eval/values/general.js +8 -5
- package/dataflow/extractor.d.ts +1 -4
- package/dataflow/extractor.js +11 -10
- package/dataflow/fn/exceptions-of-function.d.ts +3 -1
- package/dataflow/fn/strict-function.js +7 -5
- package/dataflow/graph/call-graph.js +2 -2
- package/dataflow/graph/df-helper.d.ts +8 -1
- package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
- package/dataflow/graph/diff-dataflow-graph.js +19 -2
- package/dataflow/graph/edge.d.ts +38 -2
- package/dataflow/graph/edge.js +32 -2
- package/dataflow/graph/graph.d.ts +4 -3
- package/dataflow/graph/graph.js +6 -2
- package/dataflow/graph/match-args.d.ts +69 -0
- package/dataflow/graph/match-args.js +167 -0
- package/dataflow/info.d.ts +15 -6
- package/dataflow/info.js +0 -17
- package/dataflow/internal/control-flow.d.ts +114 -0
- package/dataflow/internal/control-flow.js +224 -0
- package/dataflow/internal/linker.d.ts +6 -31
- package/dataflow/internal/linker.js +24 -81
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +9 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +18 -37
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +11 -7
- 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.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +18 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +18 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +12 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +38 -30
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +36 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +20 -17
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +9 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +7 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +15 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +11 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +26 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +17 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +71 -33
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +6 -15
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +13 -14
- 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 +14 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +15 -1
- 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 +12 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +50 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +20 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +6 -2
- package/dataflow/internal/process/functions/call/common.js +5 -6
- package/dataflow/internal/process/functions/call/deferred.js +2 -2
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +12 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +41 -15
- package/dataflow/internal/process/functions/call/named-call-handling.js +2 -0
- package/dataflow/internal/process/functions/call/nse.d.ts +1 -1
- package/dataflow/internal/process/functions/call/nse.js +6 -1
- package/dataflow/internal/process/functions/call/quoted.js +2 -2
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +19 -6
- package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/process-argument.js +12 -4
- package/dataflow/internal/process/functions/process-parameter.js +13 -0
- package/dataflow/internal/process/process-named-call.d.ts +2 -2
- package/dataflow/internal/process/process-named-call.js +9 -7
- package/documentation/data/server/doc-data-server-messages.js +4 -4
- package/documentation/doc-readme.js +33 -0
- package/documentation/doc-util/doc-cfg.d.ts +8 -7
- package/documentation/doc-util/doc-cfg.js +10 -10
- package/documentation/doc-util/doc-playground.d.ts +12 -0
- package/documentation/doc-util/doc-playground.js +21 -0
- package/documentation/doc-util/doc-query.d.ts +4 -1
- package/documentation/doc-util/doc-query.js +4 -2
- package/documentation/wiki-absint.d.ts +3 -4
- package/documentation/wiki-absint.js +17 -5
- package/documentation/wiki-analyzer.js +2 -2
- package/documentation/wiki-cfg.js +101 -106
- package/documentation/wiki-dataflow-graph.js +84 -53
- package/documentation/wiki-interface.js +1 -0
- package/documentation/wiki-linter.js +15 -1
- package/documentation/wiki-linting-and-testing.js +1 -16
- package/documentation/wiki-mk/doc-maker.js +6 -4
- package/documentation/wiki-query.js +14 -4
- package/documentation/wiki-signature-database.js +28 -2
- package/linter/linter-fix.d.ts +16 -0
- package/linter/linter-fix.js +104 -0
- package/linter/linter-format.d.ts +18 -1
- package/linter/linter-format.js +31 -1
- package/linter/linter-output.js +46 -10
- package/linter/linter-rules.d.ts +40 -9
- package/linter/linter-rules.js +2 -0
- package/linter/rules/absolute-path.js +4 -2
- package/linter/rules/dataframe-access-validation.js +6 -7
- package/linter/rules/deprecated-functions.d.ts +107 -10
- package/linter/rules/deprecated-functions.js +311 -23
- package/linter/rules/file-path-validity.js +5 -4
- package/linter/rules/function-finder-util.d.ts +6 -0
- package/linter/rules/function-finder-util.js +21 -13
- package/linter/rules/naming-convention.js +1 -1
- package/linter/rules/network-functions.d.ts +2 -2
- package/linter/rules/stop-with-call-arg.js +2 -2
- package/linter/rules/unclosed-connection.js +2 -2
- package/linter/rules/undefined-symbol-util.js +6 -4
- package/linter/rules/undefined-symbol.js +2 -2
- package/linter/rules/unused-definition.js +8 -4
- package/linter/rules/unused-import.d.ts +60 -0
- package/linter/rules/unused-import.js +179 -0
- package/package.json +2 -2
- package/project/attached-packages.js +2 -1
- package/project/cache/flowr-analyzer-cache.d.ts +2 -5
- package/project/cache/flowr-analyzer-cache.js +4 -7
- package/project/cache/flowr-analyzer-controlflow-cache.d.ts +9 -8
- package/project/cache/flowr-analyzer-controlflow-cache.js +17 -34
- package/project/cache/flowr-cache.d.ts +9 -0
- package/project/cache/flowr-cache.js +19 -0
- package/project/context/flowr-analyzer-context.d.ts +7 -3
- package/project/context/flowr-analyzer-context.js +15 -9
- package/project/context/flowr-analyzer-dependencies-context.d.ts +24 -3
- package/project/context/flowr-analyzer-dependencies-context.js +9 -14
- package/project/context/flowr-analyzer-files-context.js +15 -17
- package/project/context/flowr-analyzer-meta-context.js +2 -12
- package/project/dependency-version-space.d.ts +1 -7
- package/project/dependency-version-space.js +9 -8
- package/project/flowr-analyzer-builder.d.ts +4 -4
- package/project/flowr-analyzer.d.ts +4 -6
- package/project/flowr-analyzer.js +4 -5
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +22 -34
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +13 -13
- package/project/plugins/file-plugins/files/flowr-rda-file.js +131 -286
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +1 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +1 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +2 -8
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +32 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +43 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +4 -12
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +3 -16
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +5 -8
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +4 -10
- package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.d.ts +3 -10
- package/project/plugins/file-plugins/flowr-analyzer-manifest-file-plugin.js +1 -13
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +3 -6
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -8
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +2 -8
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +2 -8
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +3 -4
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +3 -6
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +4 -12
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +3 -16
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +4 -12
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +3 -16
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +4 -12
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +3 -16
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +2 -8
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.d.ts +2 -6
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmarkdown-file-plugin.js +1 -10
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.d.ts +2 -5
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.js +2 -8
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-library-plugin.js +2 -1
- package/project/sigdb/build.d.ts +2 -2
- package/project/sigdb/decode.d.ts +0 -5
- package/project/sigdb/decode.js +0 -8
- package/project/sigdb/index-format.d.ts +4 -4
- package/project/sigdb/manifest.d.ts +2 -2
- package/project/sigdb/reader.d.ts +54 -13
- package/project/sigdb/reader.js +4 -3
- package/project/sigdb/schema.d.ts +3 -1
- package/project/sigdb/signature-db.d.ts +69 -0
- package/project/sigdb/signature-db.js +54 -0
- package/project/sigdb/signature-match.d.ts +10 -5
- package/project/sigdb/signature-match.js +13 -8
- package/queries/catalog/absint-query/absint-query-executor.js +1 -2
- package/queries/catalog/call-context-query/call-context-query-executor.js +2 -4
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +33 -6
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +1 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +8 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.js +22 -35
- package/queries/catalog/dependencies-query/function-info/library-functions.d.ts +13 -1
- package/queries/catalog/dependencies-query/function-info/library-functions.js +26 -22
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +9 -0
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +19 -0
- package/queries/catalog/dependencies-query/implicit-echo.d.ts +13 -0
- package/queries/catalog/dependencies-query/implicit-echo.js +133 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +1 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/signature-query/signature-query-executor.js +4 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -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 +1 -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 +4 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +5 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +6 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +6 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -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 +1 -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 +1 -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 +1 -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 +1 -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 +6 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +13 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +8 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +8 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -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-project.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -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 +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -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 +1 -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 +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -1
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +0 -5
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +3 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then-else.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +6 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +5 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +5 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +3 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +2 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +5 -3
- package/reconstruct/inline/source-inline-map.js +3 -3
- package/reconstruct/reconstruct.js +6 -4
- package/search/flowr-search-builder.d.ts +8 -8
- package/search/flowr-search-builder.js +4 -4
- package/search/flowr-search-filters.d.ts +2 -2
- package/search/flowr-search-filters.js +3 -2
- package/search/search-executor/search-enrichers.d.ts +6 -0
- package/search/search-executor/search-enrichers.js +44 -5
- package/slicing/criterion/filters/all-variables.js +2 -1
- package/slicing/criterion/parse.js +8 -6
- package/slicing/static/slice-call.js +2 -2
- package/util/arg-matching.d.ts +3 -0
- package/util/arg-matching.js +12 -1
- package/util/collections/arrays.d.ts +0 -4
- package/util/collections/arrays.js +4 -26
- package/util/diff-graph.d.ts +1 -1
- package/util/diff-graph.js +17 -3
- package/util/diff.d.ts +6 -0
- package/util/mermaid/ast.d.ts +1 -1
- package/util/mermaid/ast.js +5 -4
- package/util/mermaid/cfg.js +130 -24
- package/util/mermaid/dfg.js +31 -10
- package/util/mermaid/mermaid.js +2 -0
- package/util/objects.d.ts +24 -4
- package/util/objects.js +12 -0
- package/util/prefix.d.ts +1 -1
- package/util/text/playground-link.d.ts +131 -0
- package/util/text/playground-link.js +214 -0
- package/util/text/strings.js +7 -3
- package/util/version.js +1 -1
- package/control-flow/cfg-builder.d.ts +0 -30
- package/control-flow/cfg-builder.js +0 -79
- package/control-flow/extract-cfg.d.ts +0 -36
- package/control-flow/extract-cfg.js +0 -693
- package/project/cfg-kind.d.ts +0 -21
- package/project/cfg-kind.js +0 -26
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DefaultBuiltinConfig = exports.WrittenBuiltinDefinitions = exports.RGroupGenerics = exports.GgPlotAddons = exports.GraphicsPlotAddons = exports.PlotFunctionsWithAddParam = exports.GgPlotImplicitAddons = exports.TinyPlotAddons = exports.PlotCreate = exports.GraphicsPlotCreate = exports.TinyPlotCrate = exports.GgPlotCreate = exports.PlotFunctionPackages = exports.StackEnvBuiltins = exports.StackEnvKind = void 0;
|
|
3
|
+
exports.DefaultBuiltinConfig = exports.WrittenBuiltinDefinitions = exports.RGroupGenerics = exports.BasePrimitiveTopics = exports.GgPlotAddons = exports.GraphicsPlotAddons = exports.PlotFunctionsWithAddParam = exports.GgPlotImplicitAddons = exports.TinyPlotAddons = exports.PlotCreate = exports.GraphicsPlotCreate = exports.TinyPlotCrate = exports.GgPlotCreate = exports.PlotFunctionPackages = exports.StackEnvBuiltins = exports.StackEnvKind = void 0;
|
|
4
4
|
exports.namespacePlotFunctions = namespacePlotFunctions;
|
|
5
5
|
exports.statedSignatures = statedSignatures;
|
|
6
6
|
exports.statedSignatureOf = statedSignatureOf;
|
|
@@ -175,6 +175,60 @@ const SigDataDots = [['.data', built_in_props_1.ArgProp.Value], ['...', built_in
|
|
|
175
175
|
const SigShape = [['x', built_in_props_1.ArgProp.Shape]];
|
|
176
176
|
const SigXTable = [['x', built_in_props_1.ArgProp.Value], ['table', built_in_props_1.ArgProp.Value]];
|
|
177
177
|
const SigDots = [['...', built_in_props_1.ArgProp.Value]];
|
|
178
|
+
/**
|
|
179
|
+
* The manual page documenting a base R primitive, for the ones not documented under their own name.
|
|
180
|
+
*
|
|
181
|
+
* A primitive is written in C and has no R closure, so nothing extracts a signature, a source file or a help
|
|
182
|
+
* topic for it and the signature database holds no entry at all: `base::sin` is documented under `Trig`, and
|
|
183
|
+
* guessing `sin` only names a page that does not exist. flowR states these names itself, so it carries where
|
|
184
|
+
* they are documented as well. Written the way R documents them, one page and everything it covers.
|
|
185
|
+
*/
|
|
186
|
+
const PrimitivesPerTopic = {
|
|
187
|
+
'Arithmetic': ['%%', '%/%', '*', '+', '-', '/', '^'],
|
|
188
|
+
'assignOps': ['<-', '<<-', '='],
|
|
189
|
+
'call': ['as.call'],
|
|
190
|
+
'CallExternal': ['.Call', '.External'],
|
|
191
|
+
'character': ['as.character', 'is.character'],
|
|
192
|
+
'Colon': [':'],
|
|
193
|
+
'Comparison': ['!=', '<', '<=', '==', '>', '>='],
|
|
194
|
+
'complex': ['Arg', 'Conj', 'Im', 'Mod', 'Re', 'as.complex'],
|
|
195
|
+
'Control': ['break', 'for', 'if', 'next', 'repeat', 'while'],
|
|
196
|
+
'crossprod': ['tcrossprod'],
|
|
197
|
+
'cumsum': ['cummax', 'cummin', 'cumprod'],
|
|
198
|
+
'double': ['as.double'],
|
|
199
|
+
'environment': ['baseenv', 'emptyenv', 'globalenv'],
|
|
200
|
+
'Extract': ['$', '[', '[['],
|
|
201
|
+
'Extremes': ['max', 'min'],
|
|
202
|
+
'Foreign': ['.C', '.Fortran'],
|
|
203
|
+
'function': ['return'],
|
|
204
|
+
'Hyperbolic': ['acosh', 'asinh', 'atanh', 'cosh', 'sinh', 'tanh'],
|
|
205
|
+
'integer': ['as.integer'],
|
|
206
|
+
'Internal': ['.Internal'],
|
|
207
|
+
'is.finite': ['is.infinite', 'is.nan'],
|
|
208
|
+
'list': ['is.list'],
|
|
209
|
+
'Log': ['exp', 'expm1', 'log', 'log10', 'log1p', 'log2'],
|
|
210
|
+
'Logic': ['!', '&', '&&', '|', '||'],
|
|
211
|
+
'logical': ['as.logical', 'is.logical'],
|
|
212
|
+
'MathFun': ['abs', 'sqrt'],
|
|
213
|
+
'matmult': ['%*%'],
|
|
214
|
+
'matrix': ['is.matrix'],
|
|
215
|
+
'NA': ['is.na'],
|
|
216
|
+
'nchar': ['nzchar'],
|
|
217
|
+
'ns-dblcolon': ['::', ':::'],
|
|
218
|
+
'NULL': ['is.null'],
|
|
219
|
+
'numeric': ['as.numeric', 'is.numeric'],
|
|
220
|
+
'Paren': ['(', '{'],
|
|
221
|
+
'Primitive': ['.Primitive'],
|
|
222
|
+
'raw': ['as.raw'],
|
|
223
|
+
'Round': ['ceiling', 'floor', 'round', 'signif', 'trunc'],
|
|
224
|
+
'seq': ['seq.int', 'seq_along', 'seq_len'],
|
|
225
|
+
'slotOp': ['@'],
|
|
226
|
+
'substitute': ['quote'],
|
|
227
|
+
'tilde': ['~'],
|
|
228
|
+
'Trig': ['acos', 'asin', 'atan', 'cos', 'sin', 'tan'],
|
|
229
|
+
};
|
|
230
|
+
/** {@link PrimitivesPerTopic} the way a lookup wants it: the topic documenting a name. */
|
|
231
|
+
exports.BasePrimitiveTopics = Object.fromEntries(Object.entries(PrimitivesPerTopic).flatMap(([topic, names]) => names.map(name => [name, topic])));
|
|
178
232
|
/**
|
|
179
233
|
* What flowR states about every function it carries a definition for, as `name -> signatures`. A name may be
|
|
180
234
|
* defined for several packages (`filter` is dplyr's and cohortBuilder's), so all of them are here and the
|
|
@@ -233,13 +287,6 @@ exports.RGroupGenerics = {
|
|
|
233
287
|
Summary: ['any', 'sum', 'prod', 'min', 'max', 'range'],
|
|
234
288
|
Complex: ['Re', 'Im', 'Mod', 'Arg', 'Conj']
|
|
235
289
|
};
|
|
236
|
-
/**
|
|
237
|
-
* Every R generic flowR states a built-in for: the {@link RGroupGenerics} members, the `.S3PrimitiveGenerics` and
|
|
238
|
-
* internal generics (which have no R body, so {@link fnInfoFromSignature} could never see them), and the
|
|
239
|
-
* `UseMethod` closures flowR models itself, as its own definition hides the one in the signature database.
|
|
240
|
-
* The `<-` forms are left out, one replacement definition covers many names.
|
|
241
|
-
* `npm run check:generic-labels` (part of `checkup`) compares this against a synced database.
|
|
242
|
-
*/
|
|
243
290
|
/**
|
|
244
291
|
* The internal generics: they dispatch in C rather than through `UseMethod`, so no signature can state it and
|
|
245
292
|
* the list has to be written down. Everything that dispatches from R is generated, see {@link RBasePackageStore}.
|
|
@@ -251,7 +298,14 @@ const InternalGenerics = [
|
|
|
251
298
|
'as.character', 'as.integer', 'as.double', 'as.logical', 'as.complex', 'as.numeric', 'as.raw',
|
|
252
299
|
'is.na', 'is.nan', 'is.finite', 'is.infinite', 'is.matrix', 'is.numeric', 'cbind', 'rbind'
|
|
253
300
|
];
|
|
254
|
-
/**
|
|
301
|
+
/**
|
|
302
|
+
* Every name R dispatches on: the generated closure generics plus the {@link InternalGenerics}, i.e. the
|
|
303
|
+
* {@link RGroupGenerics} members, the `.S3PrimitiveGenerics` and internal generics (which have no R body, so
|
|
304
|
+
* {@link fnInfoFromSignature} could never see them), and the `UseMethod` closures flowR models itself, as its
|
|
305
|
+
* own definition hides the one in the signature database.
|
|
306
|
+
* The `<-` forms are left out, one replacement definition covers many names.
|
|
307
|
+
* `npm run check:generic-labels` (part of `checkup`) compares this against a synced database.
|
|
308
|
+
*/
|
|
255
309
|
const RGenerics = new Set([...r_base_packages_generated_1.RBasePackageStore.generics, ...InternalGenerics]);
|
|
256
310
|
/** Label every {@link RGenerics} {@link CallProp.Generic}, splitting an entry that mixes them with names that do not dispatch (`&` does, `&&` does not). */
|
|
257
311
|
function markGenerics(definitions) {
|
|
@@ -284,6 +338,23 @@ function markGenerics(definitions) {
|
|
|
284
338
|
}
|
|
285
339
|
return out;
|
|
286
340
|
}
|
|
341
|
+
/** what creating a plot does; restated by the deprecated plot creators, which do the same but should not be used */
|
|
342
|
+
const PlotCreateConfig = {
|
|
343
|
+
forceArgs: 'all',
|
|
344
|
+
hasUnknownSideEffects: {
|
|
345
|
+
type: 'link-to-last-call',
|
|
346
|
+
ignoreIf: (source, graph) => {
|
|
347
|
+
const sourceVertex = graph.getVertex(source);
|
|
348
|
+
/* map with add = true appends to an existing plot */
|
|
349
|
+
return (exports.PlotFunctionsWithAddParam.has(identifier_1.Identifier.getName(sourceVertex.name)) && (0, identify_link_to_last_call_relation_1.getValueOfArgument)(graph, sourceVertex, {
|
|
350
|
+
index: -1,
|
|
351
|
+
name: 'add'
|
|
352
|
+
}, [type_1.RType.Logical])?.content === true);
|
|
353
|
+
},
|
|
354
|
+
callName: toRegex(GraphicDeviceOpen)
|
|
355
|
+
},
|
|
356
|
+
props: built_in_props_1.CallProp.Graphics
|
|
357
|
+
};
|
|
287
358
|
/**
|
|
288
359
|
* Contains the built-in definitions recognized by flowR, as they are written down: {@link DefaultBuiltinConfig}
|
|
289
360
|
* is what {@link markGenerics} makes of them, and a test checks that this is all it changes.
|
|
@@ -470,6 +541,28 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
470
541
|
config: { props: built_in_props_1.CallProp.Pure },
|
|
471
542
|
assumePrimitive: true
|
|
472
543
|
},
|
|
544
|
+
/* the hypothesis tests: they compute a test statistic and hand it back visibly, which is the output a reader sees */
|
|
545
|
+
{
|
|
546
|
+
type: 'function',
|
|
547
|
+
names: [
|
|
548
|
+
...identifier_1.Identifier.fromAll("stats" /* PkgName.Stats */, [
|
|
549
|
+
'anova', 'ansari.test', 'aov', 'bartlett.test', 'binom.test', 'Box.test', 'chisq.test', 'cor.test',
|
|
550
|
+
'fisher.test', 'fligner.test', 'friedman.test', 'kruskal.test', 'ks.test', 'manova', 'mantelhaen.test',
|
|
551
|
+
'mauchly.test', 'mcnemar.test', 'mood.test', 'oneway.test', 'pairwise.prop.test', 'pairwise.t.test',
|
|
552
|
+
'pairwise.wilcox.test', 'poisson.test', 'PP.test', 'prop.test', 'prop.trend.test', 'quade.test',
|
|
553
|
+
'shapiro.test', 't.test', 'TukeyHSD', 'var.test', 'wilcox.test'
|
|
554
|
+
]),
|
|
555
|
+
...identifier_1.Identifier.fromAll("car" /* PkgName.Car */, ['Anova', 'durbinWatsonTest', 'leveneTest', 'linearHypothesis', 'ncvTest', 'outlierTest']),
|
|
556
|
+
...identifier_1.Identifier.fromAll("lmtest" /* PkgName.LmTest */, ['bgtest', 'bptest', 'coeftest', 'dwtest', 'gqtest', 'lrtest', 'raintest', 'resettest', 'waldtest']),
|
|
557
|
+
...identifier_1.Identifier.fromAll("nortest" /* PkgName.NorTest */, ['ad.test', 'cvm.test', 'lillie.test', 'pearson.test', 'sf.test']),
|
|
558
|
+
...identifier_1.Identifier.fromAll("tseries" /* PkgName.Tseries */, ['adf.test', 'jarque.bera.test', 'kpss.test', 'pp.test', 'runs.test', 'white.test']),
|
|
559
|
+
...identifier_1.Identifier.fromAll("rstatix" /* PkgName.Rstatix */, ['anova_test', 'chisq_test', 'cor_test', 'kruskal_test', 'shapiro_test', 't_test', 'wilcox_test']),
|
|
560
|
+
identifier_1.Identifier.from(['glht', "multcomp" /* PkgName.Multcomp */])
|
|
561
|
+
],
|
|
562
|
+
processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
|
|
563
|
+
config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Statistics },
|
|
564
|
+
assumePrimitive: false
|
|
565
|
+
},
|
|
473
566
|
/* indices and index sequences: bounded by the shape of what they are handed, never by its contents */
|
|
474
567
|
{ type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['which', 'which.max', 'which.min', 'seq_len', 'seq_along']),
|
|
475
568
|
processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Narrows }, assumePrimitive: true },
|
|
@@ -619,22 +712,12 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
619
712
|
// graphics base
|
|
620
713
|
{ type: 'function', names: namespacePlotFunctions(exports.PlotCreate),
|
|
621
714
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
622
|
-
config:
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
/* map with add = true appends to an existing plot */
|
|
629
|
-
return (exports.PlotFunctionsWithAddParam.has(identifier_1.Identifier.getName(sourceVertex.name)) && (0, identify_link_to_last_call_relation_1.getValueOfArgument)(graph, sourceVertex, {
|
|
630
|
-
index: -1,
|
|
631
|
-
name: 'add'
|
|
632
|
-
}, [type_1.RType.Logical])?.content === true);
|
|
633
|
-
},
|
|
634
|
-
callName: toRegex(GraphicDeviceOpen)
|
|
635
|
-
},
|
|
636
|
-
props: built_in_props_1.CallProp.Graphics
|
|
637
|
-
}, assumePrimitive: true },
|
|
715
|
+
config: PlotCreateConfig, assumePrimitive: true },
|
|
716
|
+
/* `qplot` creates a plot like the ones above and is deprecated on top of it; registered after them so this
|
|
717
|
+
definition is the one that sticks */
|
|
718
|
+
{ type: 'function', names: [identifier_1.Identifier.from(['qplot', "ggplot2" /* PkgName.GgPlot2 */])],
|
|
719
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
720
|
+
config: { ...PlotCreateConfig, props: built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.Deprecated }, assumePrimitive: true },
|
|
638
721
|
// graphics addons
|
|
639
722
|
{ type: 'function', names: namespacePlotFunctions(PlotAddons),
|
|
640
723
|
processor: built_in_proc_name_1.BuiltInProcName.Default, config: {
|
|
@@ -750,7 +833,7 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
750
833
|
{ type: 'function', names: [identifier_1.Identifier.from(['cat', "base" /* PkgName.Base */])],
|
|
751
834
|
processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ }, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes | built_in_props_1.CallProp.Prints, sig: [['...', built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Forced], ['file', built_in_props_1.ArgProp.Resource]] }, assumePrimitive: false },
|
|
752
835
|
{ type: 'function', names: [identifier_1.Identifier.from(['switch', "base" /* PkgName.Base */])],
|
|
753
|
-
processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: [true], useAsProcessor: built_in_proc_name_1.BuiltInProcName.Switch, props: built_in_props_1.CallProp.Pure }, assumePrimitive: false },
|
|
836
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: [true], alternativeArgsFrom: 1, useAsProcessor: built_in_proc_name_1.BuiltInProcName.Switch, props: built_in_props_1.CallProp.Pure }, assumePrimitive: false },
|
|
754
837
|
{ type: 'function', names: ['return'],
|
|
755
838
|
processor: built_in_proc_name_1.BuiltInProcName.Default, config: { cfg: 1 /* ExitPointType.Return */, keepArgumentOut: true, useAsProcessor: built_in_proc_name_1.BuiltInProcName.Return, props: built_in_props_1.CallProp.Pure, sig: [['value', built_in_props_1.ArgProp.Alias]] }, assumePrimitive: true },
|
|
756
839
|
{
|
|
@@ -778,7 +861,8 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
778
861
|
{ type: 'function', names: ['{'],
|
|
779
862
|
processor: built_in_proc_name_1.BuiltInProcName.ExpressionList, config: {}, assumePrimitive: true },
|
|
780
863
|
{ type: 'function', names: [identifier_1.Identifier.from(['source', "base" /* PkgName.Base */])],
|
|
781
|
-
|
|
864
|
+
/* it hands back what it evaluated invisibly, so a top-level `source()` prints nothing of its own */
|
|
865
|
+
processor: built_in_proc_name_1.BuiltInProcName.Source, config: { includeFunctionCall: true, forceFollow: false, props: built_in_props_1.CallProp.Invisible }, assumePrimitive: false },
|
|
782
866
|
{ type: 'function', names: ['['],
|
|
783
867
|
processor: built_in_proc_name_1.BuiltInProcName.Access, config: { treatIndicesAsString: false, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true },
|
|
784
868
|
{ type: 'function', names: ['[['],
|
|
@@ -836,11 +920,12 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
836
920
|
processor: built_in_proc_name_1.BuiltInProcName.SpecialBinOp, config: { lazy: true, evalRhsWhen: false, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Logical },
|
|
837
921
|
{ type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['&', '|']),
|
|
838
922
|
processor: built_in_proc_name_1.BuiltInProcName.SpecialBinOp, config: { lazy: false, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true, evalHandler: built_in_eval_name_1.BuiltInEvalName.Logical },
|
|
923
|
+
/* a pipe hands back what the side it feeds hands back, which `Alias` is what states */
|
|
839
924
|
{ type: 'function', names: ['|>'],
|
|
840
|
-
processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '_', assignLhs: false, returnLhs: false }, assumePrimitive: true },
|
|
841
|
-
{ type: 'function', names: [identifier_1.Identifier.from(['%>%', "magrittr" /* PkgName.Magrittr */]), '%!>%'], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: false, returnLhs: false, rhsMightBeSymbol: true }, assumePrimitive: true },
|
|
842
|
-
{ type: 'function', names: [identifier_1.Identifier.from(['%<>%', "magrittr" /* PkgName.Magrittr */])], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: true, returnLhs: false, rhsMightBeSymbol: true }, assumePrimitive: true },
|
|
843
|
-
{ type: 'function', names: [identifier_1.Identifier.from(['%T>%', "magrittr" /* PkgName.Magrittr */])], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: false, returnLhs: true, rhsMightBeSymbol: true }, assumePrimitive: true },
|
|
925
|
+
processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '_', assignLhs: false, returnLhs: false, sig: [['lhs', built_in_props_1.ArgProp.Value], ['rhs', built_in_props_1.ArgProp.Alias]] }, assumePrimitive: true },
|
|
926
|
+
{ type: 'function', names: [identifier_1.Identifier.from(['%>%', "magrittr" /* PkgName.Magrittr */]), '%!>%'], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: false, returnLhs: false, rhsMightBeSymbol: true, sig: [['lhs', built_in_props_1.ArgProp.Value], ['rhs', built_in_props_1.ArgProp.Alias]] }, assumePrimitive: true },
|
|
927
|
+
{ type: 'function', names: [identifier_1.Identifier.from(['%<>%', "magrittr" /* PkgName.Magrittr */])], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: true, returnLhs: false, rhsMightBeSymbol: true, props: built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Scope }, assumePrimitive: true },
|
|
928
|
+
{ type: 'function', names: [identifier_1.Identifier.from(['%T>%', "magrittr" /* PkgName.Magrittr */])], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: { pipePlaceholderName: '.', assignLhs: false, returnLhs: true, rhsMightBeSymbol: true, sig: [['lhs', built_in_props_1.ArgProp.Alias], ['rhs', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
|
|
844
929
|
{ type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['map', 'map_lgl', 'map_int', 'map_dbl', 'map_chr']), processor: built_in_proc_name_1.BuiltInProcName.PurrrFormula, config: {
|
|
845
930
|
args: {
|
|
846
931
|
'.x': { index: 0, name: '.x' }
|
|
@@ -993,7 +1078,7 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
993
1078
|
{ type: 'function', names: [identifier_1.Identifier.from(['exec', "rlang" /* PkgName.Rlang */])],
|
|
994
1079
|
processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: '.fn', unquoteFunction: true, hasUnknownSideEffects: true, libFn: true, props: built_in_props_1.CallProp.MayPure, sig: [['.fn', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
|
|
995
1080
|
{ type: 'function', names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['invoke', 'invoke_map']),
|
|
996
|
-
processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: '.f', unquoteFunction: true, hasUnknownSideEffects: true, libFn: true, props: built_in_props_1.CallProp.MayPure, sig: [['.f', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
|
|
1081
|
+
processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: '.f', unquoteFunction: true, hasUnknownSideEffects: true, libFn: true, props: built_in_props_1.CallProp.MayPure | built_in_props_1.CallProp.Deprecated, sig: [['.f', built_in_props_1.ArgProp.Callee], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
|
|
997
1082
|
/* the `{...}` of a template holds R code, evaluated where the call is; `cli_abort` stays with the other
|
|
998
1083
|
* error exits, as terminating a branch matters more than interpolating its message */
|
|
999
1084
|
{ type: 'function', names: [...identifier_1.Identifier.fromAll("glue" /* PkgName.Glue */, ['glue', 'glue_safe', 'glue_collapse']), identifier_1.Identifier.from(['str_glue', "stringr" /* PkgName.Stringr */])],
|
|
@@ -1003,7 +1088,7 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
1003
1088
|
'format_inline', 'cli_verbatim']),
|
|
1004
1089
|
processor: built_in_proc_name_1.BuiltInProcName.StringTemplate, config: { markup: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
|
|
1005
1090
|
{ type: 'function', names: [identifier_1.Identifier.from(['str_interp', "stringr" /* PkgName.Stringr */])],
|
|
1006
|
-
processor: built_in_proc_name_1.BuiltInProcName.StringTemplate, config: { open: '${', props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
|
|
1091
|
+
processor: built_in_proc_name_1.BuiltInProcName.StringTemplate, config: { open: '${', props: built_in_props_1.CallProp.MayPure | built_in_props_1.CallProp.Deprecated }, assumePrimitive: false },
|
|
1007
1092
|
{ type: 'function', names: [identifier_1.Identifier.from(['local', "base" /* PkgName.Base */])],
|
|
1008
1093
|
processor: built_in_proc_name_1.BuiltInProcName.Local, config: { args: { env: 'envir', expr: 'expr' } }, assumePrimitive: false },
|
|
1009
1094
|
{ type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['with', 'within']),
|
|
@@ -1312,9 +1397,13 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
1312
1397
|
processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Pure, sig: [['data', built_in_props_1.ArgProp.Value], ['nrow', built_in_props_1.ArgProp.Value], ['ncol', built_in_props_1.ArgProp.Value], ['byrow', built_in_props_1.ArgProp.Flag], ['dimnames', built_in_props_1.ArgProp.Value]] }, assumePrimitive: true },
|
|
1313
1398
|
/* the tidyverse verbs, under the names R declares them with. They keep the data mask the group above
|
|
1314
1399
|
gives them; what this adds is which argument is the data and what the further ones are called */
|
|
1315
|
-
{ type: 'function', names: identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['mutate', '
|
|
1400
|
+
{ type: 'function', names: identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['mutate', 'select', 'rename']),
|
|
1316
1401
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
1317
1402
|
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: SigDataDots }, assumePrimitive: false },
|
|
1403
|
+
/* `transmute` is one of them and deprecated on top of it */
|
|
1404
|
+
{ type: 'function', names: [identifier_1.Identifier.from(['transmute', "dplyr" /* PkgName.Dplyr */])],
|
|
1405
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
1406
|
+
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Deprecated, sig: SigDataDots }, assumePrimitive: false },
|
|
1318
1407
|
{ type: 'function', names: [identifier_1.Identifier.from(['filter', "dplyr" /* PkgName.Dplyr */]), identifier_1.Identifier.from(['slice', "dplyr" /* PkgName.Dplyr */])],
|
|
1319
1408
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
1320
1409
|
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
|
|
@@ -1364,7 +1453,7 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
1364
1453
|
sig: [['data', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value], ['names_from', built_in_props_1.ArgProp.Value], ['values_from', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
|
|
1365
1454
|
{ type: 'function', names: [identifier_1.Identifier.from(['separate', "tidyr" /* PkgName.TidyR */])],
|
|
1366
1455
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
1367
|
-
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
|
|
1456
|
+
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Deprecated,
|
|
1368
1457
|
sig: [['data', built_in_props_1.ArgProp.Value], ['col', built_in_props_1.ArgProp.Value], ['into', built_in_props_1.ArgProp.Value], ['sep', built_in_props_1.ArgProp.Value], ['remove', built_in_props_1.ArgProp.Flag], ['convert', built_in_props_1.ArgProp.Flag]] }, assumePrimitive: false },
|
|
1369
1458
|
{ type: 'function', names: [identifier_1.Identifier.from(['unite', "tidyr" /* PkgName.TidyR */])],
|
|
1370
1459
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
@@ -1412,6 +1501,19 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
1412
1501
|
{ type: 'function', names: [identifier_1.Identifier.from(['download.file', "utils" /* PkgName.Utils */])],
|
|
1413
1502
|
processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
|
|
1414
1503
|
config: { props: built_in_props_1.CallProp.Network | built_in_props_1.CallProp.File | built_in_props_1.CallProp.Writes, sig: [['url', built_in_props_1.ArgProp.Resource], ['destfile', built_in_props_1.ArgProp.Resource], ['method', built_in_props_1.ArgProp.Value], ['quiet', built_in_props_1.ArgProp.Flag], ['mode', built_in_props_1.ArgProp.Value], ['cacheOK', built_in_props_1.ArgProp.Flag], ['extra', built_in_props_1.ArgProp.Value], ['headers', built_in_props_1.ArgProp.Value], ['...', built_in_props_1.ArgProp.Value]] }, assumePrimitive: false },
|
|
1504
|
+
/** Deprecated Functions */
|
|
1505
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['id', 'top_n', 'sample_n', 'recode', 'progress_estimated', 'group_nest', 'add_rownames', 'tbl_df', 'src_local', 'summarise_each', 'summarize_', 'summarise_', 'slice_', 'select_vars_', 'select_', 'rename_vars_', 'rename_', 'transmute_', 'tally_', 'mutate_', 'group_indices_', 'group_by_', 'funs_', 'filter_', 'do_', 'distinct_', 'count_', 'arrange_', 'add_tally_', 'add_count_', 'funs', 'do', 'combine', 'changes', 'location', 'eval_tbls2', 'eval_tbls', 'compare_tbls2', 'compare_tbls', 'bench_tbls', 'current_vars', 'select_var', 'rename_vars', 'select_vars', 'failwith', 'all_vars', 'vars', 'select_all', 'mutate_all', 'summarise_all', 'group_by_all', 'filter_all', 'all_equal', 'arrange_all', 'distinct_all']) },
|
|
1506
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: [identifier_1.Identifier.make('fct_explicit_na', "forcats" /* PkgName.Forecats */)] },
|
|
1507
|
+
/* deprecated, but still data-masking: restating the mask keeps the column names out of the variable resolution */
|
|
1508
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.Default, config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Deprecated },
|
|
1509
|
+
names: [...identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['nest_by', 'with_groups', 'group_split']), ...identifier_1.Identifier.fromAll("tidyr" /* PkgName.TidyR */, ['spread', 'separate_rows', 'gather', 'extract'])] },
|
|
1510
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: identifier_1.Identifier.fromAll("ggplot2" /* PkgName.GgPlot2 */, ['gg_dep', 'is.theme', 'is.ggplot', 'guide_train', 'is.ggproto', 'fortify', 'is.facet', 'coord_map', 'coord_flip', 'is.Coord', 'annotation_logticks', 'aes_auto', 'aes_']) },
|
|
1511
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: identifier_1.Identifier.fromAll("plyr" /* PkgName.Plyr */, ['liply', 'isplit2']) },
|
|
1512
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: identifier_1.Identifier.fromAll("purrr" /* PkgName.Purrr */, ['transpose', 'as_vector', 'map_dfr', 'flatten', 'reduce_right', 'accumulate', 'map_raw', 'update_list', 'when', 'rdunif', 'rbernoulli', 'splice', 'rerun', 'prepend', 'at_depth', 'cross', 'list_along']) },
|
|
1513
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: ['`%@%`'] },
|
|
1514
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: identifier_1.Identifier.fromAll("readr" /* PkgName.Readr */, ['read_table2', 'melt_table', 'melt_fwf', 'melt_delim']) },
|
|
1515
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: identifier_1.Identifier.fromAll("tibble" /* PkgName.Tibble */, ['repair_names', 'set_tidy_names', 'tidy_names', 'is.tibble', 'trunc_mat', 'frame_data', 'as.tibble', 'as_data_frame', 'lst_', 'data_frame_', 'tibble_', 'data_frame', 'as_tibble']) },
|
|
1516
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: identifier_1.Identifier.fromAll("tidyr" /* PkgName.TidyR */, ['nest_legacy', 'unnest_', 'unite_', 'spread_', 'separate_', 'separate_rows_', 'nest_', 'gather_', 'fill_', 'extract_', 'nesting_', 'crossing_', 'expand_', 'drop_na_', 'complete_', 'extract_numeric']) },
|
|
1415
1517
|
];
|
|
1416
1518
|
/**
|
|
1417
1519
|
* Contains the built-in definitions recognized by flowR
|
|
@@ -61,17 +61,17 @@ export declare class Environment implements IEnvironment {
|
|
|
61
61
|
setClosureNodeId(nodeId: NodeId): void;
|
|
62
62
|
/** Provides the closure linked to this environment. */
|
|
63
63
|
get closure(): NodeId | undefined;
|
|
64
|
-
/**
|
|
65
|
-
* This environment's {@link memory}, ready to be written to. Every in-place write must go through this
|
|
66
|
-
* rather than through {@link memory} directly, as {@link clone} hands the map itself to the clone and only
|
|
67
|
-
* the first writer of either side copies it (copy-on-write).
|
|
68
|
-
*/
|
|
69
64
|
/**
|
|
70
65
|
* The parent, unshared first when a write is about to go through it. A `clone(true)` hands out the original
|
|
71
66
|
* chain and lets it materialize one frame at a time here, because a removal usually reaches a frame or two,
|
|
72
67
|
* not the ~20 an attached-package search path is deep.
|
|
73
68
|
*/
|
|
74
69
|
get writableParent(): Environment;
|
|
70
|
+
/**
|
|
71
|
+
* This environment's {@link memory}, ready to be written to. Every in-place write must go through this
|
|
72
|
+
* rather than through {@link memory} directly, as {@link clone} hands the map itself to the clone and only
|
|
73
|
+
* the first writer of either side copies it (copy-on-write).
|
|
74
|
+
*/
|
|
75
75
|
get writableMemory(): BuiltInMemory;
|
|
76
76
|
/**
|
|
77
77
|
* Create a clone of this environment.
|
|
@@ -75,11 +75,6 @@ class Environment {
|
|
|
75
75
|
get closure() {
|
|
76
76
|
return this.c;
|
|
77
77
|
}
|
|
78
|
-
/**
|
|
79
|
-
* This environment's {@link memory}, ready to be written to. Every in-place write must go through this
|
|
80
|
-
* rather than through {@link memory} directly, as {@link clone} hands the map itself to the clone and only
|
|
81
|
-
* the first writer of either side copies it (copy-on-write).
|
|
82
|
-
*/
|
|
83
78
|
/**
|
|
84
79
|
* The parent, unshared first when a write is about to go through it. A `clone(true)` hands out the original
|
|
85
80
|
* chain and lets it materialize one frame at a time here, because a removal usually reaches a frame or two,
|
|
@@ -94,6 +89,11 @@ class Environment {
|
|
|
94
89
|
}
|
|
95
90
|
return this.parent;
|
|
96
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* This environment's {@link memory}, ready to be written to. Every in-place write must go through this
|
|
94
|
+
* rather than through {@link memory} directly, as {@link clone} hands the map itself to the clone and only
|
|
95
|
+
* the first writer of either side copies it (copy-on-write).
|
|
96
|
+
*/
|
|
97
97
|
get writableMemory() {
|
|
98
98
|
if (this.sharedMemory) {
|
|
99
99
|
this.memory = new Map(this.memory);
|
|
@@ -133,6 +133,8 @@ export declare const Identifier: {
|
|
|
133
133
|
* a user definition, so a local `sd()` stays bare.
|
|
134
134
|
*
|
|
135
135
|
* Returns `undefined` when none apply. Steps 2 and 3 need the call's `name`.
|
|
136
|
+
* @param origins - the origins of the call to qualify
|
|
137
|
+
* @param name - the name the call was written with, needed by steps 2 and 3
|
|
136
138
|
* @param qualifyBaseR - whether to also qualify a bare base-R call from its exporting package (default `true`)
|
|
137
139
|
* @see {@link Dataflow.qualify} - the compact form, if you have the call's id and its graph
|
|
138
140
|
*/
|
|
@@ -152,6 +154,7 @@ export declare const enum PkgName {
|
|
|
152
154
|
Utils = "utils",
|
|
153
155
|
AssertThat = "assertthat",
|
|
154
156
|
Box = "box",
|
|
157
|
+
Car = "car",
|
|
155
158
|
Cli = "cli",
|
|
156
159
|
CohortBuilder = "cohortBuilder",
|
|
157
160
|
DataTable = "data.table",
|
|
@@ -167,9 +170,12 @@ export declare const enum PkgName {
|
|
|
167
170
|
Inferference = "inferference",
|
|
168
171
|
Janitor = "janitor",
|
|
169
172
|
Lattice = "lattice",
|
|
173
|
+
LmTest = "lmtest",
|
|
170
174
|
Magick = "magick",
|
|
171
175
|
Magrittr = "magrittr",
|
|
172
176
|
Msgr = "msgr",
|
|
177
|
+
Multcomp = "multcomp",
|
|
178
|
+
NorTest = "nortest",
|
|
173
179
|
PkgLoad = "pkgload",
|
|
174
180
|
Plyr = "plyr",
|
|
175
181
|
Purrr = "purrr",
|
|
@@ -181,6 +187,7 @@ export declare const enum PkgName {
|
|
|
181
187
|
Rlang = "rlang",
|
|
182
188
|
RmethodsS3 = "R.methodsS3",
|
|
183
189
|
Roo = "R.oo",
|
|
190
|
+
Rstatix = "rstatix",
|
|
184
191
|
RstudioApi = "rstudioapi",
|
|
185
192
|
Rutils = "R.utils",
|
|
186
193
|
S7 = "S7",
|
|
@@ -198,7 +205,10 @@ export declare const enum PkgName {
|
|
|
198
205
|
Stringr = "stringr",
|
|
199
206
|
TinyPlot = "tinyplot",
|
|
200
207
|
TryCatchLog = "tryCatchLog",
|
|
201
|
-
|
|
208
|
+
Tseries = "tseries",
|
|
209
|
+
Withr = "withr",
|
|
210
|
+
Forecats = "forcats",
|
|
211
|
+
Readr = "readr"
|
|
202
212
|
}
|
|
203
213
|
/**
|
|
204
214
|
* Each reference has exactly one reference type, stored as the respective number.
|
|
@@ -5,6 +5,7 @@ exports.isReferenceType = isReferenceType;
|
|
|
5
5
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
6
6
|
const strings_1 = require("../../util/text/strings");
|
|
7
7
|
const r_base_packages_1 = require("../../util/r-base-packages");
|
|
8
|
+
const objects_1 = require("../../util/objects");
|
|
8
9
|
const dotDotDotAccess = /^\.\.\d+$/;
|
|
9
10
|
/**
|
|
10
11
|
* Helper functions to work with {@link Identifier|identifiers}.
|
|
@@ -222,6 +223,8 @@ exports.Identifier = {
|
|
|
222
223
|
* a user definition, so a local `sd()` stays bare.
|
|
223
224
|
*
|
|
224
225
|
* Returns `undefined` when none apply. Steps 2 and 3 need the call's `name`.
|
|
226
|
+
* @param origins - the origins of the call to qualify
|
|
227
|
+
* @param name - the name the call was written with, needed by steps 2 and 3
|
|
225
228
|
* @param qualifyBaseR - whether to also qualify a bare base-R call from its exporting package (default `true`)
|
|
226
229
|
* @see {@link Dataflow.qualify} - the compact form, if you have the call's id and its graph
|
|
227
230
|
*/
|
|
@@ -311,7 +314,7 @@ var ReferenceType;
|
|
|
311
314
|
ReferenceType[ReferenceType["NonFunction"] = 1024] = "NonFunction";
|
|
312
315
|
})(ReferenceType || (exports.ReferenceType = ReferenceType = {}));
|
|
313
316
|
/** Reverse mapping of the reference types so you can get the name from the bitmask (useful for debugging) */
|
|
314
|
-
exports.ReferenceTypeReverseMapping = new Map(
|
|
317
|
+
exports.ReferenceTypeReverseMapping = new Map((0, objects_1.enumMembers)(ReferenceType).map(([name, value]) => [value, name]));
|
|
315
318
|
/**
|
|
316
319
|
* Check if the reference types have an overlapping type!
|
|
317
320
|
*/
|
|
@@ -17,6 +17,13 @@ export declare function resolveByName(id: Identifier, environment: REnvironmentI
|
|
|
17
17
|
* @useInstead {@link Resolve.byName}
|
|
18
18
|
*/
|
|
19
19
|
export declare function resolveByNameAnyType(id: Identifier, environment: REnvironmentInformation): IdentifierDefinition[] | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Whether every definition `name` may refer to is the built-in one (or there is none), i.e., the name is not
|
|
22
|
+
* shadowed by a user definition. Pass the {@link ReferenceType} the use site wants: `Function` for a call like
|
|
23
|
+
* `ls()`, `Constant` for a name like `.GlobalEnv`.
|
|
24
|
+
* @useInstead {@link Resolve.isBuiltIn}
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolvesToBuiltIn(name: Identifier, environment: REnvironmentInformation, target: ReferenceType.Function | ReferenceType.Constant): boolean;
|
|
20
27
|
/**
|
|
21
28
|
* Checks whether the given identifier name resolves to a built-in constant with the given value.
|
|
22
29
|
* @param name - The name of the identifier to resolve
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveByName = resolveByName;
|
|
4
4
|
exports.resolveByNameAnyType = resolveByNameAnyType;
|
|
5
|
+
exports.resolvesToBuiltIn = resolvesToBuiltIn;
|
|
5
6
|
exports.resolvesToBuiltInConstant = resolvesToBuiltInConstant;
|
|
6
7
|
const environment_1 = require("./environment");
|
|
7
8
|
const logic_1 = require("../../util/logic");
|
|
@@ -210,6 +211,17 @@ function resolveByNameAnyType(id, environment) {
|
|
|
210
211
|
}
|
|
211
212
|
return ret;
|
|
212
213
|
}
|
|
214
|
+
/**
|
|
215
|
+
* Whether every definition `name` may refer to is the built-in one (or there is none), i.e., the name is not
|
|
216
|
+
* shadowed by a user definition. Pass the {@link ReferenceType} the use site wants: `Function` for a call like
|
|
217
|
+
* `ls()`, `Constant` for a name like `.GlobalEnv`.
|
|
218
|
+
* @useInstead {@link Resolve.isBuiltIn}
|
|
219
|
+
*/
|
|
220
|
+
function resolvesToBuiltIn(name, environment, target) {
|
|
221
|
+
const defs = resolveByName(name, environment, target);
|
|
222
|
+
const builtIn = target === identifier_1.ReferenceType.Function ? identifier_1.ReferenceType.BuiltInFunction : identifier_1.ReferenceType.BuiltInConstant;
|
|
223
|
+
return defs === undefined || defs.every(d => (0, identifier_1.isReferenceType)(d.type, builtIn));
|
|
224
|
+
}
|
|
213
225
|
/**
|
|
214
226
|
* Checks whether the given identifier name resolves to a built-in constant with the given value.
|
|
215
227
|
* @param name - The name of the identifier to resolve
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { resolveByName, resolveByNameAnyType, resolvesToBuiltInConstant } from './resolve-by-name';
|
|
1
|
+
import { resolveByName, resolveByNameAnyType, resolvesToBuiltIn, resolvesToBuiltInConstant } from './resolve-by-name';
|
|
2
2
|
import { resolveIdToValue, resolveIdToSingleString, resolveToConstants } from '../eval/resolve/alias-tracking';
|
|
3
3
|
import { resolveIdToArgName, resolveIdToArgStringVector, resolveIdToArgValue, resolveIdToArgValueSymbolName, resolveIdToArgVectorLength } from '../../abstract-interpretation/data-frame/resolve-args';
|
|
4
4
|
/**
|
|
@@ -27,6 +27,8 @@ export declare const Resolve: {
|
|
|
27
27
|
readonly byNameAndType: typeof resolveByName;
|
|
28
28
|
/** Whether the name always, never, or maybe refers to a built-in constant of the given value. */
|
|
29
29
|
readonly toBuiltIn: typeof resolvesToBuiltInConstant;
|
|
30
|
+
/** Whether the name is not shadowed by a user definition, so it still refers to the built-in. */
|
|
31
|
+
readonly isBuiltIn: typeof resolvesToBuiltIn;
|
|
30
32
|
/** The constant values the name resolves to. */
|
|
31
33
|
readonly toConstants: typeof resolveToConstants;
|
|
32
34
|
/** The value(s) the node may hold, tracking aliases as the configuration allows. */
|
|
@@ -30,6 +30,8 @@ exports.Resolve = {
|
|
|
30
30
|
byNameAndType: resolve_by_name_1.resolveByName,
|
|
31
31
|
/** Whether the name always, never, or maybe refers to a built-in constant of the given value. */
|
|
32
32
|
toBuiltIn: resolve_by_name_1.resolvesToBuiltInConstant,
|
|
33
|
+
/** Whether the name is not shadowed by a user definition, so it still refers to the built-in. */
|
|
34
|
+
isBuiltIn: resolve_by_name_1.resolvesToBuiltIn,
|
|
33
35
|
/** The constant values the name resolves to. */
|
|
34
36
|
toConstants: alias_tracking_1.resolveToConstants,
|
|
35
37
|
/** The value(s) the node may hold, tracking aliases as the configuration allows. */
|
|
@@ -60,8 +60,8 @@ export declare function getAliases(sourceIds: readonly NodeId[], dataflow: Dataf
|
|
|
60
60
|
* @useInstead {@link Resolve.toValue}
|
|
61
61
|
*/
|
|
62
62
|
export declare function resolveIdToValue(id: NodeId | RNodeWithParent | undefined, { environment, graph, idMap, full, ctx, resolve, blocked }: ResolveInfo): ResolveResult;
|
|
63
|
-
/** Resolves an id to a single constant string value, or `undefined` if it is not a unique string constant. */
|
|
64
63
|
/**
|
|
64
|
+
* Resolves an id to a single constant string value, or `undefined` if it is not a unique string constant.
|
|
65
65
|
* @useInstead {@link Resolve.toSingleString}
|
|
66
66
|
*/
|
|
67
67
|
export declare function resolveIdToSingleString(id: NodeId | RNodeWithParent | undefined, info: ResolveInfo): string | undefined;
|
|
@@ -70,9 +70,9 @@ export declare function resolveIdToSingleString(id: NodeId | RNodeWithParent | u
|
|
|
70
70
|
*
|
|
71
71
|
* Uses the aliases that were tracked in the environments (by the
|
|
72
72
|
* {@link getAliases} function) to resolve a node to a value.
|
|
73
|
-
* @
|
|
73
|
+
* The third argument is the {@link ResolveInfo} (ctx, idMap, ...) minus the environment, which is passed on its own.
|
|
74
|
+
* @param identifier - Identifier to resolve
|
|
74
75
|
* @param environment - Environment to use
|
|
75
|
-
* @param r - Resolve information (env, ctx, ...)
|
|
76
76
|
* @returns Value of Identifier or Top
|
|
77
77
|
*/
|
|
78
78
|
export declare function trackAliasInEnvironments(identifier: Identifier | undefined, environment: REnvironmentInformation, { blocked, idMap, resolve, ctx, graph }: Omit<ResolveInfo, 'environment'>): ResolveResult;
|
|
@@ -169,8 +169,8 @@ function resolveIdToValue(id, { environment, graph, idMap, full = true, ctx, res
|
|
|
169
169
|
return r_value_1.Top;
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
/** Resolves an id to a single constant string value, or `undefined` if it is not a unique string constant. */
|
|
173
172
|
/**
|
|
173
|
+
* Resolves an id to a single constant string value, or `undefined` if it is not a unique string constant.
|
|
174
174
|
* @useInstead {@link Resolve.toSingleString}
|
|
175
175
|
*/
|
|
176
176
|
function resolveIdToSingleString(id, info) {
|
|
@@ -192,9 +192,9 @@ function iteratedElements(value) {
|
|
|
192
192
|
*
|
|
193
193
|
* Uses the aliases that were tracked in the environments (by the
|
|
194
194
|
* {@link getAliases} function) to resolve a node to a value.
|
|
195
|
-
* @
|
|
195
|
+
* The third argument is the {@link ResolveInfo} (ctx, idMap, ...) minus the environment, which is passed on its own.
|
|
196
|
+
* @param identifier - Identifier to resolve
|
|
196
197
|
* @param environment - Environment to use
|
|
197
|
-
* @param r - Resolve information (env, ctx, ...)
|
|
198
198
|
* @returns Value of Identifier or Top
|
|
199
199
|
*/
|
|
200
200
|
function trackAliasInEnvironments(identifier, environment, { blocked, idMap, resolve = config_1.VariableResolve.Alias, ctx, graph }) {
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.matchCallArguments = matchCallArguments;
|
|
4
4
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
5
|
-
const
|
|
5
|
+
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
6
|
+
const r_binary_op_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-binary-op");
|
|
7
|
+
const r_unary_op_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-unary-op");
|
|
6
8
|
/**
|
|
7
9
|
* The arguments of a call, one slot per declared parameter, matched the way R does: a named argument goes to
|
|
8
10
|
* the parameter it names, the rest fill the remaining slots left to right, and a `...` parameter collects
|
|
@@ -15,13 +17,13 @@ const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
|
15
17
|
* solver relies on that, since a call it cannot match is one whose result it must not guess at.
|
|
16
18
|
*/
|
|
17
19
|
function matchCallArguments(node, params, ignored = []) {
|
|
18
|
-
if (
|
|
20
|
+
if (r_unary_op_1.RUnaryOp.is(node)) {
|
|
19
21
|
return [node.operand];
|
|
20
22
|
}
|
|
21
|
-
else if (
|
|
23
|
+
else if (r_binary_op_1.RBinaryOp.is(node)) {
|
|
22
24
|
return [node.lhs, node.rhs];
|
|
23
25
|
}
|
|
24
|
-
else if (
|
|
26
|
+
else if (!r_function_call_1.RFunctionCall.is(node) || !node.named) {
|
|
25
27
|
return undefined;
|
|
26
28
|
}
|
|
27
29
|
const rest = params.indexOf('...');
|
|
@@ -31,7 +33,7 @@ function matchCallArguments(node, params, ignored = []) {
|
|
|
31
33
|
const positional = [];
|
|
32
34
|
// R matches every named argument before it gives a slot to a positional one, so this takes two passes
|
|
33
35
|
for (const [at, arg] of node.arguments.entries()) {
|
|
34
|
-
if (arg
|
|
36
|
+
if (r_argument_1.RArgument.isEmpty(arg) || arg.value === undefined) {
|
|
35
37
|
continue;
|
|
36
38
|
}
|
|
37
39
|
else if (arg.name === undefined) {
|
|
@@ -5,7 +5,7 @@ import type { DataflowGraph } from '../../graph/graph';
|
|
|
5
5
|
import type { ReadOnlyFlowrAnalyzerContext } from '../../../project/context/flowr-analyzer-context';
|
|
6
6
|
import type { ResolveInfo, ResolveResult } from './alias-tracking';
|
|
7
7
|
import { soleValue } from '../values/general';
|
|
8
|
-
import type
|
|
8
|
+
import { type Value, type ValueSet } from '../values/r-value';
|
|
9
9
|
/** The node to resolve, given either by id or directly. */
|
|
10
10
|
type Target = NodeId | RNodeWithParent | undefined;
|
|
11
11
|
declare function infoOf<OtherInfo>(this: void, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, overrides?: Partial<ResolveInfo>): ResolveInfo;
|
|
@@ -34,6 +34,8 @@ export declare const NodeValue: {
|
|
|
34
34
|
readonly setOf: <OtherInfo>(this: void, id: Target, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, overrides?: Partial<ResolveInfo>) => ValueSet<Value[]> | undefined;
|
|
35
35
|
/** The strings the node may hold, `undefined` if it does not resolve to strings. */
|
|
36
36
|
readonly stringsOf: <OtherInfo>(this: void, id: Target, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, overrides?: Partial<ResolveInfo>) => string[] | undefined;
|
|
37
|
+
/** The strings the node may hold, dropping every value that is not one (in contrast to {@link NodeValue.stringsOf}, which gives up on them). */
|
|
38
|
+
readonly knownStringsOf: <OtherInfo>(this: void, id: Target, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, overrides?: Partial<ResolveInfo>) => string[];
|
|
37
39
|
/** The single string the node resolves to, `undefined` if it is not exactly one. */
|
|
38
40
|
readonly singleStringOf: <OtherInfo>(this: void, id: Target, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, overrides?: Partial<ResolveInfo>) => string | undefined;
|
|
39
41
|
/** The one value a set holds, `undefined` unless it holds exactly one, optionally of the given kind. */
|
|
@@ -4,6 +4,7 @@ exports.NodeValue = void 0;
|
|
|
4
4
|
const resolve_helper_1 = require("../../environments/resolve-helper");
|
|
5
5
|
const general_1 = require("../values/general");
|
|
6
6
|
const string_constants_1 = require("../values/string/string-constants");
|
|
7
|
+
const r_value_1 = require("../values/r-value");
|
|
7
8
|
function infoOf(data, overrides) {
|
|
8
9
|
return {
|
|
9
10
|
environment: data.environment,
|
|
@@ -48,6 +49,17 @@ exports.NodeValue = {
|
|
|
48
49
|
const resolved = (0, general_1.valueSetGuard)(resolve_helper_1.Resolve.toValue(id, infoOf(data, overrides)));
|
|
49
50
|
return resolved ? (0, string_constants_1.collectStrings)(resolved.elements) : undefined;
|
|
50
51
|
},
|
|
52
|
+
/** The strings the node may hold, dropping every value that is not one (in contrast to {@link NodeValue.stringsOf}, which gives up on them). */
|
|
53
|
+
knownStringsOf(id, data, overrides) {
|
|
54
|
+
const resolved = (0, general_1.valueSetGuard)(resolve_helper_1.Resolve.toValue(id, infoOf(data, overrides)));
|
|
55
|
+
const strings = [];
|
|
56
|
+
for (const element of resolved?.elements ?? []) {
|
|
57
|
+
if (element.type === 'string' && (0, r_value_1.isValue)(element.value)) {
|
|
58
|
+
strings.push(element.value.str);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return strings;
|
|
62
|
+
},
|
|
51
63
|
/** The single string the node resolves to, `undefined` if it is not exactly one. */
|
|
52
64
|
singleStringOf(id, data, overrides) {
|
|
53
65
|
return resolve_helper_1.Resolve.toSingleString(id, infoOf(data, overrides));
|