@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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
+
import type { NormalizedAst } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
3
|
+
import type { DataflowInformation } from '../../../dataflow/info';
|
|
4
|
+
import type { DependencyInfo } from './dependencies-query-format';
|
|
5
|
+
/**
|
|
6
|
+
* Collects what the top level of the analyzed code prints on its own (as {@link DependencyInfo#implicit}
|
|
7
|
+
* outputs), given that it is echoed at all
|
|
8
|
+
* (`project.assumeImplicitEcho`). A statement is only an output if its value is visible: an assignment, a loop,
|
|
9
|
+
* and every {@link CallProp.Invisible} call hand back their result invisibly, while a bare symbol, a constant,
|
|
10
|
+
* or an ordinary call reaches stdout. Calls another category already reports (a plot, a write, an assertion)
|
|
11
|
+
* are left to it.
|
|
12
|
+
*/
|
|
13
|
+
export declare function collectImplicitEchoes(ast: NormalizedAst, dataflow: DataflowInformation, accountedFor: ReadonlySet<NodeId>, result: DependencyInfo[]): void;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.collectImplicitEchoes = collectImplicitEchoes;
|
|
4
|
+
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
5
|
+
const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
|
|
6
|
+
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
7
|
+
const r_binary_op_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-binary-op");
|
|
8
|
+
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
9
|
+
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
10
|
+
const r_comment_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-comment");
|
|
11
|
+
const r_line_directive_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-line-directive");
|
|
12
|
+
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
13
|
+
const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
14
|
+
const query_fn_props_1 = require("../../../dataflow/environments/query-fn-props");
|
|
15
|
+
const built_in_props_1 = require("../../../dataflow/environments/built-in-props");
|
|
16
|
+
const test_functions_1 = require("./function-info/test-functions");
|
|
17
|
+
/** the node whose value R echoes for a statement, `undefined` if the statement yields nothing visible */
|
|
18
|
+
function echoedValue(node, dataflow) {
|
|
19
|
+
switch (node?.type) {
|
|
20
|
+
/* the loops hand back an invisible NULL, and the jumps never hand back anything at all */
|
|
21
|
+
case undefined:
|
|
22
|
+
case type_1.RType.ForLoop:
|
|
23
|
+
case type_1.RType.WhileLoop:
|
|
24
|
+
case type_1.RType.RepeatLoop:
|
|
25
|
+
case type_1.RType.Break:
|
|
26
|
+
case type_1.RType.Next:
|
|
27
|
+
case type_1.RType.Comment:
|
|
28
|
+
case type_1.RType.LineDirective:
|
|
29
|
+
return undefined;
|
|
30
|
+
case type_1.RType.FunctionCall: {
|
|
31
|
+
if (callName(node, dataflow) === undefined) {
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
34
|
+
const handedOn = aliased(node, dataflow);
|
|
35
|
+
return handedOn === undefined ? node : echoedValue(handedOn, dataflow);
|
|
36
|
+
}
|
|
37
|
+
/* a block hands on the value of its last statement, a `( )` group that of what it holds, visibly:
|
|
38
|
+
which is what makes `(x <- 1)` print what it assigned */
|
|
39
|
+
case type_1.RType.ExpressionList:
|
|
40
|
+
return grouped(node) ? lastStatement(node) ?? node
|
|
41
|
+
: echoedValue(lastStatement(node), dataflow) ?? (node.children.length === 0 ? node : undefined);
|
|
42
|
+
case type_1.RType.Pipe:
|
|
43
|
+
return echoedValue(node.rhs, dataflow);
|
|
44
|
+
/* whichever branch runs decides; without an `else` a false condition yields an invisible NULL */
|
|
45
|
+
case type_1.RType.IfThenElse:
|
|
46
|
+
return echoedValue(node.then, dataflow) ?? echoedValue(node.otherwise, dataflow);
|
|
47
|
+
case type_1.RType.BinaryOp:
|
|
48
|
+
return r_binary_op_1.RBinaryOp.getOperatorInfo(node)?.usedAs === 'assignment' ? undefined : node;
|
|
49
|
+
/* a symbol, a constant, an access, a unary operator, or a function definition is printed as it stands */
|
|
50
|
+
default:
|
|
51
|
+
return node;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** whether the list is a `( )` group rather than a `{ }` block, which is what makes its value visible */
|
|
55
|
+
function grouped(node) {
|
|
56
|
+
return node.grouping?.[0].content === '(';
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The call whose result this one hands back unchanged, as its {@link ArgProp.Alias} argument states: a pipe
|
|
60
|
+
* is visible exactly when the call it feeds is. `undefined` when the call answers for itself.
|
|
61
|
+
*/
|
|
62
|
+
function aliased(node, dataflow) {
|
|
63
|
+
const name = callName(node, dataflow);
|
|
64
|
+
const at = name === undefined ? -1 : (0, query_fn_props_1.queryFnProps)(name, { environment: dataflow.environment })?.sig
|
|
65
|
+
?.findIndex(([, p]) => (p & built_in_props_1.ArgProp.Alias) !== 0) ?? -1;
|
|
66
|
+
const arg = at < 0 ? undefined : node.arguments[at];
|
|
67
|
+
const value = typeof arg === 'object' && r_argument_1.RArgument.is(arg) ? arg.value : undefined;
|
|
68
|
+
/* only a call of its own can be invisible where the one around it is not, a symbol says nothing new */
|
|
69
|
+
return r_function_call_1.RFunctionCall.is(value) ? value : undefined;
|
|
70
|
+
}
|
|
71
|
+
/** the last statement of a block, which is what its value comes from */
|
|
72
|
+
function lastStatement(node) {
|
|
73
|
+
for (let i = node.children.length - 1; i >= 0; i--) {
|
|
74
|
+
const child = node.children[i];
|
|
75
|
+
if (!r_comment_1.RComment.is(child) && !r_line_directive_1.RLineDirective.is(child)) {
|
|
76
|
+
return child;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
/** the name the call goes by, with its package when it has one */
|
|
82
|
+
function qualifiedName(node, dataflow) {
|
|
83
|
+
const vertex = dataflow.graph.getVertex(node.info.id);
|
|
84
|
+
return vertex_1.FunctionCallVertex.is(vertex)
|
|
85
|
+
? df_helper_1.Dataflow.qualify(node.info.id, dataflow.graph, false) ?? vertex.name : undefined;
|
|
86
|
+
}
|
|
87
|
+
/** the name of a call that reaches stdout, `undefined` if it returns invisibly, draws, or asserts */
|
|
88
|
+
function callName(node, dataflow) {
|
|
89
|
+
const name = qualifiedName(node, dataflow);
|
|
90
|
+
if (name === undefined) {
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
const props = (0, query_fn_props_1.queryFnProps)(name, { environment: dataflow.environment })?.props ?? 0;
|
|
94
|
+
return (props & (built_in_props_1.CallProp.Invisible | built_in_props_1.CallProp.Graphics)) !== 0 || test_functions_1.ExpectFunctionNames.test(identifier_1.Identifier.getName(name))
|
|
95
|
+
? undefined : name;
|
|
96
|
+
}
|
|
97
|
+
/** what to report the echo under: the called name, or the operator or lexeme producing the value */
|
|
98
|
+
function echoName(node, dataflow) {
|
|
99
|
+
switch (node.type) {
|
|
100
|
+
case type_1.RType.FunctionCall:
|
|
101
|
+
return qualifiedName(node, dataflow) ?? '';
|
|
102
|
+
case type_1.RType.BinaryOp:
|
|
103
|
+
case type_1.RType.UnaryOp:
|
|
104
|
+
case type_1.RType.Access:
|
|
105
|
+
return node.operator;
|
|
106
|
+
case type_1.RType.FunctionDefinition:
|
|
107
|
+
return 'function';
|
|
108
|
+
case type_1.RType.ExpressionList:
|
|
109
|
+
return grouped(node) ? '(' : '{';
|
|
110
|
+
default:
|
|
111
|
+
return model_1.RNode.lexeme(node) ?? '';
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Collects what the top level of the analyzed code prints on its own (as {@link DependencyInfo#implicit}
|
|
116
|
+
* outputs), given that it is echoed at all
|
|
117
|
+
* (`project.assumeImplicitEcho`). A statement is only an output if its value is visible: an assignment, a loop,
|
|
118
|
+
* and every {@link CallProp.Invisible} call hand back their result invisibly, while a bare symbol, a constant,
|
|
119
|
+
* or an ordinary call reaches stdout. Calls another category already reports (a plot, a write, an assertion)
|
|
120
|
+
* are left to it.
|
|
121
|
+
*/
|
|
122
|
+
function collectImplicitEchoes(ast, dataflow, accountedFor, result) {
|
|
123
|
+
for (const file of ast.ast.files) {
|
|
124
|
+
for (const statement of file.root.children) {
|
|
125
|
+
const echoed = echoedValue(statement, dataflow);
|
|
126
|
+
if (echoed === undefined || accountedFor.has(echoed.info.id)) {
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
129
|
+
result.push({ nodeId: echoed.info.id, functionName: echoName(echoed, dataflow), value: 'stdout', implicit: true });
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
//# sourceMappingURL=implicit-echo.js.map
|
|
@@ -312,7 +312,7 @@ exports.GuessDepVersionsQueryDefinition = {
|
|
|
312
312
|
const tightestLe = versionBound(tightestBound(enforced.filter(e => versionBound(e.bound)), '<='))?.ver;
|
|
313
313
|
const active = [], dominated = [];
|
|
314
314
|
const nonSig = [...(0, arrays_1.arraysGroupBy)(dep.evidence.filter(e => e.source !== 'signature' && e.source !== 'available'), e => `${e.source}|${e.bound ?? ''}|${e.partial ? 'p' : ''}`)]
|
|
315
|
-
.map(([, evs]) => ({ ev: evs[0], origins:
|
|
315
|
+
.map(([, evs]) => ({ ev: evs[0], origins: (0, arrays_1.uniqueArray)(evs.map(e => e.origin)) }))
|
|
316
316
|
.sort((x, y) => compareBounds(x.ev, y.ev));
|
|
317
317
|
const bestRankByBound = new Map();
|
|
318
318
|
for (const { ev } of nonSig) {
|
|
@@ -343,7 +343,7 @@ exports.GuessDepVersionsQueryDefinition = {
|
|
|
343
343
|
const sigRecords = [...(0, arrays_1.arraysGroupBy)(dep.evidence.filter(e => e.source === 'signature'), e => e.function ?? e.origin)].map(([fn, evs]) => {
|
|
344
344
|
const ge = tightestBound(evs, '>='), le = tightestBound(evs, '<=');
|
|
345
345
|
const geVer = versionBound(ge)?.ver, leVer = versionBound(le)?.ver;
|
|
346
|
-
const params =
|
|
346
|
+
const params = (0, arrays_1.uniqueArray)(evs.map(e => e.parameter).filter((pm) => pm !== undefined));
|
|
347
347
|
const at = evs.find(e => e.location)?.location;
|
|
348
348
|
const reasons = [evs.some(e => !e.parameter) ? 'new' : undefined, params.length > 0 ? `params: [${truncatedList(params)}]` : undefined,
|
|
349
349
|
at ? `at ${at}` : undefined].filter(Boolean).join(', ');
|
|
@@ -6,7 +6,6 @@ const logic_1 = require("../../../util/logic");
|
|
|
6
6
|
const log_1 = require("../../../util/log");
|
|
7
7
|
const happens_before_1 = require("../../../control-flow/happens-before");
|
|
8
8
|
const parse_1 = require("../../../slicing/criterion/parse");
|
|
9
|
-
const cfg_kind_1 = require("../../../project/cfg-kind");
|
|
10
9
|
/**
|
|
11
10
|
* Execute happens-before queries on the given analyzer.
|
|
12
11
|
* This checks, whether for two given slicing criteria `a` and `b`, `a` happens before `b` in the control flow graph.
|
|
@@ -15,7 +14,7 @@ async function executeHappensBefore({ analyzer }, queries) {
|
|
|
15
14
|
const start = Date.now();
|
|
16
15
|
const results = {};
|
|
17
16
|
const ast = await analyzer.normalize();
|
|
18
|
-
const cfg = await analyzer.controlflow(undefined
|
|
17
|
+
const cfg = await analyzer.controlflow(undefined);
|
|
19
18
|
for (const query of queries) {
|
|
20
19
|
const { a, b } = query;
|
|
21
20
|
const fingerprint = happens_before_query_format_1.HappensBeforeKey.of(a, b);
|
|
@@ -6,7 +6,7 @@ import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id'
|
|
|
6
6
|
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
7
7
|
import type { FlowrConfig } from '../../../config';
|
|
8
8
|
import { criteriaQueryCompleter } from '../../../cli/repl/parser/slice-query-parser';
|
|
9
|
-
import type {
|
|
9
|
+
import type { ExceptionsByFunction } from '../../../dataflow/fn/exceptions-of-function';
|
|
10
10
|
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
|
|
11
11
|
/**
|
|
12
12
|
* Either returns all function definitions alongside exception information,
|
|
@@ -22,7 +22,7 @@ export interface InspectExceptionQueryResult extends BaseQueryResult {
|
|
|
22
22
|
* If a function throws exceptions, the Ids of the throwing functions (at least the functions flowr knows about).
|
|
23
23
|
* An empty array means the function does not throw any exceptions.
|
|
24
24
|
*/
|
|
25
|
-
readonly exceptions:
|
|
25
|
+
readonly exceptions: ExceptionsByFunction;
|
|
26
26
|
}
|
|
27
27
|
declare function inspectExceptionLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-exception'>;
|
|
28
28
|
export declare const InspectExceptionQueryDefinition: {
|
|
@@ -22,6 +22,7 @@ const r_version_1 = require("../../../util/r-version");
|
|
|
22
22
|
const r_base_packages_1 = require("../../../util/r-base-packages");
|
|
23
23
|
const mermaid_1 = require("../../../util/mermaid/mermaid");
|
|
24
24
|
const resolve_helper_1 = require("../../../dataflow/environments/resolve-helper");
|
|
25
|
+
const arrays_1 = require("../../../util/collections/arrays");
|
|
25
26
|
/** the CRAN package landing page (only meaningful for CRAN packages, not base R) */
|
|
26
27
|
function cranPageUrl(pkg) {
|
|
27
28
|
return `https://cran.r-project.org/package=${encodeURIComponent(pkg)}`;
|
|
@@ -565,7 +566,7 @@ function searchSources(sources, allNames, q) {
|
|
|
565
566
|
// every source holding a package (its latest lives in `current`, its older releases in `history`)
|
|
566
567
|
const owningOf = (pkg) => sources.filter(s => s.has(pkg));
|
|
567
568
|
// the versions of `pkg` matching the spec, unioned across all owning sources (so a `3.*`/date filter reaches history)
|
|
568
|
-
const matchingVersions = (owners, pkg, m) =>
|
|
569
|
+
const matchingVersions = (owners, pkg, m) => (0, arrays_1.uniqueArray)(owners.flatMap(s => (0, reader_1.availableVersionEntries)(s, pkg).filter(m).map(e => e.version)));
|
|
569
570
|
const paramPred = parameterFilter(q);
|
|
570
571
|
// a parameter filter (with no function name) still means "search functions", not "list packages"
|
|
571
572
|
if (!q.function && paramPred === undefined) {
|
|
@@ -705,10 +706,10 @@ function signatureQueryCompleter(line, startingNewArg) {
|
|
|
705
706
|
const stride = all.length / MaxCompletions;
|
|
706
707
|
return Array.from({ length: MaxCompletions }, (_, i) => all[Math.floor(i * stride)]);
|
|
707
708
|
};
|
|
708
|
-
const packageNames = () =>
|
|
709
|
+
const packageNames = () => (0, arrays_1.uniqueArray)(sources.flatMap(s => s.packageNames())).sort();
|
|
709
710
|
const functionsOf = (pkg) => {
|
|
710
711
|
const src = sources.find(s => s.has(pkg));
|
|
711
|
-
return src ?
|
|
712
|
+
return src ? (0, arrays_1.uniqueArray)((src.functions(pkg) ?? []).map(f => f.name)).sort() : [];
|
|
712
713
|
};
|
|
713
714
|
// first token: a package spec (`pkg`, `pkg::fn`, `pkg@ver`)
|
|
714
715
|
if (line.length === 0 || (line.length === 1 && !startingNewArg)) {
|
|
@@ -22,7 +22,7 @@ export interface StaticSliceQuery extends BaseQueryFormat, SliceQueryOptions {
|
|
|
22
22
|
export interface StaticSliceQueryResult extends BaseQueryResult {
|
|
23
23
|
/**
|
|
24
24
|
* only contains the results of the slice steps to not repeat ourselves, this does not contain the reconstruction
|
|
25
|
-
* if you set the {@link
|
|
25
|
+
* if you set the {@link SliceQueryOptions#noReconstruction|noReconstruction} flag.
|
|
26
26
|
*
|
|
27
27
|
* The keys are serialized versions of the used queries (i.e., the result of `JSON.stringify`).
|
|
28
28
|
* This implies that multiple slice queries with the same query configuration will _not_ be re-executed.
|
|
@@ -9,6 +9,7 @@ exports.RDelimiter = {
|
|
|
9
9
|
name: 'RDelimiter',
|
|
10
10
|
/**
|
|
11
11
|
* Type guard for {@link RDelimiter} nodes.
|
|
12
|
+
* @lintIgnore node-is node-is-optional
|
|
12
13
|
*/
|
|
13
14
|
is(node) {
|
|
14
15
|
return typeof node === 'object' && node !== null && 'type' in node && node.type === type_1.RType.Delimiter;
|
|
@@ -33,6 +33,7 @@ export declare const RAccess: {
|
|
|
33
33
|
readonly name: "RAccess";
|
|
34
34
|
/**
|
|
35
35
|
* Type guard for {@link RAccess} nodes.
|
|
36
|
+
* @lintIgnore node-is node-is-optional
|
|
36
37
|
*/
|
|
37
38
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RAccess<Info>;
|
|
38
39
|
/**
|
|
@@ -31,6 +31,7 @@ export declare const RArgument: {
|
|
|
31
31
|
/**
|
|
32
32
|
* Type guard for {@link RArgument} nodes.
|
|
33
33
|
* @see {@link RArgument.isUnnamed} - to check whether an argument is unnamed
|
|
34
|
+
* @lintIgnore node-is node-is-optional
|
|
34
35
|
*/
|
|
35
36
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RArgument<Info>;
|
|
36
37
|
/**
|
|
@@ -39,8 +40,10 @@ export declare const RArgument: {
|
|
|
39
40
|
readonly isEmpty: <Info = object>(this: void, node: RNode<Info> | typeof EmptyArgument | undefined) => node is typeof EmptyArgument;
|
|
40
41
|
/**
|
|
41
42
|
* Type guard for arguments that are _not_ empty, i.e. _not_ {@link EmptyArgument}.
|
|
43
|
+
* It only removes the marker, it does not claim the rest is an {@link RArgument}.
|
|
44
|
+
* @see {@link RArgument.is} - to additionally check that the node is an argument
|
|
42
45
|
*/
|
|
43
|
-
readonly isNotEmpty: <
|
|
46
|
+
readonly isNotEmpty: <T>(this: void, node: T) => node is Exclude<T, typeof EmptyArgument>;
|
|
44
47
|
/**
|
|
45
48
|
* Type guard for named arguments, i.e. arguments with a name.
|
|
46
49
|
*/
|
|
@@ -13,6 +13,7 @@ exports.RArgument = {
|
|
|
13
13
|
/**
|
|
14
14
|
* Type guard for {@link RArgument} nodes.
|
|
15
15
|
* @see {@link RArgument.isUnnamed} - to check whether an argument is unnamed
|
|
16
|
+
* @lintIgnore node-is node-is-optional
|
|
16
17
|
*/
|
|
17
18
|
is(node) {
|
|
18
19
|
return node?.type === type_1.RType.Argument;
|
|
@@ -25,9 +26,11 @@ exports.RArgument = {
|
|
|
25
26
|
},
|
|
26
27
|
/**
|
|
27
28
|
* Type guard for arguments that are _not_ empty, i.e. _not_ {@link EmptyArgument}.
|
|
29
|
+
* It only removes the marker, it does not claim the rest is an {@link RArgument}.
|
|
30
|
+
* @see {@link RArgument.is} - to additionally check that the node is an argument
|
|
28
31
|
*/
|
|
29
32
|
isNotEmpty(node) {
|
|
30
|
-
return node !== r_function_call_1.EmptyArgument
|
|
33
|
+
return node !== r_function_call_1.EmptyArgument;
|
|
31
34
|
},
|
|
32
35
|
/**
|
|
33
36
|
* Type guard for named arguments, i.e. arguments with a name.
|
|
@@ -52,7 +55,7 @@ exports.RArgument = {
|
|
|
52
55
|
return undefined;
|
|
53
56
|
}
|
|
54
57
|
for (const arg of args) {
|
|
55
|
-
if (arg
|
|
58
|
+
if (exports.RArgument.isEmpty(arg)) {
|
|
56
59
|
continue;
|
|
57
60
|
}
|
|
58
61
|
if (arg.info.id === id) {
|
|
@@ -18,6 +18,7 @@ export declare const RBinaryOp: {
|
|
|
18
18
|
readonly name: "RBinaryOp";
|
|
19
19
|
/**
|
|
20
20
|
* Type guard for {@link RBinaryOp} nodes.
|
|
21
|
+
* @lintIgnore node-is node-is-optional
|
|
21
22
|
*/
|
|
22
23
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RBinaryOp<Info>;
|
|
23
24
|
/**
|
|
@@ -14,6 +14,7 @@ export declare const RBreak: {
|
|
|
14
14
|
readonly name: "RBreak";
|
|
15
15
|
/**
|
|
16
16
|
* Type guard for {@link RBreak} nodes.
|
|
17
|
+
* @lintIgnore node-is node-is-optional
|
|
17
18
|
*/
|
|
18
19
|
readonly is: <Info = object>(this: void, node: unknown) => node is RBreak<Info>;
|
|
19
20
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
@@ -16,6 +16,7 @@ export declare const RComment: {
|
|
|
16
16
|
readonly name: "RComment";
|
|
17
17
|
/**
|
|
18
18
|
* Type guard for {@link RComment} nodes.
|
|
19
|
+
* @lintIgnore node-is node-is-optional
|
|
19
20
|
*/
|
|
20
21
|
readonly is: <Info = object>(this: void, node: unknown) => node is RComment<Info>;
|
|
21
22
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
@@ -18,6 +18,7 @@ export declare const RExpressionList: {
|
|
|
18
18
|
readonly name: "RExpressionList";
|
|
19
19
|
/**
|
|
20
20
|
* Type guard for {@link RExpressionList} nodes.
|
|
21
|
+
* @lintIgnore node-is node-is-optional
|
|
21
22
|
*/
|
|
22
23
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RExpressionList<Info>;
|
|
23
24
|
/**
|
|
@@ -24,6 +24,7 @@ export declare const RForLoop: {
|
|
|
24
24
|
readonly name: "RForLoop";
|
|
25
25
|
/**
|
|
26
26
|
* Type guard for RForLoop nodes.
|
|
27
|
+
* @lintIgnore node-is node-is-optional
|
|
27
28
|
*/
|
|
28
29
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RForLoop<Info>;
|
|
29
30
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
@@ -37,6 +37,7 @@ export declare const RFunctionCall: {
|
|
|
37
37
|
readonly name: "RFunctionCall";
|
|
38
38
|
/**
|
|
39
39
|
* Type guard for {@link RFunctionCall} nodes.
|
|
40
|
+
* @lintIgnore node-is node-is-optional
|
|
40
41
|
*/
|
|
41
42
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RFunctionCall<Info>;
|
|
42
43
|
/**
|
|
@@ -48,10 +49,11 @@ export declare const RFunctionCall: {
|
|
|
48
49
|
*/
|
|
49
50
|
readonly isUnnamed: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RUnnamedFunctionCall<Info>;
|
|
50
51
|
/**
|
|
51
|
-
* Bind a call's `arguments` to the formal `paramNames
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
52
|
+
* Bind a call's `arguments` to the formal `paramNames`, R's argument matching.
|
|
53
|
+
*
|
|
54
|
+
* Kept here rather than forwarding to {@link MatchArgs.toNames}: this module is loaded before the dataflow
|
|
55
|
+
* layer exists, so importing the wall from here would drag it into the AST model at load time.
|
|
56
|
+
* @useInstead {@link MatchArgs.toNames}
|
|
55
57
|
*/
|
|
56
58
|
readonly matchArgsToParams: <Info = object>(this: void, args: readonly PotentiallyEmptyRArgument<Info>[], paramNames: readonly string[]) => ReadonlyMap<string, RArgument<Info>>;
|
|
57
59
|
/** The one argument a call was given, `undefined` unless there is exactly one and it is not empty. */
|
|
@@ -13,6 +13,7 @@ exports.RFunctionCall = {
|
|
|
13
13
|
name: 'RFunctionCall',
|
|
14
14
|
/**
|
|
15
15
|
* Type guard for {@link RFunctionCall} nodes.
|
|
16
|
+
* @lintIgnore node-is node-is-optional
|
|
16
17
|
*/
|
|
17
18
|
is(node) {
|
|
18
19
|
return node?.type === type_1.RType.FunctionCall;
|
|
@@ -30,10 +31,11 @@ exports.RFunctionCall = {
|
|
|
30
31
|
return exports.RFunctionCall.is(node) && !node.named;
|
|
31
32
|
},
|
|
32
33
|
/**
|
|
33
|
-
* Bind a call's `arguments` to the formal `paramNames
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
34
|
+
* Bind a call's `arguments` to the formal `paramNames`, R's argument matching.
|
|
35
|
+
*
|
|
36
|
+
* Kept here rather than forwarding to {@link MatchArgs.toNames}: this module is loaded before the dataflow
|
|
37
|
+
* layer exists, so importing the wall from here would drag it into the AST model at load time.
|
|
38
|
+
* @useInstead {@link MatchArgs.toNames}
|
|
37
39
|
*/
|
|
38
40
|
matchArgsToParams(args, paramNames) {
|
|
39
41
|
const matched = (0, arg_matching_1.matchArgumentsToParameters)(args.map(a => a === exports.EmptyArgument ? undefined : a.name?.content), paramNames);
|
|
@@ -25,6 +25,7 @@ export declare const RFunctionDefinition: {
|
|
|
25
25
|
readonly name: "RFunctionDefinition";
|
|
26
26
|
/**
|
|
27
27
|
* Type guard for {@link RFunctionDefinition} nodes.
|
|
28
|
+
* @lintIgnore node-is node-is-optional
|
|
28
29
|
*/
|
|
29
30
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RFunctionDefinition<Info>;
|
|
30
31
|
/**
|
|
@@ -20,6 +20,7 @@ export declare const RIfThenElse: {
|
|
|
20
20
|
readonly name: "RIfThenElse";
|
|
21
21
|
/**
|
|
22
22
|
* Type guard for {@link RIfThenElse} nodes.
|
|
23
|
+
* @lintIgnore node-is node-is-optional
|
|
23
24
|
*/
|
|
24
25
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RIfThenElse<Info>;
|
|
25
26
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
@@ -16,6 +16,7 @@ export declare const RLineDirective: {
|
|
|
16
16
|
readonly name: "RLineDirective";
|
|
17
17
|
/**
|
|
18
18
|
* Type guard for {@link RLineDirective} nodes.
|
|
19
|
+
* @lintIgnore node-is node-is-optional
|
|
19
20
|
*/
|
|
20
21
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RLineDirective<Info>;
|
|
21
22
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
@@ -16,6 +16,7 @@ export declare const RLogical: {
|
|
|
16
16
|
readonly name: "RLogical";
|
|
17
17
|
/**
|
|
18
18
|
* Type guard for {@link RLogical} nodes.
|
|
19
|
+
* @lintIgnore node-is node-is-optional
|
|
19
20
|
*/
|
|
20
21
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RLogical<Info>;
|
|
21
22
|
/**
|
|
@@ -14,6 +14,7 @@ export declare const RNext: {
|
|
|
14
14
|
readonly name: "RNext";
|
|
15
15
|
/**
|
|
16
16
|
* Type guard for {@link RNext} nodes.
|
|
17
|
+
* @lintIgnore node-is node-is-optional
|
|
17
18
|
*/
|
|
18
19
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RNext<Info>;
|
|
19
20
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
@@ -18,8 +18,14 @@ export declare const RNumber: {
|
|
|
18
18
|
readonly name: "RNumber";
|
|
19
19
|
/**
|
|
20
20
|
* Type guard for {@link RNumber} nodes.
|
|
21
|
+
* @lintIgnore node-is node-is-optional
|
|
21
22
|
*/
|
|
22
23
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RNumber<Info>;
|
|
24
|
+
/**
|
|
25
|
+
* The value `node` is written as, counting a leading unary minus (`-1`) as part of the literal;
|
|
26
|
+
* `undefined` whenever the value is not spelled out in the source.
|
|
27
|
+
*/
|
|
28
|
+
readonly literalValueOf: <Info = object>(this: void, node: RNode<Info> | undefined) => number | undefined;
|
|
23
29
|
readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
|
|
24
30
|
readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
|
|
25
31
|
readonly stableId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => string | undefined;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.RNumber = void 0;
|
|
4
4
|
const model_1 = require("../model");
|
|
5
5
|
const type_1 = require("../type");
|
|
6
|
+
const r_unary_op_1 = require("./r-unary-op");
|
|
6
7
|
/**
|
|
7
8
|
* Helper for working with {@link RNumber} AST nodes.
|
|
8
9
|
*/
|
|
@@ -11,9 +12,21 @@ exports.RNumber = {
|
|
|
11
12
|
name: 'RNumber',
|
|
12
13
|
/**
|
|
13
14
|
* Type guard for {@link RNumber} nodes.
|
|
15
|
+
* @lintIgnore node-is node-is-optional
|
|
14
16
|
*/
|
|
15
17
|
is(node) {
|
|
16
18
|
return node?.type === type_1.RType.Number;
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* The value `node` is written as, counting a leading unary minus (`-1`) as part of the literal;
|
|
22
|
+
* `undefined` whenever the value is not spelled out in the source.
|
|
23
|
+
*/
|
|
24
|
+
literalValueOf(node) {
|
|
25
|
+
if (exports.RNumber.is(node)) {
|
|
26
|
+
return node.content.num;
|
|
27
|
+
}
|
|
28
|
+
return r_unary_op_1.RUnaryOp.is(node) && node.operator === '-' && exports.RNumber.is(node.operand)
|
|
29
|
+
? -node.operand.content.num : undefined;
|
|
17
30
|
}
|
|
18
31
|
};
|
|
19
32
|
//# sourceMappingURL=r-number.js.map
|
|
@@ -21,6 +21,7 @@ export declare const RParameter: {
|
|
|
21
21
|
/**
|
|
22
22
|
* Type guard for {@link RParameter} nodes.
|
|
23
23
|
* @see {@link RParameter.isDotDotDotDot} - to check whether a parameter is the special `...` parameter
|
|
24
|
+
* @lintIgnore node-is node-is-optional
|
|
24
25
|
*/
|
|
25
26
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RParameter<Info>;
|
|
26
27
|
/**
|