@eagleoutice/flowr 2.14.1 → 2.14.2
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 +154 -87
- package/abstract-interpretation/absint-visitor.d.ts +91 -25
- package/abstract-interpretation/absint-visitor.js +235 -74
- 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 +6 -0
- package/config.js +8 -4
- 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 -26
- 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 +112 -7
- package/dataflow/environments/default-builtin-config.js +82 -34
- 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 +2 -2
- package/dataflow/eval/resolve/alias-tracking.js +2 -2
- 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 +14 -0
- package/dataflow/internal/control-flow.d.ts +102 -0
- package/dataflow/internal/control-flow.js +200 -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 +8 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +11 -0
- 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 +27 -20
- 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 +35 -6
- 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 +8 -3
- 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.js +2 -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 +12 -13
- 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 +45 -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 +19 -3
- 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 +23 -1
- 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 +45 -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 +12 -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-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 +309 -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 +0 -7
- package/project/dependency-version-space.js +8 -7
- 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 +48 -13
- package/project/sigdb/reader.js +2 -1
- 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 +1 -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 +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/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 -4
- 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 +9 -0
- 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
|
@@ -233,13 +233,6 @@ exports.RGroupGenerics = {
|
|
|
233
233
|
Summary: ['any', 'sum', 'prod', 'min', 'max', 'range'],
|
|
234
234
|
Complex: ['Re', 'Im', 'Mod', 'Arg', 'Conj']
|
|
235
235
|
};
|
|
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
236
|
/**
|
|
244
237
|
* The internal generics: they dispatch in C rather than through `UseMethod`, so no signature can state it and
|
|
245
238
|
* the list has to be written down. Everything that dispatches from R is generated, see {@link RBasePackageStore}.
|
|
@@ -251,7 +244,14 @@ const InternalGenerics = [
|
|
|
251
244
|
'as.character', 'as.integer', 'as.double', 'as.logical', 'as.complex', 'as.numeric', 'as.raw',
|
|
252
245
|
'is.na', 'is.nan', 'is.finite', 'is.infinite', 'is.matrix', 'is.numeric', 'cbind', 'rbind'
|
|
253
246
|
];
|
|
254
|
-
/**
|
|
247
|
+
/**
|
|
248
|
+
* Every name R dispatches on: the generated closure generics plus the {@link InternalGenerics}, i.e. the
|
|
249
|
+
* {@link RGroupGenerics} members, the `.S3PrimitiveGenerics` and internal generics (which have no R body, so
|
|
250
|
+
* {@link fnInfoFromSignature} could never see them), and the `UseMethod` closures flowR models itself, as its
|
|
251
|
+
* own definition hides the one in the signature database.
|
|
252
|
+
* The `<-` forms are left out, one replacement definition covers many names.
|
|
253
|
+
* `npm run check:generic-labels` (part of `checkup`) compares this against a synced database.
|
|
254
|
+
*/
|
|
255
255
|
const RGenerics = new Set([...r_base_packages_generated_1.RBasePackageStore.generics, ...InternalGenerics]);
|
|
256
256
|
/** Label every {@link RGenerics} {@link CallProp.Generic}, splitting an entry that mixes them with names that do not dispatch (`&` does, `&&` does not). */
|
|
257
257
|
function markGenerics(definitions) {
|
|
@@ -288,6 +288,23 @@ function markGenerics(definitions) {
|
|
|
288
288
|
* Contains the built-in definitions recognized by flowR, as they are written down: {@link DefaultBuiltinConfig}
|
|
289
289
|
* is what {@link markGenerics} makes of them, and a test checks that this is all it changes.
|
|
290
290
|
*/
|
|
291
|
+
/** what creating a plot does; restated by the deprecated plot creators, which do the same but should not be used */
|
|
292
|
+
const PlotCreateConfig = {
|
|
293
|
+
forceArgs: 'all',
|
|
294
|
+
hasUnknownSideEffects: {
|
|
295
|
+
type: 'link-to-last-call',
|
|
296
|
+
ignoreIf: (source, graph) => {
|
|
297
|
+
const sourceVertex = graph.getVertex(source);
|
|
298
|
+
/* map with add = true appends to an existing plot */
|
|
299
|
+
return (exports.PlotFunctionsWithAddParam.has(identifier_1.Identifier.getName(sourceVertex.name)) && (0, identify_link_to_last_call_relation_1.getValueOfArgument)(graph, sourceVertex, {
|
|
300
|
+
index: -1,
|
|
301
|
+
name: 'add'
|
|
302
|
+
}, [type_1.RType.Logical])?.content === true);
|
|
303
|
+
},
|
|
304
|
+
callName: toRegex(GraphicDeviceOpen)
|
|
305
|
+
},
|
|
306
|
+
props: built_in_props_1.CallProp.Graphics
|
|
307
|
+
};
|
|
291
308
|
exports.WrittenBuiltinDefinitions = [
|
|
292
309
|
{ type: 'constant', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['NULL', 'NA', 'NA_integer_', 'NA_real_', 'NA_complex_', 'NA_character_']), value: null, assumePrimitive: true },
|
|
293
310
|
{ type: 'constant', names: [identifier_1.Identifier.from(['NaN', "base" /* PkgName.Base */])], value: NaN, assumePrimitive: true },
|
|
@@ -470,6 +487,28 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
470
487
|
config: { props: built_in_props_1.CallProp.Pure },
|
|
471
488
|
assumePrimitive: true
|
|
472
489
|
},
|
|
490
|
+
/* the hypothesis tests: they compute a test statistic and hand it back visibly, which is the output a reader sees */
|
|
491
|
+
{
|
|
492
|
+
type: 'function',
|
|
493
|
+
names: [
|
|
494
|
+
...identifier_1.Identifier.fromAll("stats" /* PkgName.Stats */, [
|
|
495
|
+
'anova', 'ansari.test', 'aov', 'bartlett.test', 'binom.test', 'Box.test', 'chisq.test', 'cor.test',
|
|
496
|
+
'fisher.test', 'fligner.test', 'friedman.test', 'kruskal.test', 'ks.test', 'manova', 'mantelhaen.test',
|
|
497
|
+
'mauchly.test', 'mcnemar.test', 'mood.test', 'oneway.test', 'pairwise.prop.test', 'pairwise.t.test',
|
|
498
|
+
'pairwise.wilcox.test', 'poisson.test', 'PP.test', 'prop.test', 'prop.trend.test', 'quade.test',
|
|
499
|
+
'shapiro.test', 't.test', 'TukeyHSD', 'var.test', 'wilcox.test'
|
|
500
|
+
]),
|
|
501
|
+
...identifier_1.Identifier.fromAll("car" /* PkgName.Car */, ['Anova', 'durbinWatsonTest', 'leveneTest', 'linearHypothesis', 'ncvTest', 'outlierTest']),
|
|
502
|
+
...identifier_1.Identifier.fromAll("lmtest" /* PkgName.LmTest */, ['bgtest', 'bptest', 'coeftest', 'dwtest', 'gqtest', 'lrtest', 'raintest', 'resettest', 'waldtest']),
|
|
503
|
+
...identifier_1.Identifier.fromAll("nortest" /* PkgName.NorTest */, ['ad.test', 'cvm.test', 'lillie.test', 'pearson.test', 'sf.test']),
|
|
504
|
+
...identifier_1.Identifier.fromAll("tseries" /* PkgName.Tseries */, ['adf.test', 'jarque.bera.test', 'kpss.test', 'pp.test', 'runs.test', 'white.test']),
|
|
505
|
+
...identifier_1.Identifier.fromAll("rstatix" /* PkgName.Rstatix */, ['anova_test', 'chisq_test', 'cor_test', 'kruskal_test', 'shapiro_test', 't_test', 'wilcox_test']),
|
|
506
|
+
identifier_1.Identifier.from(['glht', "multcomp" /* PkgName.Multcomp */])
|
|
507
|
+
],
|
|
508
|
+
processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
|
|
509
|
+
config: { props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Statistics },
|
|
510
|
+
assumePrimitive: false
|
|
511
|
+
},
|
|
473
512
|
/* indices and index sequences: bounded by the shape of what they are handed, never by its contents */
|
|
474
513
|
{ type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['which', 'which.max', 'which.min', 'seq_len', 'seq_along']),
|
|
475
514
|
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 +658,12 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
619
658
|
// graphics base
|
|
620
659
|
{ type: 'function', names: namespacePlotFunctions(exports.PlotCreate),
|
|
621
660
|
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 },
|
|
661
|
+
config: PlotCreateConfig, assumePrimitive: true },
|
|
662
|
+
/* `qplot` creates a plot like the ones above and is deprecated on top of it; registered after them so this
|
|
663
|
+
definition is the one that sticks */
|
|
664
|
+
{ type: 'function', names: [identifier_1.Identifier.from(['qplot', "ggplot2" /* PkgName.GgPlot2 */])],
|
|
665
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
666
|
+
config: { ...PlotCreateConfig, props: built_in_props_1.CallProp.Graphics | built_in_props_1.CallProp.Deprecated }, assumePrimitive: true },
|
|
638
667
|
// graphics addons
|
|
639
668
|
{ type: 'function', names: namespacePlotFunctions(PlotAddons),
|
|
640
669
|
processor: built_in_proc_name_1.BuiltInProcName.Default, config: {
|
|
@@ -750,7 +779,7 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
750
779
|
{ type: 'function', names: [identifier_1.Identifier.from(['cat', "base" /* PkgName.Base */])],
|
|
751
780
|
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
781
|
{ 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 },
|
|
782
|
+
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
783
|
{ type: 'function', names: ['return'],
|
|
755
784
|
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
785
|
{
|
|
@@ -778,7 +807,8 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
778
807
|
{ type: 'function', names: ['{'],
|
|
779
808
|
processor: built_in_proc_name_1.BuiltInProcName.ExpressionList, config: {}, assumePrimitive: true },
|
|
780
809
|
{ type: 'function', names: [identifier_1.Identifier.from(['source', "base" /* PkgName.Base */])],
|
|
781
|
-
|
|
810
|
+
/* it hands back what it evaluated invisibly, so a top-level `source()` prints nothing of its own */
|
|
811
|
+
processor: built_in_proc_name_1.BuiltInProcName.Source, config: { includeFunctionCall: true, forceFollow: false, props: built_in_props_1.CallProp.Invisible }, assumePrimitive: false },
|
|
782
812
|
{ type: 'function', names: ['['],
|
|
783
813
|
processor: built_in_proc_name_1.BuiltInProcName.Access, config: { treatIndicesAsString: false, props: built_in_props_1.CallProp.Pure }, assumePrimitive: true },
|
|
784
814
|
{ type: 'function', names: ['[['],
|
|
@@ -836,11 +866,12 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
836
866
|
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
867
|
{ type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['&', '|']),
|
|
838
868
|
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 },
|
|
869
|
+
/* a pipe hands back what the side it feeds hands back, which `Alias` is what states */
|
|
839
870
|
{ 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 },
|
|
871
|
+
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 },
|
|
872
|
+
{ 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 },
|
|
873
|
+
{ 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 },
|
|
874
|
+
{ 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
875
|
{ 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
876
|
args: {
|
|
846
877
|
'.x': { index: 0, name: '.x' }
|
|
@@ -993,7 +1024,7 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
993
1024
|
{ type: 'function', names: [identifier_1.Identifier.from(['exec', "rlang" /* PkgName.Rlang */])],
|
|
994
1025
|
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
1026
|
{ 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 },
|
|
1027
|
+
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
1028
|
/* the `{...}` of a template holds R code, evaluated where the call is; `cli_abort` stays with the other
|
|
998
1029
|
* error exits, as terminating a branch matters more than interpolating its message */
|
|
999
1030
|
{ 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 +1034,7 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
1003
1034
|
'format_inline', 'cli_verbatim']),
|
|
1004
1035
|
processor: built_in_proc_name_1.BuiltInProcName.StringTemplate, config: { markup: true, props: built_in_props_1.CallProp.MayPure }, assumePrimitive: false },
|
|
1005
1036
|
{ 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 },
|
|
1037
|
+
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
1038
|
{ type: 'function', names: [identifier_1.Identifier.from(['local', "base" /* PkgName.Base */])],
|
|
1008
1039
|
processor: built_in_proc_name_1.BuiltInProcName.Local, config: { args: { env: 'envir', expr: 'expr' } }, assumePrimitive: false },
|
|
1009
1040
|
{ type: 'function', names: identifier_1.Identifier.fromAll("base" /* PkgName.Base */, ['with', 'within']),
|
|
@@ -1312,9 +1343,13 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
1312
1343
|
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
1344
|
/* the tidyverse verbs, under the names R declares them with. They keep the data mask the group above
|
|
1314
1345
|
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', '
|
|
1346
|
+
{ type: 'function', names: identifier_1.Identifier.fromAll("dplyr" /* PkgName.Dplyr */, ['mutate', 'select', 'rename']),
|
|
1316
1347
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
1317
1348
|
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure, sig: SigDataDots }, assumePrimitive: false },
|
|
1349
|
+
/* `transmute` is one of them and deprecated on top of it */
|
|
1350
|
+
{ type: 'function', names: [identifier_1.Identifier.from(['transmute', "dplyr" /* PkgName.Dplyr */])],
|
|
1351
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
1352
|
+
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
1353
|
{ type: 'function', names: [identifier_1.Identifier.from(['filter', "dplyr" /* PkgName.Dplyr */]), identifier_1.Identifier.from(['slice', "dplyr" /* PkgName.Dplyr */])],
|
|
1319
1354
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
1320
1355
|
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
|
|
@@ -1364,7 +1399,7 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
1364
1399
|
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
1400
|
{ type: 'function', names: [identifier_1.Identifier.from(['separate', "tidyr" /* PkgName.TidyR */])],
|
|
1366
1401
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
1367
|
-
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure,
|
|
1402
|
+
config: { markArgsAsMasked: known_call_handling_1.NseArguments.AllButFirst, props: built_in_props_1.CallProp.Pure | built_in_props_1.CallProp.Deprecated,
|
|
1368
1403
|
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
1404
|
{ type: 'function', names: [identifier_1.Identifier.from(['unite', "tidyr" /* PkgName.TidyR */])],
|
|
1370
1405
|
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
@@ -1412,6 +1447,19 @@ exports.WrittenBuiltinDefinitions = [
|
|
|
1412
1447
|
{ type: 'function', names: [identifier_1.Identifier.from(['download.file', "utils" /* PkgName.Utils */])],
|
|
1413
1448
|
processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
|
|
1414
1449
|
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 },
|
|
1450
|
+
/** Deprecated Functions */
|
|
1451
|
+
{ 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']) },
|
|
1452
|
+
{ 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 */)] },
|
|
1453
|
+
/* deprecated, but still data-masking: restating the mask keeps the column names out of the variable resolution */
|
|
1454
|
+
{ 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 },
|
|
1455
|
+
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'])] },
|
|
1456
|
+
{ 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_']) },
|
|
1457
|
+
{ 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']) },
|
|
1458
|
+
{ 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']) },
|
|
1459
|
+
{ type: 'function', processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, config: { props: built_in_props_1.CallProp.Deprecated }, names: ['`%@%`'] },
|
|
1460
|
+
{ 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']) },
|
|
1461
|
+
{ 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']) },
|
|
1462
|
+
{ 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
1463
|
];
|
|
1416
1464
|
/**
|
|
1417
1465
|
* 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. */
|
|
@@ -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;
|
|
@@ -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));
|
|
@@ -5,13 +5,14 @@ const graph_1 = require("../../graph/graph");
|
|
|
5
5
|
const r_value_1 = require("../values/r-value");
|
|
6
6
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
7
7
|
const assert_1 = require("../../../util/assert");
|
|
8
|
-
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
9
8
|
const dependencies_query_format_1 = require("../../../queries/catalog/dependencies-query/dependencies-query-format");
|
|
10
9
|
const general_1 = require("../values/general");
|
|
11
10
|
const r_value_2 = require("../values/r-value");
|
|
12
11
|
const convert_values_1 = require("../../../r-bridge/lang-4.x/convert-values");
|
|
13
12
|
const string_constants_1 = require("../values/string/string-constants");
|
|
14
13
|
const resolve_helper_1 = require("../../environments/resolve-helper");
|
|
14
|
+
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
15
|
+
const r_symbol_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
|
|
15
16
|
/**
|
|
16
17
|
* Get the values of all arguments matching the criteria.
|
|
17
18
|
*/
|
|
@@ -31,7 +32,7 @@ function getArgumentStringValue(variableResolve, graph, vertex, argumentIndex, a
|
|
|
31
32
|
const map = new Map();
|
|
32
33
|
for (const ref of references) {
|
|
33
34
|
let valueNode = graph.idMap?.get(ref);
|
|
34
|
-
if (
|
|
35
|
+
if (r_argument_1.RArgument.is(valueNode)) {
|
|
35
36
|
valueNode = valueNode.value;
|
|
36
37
|
}
|
|
37
38
|
if (valueNode) {
|
|
@@ -48,7 +49,7 @@ function getArgumentStringValue(variableResolve, graph, vertex, argumentIndex, a
|
|
|
48
49
|
return undefined;
|
|
49
50
|
}
|
|
50
51
|
let valueNode = graph.idMap?.get(arg);
|
|
51
|
-
if (
|
|
52
|
+
if (r_argument_1.RArgument.is(valueNode)) {
|
|
52
53
|
valueNode = valueNode.value;
|
|
53
54
|
}
|
|
54
55
|
if (valueNode) {
|
|
@@ -83,7 +84,7 @@ function resolveBasedOnConfig(variableResolve, graph, vertex, argument, environm
|
|
|
83
84
|
if (resolveValue === 'library') {
|
|
84
85
|
const hasChar = hasCharacterOnly(variableResolve, graph, vertex, idMap, ctx);
|
|
85
86
|
if (hasChar === false) {
|
|
86
|
-
if (
|
|
87
|
+
if (r_symbol_1.RSymbol.is(argument)) {
|
|
87
88
|
return [argument.lexeme];
|
|
88
89
|
}
|
|
89
90
|
full = false;
|