@eagleoutice/flowr 2.14.4 → 2.15.1
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 +77 -64
- package/abstract-interpretation/absint-inference.d.ts +347 -0
- package/abstract-interpretation/{absint-visitor.js → absint-inference.js} +327 -97
- package/abstract-interpretation/abstract-semantics.d.ts +246 -0
- package/abstract-interpretation/abstract-semantics.js +3 -0
- package/abstract-interpretation/data-frame/{mappers/arguments.d.ts → arguments.d.ts} +18 -16
- package/abstract-interpretation/data-frame/{mappers/arguments.js → arguments.js} +20 -21
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +52 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.js +1665 -0
- package/abstract-interpretation/data-frame/resolve-args.js +4 -4
- package/abstract-interpretation/data-frame/semantics.d.ts +15 -21
- package/abstract-interpretation/data-frame/semantics.js +27 -29
- package/abstract-interpretation/data-frame/shape-inference.d.ts +28 -24
- package/abstract-interpretation/data-frame/shape-inference.js +14 -79
- package/abstract-interpretation/domains/interval-domain.d.ts +5 -1
- package/abstract-interpretation/domains/interval-domain.js +25 -33
- package/abstract-interpretation/domains/multi-value-state-domain.d.ts +6 -3
- package/abstract-interpretation/domains/multi-value-state-domain.js +24 -4
- package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -6
- package/abstract-interpretation/domains/partial-product-domain.js +26 -43
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -6
- package/abstract-interpretation/domains/positive-interval-domain.js +3 -29
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.d.ts +6 -0
- package/abstract-interpretation/domains/set-range-domain.js +29 -62
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +9 -2
- package/abstract-interpretation/domains/state-abstract-domain.js +26 -37
- package/abstract-interpretation/domains/{state-domain-like.d.ts → state-domain.d.ts} +10 -6
- package/abstract-interpretation/domains/{state-domain-like.js → state-domain.js} +1 -1
- package/abstract-interpretation/value-semantics.d.ts +113 -0
- package/abstract-interpretation/value-semantics.js +115 -0
- package/benchmark/slicer.js +12 -6
- package/benchmark/stats/feature-counts.d.ts +2 -1
- package/benchmark/stats/feature-counts.js +25 -1
- package/benchmark/stats/stats.d.ts +4 -0
- package/benchmark/summarizer/second-phase/graph.js +7 -0
- package/cli/repl/commands/repl-parse.js +11 -22
- package/cli/repl/parser/slice-query-parser.d.ts +2 -0
- package/cli/repl/parser/slice-query-parser.js +1 -0
- package/config.d.ts +30 -205
- package/config.js +37 -3
- package/control-flow/cfg-properties.d.ts +5 -0
- package/control-flow/cfg-properties.js +25 -7
- package/control-flow/control-flow-graph.d.ts +11 -37
- package/control-flow/control-flow-graph.js +33 -77
- package/control-flow/semantic-cfg-guided-visitor.d.ts +63 -320
- package/control-flow/semantic-cfg-guided-visitor.js +65 -320
- package/dataflow/environments/built-in-config.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +4 -0
- package/dataflow/environments/built-in-props.d.ts +192 -82
- package/dataflow/environments/built-in-props.js +336 -106
- package/dataflow/environments/built-in.d.ts +21 -9
- package/dataflow/environments/built-in.js +43 -12
- package/dataflow/environments/default-builtin-config.d.ts +3219 -313
- package/dataflow/environments/default-builtin-config.js +803 -1012
- package/dataflow/environments/environment.d.ts +26 -49
- package/dataflow/environments/environment.js +34 -47
- package/dataflow/environments/group-generics.d.ts +11 -2
- package/dataflow/environments/group-generics.js +22 -3
- package/dataflow/environments/identifier.d.ts +106 -6
- package/dataflow/environments/identifier.js +19 -1
- package/dataflow/environments/query-fn-props.d.ts +16 -8
- package/dataflow/environments/query-fn-props.js +45 -21
- package/dataflow/environments/resolve-by-name.js +9 -2
- package/dataflow/environments/scoping.d.ts +5 -0
- package/dataflow/environments/scoping.js +11 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
- package/dataflow/eval/resolve/alias-tracking.js +24 -6
- package/dataflow/eval/resolve/resolve-numbers.d.ts +182 -7
- package/dataflow/eval/resolve/resolve-numbers.js +44 -9
- package/dataflow/eval/resolve/resolve-strings.d.ts +79 -2
- package/dataflow/eval/resolve/resolve-strings.js +16 -7
- package/dataflow/eval/resolve/resolve.d.ts +5 -22
- package/dataflow/eval/resolve/resolve.js +34 -34
- package/dataflow/eval/values/general.d.ts +9 -1
- package/dataflow/eval/values/general.js +22 -3
- package/dataflow/eval/values/sets/set-constants.d.ts +5 -0
- package/dataflow/eval/values/sets/set-constants.js +9 -1
- package/dataflow/eval/values/string/string-constants.d.ts +16 -15
- package/dataflow/eval/values/string/string-constants.js +59 -27
- package/dataflow/extractor.d.ts +2 -1
- package/dataflow/extractor.js +16 -4
- package/dataflow/fn/argument-roles.d.ts +35 -0
- package/dataflow/fn/argument-roles.js +252 -0
- package/dataflow/fn/class-declaration.d.ts +148 -0
- package/dataflow/fn/class-declaration.js +317 -0
- package/dataflow/fn/condition-handlers.d.ts +5 -0
- package/dataflow/fn/condition-handlers.js +13 -0
- package/dataflow/fn/exceptions-of-function.d.ts +21 -7
- package/dataflow/fn/exceptions-of-function.js +74 -43
- package/dataflow/fn/frame-reflection.d.ts +46 -0
- package/dataflow/fn/frame-reflection.js +169 -0
- package/dataflow/fn/function-props.d.ts +32 -0
- package/dataflow/fn/function-props.js +160 -0
- package/dataflow/fn/higher-order-function.d.ts +23 -5
- package/dataflow/fn/higher-order-function.js +64 -18
- package/dataflow/fn/strict-function.d.ts +24 -2
- package/dataflow/fn/strict-function.js +49 -19
- package/dataflow/graph/call-graph.js +10 -2
- package/dataflow/graph/df-helper.d.ts +1 -12
- package/dataflow/graph/df-helper.js +2 -19
- package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
- package/dataflow/graph/diff-dataflow-graph.js +2 -2
- package/dataflow/graph/graph.d.ts +39 -188
- package/dataflow/graph/graph.js +46 -163
- package/dataflow/graph/match-args.d.ts +34 -2
- package/dataflow/graph/match-args.js +45 -12
- package/dataflow/graph/vertex.d.ts +8 -0
- package/dataflow/info.d.ts +7 -5
- package/dataflow/info.js +1 -5
- package/dataflow/internal/control-flow.js +20 -17
- package/dataflow/internal/linker.d.ts +8 -37
- package/dataflow/internal/linker.js +22 -55
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +8 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +43 -50
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +23 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.js +24 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +0 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +73 -27
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +131 -92
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +17 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +187 -99
- package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +0 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +31 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +101 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +23 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +22 -1
- package/dataflow/internal/process/functions/call/common.d.ts +4 -6
- package/dataflow/internal/process/functions/call/common.js +2 -2
- package/dataflow/internal/process/functions/call/deferred.d.ts +1 -1
- package/dataflow/internal/process/functions/call/deferred.js +2 -2
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +5 -3
- package/dataflow/internal/process/functions/call/known-call-handling.js +6 -4
- package/dataflow/internal/process/functions/call/named-call-handling.js +19 -13
- package/dataflow/internal/process/functions/call/quoted.d.ts +2 -2
- package/dataflow/internal/process/functions/call/quoted.js +144 -28
- package/dataflow/origin/dfg-get-origin.js +23 -10
- package/dataflow/processor.d.ts +2 -1
- package/dataflow/processor.js +6 -0
- package/documentation/data/interface/doc-writing-code.js +2 -0
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/wiki-absint.d.ts +11 -14
- package/documentation/wiki-absint.js +73 -59
- package/documentation/wiki-core.js +64 -24
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-query.js +82 -264
- package/documentation/wiki-signature-database.js +17 -5
- package/gas.d.ts +91 -47
- package/gas.js +97 -13
- package/index.d.ts +31 -0
- package/index.js +52 -0
- package/linter/linter-rules.d.ts +87 -23
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +10 -8
- package/linter/rules/dead-code.d.ts +1 -1
- package/linter/rules/deprecated-functions.js +14 -5
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +13 -2
- package/linter/rules/network-functions.d.ts +10 -5
- package/linter/rules/network-functions.js +48 -36
- package/linter/rules/no-leaked-credentials.d.ts +1 -1
- package/linter/rules/problematic-inputs.d.ts +1 -1
- package/linter/rules/problematic-inputs.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +3 -2
- package/linter/rules/seeded-randomness.js +7 -3
- package/linter/rules/software-has-license.d.ts +1 -1
- package/linter/rules/software-has-tests.d.ts +1 -1
- package/linter/rules/stop-with-call-arg.d.ts +1 -1
- package/linter/rules/syntactically-valid.d.ts +1 -1
- package/linter/rules/unclosed-connection.d.ts +3 -3
- package/linter/rules/unclosed-connection.js +3 -4
- package/linter/rules/undefined-symbol.d.ts +1 -1
- package/linter/rules/unescaped-arguments.d.ts +161 -0
- package/linter/rules/unescaped-arguments.js +293 -0
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/unused-definition.js +49 -4
- package/linter/rules/unused-import.d.ts +1 -1
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +3 -198
- package/project/context/flowr-analyzer-environment-context.d.ts +12 -1
- package/project/context/flowr-analyzer-environment-context.js +33 -1
- package/project/context/flowr-analyzer-files-context.d.ts +24 -1
- package/project/context/flowr-analyzer-files-context.js +42 -21
- package/project/context/flowr-analyzer-functions-context.d.ts +8 -0
- package/project/context/flowr-analyzer-functions-context.js +2 -0
- package/project/context/flowr-analyzer-gas-context.d.ts +9 -1
- package/project/context/flowr-analyzer-gas-context.js +21 -0
- package/project/context/flowr-file.d.ts +16 -1
- package/project/context/flowr-file.js +26 -2
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +19 -20
- package/project/plugins/file-plugins/files/flowr-description-file.js +55 -41
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +9 -4
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +11 -3
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +6 -9
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +5 -21
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +11 -12
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +48 -61
- package/project/plugins/file-plugins/files/flowr-news-file.d.ts +3 -12
- package/project/plugins/file-plugins/files/flowr-news-file.js +2 -19
- package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +145 -0
- package/project/plugins/file-plugins/files/flowr-rd-file.js +676 -0
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +122 -422
- package/project/plugins/file-plugins/files/flowr-rda-file.js +517 -1005
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +8 -2
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +10 -1
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +7 -2
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +9 -1
- package/project/plugins/file-plugins/files/flowr-sysdata-file.d.ts +17 -0
- package/project/plugins/file-plugins/files/flowr-sysdata-file.js +40 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +3 -1
- package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.d.ts +58 -0
- package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.js +95 -0
- package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.d.ts +23 -0
- package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +33 -72
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +17 -15
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +20 -37
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +29 -53
- package/project/plugins/package-version-plugins/package.js +2 -1
- package/project/plugins/plugin-registry.d.ts +3 -1
- package/project/plugins/plugin-registry.js +11 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +20 -4
- package/project/sigdb/build.d.ts +9 -15
- package/project/sigdb/build.js +101 -42
- package/project/sigdb/decode.d.ts +10 -4
- package/project/sigdb/decode.js +60 -21
- package/project/sigdb/memory-source.d.ts +4 -0
- package/project/sigdb/memory-source.js +8 -0
- package/project/sigdb/reader.d.ts +57 -100
- package/project/sigdb/reader.js +157 -108
- package/project/sigdb/schema.d.ts +90 -26
- package/project/sigdb/schema.js +12 -6
- package/queries/base-query-format.d.ts +7 -0
- package/queries/base-query-format.js +29 -0
- package/queries/catalog/absint-query/absint-query-executor.js +8 -6
- package/queries/catalog/absint-query/absint-query-format.d.ts +20 -9
- package/queries/catalog/absint-query/absint-query-format.js +32 -19
- package/queries/catalog/call-context-query/call-context-query-executor.js +3 -3
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +33 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +2 -2
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +14 -4
- package/queries/catalog/dependencies-query/function-info/read-functions.js +7 -121
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +4 -46
- package/queries/catalog/dependencies-query/function-info/write-functions.js +3 -76
- package/queries/catalog/dependencies-query/implicit-echo.js +2 -2
- package/queries/catalog/dependencies-query/link-devices.d.ts +2 -2
- package/queries/catalog/dependencies-query/link-devices.js +6 -7
- package/queries/catalog/dice-query/dice-query-executor.js +1 -1
- package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
- package/queries/catalog/does-call-query/does-call-query-executor.js +4 -0
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -1
- package/queries/catalog/files-query/files-query-format.d.ts +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-source-functions.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -17
- package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -27
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +3 -8
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -11
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +4 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +60 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +35 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +63 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -6
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +3 -8
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -11
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +3 -8
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -12
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +3 -8
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -14
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -10
- package/queries/catalog/signature-query/signature-query-executor.js +87 -93
- package/queries/catalog/signature-query/signature-query-format.d.ts +20 -5
- package/queries/catalog/signature-query/signature-query-format.js +16 -4
- package/queries/catalog/signature-query/signature-query-render.js +18 -4
- package/queries/catalog/slice-query-options.d.ts +14 -0
- package/queries/catalog/slice-query-options.js +15 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.js +7 -5
- package/queries/query-function-filter.d.ts +8 -3
- package/queries/query-function-filter.js +16 -6
- package/queries/query.d.ts +38 -38
- package/queries/query.js +30 -4
- package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/model.js +14 -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-argument.d.ts +1 -0
- 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-break.d.ts +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-expression-list.d.ts +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-function-call.d.ts +1 -0
- 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-if-then-else.d.ts +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-logical.d.ts +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-number.d.ts +1 -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-pipe.d.ts +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-string.d.ts +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-unary-op.d.ts +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/processing/node-id.d.ts +17 -9
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +35 -27
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -22
- package/reconstruct/reconstruct.d.ts +9 -20
- package/reconstruct/reconstruct.js +66 -28
- package/search/flowr-search-filters.d.ts +7 -6
- package/search/flowr-search-filters.js +6 -4
- package/search/search-executor/search-enrichers.d.ts +10 -10
- package/search/search-executor/search-enrichers.js +32 -3
- package/search/search-executor/search-transformer.js +15 -23
- package/slicing/criterion/parse.js +2 -12
- package/slicing/static/slice-call.js +1 -8
- package/slicing/static/static-slicer.js +1 -1
- package/util/collections/bimap.js +14 -6
- package/util/objects.js +16 -17
- package/util/r-value.d.ts +5 -4
- package/util/record.d.ts +38 -3
- package/util/record.js +48 -1
- package/util/simple-df/dfg-ascii.js +1 -1
- package/util/text/strings.d.ts +5 -0
- package/util/text/strings.js +10 -0
- package/util/version.js +2 -2
- package/abstract-interpretation/absint-visitor.d.ts +0 -223
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -19
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -151
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +0 -287
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +0 -1096
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -15
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -207
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +0 -6
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +0 -25
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +0 -31
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +0 -56
|
@@ -28,7 +28,7 @@ export declare const HappensBeforeKey: {
|
|
|
28
28
|
export declare const HappensBeforeQueryDefinition: {
|
|
29
29
|
readonly title: "Happens-Before Query";
|
|
30
30
|
readonly executor: typeof executeHappensBefore;
|
|
31
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("
|
|
31
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
32
32
|
readonly schema: Joi.ObjectSchema<any>;
|
|
33
33
|
readonly flattenInvolvedNodes: () => never[];
|
|
34
34
|
};
|
|
@@ -11,7 +11,7 @@ export interface IdMapQueryResult extends BaseQueryResult {
|
|
|
11
11
|
export declare const IdMapQueryDefinition: {
|
|
12
12
|
readonly title: "Id-Map Query";
|
|
13
13
|
readonly executor: typeof executeIdMapQuery;
|
|
14
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("
|
|
14
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
15
15
|
readonly schema: Joi.ObjectSchema<any>;
|
|
16
16
|
readonly flattenInvolvedNodes: () => never[];
|
|
17
17
|
};
|
|
@@ -8,7 +8,7 @@ import { BuiltInIndex } from '../../../dataflow/environments/query-fn-props';
|
|
|
8
8
|
*/
|
|
9
9
|
export declare const LinkedInputObjects: readonly LinkedInputObject[];
|
|
10
10
|
/**
|
|
11
|
-
* The functions whose result is bounded no matter what flows in, read back from the {@link
|
|
11
|
+
* The functions whose result is bounded no matter what flows in, read back from the {@link SemanticCallTag.Narrows}
|
|
12
12
|
* built-ins: with an {@link ArgProp.Bounds} parameter the result is one of that argument's values (`match.arg`
|
|
13
13
|
* and its `choices`), without one it is a count, an index, or a logical of the call's own making. Label a
|
|
14
14
|
* built-in `Narrows` (in the {@link DefaultBuiltinConfig} or your own definitions) and it shows up here.
|
|
@@ -29,14 +29,14 @@ exports.LinkedInputObjects = [
|
|
|
29
29
|
{ name: 'session', type: simple_input_classifier_1.InputType.User, withParams: ['input', 'output'], requires: 'shiny', fields: ['clientData', 'request'] }
|
|
30
30
|
];
|
|
31
31
|
/**
|
|
32
|
-
* The functions whose result is bounded no matter what flows in, read back from the {@link
|
|
32
|
+
* The functions whose result is bounded no matter what flows in, read back from the {@link SemanticCallTag.Narrows}
|
|
33
33
|
* built-ins: with an {@link ArgProp.Bounds} parameter the result is one of that argument's values (`match.arg`
|
|
34
34
|
* and its `choices`), without one it is a count, an index, or a logical of the call's own making. Label a
|
|
35
35
|
* built-in `Narrows` (in the {@link DefaultBuiltinConfig} or your own definitions) and it shows up here.
|
|
36
36
|
*/
|
|
37
37
|
function narrowingFunctions(index = query_fn_props_1.BuiltInIndex.default()) {
|
|
38
38
|
const bounds = new Map(index.params(built_in_props_1.ArgProp.Bounds).map(p => [identifier_1.Identifier.getName(p.call), p]));
|
|
39
|
-
return index.with(built_in_props_1.
|
|
39
|
+
return index.with(built_in_props_1.SemanticCallTag.Narrows).map(call => {
|
|
40
40
|
const bound = bounds.get(identifier_1.Identifier.getName(call));
|
|
41
41
|
return bound === undefined ? { call } : { call, argName: bound.name, argIdx: bound.index };
|
|
42
42
|
});
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BaseQueryFormat, type BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
|
|
3
|
-
import type { ParsedQueryLine } from '../../query';
|
|
4
3
|
import Joi from 'joi';
|
|
5
4
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
5
|
import { type InputClassifierConfig, type InputSources } from './simple-input-classifier';
|
|
7
|
-
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
-
import type { FlowrConfig } from '../../../config';
|
|
9
6
|
import { criteriaQueryCompleter } from '../../../cli/repl/parser/slice-query-parser';
|
|
10
7
|
import { executeInputSourcesQuery } from './input-sources-query-executor';
|
|
11
8
|
export type InputSourcesQueryConfig = InputClassifierConfig;
|
|
@@ -16,35 +13,28 @@ export type InputSourcesQueryConfig = InputClassifierConfig;
|
|
|
16
13
|
export interface InputSourcesQuery extends BaseQueryFormat {
|
|
17
14
|
readonly type: 'input-sources';
|
|
18
15
|
/**
|
|
19
|
-
* One or more slicing criteria to analyze
|
|
20
|
-
*
|
|
21
|
-
* into a single round-trip.
|
|
22
|
-
* {@link SlicingCriterion.fromId}
|
|
16
|
+
* One or more slicing criteria to analyze, each resolved independently and keyed by its criterion string in the result map;
|
|
17
|
+
* an array batches multiple lookups into a single round-trip. {@link SlicingCriterion.fromId}
|
|
23
18
|
*/
|
|
24
19
|
readonly criterion: SlicingCriterion | readonly SlicingCriterion[];
|
|
25
20
|
readonly config?: InputSourcesQueryConfig;
|
|
26
21
|
}
|
|
27
22
|
/**
|
|
28
|
-
* Which functions belong to which input type is stated with the functions themselves, in the
|
|
29
|
-
* {@link
|
|
30
|
-
* {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a
|
|
31
|
-
* {@link CallProp.Narrows} one bounds its result no matter what flows in.
|
|
32
|
-
* Add a function there (or override its props with your own built-in definitions) and it shows up here.
|
|
23
|
+
* Which functions belong to which input type is stated with the functions themselves, in the {@link DefaultBuiltinConfig|built-in configuration}:
|
|
24
|
+
* a function that states its props and carries none of the {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a {@link SemanticCallTag.Narrows} one bounds its result no matter what flows in. Add a function there (or override its props with your own built-in definitions) and it shows up here.
|
|
33
25
|
*/
|
|
34
26
|
export declare const DefaultInputClassifierConfig: InputClassifierConfig;
|
|
35
27
|
export interface InputSourcesQueryResult extends BaseQueryResult {
|
|
36
28
|
/** For each query key, a list of classified input sources (each with id and all traces) */
|
|
37
29
|
results: Record<string, InputSources>;
|
|
38
30
|
}
|
|
39
|
-
declare function inputSourcesQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'input-sources'>;
|
|
40
31
|
export declare const InputSourcesDefinition: {
|
|
41
32
|
readonly title: "Input Sources Query";
|
|
42
33
|
readonly executor: typeof executeInputSourcesQuery;
|
|
43
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("
|
|
44
|
-
readonly fromLine:
|
|
34
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, analyzer: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
35
|
+
readonly fromLine: (output: import("../../../cli/repl/commands/repl-main").ReplOutput, line: readonly string[], _config: import("../../..").FlowrConfig) => import("../../query").ParsedQueryLine<"input-sources">;
|
|
45
36
|
readonly completer: typeof criteriaQueryCompleter;
|
|
46
37
|
readonly syntax: "@input-sources (<criterion>) <code | file://path>";
|
|
47
38
|
readonly schema: Joi.ObjectSchema<any>;
|
|
48
39
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
49
40
|
};
|
|
50
|
-
export {};
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.InputSourcesDefinition = exports.DefaultInputClassifierConfig = void 0;
|
|
7
|
+
const base_query_format_1 = require("../../base-query-format");
|
|
7
8
|
const ansi_1 = require("../../../util/text/ansi");
|
|
8
9
|
const time_1 = require("../../../util/text/time");
|
|
9
10
|
const joi_1 = __importDefault(require("joi"));
|
|
@@ -20,47 +21,30 @@ const built_in_props_1 = require("../../../dataflow/environments/built-in-props"
|
|
|
20
21
|
const query_fn_props_1 = require("../../../dataflow/environments/query-fn-props");
|
|
21
22
|
const builtIns = query_fn_props_1.BuiltInIndex.default();
|
|
22
23
|
/**
|
|
23
|
-
* Which functions belong to which input type is stated with the functions themselves, in the
|
|
24
|
-
* {@link
|
|
25
|
-
* {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a
|
|
26
|
-
* {@link CallProp.Narrows} one bounds its result no matter what flows in.
|
|
27
|
-
* Add a function there (or override its props with your own built-in definitions) and it shows up here.
|
|
24
|
+
* Which functions belong to which input type is stated with the functions themselves, in the {@link DefaultBuiltinConfig|built-in configuration}:
|
|
25
|
+
* a function that states its props and carries none of the {@link InputProps} derives its result from its arguments, the others bring in data of their own, and a {@link SemanticCallTag.Narrows} one bounds its result no matter what flows in. Add a function there (or override its props with your own built-in definitions) and it shows up here.
|
|
28
26
|
*/
|
|
29
27
|
exports.DefaultInputClassifierConfig = {
|
|
30
28
|
/*
|
|
31
|
-
* every {@link CallProp.Pure} built-in is in here (a test checks it), but the label alone is too narrow:
|
|
32
|
-
*
|
|
33
|
-
* all. `x <- z <- 'x'` has to stay constant across the assignments, and `print(x)` hands `x` back, yet
|
|
34
|
-
* neither is `Pure` (they rebind a name, they write to the console). So the set is every built-in that
|
|
35
|
-
* states its props and claims none of the {@link InputProps}.
|
|
29
|
+
* every {@link CallProp.Pure} built-in is in here (a test checks it), but the label alone is too narrow: what matters for provenance is that the call invents no data of its own, not that it has no effect at all -- `x <- z <- 'x'` stays constant across the assignments, and `print(x)` hands `x` back, yet neither is `Pure` (they rebind a name, write to the console).
|
|
30
|
+
* So the set is every built-in that states its props and claims none of the {@link InputProps}.
|
|
36
31
|
*/
|
|
37
32
|
[simple_input_classifier_1.InputTraceType.Pure]: builtIns.without(built_in_props_1.InputProps),
|
|
38
33
|
[simple_input_classifier_1.InputType.File]: [...read_functions_1.ReadFunctions.map(readFunction => readFunction.name), ...builtIns.withAll(built_in_props_1.FileInputProps)],
|
|
39
|
-
[simple_input_classifier_1.InputType.TempFile]: builtIns.with(built_in_props_1.
|
|
40
|
-
[simple_input_classifier_1.InputType.Glob]: builtIns.with(built_in_props_1.
|
|
34
|
+
[simple_input_classifier_1.InputType.TempFile]: builtIns.with(built_in_props_1.SemanticCallTag.TempFile),
|
|
35
|
+
[simple_input_classifier_1.InputType.Glob]: builtIns.with(built_in_props_1.SemanticCallTag.Glob),
|
|
41
36
|
[simple_input_classifier_1.InputType.Network]: flowr_search_builder_1.Q.fromQuery({ type: 'linter', rules: ['network-functions'] }, linter_format_1.LintingResultCertainty.Certain),
|
|
42
37
|
[simple_input_classifier_1.InputType.Random]: flowr_search_builder_1.Q.fromQuery({ type: 'linter', rules: ['seeded-randomness'] }),
|
|
43
|
-
[simple_input_classifier_1.InputType.System]: builtIns.with(built_in_props_1.
|
|
38
|
+
[simple_input_classifier_1.InputType.System]: builtIns.with(built_in_props_1.SemanticCallTag.Process),
|
|
44
39
|
[simple_input_classifier_1.InputType.Ffi]: builtIns.with(built_in_props_1.CallProp.Ffi),
|
|
45
40
|
[simple_input_classifier_1.InputType.Lang]: builtIns.with(built_in_props_1.CallProp.Lang),
|
|
46
41
|
[simple_input_classifier_1.InputType.Options]: builtIns.with(built_in_props_1.CallProp.Ambient),
|
|
47
|
-
[simple_input_classifier_1.InputType.CommandLine]: builtIns.with(built_in_props_1.
|
|
48
|
-
[simple_input_classifier_1.InputType.User]: builtIns.with(built_in_props_1.
|
|
42
|
+
[simple_input_classifier_1.InputType.CommandLine]: builtIns.with(built_in_props_1.SemanticCallTag.CommandLine),
|
|
43
|
+
[simple_input_classifier_1.InputType.User]: builtIns.with(built_in_props_1.SemanticCallTag.User),
|
|
49
44
|
linkedObjects: input_source_functions_1.LinkedInputObjects,
|
|
50
45
|
linkedEntryPoints: input_source_functions_1.LinkedInputEntryPoints,
|
|
51
46
|
narrowing: (0, input_source_functions_1.narrowingFunctions)(builtIns)
|
|
52
47
|
};
|
|
53
|
-
function inputSourcesQueryLineParser(output, line, _config) {
|
|
54
|
-
const criterion = (0, slice_query_parser_1.sliceCriteriaParser)(line[0]);
|
|
55
|
-
if (!criterion || criterion.length !== 1) {
|
|
56
|
-
output.stderr(output.formatter.format('Invalid input sources query format, a single slicing criterion must be given in the form "(criterion1)"', { color: 1 /* Colors.Red */, effect: ansi_1.ColorEffect.Foreground, style: 1 /* FontStyles.Bold */ }));
|
|
57
|
-
return { query: [] };
|
|
58
|
-
}
|
|
59
|
-
return { query: [{
|
|
60
|
-
type: 'input-sources',
|
|
61
|
-
criterion: criterion[0],
|
|
62
|
-
}], rCode: (0, slice_query_parser_1.queryLineCode)(line) };
|
|
63
|
-
}
|
|
64
48
|
exports.InputSourcesDefinition = {
|
|
65
49
|
title: 'Input Sources Query',
|
|
66
50
|
executor: input_sources_query_executor_1.executeInputSourcesQuery,
|
|
@@ -84,7 +68,7 @@ exports.InputSourcesDefinition = {
|
|
|
84
68
|
}
|
|
85
69
|
return true;
|
|
86
70
|
},
|
|
87
|
-
fromLine:
|
|
71
|
+
fromLine: (0, base_query_format_1.singleCriterionLineParser)('input-sources', 'input sources'),
|
|
88
72
|
completer: slice_query_parser_1.criteriaQueryCompleter,
|
|
89
73
|
syntax: '@input-sources (<criterion>) <code | file://path>',
|
|
90
74
|
schema: joi_1.default.object({
|
|
@@ -14,7 +14,7 @@ async function executeExceptionQuery({ analyzer }, queries) {
|
|
|
14
14
|
if (result[id]) {
|
|
15
15
|
continue;
|
|
16
16
|
}
|
|
17
|
-
const res =
|
|
17
|
+
const res = exceptions_of_function_1.FunctionExceptions.of(id, cg, { knownThrower: result });
|
|
18
18
|
for (const [k, v] of Object.entries(res)) {
|
|
19
19
|
if (!result[k]) {
|
|
20
20
|
result[k] = v;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BaseQueryFormat, type BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import Joi from 'joi';
|
|
3
|
-
import type { ParsedQueryLine } from '../../query';
|
|
4
3
|
import { executeExceptionQuery } from './inspect-exception-query-executor';
|
|
5
4
|
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
|
-
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
7
|
-
import type { FlowrConfig } from '../../../config';
|
|
8
5
|
import { criteriaQueryCompleter } from '../../../cli/repl/parser/slice-query-parser';
|
|
9
6
|
import type { ExceptionsByFunction } from '../../../dataflow/fn/exceptions-of-function';
|
|
10
7
|
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
|
|
@@ -24,15 +21,13 @@ export interface InspectExceptionQueryResult extends BaseQueryResult {
|
|
|
24
21
|
*/
|
|
25
22
|
readonly exceptions: ExceptionsByFunction;
|
|
26
23
|
}
|
|
27
|
-
declare function inspectExceptionLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-exception'>;
|
|
28
24
|
export declare const InspectExceptionQueryDefinition: {
|
|
29
25
|
readonly title: "Inspect Exceptions of Functions Query";
|
|
30
26
|
readonly executor: typeof executeExceptionQuery;
|
|
31
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("
|
|
32
|
-
readonly fromLine:
|
|
27
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
28
|
+
readonly fromLine: (_output: import("../../../cli/repl/commands/repl-main").ReplOutput, line: readonly string[], _config: import("../../..").FlowrConfig) => import("../../query").ParsedQueryLine<"inspect-exception">;
|
|
33
29
|
readonly completer: typeof criteriaQueryCompleter;
|
|
34
30
|
readonly syntax: "@inspect-exception [(<crit>;...)] <code | file://path>";
|
|
35
31
|
readonly schema: Joi.ObjectSchema<any>;
|
|
36
32
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
37
33
|
};
|
|
38
|
-
export {};
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.InspectExceptionQueryDefinition = void 0;
|
|
7
|
+
const base_query_format_1 = require("../../base-query-format");
|
|
7
8
|
const ansi_1 = require("../../../util/text/ansi");
|
|
8
9
|
const joi_1 = __importDefault(require("joi"));
|
|
9
10
|
const inspect_exception_query_executor_1 = require("./inspect-exception-query-executor");
|
|
@@ -11,16 +12,6 @@ const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-
|
|
|
11
12
|
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
12
13
|
const range_1 = require("../../../util/range");
|
|
13
14
|
const info_1 = require("../../../dataflow/info");
|
|
14
|
-
function inspectExceptionLineParser(_output, line, _config) {
|
|
15
|
-
const criteria = (0, slice_query_parser_1.sliceCriteriaParser)(line[0]);
|
|
16
|
-
return {
|
|
17
|
-
query: {
|
|
18
|
-
type: 'inspect-exception',
|
|
19
|
-
filter: criteria
|
|
20
|
-
},
|
|
21
|
-
rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
15
|
exports.InspectExceptionQueryDefinition = {
|
|
25
16
|
title: 'Inspect Exceptions of Functions Query',
|
|
26
17
|
executor: inspect_exception_query_executor_1.executeExceptionQuery,
|
|
@@ -43,7 +34,7 @@ exports.InspectExceptionQueryDefinition = {
|
|
|
43
34
|
}
|
|
44
35
|
return true;
|
|
45
36
|
},
|
|
46
|
-
fromLine:
|
|
37
|
+
fromLine: (0, base_query_format_1.filterLineParser)('inspect-exception'),
|
|
47
38
|
completer: slice_query_parser_1.criteriaQueryCompleter,
|
|
48
39
|
syntax: '@inspect-exception [(<crit>;...)] <code | file://path>',
|
|
49
40
|
schema: joi_1.default.object({
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { InspectFnPropsQuery, InspectFnPropsQueryResult } from './inspect-fn-props-query-format';
|
|
2
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
+
/** Execute function-property inspection queries on the given analyzer. */
|
|
4
|
+
export declare function executeFnPropsQuery({ analyzer }: BasicQueryData, queries: readonly InspectFnPropsQuery[]): Promise<InspectFnPropsQueryResult>;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeFnPropsQuery = executeFnPropsQuery;
|
|
4
|
+
const built_in_props_1 = require("../../../dataflow/environments/built-in-props");
|
|
5
|
+
const function_props_1 = require("../../../dataflow/fn/function-props");
|
|
6
|
+
const query_function_filter_1 = require("../../query-function-filter");
|
|
7
|
+
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
8
|
+
/** every bit, for a query naming no properties to keep */
|
|
9
|
+
const AllProps = ~0;
|
|
10
|
+
/** The formals a query asks about, dropping the ones it does not name and the bits it does not want. */
|
|
11
|
+
function keepRoles(all, graph, formals, mask) {
|
|
12
|
+
if (formals === undefined && mask === AllProps) {
|
|
13
|
+
return all;
|
|
14
|
+
}
|
|
15
|
+
const kept = {};
|
|
16
|
+
for (const [id, roles] of Object.entries(all)) {
|
|
17
|
+
const some = {};
|
|
18
|
+
for (const [formal, props] of Object.entries(roles)) {
|
|
19
|
+
const named = graph.idMap?.get(node_id_1.NodeId.normalize(formal))?.lexeme;
|
|
20
|
+
if ((formals === undefined || (named !== undefined && formals.has(named))) && (props & mask) !== 0) {
|
|
21
|
+
some[formal] = props & mask;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (Object.keys(some).length > 0) {
|
|
25
|
+
kept[id] = some;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return kept;
|
|
29
|
+
}
|
|
30
|
+
/** The function properties a query asks about, dropping the ones it does not want. */
|
|
31
|
+
function keepProps(all, mask) {
|
|
32
|
+
if (mask === undefined) {
|
|
33
|
+
return all;
|
|
34
|
+
}
|
|
35
|
+
const kept = {};
|
|
36
|
+
for (const [id, stated] of Object.entries(all)) {
|
|
37
|
+
const some = built_in_props_1.CallProps.filter(stated, mask);
|
|
38
|
+
if (built_in_props_1.CallProps.hasAny(some)) {
|
|
39
|
+
kept[id] = some;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return kept;
|
|
43
|
+
}
|
|
44
|
+
/** Execute function-property inspection queries on the given analyzer. */
|
|
45
|
+
async function executeFnPropsQuery({ analyzer }, queries) {
|
|
46
|
+
const start = Date.now();
|
|
47
|
+
const filterFor = await query_function_filter_1.QueryFunctionFilter.criteria(queries, analyzer);
|
|
48
|
+
const [{ only, formals, props, maxDepth } = {}] = queries;
|
|
49
|
+
const ctx = analyzer.inspectContext();
|
|
50
|
+
const graph = (await analyzer.dataflow()).graph;
|
|
51
|
+
const inferred = function_props_1.FunctionProps.of(query_function_filter_1.QueryFunctionFilter.definitions(graph, filterFor), graph, { ctx, maxDepth, only });
|
|
52
|
+
return {
|
|
53
|
+
'.meta': {
|
|
54
|
+
timing: Date.now() - start
|
|
55
|
+
},
|
|
56
|
+
roles: keepRoles(inferred.roles, graph, formals && new Set(formals), props ? built_in_props_1.ArgProps.mask(props) : AllProps),
|
|
57
|
+
props: keepProps(inferred.props, props ? built_in_props_1.CallProps.mask(props) : undefined)
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=inspect-fn-props-query-executor.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type BaseQueryFormat, type BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
import { executeFnPropsQuery } from './inspect-fn-props-query-executor';
|
|
4
|
+
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
5
|
+
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
|
|
6
|
+
import type { FunctionArgumentRoles } from '../../../dataflow/fn/argument-roles';
|
|
7
|
+
import type { StatedProps } from '../../../dataflow/environments/built-in-props';
|
|
8
|
+
/** either returns all function definitions alongside what they and their formals do, or just those matching the filters */
|
|
9
|
+
export interface InspectFnPropsQuery extends BaseQueryFormat {
|
|
10
|
+
readonly type: 'inspect-fn-props';
|
|
11
|
+
readonly filter?: SlicingCriterion[];
|
|
12
|
+
/** how far a value is followed back through names and calls (default {@link ArgumentRoles.maxDepth}) */
|
|
13
|
+
readonly maxDepth?: number;
|
|
14
|
+
/** infer only what the formals do (`arguments`) or only what the function does (`function`); both by default */
|
|
15
|
+
readonly only?: 'arguments' | 'function';
|
|
16
|
+
/** keep only the formals written as one of these names */
|
|
17
|
+
readonly formals?: string[];
|
|
18
|
+
/** keep only these properties, named as the {@link ArgProp}/{@link CallProp} members they are */
|
|
19
|
+
readonly props?: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface InspectFnPropsQueryResult extends BaseQueryResult {
|
|
22
|
+
/** per function definition, the {@link ArgProp} mask of the formals that carry one, strictness included */
|
|
23
|
+
readonly roles: Record<NodeId, FunctionArgumentRoles>;
|
|
24
|
+
/** per function definition, what its body states about the function itself */
|
|
25
|
+
readonly props: Record<NodeId, StatedProps>;
|
|
26
|
+
}
|
|
27
|
+
export declare const InspectFnPropsQueryDefinition: {
|
|
28
|
+
readonly title: "Inspect Argument Roles Query";
|
|
29
|
+
readonly executor: typeof executeFnPropsQuery;
|
|
30
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
31
|
+
readonly fromLine: (_output: import("../../../cli/repl/commands/repl-main").ReplOutput, line: readonly string[], _config: import("../../..").FlowrConfig) => import("../../query").ParsedQueryLine<"inspect-fn-props">;
|
|
32
|
+
readonly syntax: "@inspect-fn-props [(<crit>;...)] <code | file://path>";
|
|
33
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
34
|
+
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
35
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
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.InspectFnPropsQueryDefinition = void 0;
|
|
7
|
+
const base_query_format_1 = require("../../base-query-format");
|
|
8
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
9
|
+
const joi_1 = __importDefault(require("joi"));
|
|
10
|
+
const inspect_fn_props_query_executor_1 = require("./inspect-fn-props-query-executor");
|
|
11
|
+
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
12
|
+
const range_1 = require("../../../util/range");
|
|
13
|
+
const argument_roles_1 = require("../../../dataflow/fn/argument-roles");
|
|
14
|
+
const built_in_props_1 = require("../../../dataflow/environments/built-in-props");
|
|
15
|
+
const objects_1 = require("../../../util/objects");
|
|
16
|
+
/** refuses a query that can only answer with nothing: `formals` narrowing an answer that carries none, or `props` naming only properties the single half it asks for cannot state */
|
|
17
|
+
function rejectEmptyAnswer(query, helpers) {
|
|
18
|
+
const { only, formals, props } = query;
|
|
19
|
+
if (only === 'function' && formals !== undefined) {
|
|
20
|
+
return helpers.message({ custom: '`formals` narrows the formals, which `only: function` does not answer' });
|
|
21
|
+
}
|
|
22
|
+
const namesNone = props === undefined ? false :
|
|
23
|
+
only === 'arguments' ? built_in_props_1.ArgProps.mask(props) === 0 :
|
|
24
|
+
only === 'function' ? built_in_props_1.CallProps.isEmptyMask(built_in_props_1.CallProps.mask(props)) : false;
|
|
25
|
+
if (namesNone) {
|
|
26
|
+
return helpers.message({ custom: `\`props\` names no ${only === 'arguments' ? built_in_props_1.ArgProps.name : built_in_props_1.CallProps.name}, so nothing about ${only === 'arguments' ? 'a formal' : 'a function'} could come back` });
|
|
27
|
+
}
|
|
28
|
+
return query;
|
|
29
|
+
}
|
|
30
|
+
exports.InspectFnPropsQueryDefinition = {
|
|
31
|
+
title: 'Inspect Argument Roles Query',
|
|
32
|
+
executor: inspect_fn_props_query_executor_1.executeFnPropsQuery,
|
|
33
|
+
asciiSummarizer: async (formatter, processed, queryResults, result) => {
|
|
34
|
+
const out = queryResults;
|
|
35
|
+
result.push(`Query: ${(0, ansi_1.bold)('inspect-fn-props', formatter)} (${out['.meta'].timing.toFixed(0)}ms)`);
|
|
36
|
+
const idMap = (await processed.normalize()).idMap;
|
|
37
|
+
for (const id of new Set([...Object.keys(out.roles), ...Object.keys(out.props)])) {
|
|
38
|
+
const node = idMap.get(node_id_1.NodeId.normalize(id));
|
|
39
|
+
const loc = node ? range_1.SourceLocation.fromNode(node) : undefined;
|
|
40
|
+
const formals = Object.entries(out.roles[id] ?? {})
|
|
41
|
+
.map(([formal, props]) => `${idMap.get(node_id_1.NodeId.normalize(formal))?.lexeme ?? formal}: ${built_in_props_1.ArgProps.words(props).join(', ')}`)
|
|
42
|
+
.join(', ');
|
|
43
|
+
const states = built_in_props_1.CallProps.labels(out.props[id]).join(', ');
|
|
44
|
+
result.push(` - Function ${(0, ansi_1.bold)(id, formatter)} (${range_1.SourceLocation.format(loc)}) ${formals}${states.length > 0 ? ` [${states}]` : ''}`);
|
|
45
|
+
}
|
|
46
|
+
return true;
|
|
47
|
+
},
|
|
48
|
+
fromLine: (0, base_query_format_1.filterLineParser)('inspect-fn-props'),
|
|
49
|
+
syntax: '@inspect-fn-props [(<crit>;...)] <code | file://path>',
|
|
50
|
+
schema: joi_1.default.object({
|
|
51
|
+
type: joi_1.default.string().valid('inspect-fn-props').required().description('The type of the query.'),
|
|
52
|
+
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.'),
|
|
53
|
+
maxDepth: joi_1.default.number().integer().min(1).optional().description(`How far a value is followed back through names and calls when deciding what a formal stands for (default ${argument_roles_1.ArgumentRoles.maxDepth}).`),
|
|
54
|
+
only: joi_1.default.string().valid('arguments', 'function').optional().description('Infer only what the formals do, or only what the function itself does; both are inferred when this is left out.'),
|
|
55
|
+
formals: joi_1.default.array().items(joi_1.default.string()).min(1).optional().description('Keep only the formals written as one of these names.'),
|
|
56
|
+
props: joi_1.default.array().items(joi_1.default.string().valid(...[...(0, objects_1.enumMembers)(built_in_props_1.ArgProp), ...(0, objects_1.enumMembers)(built_in_props_1.CallProp)].map(([name]) => name), ...Object.keys(built_in_props_1.SemanticCallTag))).min(1).optional().description('Keep only these properties, named as the ArgProp/CallProp/SemanticCallTag members they are.')
|
|
57
|
+
}).custom(rejectEmptyAnswer).description('Either returns all function definitions alongside what they and their formals do, or just those matching the filters.'),
|
|
58
|
+
flattenInvolvedNodes: (queryResults) => {
|
|
59
|
+
const out = queryResults;
|
|
60
|
+
return [...new Set([...Object.keys(out.roles), ...Object.keys(out.props)])];
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=inspect-fn-props-query-format.js.map
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeHigherOrderQuery = executeHigherOrderQuery;
|
|
4
4
|
const higher_order_function_1 = require("../../../dataflow/fn/higher-order-function");
|
|
5
|
-
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
6
5
|
const df_helper_1 = require("../../../dataflow/graph/df-helper");
|
|
7
6
|
const query_function_filter_1 = require("../../query-function-filter");
|
|
8
7
|
/**
|
|
@@ -12,16 +11,14 @@ async function executeHigherOrderQuery({ analyzer }, queries) {
|
|
|
12
11
|
const start = Date.now();
|
|
13
12
|
const filterFor = await query_function_filter_1.QueryFunctionFilter.criteria(queries, analyzer);
|
|
14
13
|
const graph = (await analyzer.dataflow()).graph;
|
|
15
|
-
const fns =
|
|
16
|
-
.filter(([id]) => query_function_filter_1.QueryFunctionFilter.written(id))
|
|
17
|
-
.filter(([, v]) => filterFor.size === 0 || filterFor.has(v.id));
|
|
14
|
+
const fns = query_function_filter_1.QueryFunctionFilter.definitions(graph, filterFor);
|
|
18
15
|
let invertedGraph;
|
|
19
16
|
if (filterFor.size === 0 || filterFor.size > 10) {
|
|
20
17
|
invertedGraph = df_helper_1.Dataflow.invertGraph(graph, analyzer.inspectContext().env.makeCleanEnv());
|
|
21
18
|
}
|
|
22
19
|
const result = {};
|
|
23
|
-
for (const
|
|
24
|
-
result[id] =
|
|
20
|
+
for (const id of fns) {
|
|
21
|
+
result[id] = higher_order_function_1.HigherOrderFunctions.of(id, graph, { ctx: analyzer.inspectContext(), invertedGraph });
|
|
25
22
|
}
|
|
26
23
|
return {
|
|
27
24
|
'.meta': {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BaseQueryFormat, type BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import Joi from 'joi';
|
|
3
|
-
import type { ParsedQueryLine } from '../../query';
|
|
4
3
|
import { executeHigherOrderQuery } from './inspect-higher-order-query-executor';
|
|
5
4
|
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
5
|
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
|
|
7
|
-
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
-
import type { FlowrConfig } from '../../../config';
|
|
9
6
|
import { criteriaQueryCompleter } from '../../../cli/repl/parser/slice-query-parser';
|
|
10
7
|
/**
|
|
11
8
|
* Either returns all function definitions alongside whether they are higher-order functions,
|
|
@@ -18,15 +15,13 @@ export interface InspectHigherOrderQuery extends BaseQueryFormat {
|
|
|
18
15
|
export interface InspectHigherOrderQueryResult extends BaseQueryResult {
|
|
19
16
|
readonly higherOrder: Record<NodeId, boolean>;
|
|
20
17
|
}
|
|
21
|
-
declare function inspectHoLineParser(_output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-higher-order'>;
|
|
22
18
|
export declare const InspectHigherOrderQueryDefinition: {
|
|
23
19
|
readonly title: "Inspect Higher-Order Functions Query";
|
|
24
20
|
readonly executor: typeof executeHigherOrderQuery;
|
|
25
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("
|
|
26
|
-
readonly fromLine:
|
|
21
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
22
|
+
readonly fromLine: (_output: import("../../../cli/repl/commands/repl-main").ReplOutput, line: readonly string[], _config: import("../../..").FlowrConfig) => import("../../query").ParsedQueryLine<"inspect-higher-order">;
|
|
27
23
|
readonly completer: typeof criteriaQueryCompleter;
|
|
28
24
|
readonly syntax: "@inspect-higher-order [(<crit>;...)] <code | file://path>";
|
|
29
25
|
readonly schema: Joi.ObjectSchema<any>;
|
|
30
26
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
31
27
|
};
|
|
32
|
-
export {};
|
|
@@ -4,22 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.InspectHigherOrderQueryDefinition = void 0;
|
|
7
|
+
const base_query_format_1 = require("../../base-query-format");
|
|
7
8
|
const ansi_1 = require("../../../util/text/ansi");
|
|
8
9
|
const joi_1 = __importDefault(require("joi"));
|
|
9
10
|
const inspect_higher_order_query_executor_1 = require("./inspect-higher-order-query-executor");
|
|
10
11
|
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
11
12
|
const slice_query_parser_1 = require("../../../cli/repl/parser/slice-query-parser");
|
|
12
13
|
const range_1 = require("../../../util/range");
|
|
13
|
-
function inspectHoLineParser(_output, line, _config) {
|
|
14
|
-
const criteria = (0, slice_query_parser_1.sliceCriteriaParser)(line[0]);
|
|
15
|
-
return {
|
|
16
|
-
query: {
|
|
17
|
-
type: 'inspect-higher-order',
|
|
18
|
-
filter: criteria
|
|
19
|
-
},
|
|
20
|
-
rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
14
|
exports.InspectHigherOrderQueryDefinition = {
|
|
24
15
|
title: 'Inspect Higher-Order Functions Query',
|
|
25
16
|
executor: inspect_higher_order_query_executor_1.executeHigherOrderQuery,
|
|
@@ -33,7 +24,7 @@ exports.InspectHigherOrderQueryDefinition = {
|
|
|
33
24
|
}
|
|
34
25
|
return true;
|
|
35
26
|
},
|
|
36
|
-
fromLine:
|
|
27
|
+
fromLine: (0, base_query_format_1.filterLineParser)('inspect-higher-order'),
|
|
37
28
|
completer: slice_query_parser_1.criteriaQueryCompleter,
|
|
38
29
|
syntax: '@inspect-higher-order [(<crit>;...)] <code | file://path>',
|
|
39
30
|
schema: joi_1.default.object({
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BaseQueryFormat, type BaseQueryResult } from '../../base-query-format';
|
|
2
2
|
import Joi from 'joi';
|
|
3
|
-
import type { ParsedQueryLine } from '../../query';
|
|
4
3
|
import { executeRecursionQuery } from './inspect-recursion-query-executor';
|
|
5
4
|
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
5
|
import type { SlicingCriterion } from '../../../slicing/criterion/parse';
|
|
7
|
-
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
-
import type { FlowrConfig } from '../../../config';
|
|
9
6
|
/**
|
|
10
7
|
* Either returns all function definitions alongside whether they are recursive,
|
|
11
8
|
* or just those matching the filters.
|
|
@@ -17,14 +14,12 @@ export interface InspectRecursionQuery extends BaseQueryFormat {
|
|
|
17
14
|
export interface InspectRecursionQueryResult extends BaseQueryResult {
|
|
18
15
|
readonly recursive: Record<NodeId, boolean>;
|
|
19
16
|
}
|
|
20
|
-
declare function inspectRecLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfig): ParsedQueryLine<'inspect-recursion'>;
|
|
21
17
|
export declare const InspectRecursionQueryDefinition: {
|
|
22
18
|
readonly title: "Inspect Recursive Functions Query";
|
|
23
19
|
readonly executor: typeof executeRecursionQuery;
|
|
24
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("
|
|
25
|
-
readonly fromLine:
|
|
20
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, processed: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => Promise<boolean>;
|
|
21
|
+
readonly fromLine: (_output: import("../../../cli/repl/commands/repl-main").ReplOutput, line: readonly string[], _config: import("../../..").FlowrConfig) => import("../../query").ParsedQueryLine<"inspect-recursion">;
|
|
26
22
|
readonly syntax: "@inspect-recursion [(<crit>;...)] <code | file://path>";
|
|
27
23
|
readonly schema: Joi.ObjectSchema<any>;
|
|
28
24
|
readonly flattenInvolvedNodes: (queryResults: BaseQueryResult) => NodeId[];
|
|
29
25
|
};
|
|
30
|
-
export {};
|
|
@@ -4,22 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.InspectRecursionQueryDefinition = void 0;
|
|
7
|
+
const base_query_format_1 = require("../../base-query-format");
|
|
7
8
|
const ansi_1 = require("../../../util/text/ansi");
|
|
8
9
|
const joi_1 = __importDefault(require("joi"));
|
|
9
10
|
const inspect_recursion_query_executor_1 = require("./inspect-recursion-query-executor");
|
|
10
11
|
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
12
|
const range_1 = require("../../../util/range");
|
|
13
|
-
function inspectRecLineParser(output, line, _config) {
|
|
14
|
-
const criteria = (0, slice_query_parser_1.sliceCriteriaParser)(line[0]);
|
|
15
|
-
return {
|
|
16
|
-
query: {
|
|
17
|
-
type: 'inspect-recursion',
|
|
18
|
-
filter: criteria
|
|
19
|
-
},
|
|
20
|
-
rCode: (0, slice_query_parser_1.queryLineCode)(line, criteria ? 1 : 0)
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
13
|
exports.InspectRecursionQueryDefinition = {
|
|
24
14
|
title: 'Inspect Recursive Functions Query',
|
|
25
15
|
executor: inspect_recursion_query_executor_1.executeRecursionQuery,
|
|
@@ -33,7 +23,7 @@ exports.InspectRecursionQueryDefinition = {
|
|
|
33
23
|
}
|
|
34
24
|
return true;
|
|
35
25
|
},
|
|
36
|
-
fromLine:
|
|
26
|
+
fromLine: (0, base_query_format_1.filterLineParser)('inspect-recursion'),
|
|
37
27
|
syntax: '@inspect-recursion [(<crit>;...)] <code | file://path>',
|
|
38
28
|
schema: joi_1.default.object({
|
|
39
29
|
type: joi_1.default.string().valid('inspect-recursion').required().description('The type of the query.'),
|
|
@@ -32,7 +32,7 @@ declare function linterQueryCompleter(line: readonly string[], startingNewArg: b
|
|
|
32
32
|
export declare const LinterQueryDefinition: {
|
|
33
33
|
readonly title: "Linter Query";
|
|
34
34
|
readonly executor: typeof executeLinterQuery;
|
|
35
|
-
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: import("
|
|
35
|
+
readonly asciiSummarizer: (formatter: OutputFormatter, analyzer: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
36
36
|
readonly completer: typeof linterQueryCompleter;
|
|
37
37
|
readonly fromLine: typeof linterQueryLineParser;
|
|
38
38
|
readonly syntax: "@linter [rules:<r1>,<r2>,...] [format:<fmt>] <code | file://path>";
|
|
@@ -14,7 +14,7 @@ export interface NormalizedAstQueryResult extends BaseQueryResult {
|
|
|
14
14
|
export declare const NormalizedAstQueryDefinition: {
|
|
15
15
|
readonly title: "Normalized AST Query";
|
|
16
16
|
readonly executor: typeof executeNormalizedAstQuery;
|
|
17
|
-
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("
|
|
17
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../..").ReadonlyFlowrAnalysisProvider<import("../../..").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
18
18
|
readonly schema: Joi.ObjectSchema<any>;
|
|
19
19
|
readonly flattenInvolvedNodes: () => never[];
|
|
20
20
|
};
|