@eagleoutice/flowr 2.15.8 → 2.15.9
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 +39 -280
- package/abstract-interpretation/absint-inference.d.ts +5 -5
- package/abstract-interpretation/absint-inference.js +12 -12
- package/abstract-interpretation/abstract-semantics.d.ts +10 -10
- package/abstract-interpretation/data-frame/arguments.d.ts +9 -9
- package/abstract-interpretation/data-frame/arguments.js +11 -11
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +1 -1
- package/abstract-interpretation/data-frame/dataframe-semantics.js +14 -14
- package/abstract-interpretation/unsupported-functions.d.ts +0 -1
- package/abstract-interpretation/unsupported-functions.js +1 -2
- package/abstract-interpretation/value-semantics.d.ts +1 -1
- package/abstract-interpretation/value-semantics.js +2 -3
- package/benchmark/calibration.d.ts +0 -2
- package/benchmark/calibration.js +0 -5
- package/benchmark/slicer.d.ts +2 -2
- package/benchmark/slicer.js +4 -4
- package/benchmark/stats/size-of.d.ts +1 -1
- package/benchmark/stats/size-of.js +2 -2
- package/benchmark/summarizer/first-phase/process.d.ts +1 -1
- package/benchmark/summarizer/first-phase/process.js +1 -1
- package/benchmark/summarizer/second-phase/graph.d.ts +1 -1
- package/benchmark/summarizer/second-phase/graph.js +1 -1
- package/cli/benchmark-app.js +3 -3
- package/cli/common/options.d.ts +0 -16
- package/cli/common/options.js +0 -3
- package/cli/common/scripts-info.d.ts +0 -16
- package/cli/compile-cache.d.ts +1 -0
- package/cli/compile-cache.js +19 -0
- package/cli/flowr-main-options.d.ts +5 -0
- package/cli/flowr-main-options.js +6 -0
- package/cli/flowr.d.ts +13 -0
- package/cli/flowr.js +27 -2
- package/cli/repl/commands/repl-clipboard.d.ts +4 -1
- package/cli/repl/commands/repl-clipboard.js +4 -1
- package/cli/repl/commands/repl-main.d.ts +0 -2
- package/cli/repl/commands/repl-main.js +0 -5
- package/cli/repl/commands/repl-normalize.js +3 -0
- package/cli/repl/commands/repl-parse.js +27 -0
- package/cli/repl/commands/repl-signature.js +17 -1
- package/cli/script-core/summarizer-core.js +0 -9
- package/cli/summarizer-app.d.ts +0 -3
- package/cli/wiki.d.ts +2 -2
- package/cli/wiki.js +18 -2
- package/config.d.ts +54 -5
- package/config.js +43 -8
- package/control-flow/cfg-dead-code.js +5 -4
- package/control-flow/cfg-properties.d.ts +2 -2
- package/control-flow/cfg-properties.js +2 -2
- package/control-flow/control-flow-graph.d.ts +32 -10
- package/control-flow/control-flow-graph.js +22 -10
- package/control-flow/diff-cfg.js +3 -2
- package/control-flow/happens-before.d.ts +6 -0
- package/control-flow/happens-before.js +42 -0
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +5 -2
- package/control-flow/simple-visitor.d.ts +2 -7
- package/control-flow/simple-visitor.js +2 -6
- package/control-flow/useless-loop.d.ts +2 -2
- package/control-flow/useless-loop.js +11 -8
- package/core/pipeline-executor.d.ts +2 -2
- package/core/pipeline-executor.js +2 -2
- package/core/steps/all/core/20-dataflow.d.ts +2 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +1 -1
- package/core/steps/all/static-slicing/00-slice.js +1 -1
- package/core/steps/all/static-slicing/10-reconstruct.js +1 -1
- package/core/steps/pipeline/default-pipelines.d.ts +16 -16
- package/core/steps/pipeline/pipeline.d.ts +1 -6
- package/data/r-base-packages.generated.d.ts +2 -2
- package/data/r-base-packages.generated.js +4 -4
- package/dataflow/cluster.js +1 -1
- package/dataflow/environments/apply-kill.d.ts +4 -0
- package/dataflow/environments/apply-kill.js +43 -8
- package/dataflow/environments/built-in-config.d.ts +7 -2
- package/dataflow/environments/built-in-config.js +7 -5
- package/dataflow/environments/built-in-eval-name.d.ts +4 -2
- package/dataflow/environments/built-in-eval-name.js +3 -1
- package/dataflow/environments/built-in-proc-name.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.js +2 -0
- package/dataflow/environments/built-in-props.d.ts +23 -7
- package/dataflow/environments/built-in-props.js +27 -10
- package/dataflow/environments/built-in.d.ts +5 -6
- package/dataflow/environments/built-in.js +12 -16
- package/dataflow/environments/data-masking-functions.js +1 -1
- package/dataflow/environments/default-builtin-config.d.ts +221 -32
- package/dataflow/environments/default-builtin-config.js +133 -83
- package/dataflow/environments/environment.d.ts +5 -0
- package/dataflow/environments/environment.js +39 -11
- package/dataflow/environments/frame-memory.d.ts +41 -2
- package/dataflow/environments/frame-memory.js +143 -12
- package/dataflow/environments/identifier.d.ts +64 -9
- package/dataflow/environments/identifier.js +99 -13
- package/dataflow/environments/query-fn-props.d.ts +8 -2
- package/dataflow/environments/query-fn-props.js +20 -12
- package/dataflow/environments/reference-to-maybe.js +1 -1
- package/dataflow/environments/removal-marker.d.ts +7 -0
- package/dataflow/environments/removal-marker.js +20 -0
- package/dataflow/environments/resolve-by-name.d.ts +8 -8
- package/dataflow/environments/resolve-by-name.js +15 -12
- package/dataflow/environments/resolve-helper.d.ts +26 -4
- package/dataflow/environments/resolve-helper.js +27 -4
- package/dataflow/eval/resolve/alias-tracking.d.ts +17 -17
- package/dataflow/eval/resolve/alias-tracking.js +57 -32
- package/dataflow/eval/resolve/node-value.d.ts +15 -28
- package/dataflow/eval/resolve/node-value.js +26 -45
- package/dataflow/eval/resolve/resolve-argument.js +21 -2
- package/dataflow/eval/resolve/resolve-get.d.ts +28 -0
- package/dataflow/eval/resolve/resolve-get.js +49 -0
- package/dataflow/eval/resolve/resolve-numbers.d.ts +4 -2
- package/dataflow/eval/resolve/resolve-numbers.js +4 -2
- package/dataflow/eval/resolve/resolve-operators.d.ts +4 -1
- package/dataflow/eval/resolve/resolve-operators.js +7 -3
- package/dataflow/eval/resolve/resolve-strings.d.ts +6 -3
- package/dataflow/eval/resolve/resolve-strings.js +29 -5
- package/dataflow/eval/resolve/resolve-working-directory.js +2 -8
- package/dataflow/eval/resolve/resolve.js +27 -15
- package/dataflow/eval/values/general.js +13 -12
- package/dataflow/eval/values/intervals/interval-constants.d.ts +10 -2
- package/dataflow/eval/values/intervals/interval-constants.js +10 -2
- package/dataflow/eval/values/logical/logical-constants.d.ts +1 -8
- package/dataflow/eval/values/logical/logical-constants.js +1 -23
- package/dataflow/eval/values/r-value.d.ts +8 -9
- package/dataflow/eval/values/r-value.js +8 -8
- package/dataflow/eval/values/scalar/scalar-constants.d.ts +1 -12
- package/dataflow/eval/values/scalar/scalar-constants.js +0 -14
- package/dataflow/eval/values/sets/set-constants.d.ts +1 -4
- package/dataflow/eval/values/sets/set-constants.js +0 -11
- package/dataflow/eval/values/string/string-constants.d.ts +4 -18
- package/dataflow/eval/values/string/string-constants.js +3 -18
- package/dataflow/eval/values/vectors/vector-constants.d.ts +1 -1
- package/dataflow/eval/values/vectors/vector-constants.js +1 -1
- package/dataflow/extractor.js +176 -13
- package/dataflow/fn/argument-roles.d.ts +10 -12
- package/dataflow/fn/argument-roles.js +16 -22
- package/dataflow/fn/class-declaration.d.ts +8 -30
- package/dataflow/fn/class-declaration.js +12 -37
- package/dataflow/fn/exceptions-of-function.d.ts +3 -16
- package/dataflow/fn/exceptions-of-function.js +5 -21
- package/dataflow/fn/frame-reflection.d.ts +5 -19
- package/dataflow/fn/frame-reflection.js +14 -29
- package/dataflow/fn/function-props.d.ts +9 -10
- package/dataflow/fn/function-props.js +16 -20
- package/dataflow/fn/function-semantics.d.ts +130 -0
- package/dataflow/fn/function-semantics.js +89 -0
- package/dataflow/fn/higher-order-function.d.ts +8 -16
- package/dataflow/fn/higher-order-function.js +17 -28
- package/dataflow/fn/recursive-function.js +1 -1
- package/dataflow/fn/strict-function.d.ts +8 -20
- package/dataflow/fn/strict-function.js +20 -38
- package/dataflow/graph/call-graph.d.ts +9 -0
- package/dataflow/graph/call-graph.js +15 -14
- package/dataflow/graph/dataflowgraph-builder.d.ts +18 -23
- package/dataflow/graph/dataflowgraph-builder.js +18 -29
- package/dataflow/graph/df-helper.d.ts +22 -109
- package/dataflow/graph/df-helper.js +20 -64
- package/dataflow/graph/diff-dataflow-graph.d.ts +5 -0
- package/dataflow/graph/diff-dataflow-graph.js +12 -7
- package/dataflow/graph/edge.d.ts +1 -0
- package/dataflow/graph/edge.js +1 -0
- package/dataflow/graph/graph-helper.d.ts +26 -1
- package/dataflow/graph/graph-helper.js +53 -2
- package/dataflow/graph/graph.d.ts +42 -7
- package/dataflow/graph/graph.js +43 -9
- package/dataflow/graph/match-args.d.ts +16 -12
- package/dataflow/graph/match-args.js +68 -26
- package/dataflow/graph/vertex.d.ts +38 -57
- package/dataflow/graph/vertex.js +38 -66
- package/dataflow/info.d.ts +5 -2
- package/dataflow/info.js +3 -1
- package/dataflow/internal/control-flow.d.ts +13 -12
- package/dataflow/internal/control-flow.js +13 -12
- package/dataflow/internal/linker.d.ts +24 -15
- package/dataflow/internal/linker.js +115 -33
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +8 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +17 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +112 -39
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +10 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.d.ts +21 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +99 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +56 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +179 -45
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +46 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +49 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +119 -22
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +5 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +62 -28
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +9 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +26 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +13 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +36 -22
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +7 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +28 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +12 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +8 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +21 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +29 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-with.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +15 -12
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +5 -5
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +23 -16
- package/dataflow/internal/process/functions/call/common.d.ts +7 -1
- package/dataflow/internal/process/functions/call/common.js +17 -7
- package/dataflow/internal/process/functions/call/deferred.d.ts +1 -3
- package/dataflow/internal/process/functions/call/deferred.js +20 -10
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +4 -4
- package/dataflow/internal/process/functions/call/known-call-handling.js +17 -8
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +5 -4
- package/dataflow/internal/process/functions/call/nse.d.ts +1 -2
- package/dataflow/internal/process/functions/call/nse.js +13 -15
- package/dataflow/internal/process/functions/call/quoted.d.ts +3 -4
- package/dataflow/internal/process/functions/call/quoted.js +96 -42
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.d.ts +4 -1
- package/dataflow/internal/process/functions/process-parameter.js +4 -1
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-origin.js +17 -10
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +2 -2
- package/dataflow/origin/dfg-get-symbol-refs.js +2 -2
- package/dataflow/processor.d.ts +10 -0
- package/documentation/data/dfg/doc-data-dfg-util.d.ts +2 -2
- package/documentation/data/dfg/doc-data-dfg-util.js +2 -2
- package/documentation/data/faq/faqs.d.ts +2 -1
- package/documentation/data/faq/faqs.js +12 -3
- package/documentation/data/server/doc-data-server-messages.d.ts +2 -1
- package/documentation/data/server/doc-data-server-messages.js +2 -1
- package/documentation/doc-capabilities.d.ts +13 -7
- package/documentation/doc-capabilities.js +445 -126
- package/documentation/doc-util/doc-auto-gen.d.ts +4 -2
- package/documentation/doc-util/doc-auto-gen.js +22 -4
- package/documentation/doc-util/doc-cfg.js +2 -2
- package/documentation/doc-util/doc-code.d.ts +8 -2
- package/documentation/doc-util/doc-code.js +36 -7
- package/documentation/doc-util/doc-dfg.d.ts +2 -0
- package/documentation/doc-util/doc-dfg.js +4 -3
- package/documentation/doc-util/doc-env.d.ts +2 -1
- package/documentation/doc-util/doc-env.js +2 -1
- package/documentation/doc-util/doc-escape.d.ts +2 -2
- package/documentation/doc-util/doc-escape.js +2 -2
- package/documentation/doc-util/doc-files.d.ts +0 -2
- package/documentation/doc-util/doc-files.js +2 -3
- package/documentation/doc-util/doc-normalized-ast.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +2 -1
- package/documentation/doc-util/doc-query.js +4 -3
- package/documentation/doc-util/doc-repl.d.ts +1 -1
- package/documentation/doc-util/doc-repl.js +1 -1
- package/documentation/doc-util/doc-search.js +2 -2
- package/documentation/doc-util/doc-server-message.js +2 -2
- package/documentation/doc-util/doc-sigdb.js +1 -1
- package/documentation/doc-util/doc-structure.d.ts +10 -3
- package/documentation/doc-util/doc-structure.js +10 -3
- package/documentation/doc-util/doc-timings.d.ts +19 -0
- package/documentation/doc-util/doc-timings.js +44 -0
- package/documentation/doc-util/doc-types.d.ts +8 -6
- package/documentation/doc-util/doc-types.js +11 -8
- package/documentation/index.d.ts +1 -0
- package/documentation/index.js +1 -0
- package/documentation/wiki-core.js +3 -0
- package/documentation/wiki-create-linting-rules.js +1 -1
- package/documentation/wiki-dataflow-graph.js +19 -20
- package/documentation/wiki-engine.js +13 -2
- package/documentation/wiki-helper-objects.d.ts +9 -0
- package/documentation/wiki-helper-objects.js +102 -0
- package/documentation/wiki-linter.js +154 -16
- package/documentation/wiki-linting-and-testing.js +99 -6
- package/documentation/wiki-mk/doc-context.d.ts +33 -29
- package/documentation/wiki-mk/doc-context.js +1 -0
- package/documentation/wiki-mk/doc-maker.d.ts +1 -1
- package/documentation/wiki-mk/doc-maker.js +18 -2
- package/documentation/wiki-query.js +44 -0
- package/documentation/wiki-signature-database.js +7 -3
- package/gas.d.ts +3 -2
- package/index.d.ts +18 -3
- package/index.js +29 -3
- package/linter/linter-executor.js +2 -2
- package/linter/linter-format.d.ts +9 -3
- package/linter/linter-format.js +2 -0
- package/linter/linter-rules.d.ts +118 -98
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.d.ts +10 -10
- package/linter/rules/absolute-path.js +9 -12
- package/linter/rules/dataframe-access-validation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.js +17 -4
- package/linter/rules/dead-code.d.ts +2 -2
- package/linter/rules/dead-code.js +1 -1
- package/linter/rules/deprecated-functions.d.ts +5 -5
- package/linter/rules/deprecated-functions.js +8 -8
- package/linter/rules/file-path-validity.d.ts +7 -7
- package/linter/rules/file-path-validity.js +4 -4
- package/linter/rules/function-finder-util.d.ts +0 -6
- package/linter/rules/function-finder-util.js +7 -2
- package/linter/rules/namespace-access.d.ts +42 -0
- package/linter/rules/namespace-access.js +78 -0
- package/linter/rules/naming-convention.d.ts +3 -3
- package/linter/rules/naming-convention.js +7 -3
- package/linter/rules/network-functions.d.ts +5 -5
- package/linter/rules/network-functions.js +5 -6
- package/linter/rules/no-leaked-credentials.d.ts +3 -3
- package/linter/rules/no-leaked-credentials.js +4 -5
- package/linter/rules/problematic-inputs.d.ts +5 -5
- package/linter/rules/problematic-inputs.js +13 -21
- package/linter/rules/roxygen-arguments.d.ts +1 -1
- package/linter/rules/roxygen-arguments.js +4 -3
- package/linter/rules/seeded-randomness.d.ts +6 -5
- package/linter/rules/seeded-randomness.js +15 -13
- package/linter/rules/software-has-license.d.ts +2 -2
- package/linter/rules/software-has-license.js +2 -2
- package/linter/rules/software-has-tests.d.ts +3 -3
- package/linter/rules/software-has-tests.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +1 -1
- package/linter/rules/stop-with-call-arg.js +16 -3
- package/linter/rules/syntactically-valid.d.ts +3 -3
- package/linter/rules/syntactically-valid.js +2 -2
- package/linter/rules/unclosed-connection.d.ts +3 -3
- package/linter/rules/unclosed-connection.js +23 -12
- package/linter/rules/undefined-symbol-util.d.ts +3 -1
- package/linter/rules/undefined-symbol-util.js +9 -7
- package/linter/rules/undefined-symbol.d.ts +4 -4
- package/linter/rules/undefined-symbol.js +4 -4
- package/linter/rules/unescaped-arguments.d.ts +37 -37
- package/linter/rules/unescaped-arguments.js +20 -21
- package/linter/rules/unused-definition.d.ts +3 -3
- package/linter/rules/unused-definition.js +63 -26
- package/linter/rules/unused-import.d.ts +4 -4
- package/linter/rules/unused-import.js +14 -5
- package/linter/rules/useless-loop.d.ts +3 -3
- package/linter/rules/useless-loop.js +3 -3
- package/package.json +6 -4
- package/project/context/flowr-analyzer-context.d.ts +5 -0
- package/project/context/flowr-analyzer-context.js +5 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +3 -3
- package/project/context/flowr-analyzer-environment-context.d.ts +20 -1
- package/project/context/flowr-analyzer-environment-context.js +24 -1
- package/project/context/flowr-analyzer-files-context.d.ts +7 -3
- package/project/context/flowr-analyzer-files-context.js +53 -22
- package/project/context/flowr-analyzer-functions-context.d.ts +1 -6
- package/project/context/flowr-analyzer-functions-context.js +1 -7
- package/project/context/flowr-analyzer-gas-context.d.ts +7 -0
- package/project/context/flowr-analyzer-gas-context.js +6 -1
- package/project/dependency-version-space.d.ts +7 -0
- package/project/dependency-version-space.js +2 -2
- package/project/flowr-analyzer-builder.d.ts +14 -4
- package/project/flowr-analyzer-builder.js +3 -1
- package/project/flowr-analyzer.d.ts +3 -3
- package/project/flowr-analyzer.js +1 -3
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +1 -1
- package/project/plugins/file-plugins/files/flowr-description-file.js +2 -2
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +1 -1
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +1 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +8 -6
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +3 -3
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +33 -10
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +2 -2
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +2 -2
- package/project/plugins/file-plugins/files/r-fun-tab.d.ts +4 -67
- package/project/plugins/file-plugins/files/r-fun-tab.js +6 -653
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +4 -1
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +4 -1
- package/project/plugins/flowr-analyzer-plugin.d.ts +1 -1
- package/project/plugins/flowr-analyzer-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +0 -19
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +4 -51
- package/project/sigdb/codec.d.ts +0 -4
- package/project/sigdb/codec.js +1 -8
- package/project/sigdb/manifest.d.ts +0 -2
- package/project/sigdb/manifest.js +2 -6
- package/project/sigdb/memory-source.js +2 -1
- package/project/sigdb/reader.js +3 -2
- package/project/sigdb/schema.d.ts +0 -2
- package/project/sigdb/schema.js +1 -7
- package/project/sigdb/signature-db.d.ts +9 -1
- package/project/sigdb/signature-db.js +8 -0
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +5 -4
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +40 -6
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +33 -54
- package/queries/catalog/dependencies-query/dependencies-query-format.js +37 -13
- package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +3 -2
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +5 -5
- package/queries/catalog/dependencies-query/function-info/read-functions.d.ts +6 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +12 -9
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +2 -2
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +1 -2
- package/queries/catalog/dependencies-query/function-info/write-functions.d.ts +9 -1
- package/queries/catalog/dependencies-query/function-info/write-functions.js +17 -6
- package/queries/catalog/dependencies-query/implicit-echo.js +28 -5
- package/queries/catalog/dependencies-query/link-devices.js +23 -10
- package/queries/catalog/dice-query/dice-query-executor.js +2 -14
- package/queries/catalog/does-call-query/does-call-query-executor.js +1 -2
- package/queries/catalog/files-query/files-query-format.d.ts +1 -1
- package/queries/catalog/function-info-query/function-info-query-executor.d.ts +7 -0
- package/queries/catalog/function-info-query/function-info-query-executor.js +38 -0
- package/queries/catalog/function-info-query/function-info-query-format.d.ts +48 -0
- package/queries/catalog/function-info-query/function-info-query-format.js +54 -0
- package/queries/catalog/function-info-query/function-origin.d.ts +22 -0
- package/queries/catalog/function-info-query/function-origin.js +46 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +2 -2
- package/queries/catalog/input-sources-query/input-source-functions.js +1 -2
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +4 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.js +24 -24
- package/queries/catalog/input-sources-query/input-types.d.ts +2 -2
- package/queries/catalog/input-sources-query/input-types.js +2 -2
- package/queries/catalog/input-sources-query/simple-input-classifier.js +6 -6
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +1 -1
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +6 -7
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +4 -4
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +8 -7
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +1 -1
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -11
- package/queries/catalog/signature-query/signature-query-executor.js +124 -63
- package/queries/catalog/signature-query/signature-query-format.d.ts +21 -0
- package/queries/catalog/signature-query/signature-query-format.js +5 -1
- package/queries/catalog/signature-query/signature-query-render.js +28 -3
- package/queries/catalog/slice-query-options.d.ts +19 -2
- package/queries/catalog/slice-query-options.js +19 -3
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -17
- package/queries/query-function-filter.d.ts +1 -0
- package/queries/query-function-filter.js +1 -0
- package/queries/query.d.ts +13 -2
- package/queries/query.js +4 -1
- package/r-bridge/data/data.d.ts +1435 -450
- package/r-bridge/data/data.js +1063 -478
- package/r-bridge/data/get.d.ts +1 -6
- package/r-bridge/data/get.js +0 -32
- package/r-bridge/data/types.d.ts +3 -0
- package/r-bridge/init.d.ts +7 -2
- package/r-bridge/init.js +10 -5
- package/r-bridge/lang-4.x/ast/model/model.d.ts +10 -8
- package/r-bridge/lang-4.x/ast/model/model.js +9 -10
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +5 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +5 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +6 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +4 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +4 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +4 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +5 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +5 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +4 -20
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +4 -43
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +11 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +18 -3
- package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +0 -5
- package/r-bridge/lang-4.x/ast/model/processing/role.js +0 -13
- package/r-bridge/lang-4.x/ast/model/versions.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/versions.js +3 -1
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +3 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +10 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-break.d.ts +3 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-break.js +3 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.d.ts +5 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +5 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.d.ts +3 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +3 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +39 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-single-node.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-single-node.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +2 -2
- package/r-bridge/lang-4.x/convert-values.d.ts +6 -0
- package/r-bridge/lang-4.x/convert-values.js +6 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +15 -2
- package/r-bridge/parser.d.ts +1 -1
- package/r-bridge/parser.js +1 -1
- package/r-bridge/retriever.d.ts +0 -21
- package/r-bridge/retriever.js +5 -63
- package/r-bridge/roxygen2/documentation-provider.d.ts +2 -2
- package/r-bridge/roxygen2/documentation-provider.js +2 -2
- package/r-bridge/shell-executor.js +1 -1
- package/r-bridge/shell.d.ts +4 -4
- package/r-bridge/shell.js +58 -35
- package/reconstruct/inline/source-inline-map.d.ts +15 -22
- package/reconstruct/inline/source-inline-map.js +63 -70
- package/reconstruct/reconstruct.d.ts +1 -1
- package/reconstruct/reconstruct.js +5 -2
- package/search/flowr-search-builder.d.ts +17 -16
- package/search/flowr-search-builder.js +9 -8
- package/search/flowr-search-filters.d.ts +1 -13
- package/search/flowr-search-filters.js +4 -13
- package/search/search-executor/search-enrichers.d.ts +2 -2
- package/search/search-executor/search-enrichers.js +3 -3
- package/search/search-executor/search-generators.d.ts +0 -3
- package/search/search-executor/search-transformer.d.ts +0 -3
- package/slicing/criterion/parse.d.ts +24 -20
- package/slicing/criterion/parse.js +34 -24
- package/slicing/static/slice-call.d.ts +1 -1
- package/slicing/static/slice-call.js +28 -9
- package/slicing/static/static-slicer.js +3 -4
- package/slicing/static/visiting-queue.d.ts +3 -1
- package/slicing/static/visiting-queue.js +25 -14
- package/util/accessor.d.ts +22 -0
- package/util/accessor.js +3 -0
- package/util/assert.d.ts +14 -8
- package/util/assert.js +25 -8
- package/util/collections/arrays.d.ts +11 -7
- package/util/collections/arrays.js +14 -14
- package/util/collections/defaultmap.d.ts +5 -0
- package/util/collections/defaultmap.js +14 -0
- package/util/diff-graph.d.ts +1 -2
- package/util/diff-graph.js +0 -1
- package/util/files.d.ts +20 -34
- package/util/files.js +36 -51
- package/util/glob.js +1 -1
- package/util/json.d.ts +0 -7
- package/util/json.js +0 -15
- package/util/logic.d.ts +5 -0
- package/util/logic.js +6 -1
- package/util/mermaid/dfg.d.ts +2 -1
- package/util/mermaid/dfg.js +7 -6
- package/util/mermaid/mermaid.d.ts +1 -0
- package/util/mermaid/mermaid.js +1 -0
- package/util/numbers.d.ts +0 -5
- package/util/numbers.js +0 -9
- package/util/objects.d.ts +3 -3
- package/util/objects.js +3 -3
- package/util/quads.d.ts +2 -2
- package/util/quads.js +1 -1
- package/util/r-base-packages.d.ts +14 -1
- package/util/r-base-packages.js +21 -1
- package/util/r-package-urls.d.ts +33 -0
- package/util/r-package-urls.js +79 -0
- package/util/r-version.d.ts +8 -2
- package/util/r-version.js +8 -2
- package/util/range.d.ts +173 -54
- package/util/range.js +221 -75
- package/util/record.d.ts +7 -6
- package/util/record.js +7 -6
- package/util/simple-df/dfg-ascii.js +6 -6
- package/util/summarizer.d.ts +2 -15
- package/util/summarizer.js +0 -15
- package/util/text/args.d.ts +2 -2
- package/util/text/args.js +2 -2
- package/util/text/playground-link.d.ts +3 -23
- package/util/text/playground-link.js +10 -10
- package/util/text/r-highlight.d.ts +20 -0
- package/util/text/r-highlight.js +171 -0
- package/util/text/strings.d.ts +6 -0
- package/util/text/strings.js +11 -2
- package/util/version.js +2 -2
- package/cli/run-script.d.ts +0 -7
- package/cli/run-script.js +0 -17
- package/project/sigdb/signature-match.d.ts +0 -18
- package/project/sigdb/signature-match.js +0 -32
- package/util/text/text.d.ts +0 -5
- package/util/text/text.js +0 -24
|
@@ -2,7 +2,7 @@ import { type Lift, type Value, type ValueVector } from '../r-value';
|
|
|
2
2
|
/**
|
|
3
3
|
* Creates an abstract vector from abstract values
|
|
4
4
|
* @param elements - elements that the vector should contain
|
|
5
|
-
* @returns
|
|
5
|
+
* @returns abstract ValueVector
|
|
6
6
|
*/
|
|
7
7
|
export declare function vectorFrom<V extends Lift<Value[]>>(elements: V): ValueVector<V>;
|
|
8
8
|
/**
|
|
@@ -8,7 +8,7 @@ const general_1 = require("../general");
|
|
|
8
8
|
/**
|
|
9
9
|
* Creates an abstract vector from abstract values
|
|
10
10
|
* @param elements - elements that the vector should contain
|
|
11
|
-
* @returns
|
|
11
|
+
* @returns abstract ValueVector
|
|
12
12
|
*/
|
|
13
13
|
function vectorFrom(elements) {
|
|
14
14
|
(0, assert_1.guard)((0, r_value_1.isTop)(elements) || (0, r_value_1.isBottom)(elements) || Array.isArray(elements), 'Expected array of values');
|
package/dataflow/extractor.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processors = void 0;
|
|
4
4
|
exports.produceDataFlowGraph = produceDataFlowGraph;
|
|
5
|
+
const function_semantics_1 = require("./fn/function-semantics");
|
|
5
6
|
const processor_1 = require("./processor");
|
|
6
7
|
const process_uninteresting_leaf_1 = require("./internal/process/process-uninteresting-leaf");
|
|
7
8
|
const process_symbol_1 = require("./internal/process/process-symbol");
|
|
@@ -16,6 +17,7 @@ const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
|
16
17
|
const built_in_source_1 = require("./internal/process/functions/call/built-in/built-in-source");
|
|
17
18
|
const built_in_library_1 = require("./internal/process/functions/call/built-in/built-in-library");
|
|
18
19
|
const graph_1 = require("./graph/graph");
|
|
20
|
+
const unknown_side_effect_1 = require("./graph/unknown-side-effect");
|
|
19
21
|
const control_flow_graph_1 = require("../control-flow/control-flow-graph");
|
|
20
22
|
const edge_1 = require("./graph/edge");
|
|
21
23
|
const identify_link_to_last_call_relation_1 = require("../queries/catalog/call-context-query/identify-link-to-last-call-relation");
|
|
@@ -24,13 +26,22 @@ const transitive_side_effects_1 = require("./internal/process/functions/call/bui
|
|
|
24
26
|
const flowr_file_1 = require("../project/context/flowr-file");
|
|
25
27
|
const vertex_1 = require("./graph/vertex");
|
|
26
28
|
const identifier_1 = require("./environments/identifier");
|
|
27
|
-
const
|
|
29
|
+
const r_symbol_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
|
|
30
|
+
const node_id_1 = require("../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
28
31
|
const range_1 = require("../util/range");
|
|
29
32
|
const logger_1 = require("./logger");
|
|
30
33
|
const gas_1 = require("../gas");
|
|
31
34
|
const config_1 = require("../config");
|
|
32
35
|
const df_helper_1 = require("./graph/df-helper");
|
|
36
|
+
const built_in_proc_name_1 = require("./environments/built-in-proc-name");
|
|
33
37
|
const arrays_1 = require("../util/collections/arrays");
|
|
38
|
+
const defaultmap_1 = require("../util/collections/defaultmap");
|
|
39
|
+
const match_args_1 = require("./graph/match-args");
|
|
40
|
+
const built_in_props_1 = require("./environments/built-in-props");
|
|
41
|
+
const query_fn_props_1 = require("./environments/query-fn-props");
|
|
42
|
+
const resolve_helper_1 = require("./environments/resolve-helper");
|
|
43
|
+
const happens_before_1 = require("../control-flow/happens-before");
|
|
44
|
+
const assert_1 = require("../util/assert");
|
|
34
45
|
/**
|
|
35
46
|
* The best friend of {@link produceDataFlowGraph} and {@link processDataflowFor}.
|
|
36
47
|
* Maps every {@link RType} in the normalized AST to a processor.
|
|
@@ -68,6 +79,163 @@ exports.processors = {
|
|
|
68
79
|
}, (0, make_argument_1.wrapArgumentsUnnamed)(children, d.completeAst.idMap), info.id, d);
|
|
69
80
|
}
|
|
70
81
|
};
|
|
82
|
+
function linkEnvironmentArgumentsWrittenByCallee(graph, environment) {
|
|
83
|
+
if (!tracksAnyEnvironment(environment)) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
for (const [, definition] of graph.verticesOfType(vertex_1.VertexType.FunctionDefinition)) {
|
|
87
|
+
const parameters = new Set(df_helper_1.Dataflow.parametersOf(definition));
|
|
88
|
+
if (parameters.size === 0) {
|
|
89
|
+
continue;
|
|
90
|
+
}
|
|
91
|
+
const writesByParameter = new defaultmap_1.DefaultMap(() => []);
|
|
92
|
+
writesOfParameters(graph, definition, parameters, writesByParameter, environment);
|
|
93
|
+
for (const [parameter, writes] of writesByParameter.entries()) {
|
|
94
|
+
for (const argument of df_helper_1.Dataflow.argumentsBoundTo(graph, parameter)) {
|
|
95
|
+
if (!holdsEnvironment(graph, argument, environment)) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
for (const [call, handed] of graph.edgesTo(argument)) {
|
|
99
|
+
if (!edge_1.DfEdge.includesType(handed, edge_1.EdgeType.Argument) || !vertex_1.DfgVertex.isFunctionCall(graph.getVertex(call))) {
|
|
100
|
+
continue;
|
|
101
|
+
}
|
|
102
|
+
(0, unknown_side_effect_1.handleUnknownSideEffect)(graph, environment, call);
|
|
103
|
+
for (const write of writes) {
|
|
104
|
+
graph.addEdge(call, write, edge_1.EdgeType.Reads);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function tracksAnyEnvironment(environment) {
|
|
112
|
+
for (let e = environment.current; e !== undefined && !e.builtInEnv; e = e.parent) {
|
|
113
|
+
for (const [, defs] of e.memory) {
|
|
114
|
+
for (const def of defs) {
|
|
115
|
+
if ((0, identifier_1.hasEnvState)(def)) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
function writesOfParameters(graph, definition, parameters, written, environment) {
|
|
124
|
+
for (const node of definition.subflow.graph) {
|
|
125
|
+
const vertex = graph.getVertex(node);
|
|
126
|
+
if (!vertex_1.DfgVertex.isVariableDefinition(vertex) || !vertex.par) {
|
|
127
|
+
if (vertex_1.DfgVertex.isFunctionCall(vertex) && graph.unknownSideEffects.has(node_id_1.NodeId.normalize(node))) {
|
|
128
|
+
for (const target of argsWithProp(vertex, (0, query_fn_props_1.callFnProps)(node, { graph, environment }), built_in_props_1.ArgProp.Written)) {
|
|
129
|
+
for (const reached of definitionsReachedBy(target, graph)) {
|
|
130
|
+
if (parameters.has(reached)) {
|
|
131
|
+
written.get(reached).push(node);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
const onParameter = [];
|
|
139
|
+
const replacements = [];
|
|
140
|
+
for (const [target, edge] of graph.edgesFrom(node)) {
|
|
141
|
+
if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads) && parameters.has(target)) {
|
|
142
|
+
onParameter.push(target);
|
|
143
|
+
}
|
|
144
|
+
else if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedBy) && vertex_1.DfgVertex.hasOrigin(graph.getVertex(target), built_in_proc_name_1.BuiltInProcName.Replacement)) {
|
|
145
|
+
replacements.push(target);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
for (const parameter of onParameter) {
|
|
149
|
+
written.get(parameter).push(...replacements);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
function argsWithProp(vertex, info, prop) {
|
|
154
|
+
return info?.sig === undefined ? [] : match_args_1.MatchArgs.findWithProps(vertex.args, info.sig, prop);
|
|
155
|
+
}
|
|
156
|
+
function holdsEnvironment(graph, argument, environment) {
|
|
157
|
+
const node = graph.idMap?.get(argument);
|
|
158
|
+
if (!r_symbol_1.RSymbol.is(node)) {
|
|
159
|
+
return false;
|
|
160
|
+
}
|
|
161
|
+
return (resolve_helper_1.Resolve.byName(node.content, environment) ?? [])
|
|
162
|
+
.some(identifier_1.hasEnvState);
|
|
163
|
+
}
|
|
164
|
+
function definitionsReachedBy(node, graph) {
|
|
165
|
+
return df_helper_1.Dataflow.reachable(graph, node, {
|
|
166
|
+
follow: edge_1.EdgeType.Reads,
|
|
167
|
+
stopAt: id => vertex_1.DfgVertex.isVariableDefinition(graph.getVertex(id))
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function sameResource(a, b, reachedBy, pathOf) {
|
|
171
|
+
if (a === b) {
|
|
172
|
+
return true;
|
|
173
|
+
}
|
|
174
|
+
const reachedByA = reachedBy(a);
|
|
175
|
+
for (const t of reachedBy(b)) {
|
|
176
|
+
if (reachedByA.has(t)) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
const path = pathOf(a);
|
|
181
|
+
return path !== undefined && path === pathOf(b);
|
|
182
|
+
}
|
|
183
|
+
function fileCallNames(index) {
|
|
184
|
+
return new Set(index.with(built_in_props_1.SemanticCallTag.File).map(identifier_1.Identifier.getName));
|
|
185
|
+
}
|
|
186
|
+
function linkResourceReadersToWriters(graph, environment, ctx) {
|
|
187
|
+
const readers = [];
|
|
188
|
+
const writers = [];
|
|
189
|
+
const stated = new Map();
|
|
190
|
+
const candidates = ctx.env.deriveFromIndex(fileCallNames);
|
|
191
|
+
for (const [id, vertex] of graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
|
|
192
|
+
if (vertex.name !== undefined && !candidates.has(identifier_1.Identifier.getName(vertex.name))) {
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
const name = df_helper_1.Dataflow.qualify(id, graph, false) ?? vertex.name;
|
|
196
|
+
const key = vertex.environment === undefined && name !== undefined ?
|
|
197
|
+
`${vertex.onlyBuiltin ? 1 : 0}${identifier_1.Identifier.toString(name)}` : undefined;
|
|
198
|
+
let info;
|
|
199
|
+
if (key !== undefined && stated.has(key)) {
|
|
200
|
+
info = stated.get(key);
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
info = (0, query_fn_props_1.callFnProps)(id, { graph, environment });
|
|
204
|
+
if (key !== undefined) {
|
|
205
|
+
stated.set(key, info);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const reads = function_semantics_1.FunctionSemantics.call.props.hasAll(info, [built_in_props_1.SemanticCallTag.File, built_in_props_1.SemanticCallTag.Reads]);
|
|
209
|
+
const writes = function_semantics_1.FunctionSemantics.call.props.hasAll(info, [built_in_props_1.SemanticCallTag.File, built_in_props_1.SemanticCallTag.Writes]);
|
|
210
|
+
if (!reads && !writes) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
const resource = argsWithProp(vertex, info, built_in_props_1.ArgProp.Resource)[0];
|
|
214
|
+
if (resource === undefined) {
|
|
215
|
+
continue; /* writing to the console names no file, and neither does a reader we cannot pin down */
|
|
216
|
+
}
|
|
217
|
+
(reads ? readers : writers).push({ id, resource });
|
|
218
|
+
}
|
|
219
|
+
if (readers.length === 0 || writers.length === 0) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const reachedBy = (0, defaultmap_1.memoize)((id) => definitionsReachedBy(id, graph));
|
|
223
|
+
const where = { graph, idMap: graph.idMap, resolve: ctx.config.solver.variables, ctx, environment };
|
|
224
|
+
const pathOf = (0, defaultmap_1.memoize)((id) => resolve_helper_1.Resolve.toSingleString(id, where));
|
|
225
|
+
let cfg;
|
|
226
|
+
for (const reader of readers) {
|
|
227
|
+
let before;
|
|
228
|
+
for (const writer of writers) {
|
|
229
|
+
if (reader.id === writer.id || !sameResource(reader.resource, writer.resource, reachedBy, pathOf)) {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
before ??= (0, happens_before_1.reachableTo)(cfg ??= new control_flow_graph_1.ControlFlowGraph(graph), [reader.id]);
|
|
233
|
+
if (before.has(writer.id)) {
|
|
234
|
+
graph.addEdge(reader.id, writer.id, edge_1.EdgeType.Reads);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
71
239
|
function resolveLinkToSideEffects(graph, ctx) {
|
|
72
240
|
const gasLevel = ctx.gas.checkGas(gas_1.GasFeatureKey.SideEffectLinking);
|
|
73
241
|
if (gasLevel >= 2 /* GasLevel.Critical */) {
|
|
@@ -152,16 +320,7 @@ function extractDataFlowGraph(parser, completeAst, ctx) {
|
|
|
152
320
|
referenceChain: [files[0].filePath],
|
|
153
321
|
ctx
|
|
154
322
|
};
|
|
155
|
-
let df;
|
|
156
|
-
try {
|
|
157
|
-
df = (0, processor_1.processDataflowFor)(files[0].root, dfData);
|
|
158
|
-
}
|
|
159
|
-
catch (e) {
|
|
160
|
-
if (e instanceof RangeError) {
|
|
161
|
-
throw new Error(`Dataflow analysis exceeded the call stack for '${files[0].filePath ?? '<inline>'}' (code is too deeply nested). Consider --stack-size=65536 when invoking Node.js.`, { cause: e });
|
|
162
|
-
}
|
|
163
|
-
throw e;
|
|
164
|
-
}
|
|
323
|
+
let df = (0, assert_1.guardNesting)('Dataflow analysis', files[0].filePath, () => (0, processor_1.processDataflowFor)(files[0].root, dfData));
|
|
165
324
|
for (let i = 1; i < files.length; i++) {
|
|
166
325
|
/* source requests register automatically */
|
|
167
326
|
df = (0, built_in_source_1.standaloneSourceFile)(i, files[i], dfData, df);
|
|
@@ -169,9 +328,11 @@ function extractDataFlowGraph(parser, completeAst, ctx) {
|
|
|
169
328
|
// resolve linkages and propagate transitive side effects across calls to a fixpoint
|
|
170
329
|
(0, built_in_function_definition_1.updateNestedFunctionCalls)(df.graph, df.environment, ctx);
|
|
171
330
|
const escapedNames = new Set();
|
|
331
|
+
/* carried across the rounds, so a definition already folded in does not read as growth again */
|
|
332
|
+
const foldedIn = new Set();
|
|
172
333
|
const rounds = ctx.config.solver.transitiveSideEffectRounds ?? config_1.DefaultTransitiveSideEffectRounds;
|
|
173
334
|
for (let round = 0; round < rounds; round++) {
|
|
174
|
-
const { environment, grew, escapedNames: roundNames } = df_helper_1.Dataflow.sideEffects.propagateTransitive(df.graph, df.environment, ctx);
|
|
335
|
+
const { environment, grew, escapedNames: roundNames } = df_helper_1.Dataflow.sideEffects.propagateTransitive(df.graph, df.environment, ctx, foldedIn);
|
|
175
336
|
df.environment = environment;
|
|
176
337
|
for (const n of roundNames) {
|
|
177
338
|
escapedNames.add(n);
|
|
@@ -187,7 +348,9 @@ function extractDataFlowGraph(parser, completeAst, ctx) {
|
|
|
187
348
|
}
|
|
188
349
|
// link on-demand-materialized package exports back to their `library()` loaders
|
|
189
350
|
(0, transitive_side_effects_1.linkMaterializedExportsToLoaders)(df.graph, df.environment);
|
|
190
|
-
|
|
351
|
+
function_semantics_1.FunctionSemantics.call.quoted.finalize(df.graph, df.environment, completeAst.idMap, () => new control_flow_graph_1.ControlFlowGraph(df.graph));
|
|
352
|
+
linkEnvironmentArgumentsWrittenByCallee(df.graph, df.environment);
|
|
353
|
+
linkResourceReadersToWriters(df.graph, df.environment, ctx);
|
|
191
354
|
resolveLinkToSideEffects(df.graph, ctx);
|
|
192
355
|
return df;
|
|
193
356
|
}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `FunctionSemantics` facade wires these together, so a sibling here has to call the backing function
|
|
3
|
+
* directly; going through `FunctionSemantics` would make `src/dataflow/fn/function-semantics.ts` import its own importers.
|
|
4
|
+
* @lintIgnore use-instead
|
|
5
|
+
*/
|
|
1
6
|
import type { DataflowGraph } from '../graph/graph';
|
|
2
7
|
import type { ArgProps } from '../environments/built-in-props';
|
|
3
8
|
import { type BuiltInLookup } from './frame-reflection';
|
|
@@ -5,7 +10,9 @@ import type { ReadOnlyFlowrAnalyzerContext } from '../../project/context/flowr-a
|
|
|
5
10
|
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
11
|
/** What a function does with its formals, as an {@link ArgProp} bitfield keyed by the id of each formal's name. */
|
|
7
12
|
export type FunctionArgumentRoles = Record<NodeId, ArgProps>;
|
|
8
|
-
/**
|
|
13
|
+
/** How far a value is followed back: enough for `y <- x; y`, not a whole slice. */
|
|
14
|
+
export declare const DefaultDepth = 6;
|
|
15
|
+
/** What to ask for beyond the definitions themselves, see {@link argumentRolesOfFunctions}. */
|
|
9
16
|
export interface ArgumentRolesOptions {
|
|
10
17
|
/** how to ask what a built-in states, so a configured or overwritten one answers */
|
|
11
18
|
readonly ctx?: ReadOnlyFlowrAnalyzerContext;
|
|
@@ -15,21 +22,12 @@ export interface ArgumentRolesOptions {
|
|
|
15
22
|
/**
|
|
16
23
|
* What each definition in `ids` does with its formals, as {@link ArgProps}. A formal is {@link ArgProp.Alias}
|
|
17
24
|
* only when the result is *always* that formal; every other bit is what the calls in the body state for it.
|
|
18
|
-
* @useInstead {@link
|
|
25
|
+
* @useInstead {@link FunctionSemantics.argumentRoles}
|
|
19
26
|
*/
|
|
20
|
-
declare function argumentRolesOfFunctions(this: void, ids: Iterable<NodeId>, graph: DataflowGraph, options?: ArgumentRolesOptions): Record<NodeId, FunctionArgumentRoles>;
|
|
21
|
-
/** What the functions of a program do with the arguments they are handed. */
|
|
22
|
-
export declare const ArgumentRoles: {
|
|
23
|
-
readonly name: "ArgumentRoles";
|
|
24
|
-
/** The roles of several definitions, sharing the built-in lookups; see {@link argumentRolesOfFunctions}. */
|
|
25
|
-
readonly of: typeof argumentRolesOfFunctions;
|
|
26
|
-
/** how far a value is followed back when nothing else is asked for */
|
|
27
|
-
readonly maxDepth: 6;
|
|
28
|
-
};
|
|
27
|
+
export declare function argumentRolesOfFunctions(this: void, ids: Iterable<NodeId>, graph: DataflowGraph, options?: ArgumentRolesOptions): Record<NodeId, FunctionArgumentRoles>;
|
|
29
28
|
/** What one run carries along, so the built-in lookups are shared between the definitions it answers. */
|
|
30
29
|
export interface LookupState {
|
|
31
30
|
readonly graph: DataflowGraph;
|
|
32
31
|
/** what flowR states about a built-in, answered once per name */
|
|
33
32
|
readonly info: BuiltInLookup;
|
|
34
33
|
}
|
|
35
|
-
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DefaultDepth = void 0;
|
|
4
|
+
exports.argumentRolesOfFunctions = argumentRolesOfFunctions;
|
|
5
|
+
const function_semantics_1 = require("./function-semantics");
|
|
4
6
|
const graph_1 = require("../graph/graph");
|
|
5
7
|
const df_helper_1 = require("../graph/df-helper");
|
|
6
|
-
const match_args_1 = require("../graph/match-args");
|
|
7
8
|
const edge_1 = require("../graph/edge");
|
|
8
9
|
const vertex_1 = require("../graph/vertex");
|
|
9
10
|
const built_in_props_1 = require("../environments/built-in-props");
|
|
@@ -16,11 +17,11 @@ const r_logical_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-logical")
|
|
|
16
17
|
const built_in_proc_name_1 = require("../environments/built-in-proc-name");
|
|
17
18
|
const info_1 = require("../info");
|
|
18
19
|
/** How far a value is followed back: enough for `y <- x; y`, not a whole slice. */
|
|
19
|
-
|
|
20
|
+
exports.DefaultDepth = 6;
|
|
20
21
|
/**
|
|
21
22
|
* What each definition in `ids` does with its formals, as {@link ArgProps}. A formal is {@link ArgProp.Alias}
|
|
22
23
|
* only when the result is *always* that formal; every other bit is what the calls in the body state for it.
|
|
23
|
-
* @useInstead {@link
|
|
24
|
+
* @useInstead {@link FunctionSemantics.argumentRoles}
|
|
24
25
|
*/
|
|
25
26
|
function argumentRolesOfFunctions(ids, graph, options = {}) {
|
|
26
27
|
const state = makeState(graph, options);
|
|
@@ -33,20 +34,12 @@ function argumentRolesOfFunctions(ids, graph, options = {}) {
|
|
|
33
34
|
}
|
|
34
35
|
return all;
|
|
35
36
|
}
|
|
36
|
-
|
|
37
|
-
exports.ArgumentRoles = {
|
|
38
|
-
name: 'ArgumentRoles',
|
|
39
|
-
/** The roles of several definitions, sharing the built-in lookups; see {@link argumentRolesOfFunctions}. */
|
|
40
|
-
of: argumentRolesOfFunctions,
|
|
41
|
-
/** how far a value is followed back when nothing else is asked for */
|
|
42
|
-
maxDepth: DefaultDepth
|
|
43
|
-
};
|
|
44
|
-
function makeState(graph, { ctx, maxDepth = DefaultDepth }) {
|
|
37
|
+
function makeState(graph, { ctx, maxDepth = exports.DefaultDepth }) {
|
|
45
38
|
return { graph, info: (0, query_fn_props_1.builtInLookup)(ctx), maxDepth, args: new Map() };
|
|
46
39
|
}
|
|
47
40
|
function rolesOf(id, state) {
|
|
48
41
|
const definition = state.graph.getVertex(id);
|
|
49
|
-
if (!vertex_1.
|
|
42
|
+
if (!vertex_1.DfgVertex.isFunctionDefinition(definition)) {
|
|
50
43
|
return {};
|
|
51
44
|
}
|
|
52
45
|
// an exit reached only on some path does not make the formal the result, so it is not followed
|
|
@@ -54,7 +47,7 @@ function rolesOf(id, state) {
|
|
|
54
47
|
const returned = identityOf(unconditional, state);
|
|
55
48
|
const stated = statedRoles(definition, state);
|
|
56
49
|
/* reflection flowR could not follow reaches every formal alike */
|
|
57
|
-
const reflective = frame_reflection_1.
|
|
50
|
+
const reflective = (0, frame_reflection_1.reflectiveRolesOf)(definition, state.graph, { known: state.info });
|
|
58
51
|
const roles = {};
|
|
59
52
|
for (const formal of Object.keys(definition.params)) {
|
|
60
53
|
const at = node_id_1.NodeId.normalize(formal);
|
|
@@ -103,7 +96,7 @@ function sameValueAs(node, state) {
|
|
|
103
96
|
const graph = state.graph;
|
|
104
97
|
const vertex = graph.getVertex(node);
|
|
105
98
|
const returns = takesApart(vertex) ? [] : (0, frame_reflection_1.edgeTargets)(graph, node, edge_1.EdgeType.Returns);
|
|
106
|
-
if (vertex_1.
|
|
99
|
+
if (vertex_1.DfgVertex.isFunctionCall(vertex)) {
|
|
107
100
|
const alias = argumentsWith(vertex, state, built_in_props_1.ArgProp.Alias);
|
|
108
101
|
if (missesItsElse(vertex, state)) {
|
|
109
102
|
/* the other path hands back an invisible `NULL`, so what the branch yields is not what the call does */
|
|
@@ -114,11 +107,11 @@ function sameValueAs(node, state) {
|
|
|
114
107
|
else if (returns.length > 0) {
|
|
115
108
|
return returns.length > 1 ? [returns, []] : [[], returns];
|
|
116
109
|
}
|
|
117
|
-
else if (vertex_1.
|
|
110
|
+
else if (vertex_1.DfgVertex.isUse(vertex)) {
|
|
118
111
|
const origins = (df_helper_1.Dataflow.origin(graph, node) ?? []).map(o => o.id).filter(other => other !== node);
|
|
119
112
|
return origins.length > 1 ? [origins, []] : [[], origins];
|
|
120
113
|
}
|
|
121
|
-
else if (vertex_1.
|
|
114
|
+
else if (vertex_1.DfgVertex.isVariableDefinition(vertex)) {
|
|
122
115
|
/* what the name was given, a call included: what that yields in turn is for the next step to say */
|
|
123
116
|
return [[], (0, frame_reflection_1.edgeTargets)(graph, node, edge_1.EdgeType.DefinedBy)];
|
|
124
117
|
}
|
|
@@ -134,7 +127,7 @@ function missesItsElse(vertex, state) {
|
|
|
134
127
|
}
|
|
135
128
|
/** Whether the call hands back a part of what it was given (`x$a`, `x[1]`, `pkg::name`) rather than the thing. */
|
|
136
129
|
function takesApart(vertex) {
|
|
137
|
-
return vertex_1.
|
|
130
|
+
return vertex_1.DfgVertex.isFunctionCall(vertex)
|
|
138
131
|
&& (vertex.origin.includes(built_in_proc_name_1.BuiltInProcName.Access) || vertex.origin.includes(built_in_proc_name_1.BuiltInProcName.NamespaceAccess));
|
|
139
132
|
}
|
|
140
133
|
/** The roles the calls inside a definition give to what they are handed, as one mask per node reached. */
|
|
@@ -151,8 +144,9 @@ function statedRoles(definition, state) {
|
|
|
151
144
|
for (const callee of calledNames(node, vertex, state)) {
|
|
152
145
|
add(callee, built_in_props_1.ArgProp.Callee);
|
|
153
146
|
}
|
|
147
|
+
const notStated = (0, info_1.happensInEveryBranch)(vertex.cds) ? NotStatedByACall : NotStatedByACall | built_in_props_1.ArgProp.Forced;
|
|
154
148
|
for (const [props, argument] of argumentProps(vertex, state)) {
|
|
155
|
-
const stated = props & ~
|
|
149
|
+
const stated = props & ~notStated;
|
|
156
150
|
if (stated !== 0) {
|
|
157
151
|
add(argument, stated);
|
|
158
152
|
}
|
|
@@ -172,7 +166,7 @@ function calledNames(id, vertex, state) {
|
|
|
172
166
|
}
|
|
173
167
|
}
|
|
174
168
|
const called = identifier_1.Identifier.getName(vertex.name);
|
|
175
|
-
return [...state.graph.
|
|
169
|
+
return [...state.graph.edgesFrom(id)]
|
|
176
170
|
.filter(([target, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads) && !handed.has(target) && !node_id_1.NodeId.isBuiltIn(target)
|
|
177
171
|
&& state.graph.idMap?.get(target)?.lexeme === called)
|
|
178
172
|
.map(([target]) => target);
|
|
@@ -235,7 +229,7 @@ function matchArgumentProps(vertex, state) {
|
|
|
235
229
|
if (sig === undefined) {
|
|
236
230
|
return [];
|
|
237
231
|
}
|
|
238
|
-
const bound =
|
|
232
|
+
const bound = function_semantics_1.FunctionSemantics.call.match.toSpec(vertex.args, Object.fromEntries(sig.map(([formal]) => [formal, formal])));
|
|
239
233
|
/* a named argument is bound by the node naming it, while what the call was handed is the value below it */
|
|
240
234
|
const values = new Map(vertex.args.filter(graph_1.FunctionArgument.isNamed).map(a => [a.nodeId, a.valueId]));
|
|
241
235
|
const found = [];
|
|
@@ -8,7 +8,6 @@ import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-i
|
|
|
8
8
|
import { type PotentiallyEmptyRArgument } from '../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
9
9
|
import type { DataflowGraph } from '../graph/graph';
|
|
10
10
|
import type { SigClassInfo } from '../../project/sigdb/schema';
|
|
11
|
-
import type { DataflowGraphVertexInfo } from '../graph/vertex';
|
|
12
11
|
/** The object system a declaration belongs to. */
|
|
13
12
|
export declare const enum ClassSystem {
|
|
14
13
|
/** `setClass`, `setClassUnion`, `setIs`, `setValidity` */
|
|
@@ -89,21 +88,19 @@ export interface ClassDeclarationConfig {
|
|
|
89
88
|
readonly relation?: 'is' | 'validity';
|
|
90
89
|
}
|
|
91
90
|
/** The argument `ref` names, by name when the call gives one and by position among the unnamed ones otherwise. */
|
|
92
|
-
declare function argForImpl<Info>(args: readonly PotentiallyEmptyRArgument<Info & ParentInformation>[], ref: ClassArgRef | undefined): RNode<Info & ParentInformation> | undefined;
|
|
91
|
+
export declare function argForImpl<Info>(args: readonly PotentiallyEmptyRArgument<Info & ParentInformation>[], ref: ClassArgRef | undefined): RNode<Info & ParentInformation> | undefined;
|
|
93
92
|
/**
|
|
94
93
|
* The argument `ref` names, by name when the call gives one and by position among the unnamed ones otherwise.
|
|
95
94
|
* Exported so `built-in-s-four.ts` can drop its own copy of this instead of hand-rolling it again; that file
|
|
96
95
|
* already imports {@link ClassArgRef} from here, so the reverse import would cycle.
|
|
97
|
-
* @deprecated use {@link
|
|
96
|
+
* @deprecated use {@link argForImpl} instead
|
|
98
97
|
*/
|
|
99
98
|
export declare function argFor<Info>(args: readonly PotentiallyEmptyRArgument<Info & ParentInformation>[], ref: ClassArgRef | undefined): RNode<Info & ParentInformation> | undefined;
|
|
100
99
|
/**
|
|
101
100
|
* Reads the {@link ClassDeclaration} a call states, following the argument mapping its built-in declares.
|
|
102
101
|
* An argument that resolves to no literal contributes a {@link ClassDeclaration.byVariable|by-variable} name, or nothing.
|
|
103
102
|
*/
|
|
104
|
-
declare function classDeclarationOfImpl<Info>(config: ClassDeclarationConfig, args: readonly PotentiallyEmptyRArgument<Info & ParentInformation>[]): ClassDeclaration;
|
|
105
|
-
/** @deprecated use {@link ClassDeclarations.of} instead */
|
|
106
|
-
export declare function classDeclarationOf<Info>(config: ClassDeclarationConfig, args: readonly PotentiallyEmptyRArgument<Info & ParentInformation>[]): ClassDeclaration;
|
|
103
|
+
export declare function classDeclarationOfImpl<Info>(config: ClassDeclarationConfig, args: readonly PotentiallyEmptyRArgument<Info & ParentInformation>[]): ClassDeclaration;
|
|
107
104
|
/** One class the analysis saw declared, with the call that declared it. */
|
|
108
105
|
export interface DeclaredClass extends ClassDeclaration {
|
|
109
106
|
/** the id of the declaring call */
|
|
@@ -112,37 +109,18 @@ export interface DeclaredClass extends ClassDeclaration {
|
|
|
112
109
|
readonly name: string;
|
|
113
110
|
}
|
|
114
111
|
/** Every class the graph declares, keyed by name. A later declaration of the same name wins, as it would in R. */
|
|
115
|
-
declare function declaredClassesImpl(graph: DataflowGraph): Map<string, DeclaredClass>;
|
|
116
|
-
/** @deprecated use {@link
|
|
112
|
+
export declare function declaredClassesImpl(graph: DataflowGraph): Map<string, DeclaredClass>;
|
|
113
|
+
/** @deprecated use {@link declaredClassesImpl} instead */
|
|
117
114
|
export declare function declaredClasses(graph: DataflowGraph): Map<string, DeclaredClass>;
|
|
118
115
|
/**
|
|
119
116
|
* The transitive superclasses of `name` among `classes`, nearest first and each named once. A class the
|
|
120
117
|
* analysis never saw declared ends the chain, so what another package contributes is simply not in the answer.
|
|
121
118
|
*/
|
|
122
|
-
declare function superClassesOfImpl(name: string, classes: ReadonlyMap<string, ClassDeclaration>): string[];
|
|
123
|
-
/** @deprecated use {@link ClassDeclarations.superOf} instead */
|
|
124
|
-
export declare function superClassesOf(name: string, classes: ReadonlyMap<string, ClassDeclaration>): string[];
|
|
119
|
+
export declare function superClassesOfImpl(name: string, classes: ReadonlyMap<string, ClassDeclaration>): string[];
|
|
125
120
|
/**
|
|
126
121
|
* The {@link SigClassInfo} records the signature database stores for the classes an analysis found. A class
|
|
127
122
|
* the analysis declared carries no `package`; a referenced class `ownerOf` can place becomes a `foreign` record.
|
|
128
123
|
*/
|
|
129
|
-
declare function toSigClassesImpl(classes: ReadonlyMap<string, DeclaredClass>, ownerOf?: (name: string) => string | undefined): SigClassInfo[];
|
|
130
|
-
/** @deprecated use {@link
|
|
124
|
+
export declare function toSigClassesImpl(classes: ReadonlyMap<string, DeclaredClass>, ownerOf?: (name: string) => string | undefined): SigClassInfo[];
|
|
125
|
+
/** @deprecated use {@link toSigClassesImpl} instead */
|
|
131
126
|
export declare function toSigClasses(classes: ReadonlyMap<string, DeclaredClass>, ownerOf?: (name: string) => string | undefined): SigClassInfo[];
|
|
132
|
-
/** Utilities for the class declarations of an analysis. */
|
|
133
|
-
export declare const ClassDeclarations: {
|
|
134
|
-
readonly name: "ClassDeclarations";
|
|
135
|
-
/** The declaration a call states; see {@link classDeclarationOfImpl}. */
|
|
136
|
-
readonly of: typeof classDeclarationOfImpl;
|
|
137
|
-
/** Every class the graph declares, keyed by name; see {@link declaredClassesImpl}. */
|
|
138
|
-
readonly declared: typeof declaredClassesImpl;
|
|
139
|
-
/** The transitive superclasses of a declared class; see {@link superClassesOfImpl}. */
|
|
140
|
-
readonly superOf: typeof superClassesOfImpl;
|
|
141
|
-
/** The signature-database records for a set of declared classes; see {@link toSigClassesImpl}. */
|
|
142
|
-
readonly toSig: typeof toSigClassesImpl;
|
|
143
|
-
/** The argument a class-declaring built-in's config names; see {@link argForImpl}. */
|
|
144
|
-
readonly argFor: typeof argForImpl;
|
|
145
|
-
/** Whether the vertex is a call that declares a class; its {@link DataflowGraphVertexFunctionCall.classDecl} is then set. */
|
|
146
|
-
readonly isDeclaring: (this: void, vertex: DataflowGraphVertexInfo | undefined) => boolean;
|
|
147
|
-
};
|
|
148
|
-
export {};
|
|
@@ -4,18 +4,19 @@
|
|
|
4
4
|
* which argument means what is configured per built-in in {@link ClassDeclarationConfig}, not guessed.
|
|
5
5
|
*/
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
-
exports.
|
|
7
|
+
exports.argForImpl = argForImpl;
|
|
8
8
|
exports.argFor = argFor;
|
|
9
|
-
exports.
|
|
9
|
+
exports.classDeclarationOfImpl = classDeclarationOfImpl;
|
|
10
|
+
exports.declaredClassesImpl = declaredClassesImpl;
|
|
10
11
|
exports.declaredClasses = declaredClasses;
|
|
11
|
-
exports.
|
|
12
|
+
exports.superClassesOfImpl = superClassesOfImpl;
|
|
13
|
+
exports.toSigClassesImpl = toSigClassesImpl;
|
|
12
14
|
exports.toSigClasses = toSigClasses;
|
|
13
15
|
const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
14
16
|
const r_argument_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
15
17
|
const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
16
18
|
const r_symbol_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
|
|
17
19
|
const r_function_definition_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
18
|
-
const graph_1 = require("../graph/graph");
|
|
19
20
|
const edge_1 = require("../graph/edge");
|
|
20
21
|
const assert_1 = require("../../util/assert");
|
|
21
22
|
const objects_1 = require("../../util/objects");
|
|
@@ -51,10 +52,10 @@ function argForImpl(args, ref) {
|
|
|
51
52
|
* The argument `ref` names, by name when the call gives one and by position among the unnamed ones otherwise.
|
|
52
53
|
* Exported so `built-in-s-four.ts` can drop its own copy of this instead of hand-rolling it again; that file
|
|
53
54
|
* already imports {@link ClassArgRef} from here, so the reverse import would cycle.
|
|
54
|
-
* @deprecated use {@link
|
|
55
|
+
* @deprecated use {@link argForImpl} instead
|
|
55
56
|
*/
|
|
56
57
|
function argFor(args, ref) {
|
|
57
|
-
return
|
|
58
|
+
return argForImpl(args, ref);
|
|
58
59
|
}
|
|
59
60
|
/** The string a node states literally, `undefined` for anything that is not a literal (a variable, a call, ...). */
|
|
60
61
|
function literal(node) {
|
|
@@ -165,10 +166,6 @@ function classDeclarationOfImpl(config, args) {
|
|
|
165
166
|
byVariable
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
|
-
/** @deprecated use {@link ClassDeclarations.of} instead */
|
|
169
|
-
function classDeclarationOf(config, args) {
|
|
170
|
-
return exports.ClassDeclarations.of(config, args);
|
|
171
|
-
}
|
|
172
169
|
/** Every class the graph declares, keyed by name. A later declaration of the same name wins, as it would in R. */
|
|
173
170
|
function declaredClassesImpl(graph) {
|
|
174
171
|
const classes = new Map();
|
|
@@ -212,9 +209,9 @@ function declaredClassesImpl(graph) {
|
|
|
212
209
|
}
|
|
213
210
|
return classes;
|
|
214
211
|
}
|
|
215
|
-
/** @deprecated use {@link
|
|
212
|
+
/** @deprecated use {@link declaredClassesImpl} instead */
|
|
216
213
|
function declaredClasses(graph) {
|
|
217
|
-
return
|
|
214
|
+
return declaredClassesImpl(graph);
|
|
218
215
|
}
|
|
219
216
|
/** Variable name to the class its generator declares, for the `Cls <- R6Class(...)`/`Cls <- new_class(...)` bindings. */
|
|
220
217
|
function generatorVariables(graph, classes) {
|
|
@@ -228,7 +225,7 @@ function generatorVariables(graph, classes) {
|
|
|
228
225
|
if (lexeme === undefined) {
|
|
229
226
|
continue;
|
|
230
227
|
}
|
|
231
|
-
for (const [target, edge] of graph.
|
|
228
|
+
for (const [target, edge] of graph.edgesFrom(id)) {
|
|
232
229
|
const cls = byName.get(target);
|
|
233
230
|
if (cls !== undefined && edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedBy)) {
|
|
234
231
|
generators.set(lexeme, cls);
|
|
@@ -256,10 +253,6 @@ function superClassesOfImpl(name, classes) {
|
|
|
256
253
|
}
|
|
257
254
|
return chain;
|
|
258
255
|
}
|
|
259
|
-
/** @deprecated use {@link ClassDeclarations.superOf} instead */
|
|
260
|
-
function superClassesOf(name, classes) {
|
|
261
|
-
return exports.ClassDeclarations.superOf(name, classes);
|
|
262
|
-
}
|
|
263
256
|
/**
|
|
264
257
|
* The {@link SigClassInfo} records the signature database stores for the classes an analysis found. A class
|
|
265
258
|
* the analysis declared carries no `package`; a referenced class `ownerOf` can place becomes a `foreign` record.
|
|
@@ -292,26 +285,8 @@ function toSigClassesImpl(classes, ownerOf) {
|
|
|
292
285
|
}
|
|
293
286
|
return records;
|
|
294
287
|
}
|
|
295
|
-
/** @deprecated use {@link
|
|
288
|
+
/** @deprecated use {@link toSigClassesImpl} instead */
|
|
296
289
|
function toSigClasses(classes, ownerOf) {
|
|
297
|
-
return
|
|
290
|
+
return toSigClassesImpl(classes, ownerOf);
|
|
298
291
|
}
|
|
299
|
-
/** Utilities for the class declarations of an analysis. */
|
|
300
|
-
exports.ClassDeclarations = {
|
|
301
|
-
name: 'ClassDeclarations',
|
|
302
|
-
/** The declaration a call states; see {@link classDeclarationOfImpl}. */
|
|
303
|
-
of: classDeclarationOfImpl,
|
|
304
|
-
/** Every class the graph declares, keyed by name; see {@link declaredClassesImpl}. */
|
|
305
|
-
declared: declaredClassesImpl,
|
|
306
|
-
/** The transitive superclasses of a declared class; see {@link superClassesOfImpl}. */
|
|
307
|
-
superOf: superClassesOfImpl,
|
|
308
|
-
/** The signature-database records for a set of declared classes; see {@link toSigClassesImpl}. */
|
|
309
|
-
toSig: toSigClassesImpl,
|
|
310
|
-
/** The argument a class-declaring built-in's config names; see {@link argForImpl}. */
|
|
311
|
-
argFor: argForImpl,
|
|
312
|
-
/** Whether the vertex is a call that declares a class; its {@link DataflowGraphVertexFunctionCall.classDecl} is then set. */
|
|
313
|
-
isDeclaring(vertex) {
|
|
314
|
-
return vertex_1.FunctionCallVertex.is(vertex) && vertex.classDecl !== undefined;
|
|
315
|
-
}
|
|
316
|
-
};
|
|
317
292
|
//# sourceMappingURL=class-declaration.js.map
|
|
@@ -7,7 +7,7 @@ export interface ExceptionPoint {
|
|
|
7
7
|
}
|
|
8
8
|
/** The exceptions each function may raise, keyed by the id of its definition. */
|
|
9
9
|
export type ExceptionsByFunction = Record<NodeId, ExceptionPoint[]>;
|
|
10
|
-
/** What to ask for beyond the definition itself, see {@link
|
|
10
|
+
/** What to ask for beyond the definition itself, see {@link exceptionsOfFunction}. */
|
|
11
11
|
export interface FunctionExceptionsOptions {
|
|
12
12
|
/** seeds additional throwers, e.g. the result of an earlier call, so their callees are counted too */
|
|
13
13
|
readonly knownThrower?: ExceptionsByFunction;
|
|
@@ -15,19 +15,6 @@ export interface FunctionExceptionsOptions {
|
|
|
15
15
|
/**
|
|
16
16
|
* The `NodeId`s of functions that may throw exceptions when called by `id`, restricted to functions known by
|
|
17
17
|
* flowR. `knownThrower` seeds additional throwers, e.g. the result of an earlier call, counting its callees.
|
|
18
|
-
* @useInstead {@link
|
|
18
|
+
* @useInstead {@link FunctionSemantics.exceptions}
|
|
19
19
|
*/
|
|
20
|
-
declare function exceptionsOfFunction(this: void, id: NodeId, graph: CallGraph, { knownThrower }?: FunctionExceptionsOptions): ExceptionsByFunction;
|
|
21
|
-
/** What the functions of a program may raise, following the calls their bodies reach. */
|
|
22
|
-
export declare const FunctionExceptions: {
|
|
23
|
-
readonly name: "FunctionExceptions";
|
|
24
|
-
/** The exceptions a definition may raise; see {@link exceptionsOfFunction}. */
|
|
25
|
-
readonly of: typeof exceptionsOfFunction;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* The `NodeId`s of functions that may throw exceptions when called by `id`, restricted to functions known by
|
|
29
|
-
* flowR. `knownThrower` seeds additional throwers, e.g. the result of an earlier call, counting its callees.
|
|
30
|
-
* @deprecated use {@link FunctionExceptions.of} instead
|
|
31
|
-
*/
|
|
32
|
-
export declare function calculateExceptionsOfFunction(id: NodeId, graph: CallGraph, knownThrower?: ExceptionsByFunction): ExceptionsByFunction;
|
|
33
|
-
export {};
|
|
20
|
+
export declare function exceptionsOfFunction(this: void, id: NodeId, graph: CallGraph, { knownThrower }?: FunctionExceptionsOptions): ExceptionsByFunction;
|