@eagleoutice/flowr 2.14.0 → 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 +169 -91
- 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 +18 -11
- package/benchmark/calibration.js +37 -27
- package/benchmark/slicer.d.ts +9 -2
- package/benchmark/slicer.js +44 -37
- 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/benchmark-app.js +4 -1
- package/cli/benchmark-helper-app.d.ts +1 -0
- package/cli/benchmark-helper-app.js +2 -2
- package/cli/common/options.d.ts +5 -0
- package/cli/common/options.js +1 -0
- package/cli/common/scripts-info.d.ts +5 -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/execute.d.ts +2 -2
- package/cli/repl/execute.js +2 -2
- 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 +12 -9
- 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 +64 -32
- package/dataflow/environments/built-in-props.d.ts +10 -2
- package/dataflow/environments/built-in-props.js +9 -1
- 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 +188 -8
- package/dataflow/environments/default-builtin-config.js +112 -39
- package/dataflow/environments/environment.d.ts +9 -1
- package/dataflow/environments/environment.js +25 -7
- package/dataflow/environments/identifier.d.ts +12 -1
- package/dataflow/environments/identifier.js +4 -1
- package/dataflow/environments/query-fn-props.d.ts +6 -0
- package/dataflow/environments/query-fn-props.js +20 -0
- package/dataflow/environments/resolve-by-name.d.ts +7 -0
- package/dataflow/environments/resolve-by-name.js +26 -2
- 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 +10 -7
- package/dataflow/eval/resolve/resolve-strings.js +2 -2
- package/dataflow/eval/resolve/resolve-working-directory.d.ts +1 -1
- package/dataflow/eval/resolve/resolve-working-directory.js +5 -5
- 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 +6 -2
- package/dataflow/fn/exceptions-of-function.js +85 -38
- package/dataflow/fn/strict-function.d.ts +40 -0
- package/dataflow/fn/strict-function.js +339 -0
- package/dataflow/graph/call-graph.js +2 -2
- package/dataflow/graph/df-helper.d.ts +17 -2
- package/dataflow/graph/df-helper.js +19 -3
- 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 +32 -5
- package/dataflow/graph/graph.js +65 -4
- package/dataflow/graph/match-args.d.ts +69 -0
- package/dataflow/graph/match-args.js +167 -0
- package/dataflow/info.d.ts +40 -0
- package/dataflow/info.js +28 -1
- 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 +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +97 -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 +15 -12
- 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/built-in/transitive-side-effects.js +29 -8
- 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-core.js +1 -1
- package/documentation/wiki-dataflow-graph.js +85 -53
- package/documentation/wiki-linter.js +16 -1
- package/documentation/wiki-linting-and-testing.js +1 -16
- package/documentation/wiki-mk/doc-maker.js +6 -4
- package/documentation/wiki-query.js +67 -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 +47 -11
- package/linter/linter-rules.d.ts +64 -9
- package/linter/linter-rules.js +5 -1
- 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 +3 -3
- package/linter/rules/stop-with-call-arg.js +2 -2
- package/linter/rules/unclosed-connection.d.ts +44 -0
- package/linter/rules/unclosed-connection.js +200 -0
- 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 +5 -8
- 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 +3 -10
- package/project/dependency-version-space.js +10 -9
- package/project/flowr-analyzer.d.ts +4 -6
- package/project/flowr-analyzer.js +4 -5
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +1 -1
- package/project/plugins/file-plugins/files/flowr-description-file.js +1 -1
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +1 -1
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +23 -35
- package/project/plugins/file-plugins/files/flowr-news-file.d.ts +1 -1
- package/project/plugins/file-plugins/files/flowr-news-file.js +1 -1
- 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/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +5 -5
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +33 -6
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +2 -2
- 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 +5 -3
- package/project/sigdb/manifest.js +50 -9
- package/project/sigdb/reader.d.ts +48 -13
- package/project/sigdb/reader.js +3 -2
- package/project/sigdb/schema.d.ts +5 -3
- package/project/sigdb/schema.js +2 -2
- 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/dependencies-query/link-devices.js +2 -8
- 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-executor.js +2 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -0
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +6 -0
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +25 -0
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +31 -0
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +56 -0
- package/queries/catalog/signature-query/signature-query-executor.js +4 -3
- package/queries/catalog/slice-query-options.d.ts +1 -1
- package/queries/catalog/slice-query-options.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/queries/query-function-filter.d.ts +8 -2
- package/queries/query-function-filter.js +11 -1
- package/queries/query.d.ts +11 -1
- package/queries/query.js +2 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/model.js +4 -4
- 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 +4 -15
- 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.d.ts +2 -2
- package/slicing/criterion/parse.js +10 -8
- package/slicing/static/fingerprint.js +1 -1
- 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 +21 -0
- package/util/objects.js +60 -0
- package/util/prefix.d.ts +1 -1
- package/util/simple-df/dfg-ascii.js +14 -3
- package/util/text/name-rank.d.ts +1 -1
- package/util/text/name-rank.js +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,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InspectStrictnessQueryDefinition = void 0;
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
|
+
const joi_1 = __importDefault(require("joi"));
|
|
9
|
+
const inspect_strictness_query_executor_1 = require("./inspect-strictness-query-executor");
|
|
10
|
+
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
11
|
+
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
12
|
+
const range_1 = require("../../../util/range");
|
|
13
|
+
const logic_1 = require("../../../util/logic");
|
|
14
|
+
function inspectStrictLineParser(output, line, _config) {
|
|
15
|
+
const criteria = (0, slice_query_parser_1.sliceCriteriaParser)(line[0]);
|
|
16
|
+
return {
|
|
17
|
+
query: {
|
|
18
|
+
type: 'inspect-strictness',
|
|
19
|
+
filter: criteria
|
|
20
|
+
},
|
|
21
|
+
rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/** How a verdict reads in a sentence, `always`, `never`, or `conditionally` strict. */
|
|
25
|
+
function phrase(value) {
|
|
26
|
+
return value === logic_1.Ternary.Maybe ? 'conditionally' : value;
|
|
27
|
+
}
|
|
28
|
+
exports.InspectStrictnessQueryDefinition = {
|
|
29
|
+
title: 'Inspect Strict Functions Query',
|
|
30
|
+
executor: inspect_strictness_query_executor_1.executeStrictnessQuery,
|
|
31
|
+
asciiSummarizer: async (formatter, processed, queryResults, result) => {
|
|
32
|
+
const out = queryResults;
|
|
33
|
+
result.push(`Query: ${(0, ansi_1.bold)('inspect-strictness', formatter)} (${out['.meta'].timing.toFixed(0)}ms)`);
|
|
34
|
+
const idMap = (await processed.normalize()).idMap;
|
|
35
|
+
for (const [id, info] of Object.entries(out.strictness)) {
|
|
36
|
+
const node = idMap.get(node_id_1.NodeId.normalize(id));
|
|
37
|
+
const loc = node ? range_1.SourceLocation.fromNode(node) : undefined;
|
|
38
|
+
const params = Object.entries(info.parameters)
|
|
39
|
+
.map(([param, value]) => `${idMap.get(node_id_1.NodeId.normalize(param))?.lexeme ?? param}: ${phrase(value)}`)
|
|
40
|
+
.join(', ');
|
|
41
|
+
result.push(` - Function ${(0, ansi_1.bold)(id, formatter)} (${range_1.SourceLocation.format(loc)}) is ${phrase(info.strict)} strict${params.length > 0 ? ` (${params})` : ''}`);
|
|
42
|
+
}
|
|
43
|
+
return true;
|
|
44
|
+
},
|
|
45
|
+
fromLine: inspectStrictLineParser,
|
|
46
|
+
syntax: '@inspect-strictness [(<crit>;...)] <code | file://path>',
|
|
47
|
+
schema: joi_1.default.object({
|
|
48
|
+
type: joi_1.default.string().valid('inspect-strictness').required().description('The type of the query.'),
|
|
49
|
+
filter: joi_1.default.array().items(joi_1.default.string().required()).optional().description('If given, only function definitions that match one of the given slicing criteria are considered. Each criterion can be either `line:column`, `line@variable-name`, or `$id`, where the latter directly specifies the node id of the function definition to be considered.')
|
|
50
|
+
}).description('Either returns all function definitions alongside whether they are strict, or just those matching the filters.'),
|
|
51
|
+
flattenInvolvedNodes: (queryResults) => {
|
|
52
|
+
const out = queryResults;
|
|
53
|
+
return Object.keys(out.strictness).filter(id => out.strictness[id].strict === logic_1.Ternary.Always);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=inspect-strictness-query-format.js.map
|
|
@@ -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)) {
|
|
@@ -55,5 +55,5 @@ export declare const SliceQueryOptionsSchema: {
|
|
|
55
55
|
* as {@link SlicingCriteria.convertAll} keeps them verbatim.
|
|
56
56
|
*/
|
|
57
57
|
export declare function resolveSliceCriteria(criteria: SlicingCriteria, ast: NormalizedAst): NodeId[];
|
|
58
|
-
/** Reconstruct the given `nodes` of `ast`, honoring the inlining, per-file and magic-comment options. */
|
|
58
|
+
/** Reconstruct the given `nodes` of `ast`, honoring the inlining, per-file, and magic-comment options. */
|
|
59
59
|
export declare function reconstructSlice(ast: NormalizedAst, graph: DataflowGraph, nodes: ReadonlySet<NodeId>, options: SliceQueryOptions): ReconstructionResult;
|
|
@@ -39,7 +39,7 @@ function resolveSliceCriteria(criteria, ast) {
|
|
|
39
39
|
}
|
|
40
40
|
return ids;
|
|
41
41
|
}
|
|
42
|
-
/** Reconstruct the given `nodes` of `ast`, honoring the inlining, per-file and magic-comment options. */
|
|
42
|
+
/** Reconstruct the given `nodes` of `ast`, honoring the inlining, per-file, and magic-comment options. */
|
|
43
43
|
function reconstructSlice(ast, graph, nodes, options) {
|
|
44
44
|
const { inlineSources, inlineFull, perFile, noMagicComments } = options;
|
|
45
45
|
const inlining = inlineSources || inlineFull;
|
|
@@ -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.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
2
|
import type { ReadonlyFlowrAnalysisProvider } from '../project/flowr-analyzer';
|
|
3
3
|
import { SlicingCriterion } from '../slicing/criterion/parse';
|
|
4
4
|
/** A query that may restrict the functions it inspects to a set of slicing criteria. */
|
|
@@ -10,12 +10,18 @@ interface FunctionFilteringQuery {
|
|
|
10
10
|
*/
|
|
11
11
|
export declare const QueryFunctionFilter: {
|
|
12
12
|
readonly name: "QueryFunctionFilter";
|
|
13
|
+
/**
|
|
14
|
+
* Whether the definition is one the analyzed code writes. A deferred expression (`on.exit` and its
|
|
15
|
+
* relatives) is wrapped in a definition of its own, which carries an id no node of the ast does, and
|
|
16
|
+
* nobody asks about a function they never wrote.
|
|
17
|
+
*/
|
|
18
|
+
readonly written: (this: void, id: NodeId) => boolean;
|
|
13
19
|
/** The ids the given queries restrict themselves to; empty if at least one query wants all functions. */
|
|
14
20
|
readonly criteria: (this: void, queries: readonly FunctionFilteringQuery[], analyzer: ReadonlyFlowrAnalysisProvider) => Promise<ReadonlySet<NodeId>>;
|
|
15
21
|
/** The call graph together with the functions the given queries want to inspect. */
|
|
16
22
|
readonly inCallGraph: (this: void, queries: readonly FunctionFilteringQuery[], analyzer: ReadonlyFlowrAnalysisProvider, onlyDefinitions?: boolean) => Promise<{
|
|
17
23
|
cg: import("../dataflow/graph/call-graph").CallGraph;
|
|
18
|
-
fns:
|
|
24
|
+
fns: IteratorObject<[NodeId, Required<import("../dataflow/graph/vertex").DataflowGraphVertexFunctionDefinition | import("../dataflow/graph/vertex").DataflowGraphVertexFunctionCall>], undefined, unknown>;
|
|
19
25
|
}>;
|
|
20
26
|
};
|
|
21
27
|
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryFunctionFilter = void 0;
|
|
4
|
+
const node_id_1 = require("../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
4
5
|
const parse_1 = require("../slicing/criterion/parse");
|
|
5
6
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
6
7
|
/**
|
|
@@ -8,6 +9,14 @@ const vertex_1 = require("../dataflow/graph/vertex");
|
|
|
8
9
|
*/
|
|
9
10
|
exports.QueryFunctionFilter = {
|
|
10
11
|
name: 'QueryFunctionFilter',
|
|
12
|
+
/**
|
|
13
|
+
* Whether the definition is one the analyzed code writes. A deferred expression (`on.exit` and its
|
|
14
|
+
* relatives) is wrapped in a definition of its own, which carries an id no node of the ast does, and
|
|
15
|
+
* nobody asks about a function they never wrote.
|
|
16
|
+
*/
|
|
17
|
+
written(id) {
|
|
18
|
+
return typeof node_id_1.NodeId.normalize(id) === 'number';
|
|
19
|
+
},
|
|
11
20
|
/** The ids the given queries restrict themselves to; empty if at least one query wants all functions. */
|
|
12
21
|
async criteria(queries, analyzer) {
|
|
13
22
|
let filters = undefined;
|
|
@@ -38,7 +47,8 @@ exports.QueryFunctionFilter = {
|
|
|
38
47
|
async inCallGraph(queries, analyzer, onlyDefinitions = true) {
|
|
39
48
|
const filterFor = await exports.QueryFunctionFilter.criteria(queries, analyzer);
|
|
40
49
|
const cg = await analyzer.callGraph();
|
|
41
|
-
let fns = (onlyDefinitions || filterFor.size === 0 ? cg.verticesOfType(vertex_1.VertexType.FunctionDefinition) : cg.vertices(true))
|
|
50
|
+
let fns = (onlyDefinitions || filterFor.size === 0 ? cg.verticesOfType(vertex_1.VertexType.FunctionDefinition) : cg.vertices(true))
|
|
51
|
+
.filter(([id]) => exports.QueryFunctionFilter.written(id));
|
|
42
52
|
if (filterFor.size > 0) {
|
|
43
53
|
fns = fns.filter(([id]) => filterFor.has(id));
|
|
44
54
|
}
|
package/queries/query.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ import type { CommandCompletions } from '../cli/repl/core';
|
|
|
31
31
|
import type { FilesQuery } from './catalog/files-query/files-query-format';
|
|
32
32
|
import type { CallGraphQuery } from './catalog/call-graph-query/call-graph-query-format';
|
|
33
33
|
import type { InspectRecursionQuery } from './catalog/inspect-recursion-query/inspect-recursion-query-format';
|
|
34
|
+
import type { InspectStrictnessQuery } from './catalog/inspect-strictness-query/inspect-strictness-query-format';
|
|
34
35
|
import type { DoesCallQuery } from './catalog/does-call-query/does-call-query-format';
|
|
35
36
|
import type { InspectExceptionQuery } from './catalog/inspect-exceptions-query/inspect-exception-query-format';
|
|
36
37
|
import type { InputSourcesQuery } from './catalog/input-sources-query/input-sources-query-format';
|
|
@@ -42,7 +43,7 @@ import { type AbsintQuery } from './catalog/absint-query/absint-query-format';
|
|
|
42
43
|
/**
|
|
43
44
|
* These are all queries that can be executed from within flowR
|
|
44
45
|
*/
|
|
45
|
-
export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | AbsintQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | ResolveValueQuery | ProjectQuery | SignatureQuery | OriginQuery | LinterQuery | ProvenanceQuery | InputSourcesQuery | DiceQuery | GuessDepVersionsQuery;
|
|
46
|
+
export type Query = CallContextQuery | ConfigQuery | SearchQuery | DataflowQuery | DoesCallQuery | CallGraphQuery | ControlFlowQuery | DataflowLensQuery | FilesQuery | AbsintQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery | DependenciesQuery | LocationMapQuery | HappensBeforeQuery | InspectExceptionQuery | InspectHigherOrderQuery | InspectRecursionQuery | InspectStrictnessQuery | ResolveValueQuery | ProjectQuery | SignatureQuery | OriginQuery | LinterQuery | ProvenanceQuery | InputSourcesQuery | DiceQuery | GuessDepVersionsQuery;
|
|
46
47
|
export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
|
|
47
48
|
type: QueryType;
|
|
48
49
|
};
|
|
@@ -266,6 +267,15 @@ export declare const SupportedQueries: {
|
|
|
266
267
|
readonly schema: Joi.ObjectSchema<any>;
|
|
267
268
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
268
269
|
};
|
|
270
|
+
readonly 'inspect-strictness': {
|
|
271
|
+
readonly title: "Inspect Strict Functions Query";
|
|
272
|
+
readonly executor: typeof import("./catalog/inspect-strictness-query/inspect-strictness-query-executor").executeStrictnessQuery;
|
|
273
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, processed: ReadonlyFlowrAnalysisProvider<import("../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
274
|
+
readonly fromLine: (output: ReplOutput, line: readonly string[], _config: FlowrConfig) => ParsedQueryLine<"inspect-strictness">;
|
|
275
|
+
readonly syntax: "@inspect-strictness [(<crit>;...)] <code | file://path>";
|
|
276
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
277
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
278
|
+
};
|
|
269
279
|
readonly 'resolve-value': {
|
|
270
280
|
readonly title: "Resolve Value Query";
|
|
271
281
|
readonly executor: typeof import("./catalog/resolve-value-query/resolve-value-query-executor").executeResolveValueQuery;
|
package/queries/query.js
CHANGED
|
@@ -40,6 +40,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
40
40
|
const files_query_format_1 = require("./catalog/files-query/files-query-format");
|
|
41
41
|
const call_graph_query_format_1 = require("./catalog/call-graph-query/call-graph-query-format");
|
|
42
42
|
const inspect_recursion_query_format_1 = require("./catalog/inspect-recursion-query/inspect-recursion-query-format");
|
|
43
|
+
const inspect_strictness_query_format_1 = require("./catalog/inspect-strictness-query/inspect-strictness-query-format");
|
|
43
44
|
const does_call_query_format_1 = require("./catalog/does-call-query/does-call-query-format");
|
|
44
45
|
const inspect_exception_query_format_1 = require("./catalog/inspect-exceptions-query/inspect-exception-query-format");
|
|
45
46
|
const input_sources_query_format_1 = require("./catalog/input-sources-query/input-sources-query-format");
|
|
@@ -70,6 +71,7 @@ exports.SupportedQueries = {
|
|
|
70
71
|
'inspect-exception': inspect_exception_query_format_1.InspectExceptionQueryDefinition,
|
|
71
72
|
'inspect-higher-order': inspect_higher_order_query_format_1.InspectHigherOrderQueryDefinition,
|
|
72
73
|
'inspect-recursion': inspect_recursion_query_format_1.InspectRecursionQueryDefinition,
|
|
74
|
+
'inspect-strictness': inspect_strictness_query_format_1.InspectStrictnessQueryDefinition,
|
|
73
75
|
'resolve-value': resolve_value_query_format_1.ResolveValueQueryDefinition,
|
|
74
76
|
'project': project_query_format_1.ProjectQueryDefinition,
|
|
75
77
|
'signature': signature_query_format_1.SignatureQueryDefinition,
|
|
@@ -116,7 +116,7 @@ export declare const RConstant: {
|
|
|
116
116
|
*/
|
|
117
117
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RConstant<Info>;
|
|
118
118
|
/**
|
|
119
|
-
* A set of all types of constants in the normalized AST, i.e. number, string and logical constants.
|
|
119
|
+
* A set of all types of constants in the normalized AST, i.e. number, string, and logical constants.
|
|
120
120
|
*/
|
|
121
121
|
readonly constantTypes: ReadonlySet<RType>;
|
|
122
122
|
};
|
|
@@ -126,7 +126,7 @@ export declare const RConstant: {
|
|
|
126
126
|
*/
|
|
127
127
|
export type RSingleNode<Info> = RComment<Info> | RSymbol<Info> | RConstant<Info> | RBreak<Info> | RNext<Info> | RLineDirective<Info>;
|
|
128
128
|
/**
|
|
129
|
-
* Represents a leaf node in the normalized AST, i.e. a node that does not have any children. This includes comment, symbol, constant, break, next and line directive nodes.
|
|
129
|
+
* Represents a leaf node in the normalized AST, i.e. a node that does not have any children. This includes comment, symbol, constant, break, next, and line directive nodes.
|
|
130
130
|
*/
|
|
131
131
|
export declare const RSingleNode: {
|
|
132
132
|
readonly name: "RSingleNode";
|
|
@@ -136,7 +136,7 @@ export declare const RSingleNode: {
|
|
|
136
136
|
*/
|
|
137
137
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RSingleNode<Info>;
|
|
138
138
|
/**
|
|
139
|
-
* A set of all types of single nodes in the normalized AST, i.e. comment, symbol, constant, break, next and line directive nodes.
|
|
139
|
+
* A set of all types of single nodes in the normalized AST, i.e. comment, symbol, constant, break, next, and line directive nodes.
|
|
140
140
|
*/
|
|
141
141
|
readonly singleNodeTypes: ReadonlySet<RType>;
|
|
142
142
|
};
|
|
@@ -186,7 +186,7 @@ export declare const RFunctions: {
|
|
|
186
186
|
*/
|
|
187
187
|
readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RFunctions<Info>;
|
|
188
188
|
/**
|
|
189
|
-
* A set of all types of function-related nodes in the normalized AST, i.e. function definitions, function calls, parameters and arguments.
|
|
189
|
+
* A set of all types of function-related nodes in the normalized AST, i.e. function definitions, function calls, parameters, and arguments.
|
|
190
190
|
*/
|
|
191
191
|
readonly functionTypes: ReadonlySet<RType>;
|
|
192
192
|
};
|
|
@@ -25,12 +25,12 @@ exports.RConstant = {
|
|
|
25
25
|
return t === type_1.RType.Number || t === type_1.RType.String || t === type_1.RType.Logical;
|
|
26
26
|
},
|
|
27
27
|
/**
|
|
28
|
-
* A set of all types of constants in the normalized AST, i.e. number, string and logical constants.
|
|
28
|
+
* A set of all types of constants in the normalized AST, i.e. number, string, and logical constants.
|
|
29
29
|
*/
|
|
30
30
|
constantTypes: new Set([type_1.RType.Number, type_1.RType.String, type_1.RType.Logical])
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* Represents a leaf node in the normalized AST, i.e. a node that does not have any children. This includes comment, symbol, constant, break, next and line directive nodes.
|
|
33
|
+
* Represents a leaf node in the normalized AST, i.e. a node that does not have any children. This includes comment, symbol, constant, break, next, and line directive nodes.
|
|
34
34
|
*/
|
|
35
35
|
exports.RSingleNode = {
|
|
36
36
|
name: 'RSingleNode',
|
|
@@ -46,7 +46,7 @@ exports.RSingleNode = {
|
|
|
46
46
|
return t === type_1.RType.Comment || t === type_1.RType.Symbol || exports.RConstant.constantTypes.has(t) || t === type_1.RType.Break || t === type_1.RType.Next || t === type_1.RType.LineDirective;
|
|
47
47
|
},
|
|
48
48
|
/**
|
|
49
|
-
* A set of all types of single nodes in the normalized AST, i.e. comment, symbol, constant, break, next and line directive nodes.
|
|
49
|
+
* A set of all types of single nodes in the normalized AST, i.e. comment, symbol, constant, break, next, and line directive nodes.
|
|
50
50
|
*/
|
|
51
51
|
singleNodeTypes: new Set([type_1.RType.Comment, type_1.RType.Symbol, type_1.RType.Break, type_1.RType.Next, type_1.RType.LineDirective, ...exports.RConstant.constantTypes])
|
|
52
52
|
};
|
|
@@ -100,7 +100,7 @@ exports.RFunctions = {
|
|
|
100
100
|
return t === type_1.RType.FunctionDefinition || t === type_1.RType.FunctionCall || t === type_1.RType.Parameter || t === type_1.RType.Argument;
|
|
101
101
|
},
|
|
102
102
|
/**
|
|
103
|
-
* A set of all types of function-related nodes in the normalized AST, i.e. function definitions, function calls, parameters and arguments.
|
|
103
|
+
* A set of all types of function-related nodes in the normalized AST, i.e. function definitions, function calls, parameters, and arguments.
|
|
104
104
|
*/
|
|
105
105
|
functionTypes: new Set([type_1.RType.FunctionDefinition, type_1.RType.FunctionCall, type_1.RType.Parameter, type_1.RType.Argument])
|
|
106
106
|
};
|
|
@@ -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;
|