@eagleoutice/flowr 2.17.5 → 2.17.6
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 +13 -51
- package/abstract-interpretation/absint-inference.d.ts +4 -4
- package/abstract-interpretation/absint-inference.js +11 -11
- package/abstract-interpretation/abstract-semantics.d.ts +2 -1
- package/abstract-interpretation/branch-paths-interpreter.d.ts +1 -0
- package/abstract-interpretation/branch-paths-interpreter.js +60 -0
- package/abstract-interpretation/branch-paths.d.ts +60 -0
- package/abstract-interpretation/branch-paths.js +120 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +6 -1
- package/abstract-interpretation/data-frame/dataframe-semantics.js +60 -1
- package/abstract-interpretation/data-frame/semantics.js +4 -10
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
- package/cli/repl/core.js +51 -0
- package/control-flow/cfg-dead-code.js +12 -7
- package/data/packed.d.ts +10 -0
- package/data/packed.js +33 -0
- package/data/r-base-guards.generated.d.ts +7 -0
- package/data/r-base-guards.generated.js +12 -0
- package/data/r-datasets.generated.d.ts +4 -0
- package/data/r-datasets.generated.js +10 -0
- package/data/r-formals.generated.d.ts +4 -0
- package/data/r-formals.generated.js +10 -0
- package/data/r-group-method-guards.generated.d.ts +3 -0
- package/data/r-group-method-guards.generated.js +8 -0
- package/dataflow/environments/ambient-effect.d.ts +1000 -0
- package/dataflow/environments/ambient-effect.js +234 -0
- package/dataflow/environments/ambient-state-name.d.ts +45 -2
- package/dataflow/environments/ambient-state-name.js +61 -3
- package/dataflow/environments/apply-kill.js +11 -4
- package/dataflow/environments/built-in-kinds.d.ts +4 -46
- package/dataflow/environments/built-in-kinds.js +6 -2
- package/dataflow/environments/built-in-props.d.ts +16 -4
- package/dataflow/environments/built-in-props.js +11 -3
- package/dataflow/environments/built-in.d.ts +6 -1
- package/dataflow/environments/built-in.js +13 -36
- package/dataflow/environments/default-builtin-config/base-functions.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/base-functions.js +110 -52
- package/dataflow/environments/default-builtin-config/base-language.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/base-language.js +11 -8
- package/dataflow/environments/default-builtin-config/dev-tooling.js +1 -1
- package/dataflow/environments/default-builtin-config/file-io.js +6 -4
- package/dataflow/environments/default-builtin-config/graphics-devices.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/graphics-devices.js +24 -14
- package/dataflow/environments/default-builtin-config/guard-builders.d.ts +16 -0
- package/dataflow/environments/default-builtin-config/guard-builders.js +29 -0
- package/dataflow/environments/default-builtin-config/guards-primitive-lang.d.ts +15 -0
- package/dataflow/environments/default-builtin-config/guards-primitive-lang.js +228 -0
- package/dataflow/environments/default-builtin-config/guards-primitive-ops.d.ts +11 -0
- package/dataflow/environments/default-builtin-config/guards-primitive-ops.js +154 -0
- package/dataflow/environments/default-builtin-config/guards.d.ts +9 -0
- package/dataflow/environments/default-builtin-config/guards.js +211 -0
- package/dataflow/environments/default-builtin-config/index.d.ts +3 -3
- package/dataflow/environments/default-builtin-config/index.js +22 -7
- package/dataflow/environments/default-builtin-config/media-formats.js +4 -4
- package/dataflow/environments/default-builtin-config/package-spatial.js +2 -1
- package/dataflow/environments/default-builtin-config/package-tidyverse.js +3 -2
- package/dataflow/environments/default-builtin-config/package-utils.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/package-utils.js +5 -2
- package/dataflow/environments/default-builtin-config/parallel-execution.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/parallel-execution.js +3 -1
- package/dataflow/environments/default-builtin-config/r-formals.d.ts +13 -0
- package/dataflow/environments/default-builtin-config/r-formals.js +110 -0
- package/dataflow/environments/default-builtin-config/shared-configs.d.ts +138 -77
- package/dataflow/environments/default-builtin-config/shared-configs.js +52 -88
- package/dataflow/environments/default-builtin-config/statistics.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/statistics.js +4 -1
- package/dataflow/environments/diff.js +5 -2
- package/dataflow/environments/environment.d.ts +20 -0
- package/dataflow/environments/environment.js +39 -4
- package/dataflow/environments/group-generics.d.ts +5 -1
- package/dataflow/environments/group-generics.js +13 -3
- package/dataflow/environments/guard-facts.d.ts +169 -0
- package/dataflow/environments/guard-facts.js +26 -0
- package/dataflow/environments/identifier.d.ts +9 -1
- package/dataflow/environments/identifier.js +5 -0
- package/dataflow/environments/pkg-name.d.ts +1 -0
- package/dataflow/environments/query-fn-props.d.ts +3 -5
- package/dataflow/environments/query-fn-props.js +44 -21
- package/dataflow/environments/removal-marker.d.ts +2 -0
- package/dataflow/environments/removal-marker.js +5 -0
- package/dataflow/eval/resolve/resolve-strings.d.ts +2 -5
- package/dataflow/eval/resolve/resolve-strings.js +2 -2
- package/dataflow/extractor.js +24 -15
- package/dataflow/fn/condition-handlers.d.ts +2 -0
- package/dataflow/fn/condition-handlers.js +3 -1
- package/dataflow/fn/frame-reflection.d.ts +4 -2
- package/dataflow/fn/frame-reflection.js +16 -0
- package/dataflow/fn/function-props.js +15 -22
- package/dataflow/fn/function-semantics.d.ts +31 -1
- package/dataflow/fn/function-semantics.js +15 -0
- package/dataflow/fn/guards/built-in-guards.d.ts +112 -0
- package/dataflow/fn/guards/built-in-guards.js +199 -0
- package/dataflow/fn/guards/call-contracts.d.ts +97 -0
- package/dataflow/fn/guards/call-contracts.js +331 -0
- package/dataflow/fn/guards/condition-grouping.d.ts +20 -0
- package/dataflow/fn/guards/condition-grouping.js +135 -0
- package/dataflow/fn/guards/function-guards.d.ts +112 -0
- package/dataflow/fn/guards/function-guards.js +1549 -0
- package/dataflow/fn/guards/group-method-guards.d.ts +28 -0
- package/dataflow/fn/guards/group-method-guards.js +56 -0
- package/dataflow/fn/guards/guard-claims.d.ts +125 -0
- package/dataflow/fn/guards/guard-claims.js +678 -0
- package/dataflow/fn/guards/guard-knowledge.d.ts +41 -0
- package/dataflow/fn/guards/guard-knowledge.js +180 -0
- package/dataflow/fn/guards/guard-term-syntax.d.ts +9 -0
- package/dataflow/fn/guards/guard-term-syntax.js +210 -0
- package/dataflow/fn/guards/guard-term.d.ts +136 -0
- package/dataflow/fn/guards/guard-term.js +550 -0
- package/dataflow/fn/guards/stated-guards.d.ts +13 -0
- package/dataflow/fn/guards/stated-guards.js +35 -0
- package/dataflow/fn/higher-order-function.d.ts +2 -0
- package/dataflow/fn/higher-order-function.js +1 -0
- package/dataflow/fn/strict-function.d.ts +4 -0
- package/dataflow/fn/strict-function.js +66 -17
- package/dataflow/graph/ambient-access.d.ts +4 -1
- package/dataflow/graph/ambient-access.js +8 -2
- package/dataflow/graph/closure-frames.js +1 -1
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/df-helper.d.ts +6 -0
- package/dataflow/graph/df-helper.js +15 -0
- package/dataflow/graph/graph.d.ts +12 -6
- package/dataflow/graph/graph.js +21 -28
- package/dataflow/info.d.ts +2 -1
- package/dataflow/info.js +3 -1
- package/dataflow/internal/dispatch-linking.d.ts +3 -1
- package/dataflow/internal/dispatch-linking.js +1 -0
- package/dataflow/internal/linker.d.ts +2 -0
- package/dataflow/internal/linker.js +115 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +19 -57
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +471 -295
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +13 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +106 -19
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +24 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-deferred-env-ops.js +33 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +23 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +19 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +347 -46
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +110 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +9 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +28 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +16 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +37 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +19 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +55 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +11 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +8 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +64 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +160 -20
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +6 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +142 -4
- package/dataflow/internal/process/functions/call/quoted.d.ts +2 -0
- package/dataflow/internal/process/functions/call/quoted.js +23 -4
- package/dataflow/processor.d.ts +2 -0
- package/documentation/data/dfg/doc-ambient.d.ts +4 -0
- package/documentation/data/dfg/doc-ambient.js +74 -0
- package/documentation/wiki-dataflow-graph.js +10 -4
- package/documentation/wiki-linter.js +12 -0
- package/documentation/wiki-query.js +112 -1
- package/linter/linter-rules.d.ts +41 -1
- package/linter/linter-rules.js +5 -1
- package/linter/rules/call-contracts.d.ts +40 -0
- package/linter/rules/call-contracts.js +56 -0
- package/linter/rules/cmd-check/bogus-return.js +1 -1
- package/linter/rules/cmd-check/call-arguments.js +5 -6
- package/linter/rules/cmd-check/cmd-check-util.d.ts +0 -6
- package/linter/rules/cmd-check/cmd-check-util.js +0 -28
- package/linter/rules/cmd-check/package-hooks.js +2 -1
- package/linter/rules/cmd-check/s-three-method-consistency.js +1 -1
- package/linter/rules/interactive-functions.d.ts +30 -0
- package/linter/rules/interactive-functions.js +87 -0
- package/linter/rules/process-state-in-session.js +1 -1
- package/linter/rules/undefined-symbol-util.d.ts +1 -1
- package/linter/rules/undefined-symbol-util.js +8 -2
- package/linter/rules/undefined-symbol.js +18 -7
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +1 -1
- package/project/context/flowr-analyzer-dependencies-context.js +2 -1
- package/project/flowr-analyzer.d.ts +1 -0
- package/project/flowr-analyzer.js +5 -5
- package/project/sigdb/build.js +14 -4
- package/project/sigdb/decode.d.ts +3 -0
- package/project/sigdb/decode.js +10 -1
- package/project/sigdb/guarded-source.d.ts +6 -0
- package/project/sigdb/guarded-source.js +29 -0
- package/project/sigdb/reader.d.ts +5 -0
- package/project/sigdb/reader.js +27 -1
- package/project/sigdb/schema.d.ts +24 -2
- package/queries/catalog/absint-query/absint-query-format.d.ts +6 -3
- package/queries/catalog/absint-query/absint-query-format.js +57 -2
- package/queries/catalog/ambient-access-query/ambient-access-query-format.d.ts +6 -2
- package/queries/catalog/ambient-access-query/ambient-access-query-format.js +48 -3
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +5 -2
- package/queries/catalog/cluster-query/cluster-query-format.js +19 -2
- package/queries/catalog/code-clones-query/code-clones-query-format.d.ts +5 -2
- package/queries/catalog/code-clones-query/code-clones-query-format.js +34 -2
- package/queries/catalog/config-query/config-query-format.d.ts +5 -2
- package/queries/catalog/config-query/config-query-format.js +41 -2
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +5 -2
- package/queries/catalog/control-flow-query/control-flow-query-format.js +19 -2
- package/queries/catalog/data-columns-query/data-columns-query-format.d.ts +72 -0
- package/queries/catalog/data-columns-query/data-columns-query-format.js +215 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +5 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +38 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +5 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.js +18 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +8 -3
- package/queries/catalog/dependencies-query/function-info/other-path-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/tagged-functions.d.ts +11 -0
- package/queries/catalog/dependencies-query/function-info/tagged-functions.js +18 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +7 -2
- package/queries/catalog/dice-query/dice-query-format.js +34 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -4
- package/queries/catalog/does-call-query/does-call-query-format.js +114 -2
- package/queries/catalog/files-query/files-query-format.d.ts +5 -2
- package/queries/catalog/files-query/files-query-format.js +45 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +6 -3
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +303 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +8 -4
- package/queries/catalog/happens-before-query/happens-before-query-format.js +37 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +5 -2
- package/queries/catalog/id-map-query/id-map-query-format.js +18 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +5 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +29 -2
- package/queries/catalog/inspect-fn-guards-query/inspect-fn-guards-query-format.d.ts +37 -0
- package/queries/catalog/inspect-fn-guards-query/inspect-fn-guards-query-format.js +125 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +3 -2
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +54 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +6 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +23 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +6 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +15 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +8 -2
- package/queries/catalog/linter-query/linter-query-format.js +69 -4
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +7 -3
- package/queries/catalog/location-map-query/location-map-query-format.js +70 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +5 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +18 -2
- package/queries/catalog/origin-query/origin-query-format.d.ts +6 -3
- package/queries/catalog/origin-query/origin-query-format.js +29 -2
- package/queries/catalog/project-query/project-query-format.d.ts +6 -3
- package/queries/catalog/project-query/project-query-format.js +98 -2
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +6 -3
- package/queries/catalog/provenance-query/provenance-query-format.js +30 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +9 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +38 -2
- package/queries/catalog/search-query/search-query-format.d.ts +5 -2
- package/queries/catalog/search-query/search-query-format.js +23 -2
- package/queries/catalog/signature-query/signature-query-executor.js +3 -1
- package/queries/catalog/signature-query/signature-query-format.d.ts +3 -0
- package/queries/catalog/signature-query/signature-query-render.js +23 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +13 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +55 -2
- package/queries/catalog/taint-query/taint-query-format.d.ts +6 -3
- package/queries/catalog/taint-query/taint-query-format.js +28 -2
- package/queries/query.d.ts +48 -27
- package/queries/query.js +6 -4
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -0
- package/r-bridge/shell.js +7 -2
- package/reconstruct/reconstruct.js +18 -3
- package/slicing/static/removal-slice.js +4 -3
- package/slicing/static/slice-call.d.ts +11 -0
- package/slicing/static/slice-call.js +43 -2
- package/slicing/static/static-slicer.d.ts +2 -0
- package/slicing/static/static-slicer.js +137 -21
- package/slicing/static/visiting-queue.d.ts +2 -0
- package/slicing/static/visiting-queue.js +4 -0
- package/util/flowr-version.d.ts +1 -1
- package/util/flowr-version.js +2 -2
- package/util/objects.d.ts +2 -0
- package/util/objects.js +5 -0
- package/util/r-datasets.d.ts +27 -0
- package/util/r-datasets.js +45 -0
- package/util/text/playground-link.d.ts +2 -0
- package/util/text/playground-link.js +2 -0
- package/queries/catalog/absint-query/absint-query-executor.d.ts +0 -6
- package/queries/catalog/absint-query/absint-query-executor.js +0 -61
- package/queries/catalog/ambient-access-query/ambient-access-query-executor.d.ts +0 -6
- package/queries/catalog/ambient-access-query/ambient-access-query-executor.js +0 -50
- package/queries/catalog/cluster-query/cluster-query-executor.d.ts +0 -6
- package/queries/catalog/cluster-query/cluster-query-executor.js +0 -21
- package/queries/catalog/code-clones-query/code-clones-query-executor.d.ts +0 -6
- package/queries/catalog/code-clones-query/code-clones-query-executor.js +0 -38
- package/queries/catalog/config-query/config-query-executor.d.ts +0 -6
- package/queries/catalog/config-query/config-query-executor.js +0 -45
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +0 -6
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +0 -21
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.d.ts +0 -6
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +0 -40
- package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +0 -6
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +0 -20
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +0 -9
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +0 -18
- package/queries/catalog/dice-query/dice-query-executor.d.ts +0 -8
- package/queries/catalog/dice-query/dice-query-executor.js +0 -37
- package/queries/catalog/does-call-query/does-call-query-executor.d.ts +0 -6
- package/queries/catalog/does-call-query/does-call-query-executor.js +0 -116
- package/queries/catalog/files-query/files-query-executor.d.ts +0 -6
- package/queries/catalog/files-query/files-query-executor.js +0 -47
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +0 -6
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +0 -307
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +0 -7
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +0 -40
- package/queries/catalog/id-map-query/id-map-query-executor.d.ts +0 -6
- package/queries/catalog/id-map-query/id-map-query-executor.js +0 -20
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +0 -6
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +0 -31
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +0 -4
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +0 -58
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +0 -7
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +0 -25
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.d.ts +0 -7
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +0 -17
- package/queries/catalog/linter-query/linter-query-executor.d.ts +0 -9
- package/queries/catalog/linter-query/linter-query-executor.js +0 -62
- package/queries/catalog/location-map-query/location-map-query-executor.d.ts +0 -7
- package/queries/catalog/location-map-query/location-map-query-executor.js +0 -73
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +0 -6
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +0 -20
- package/queries/catalog/origin-query/origin-query-executor.d.ts +0 -6
- package/queries/catalog/origin-query/origin-query-executor.js +0 -31
- package/queries/catalog/project-query/project-query-executor.d.ts +0 -6
- package/queries/catalog/project-query/project-query-executor.js +0 -103
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +0 -6
- package/queries/catalog/provenance-query/provenance-query-executor.js +0 -33
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +0 -10
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +0 -40
- package/queries/catalog/search-query/search-query-executor.d.ts +0 -6
- package/queries/catalog/search-query/search-query-executor.js +0 -25
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +0 -14
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +0 -59
- package/queries/catalog/taint-query/taint-query-executor.d.ts +0 -7
- package/queries/catalog/taint-query/taint-query-executor.js +0 -30
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DataFrameShapeSemantics = exports.DataFrameFunctions = void 0;
|
|
4
4
|
const config_1 = require("../../config");
|
|
5
5
|
const built_in_proc_name_1 = require("../../dataflow/environments/built-in-proc-name");
|
|
6
|
+
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
7
|
+
const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
8
|
+
const r_datasets_1 = require("../../util/r-datasets");
|
|
6
9
|
const resolve_helper_1 = require("../../dataflow/environments/resolve-helper");
|
|
7
10
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
8
11
|
const make_argument_1 = require("../../dataflow/internal/process/functions/call/argument/make-argument");
|
|
@@ -23,6 +26,8 @@ const arguments_1 = require("./arguments");
|
|
|
23
26
|
const dataframe_domain_1 = require("./dataframe-domain");
|
|
24
27
|
const resolve_args_1 = require("./resolve-args");
|
|
25
28
|
const semantics_1 = require("./semantics");
|
|
29
|
+
/** see `scripts/gen-r-datasets.ts`, which keeps at most this many columns of a data set */
|
|
30
|
+
const MaxDatasetColumns = 200;
|
|
26
31
|
/**
|
|
27
32
|
* Represents the different types of data frames in R
|
|
28
33
|
*/
|
|
@@ -436,6 +441,23 @@ class DataFrameShapeSemantics extends value_semantics_1.ValueSemantics {
|
|
|
436
441
|
getAbstractOperations(id) {
|
|
437
442
|
return id !== undefined ? this.operations?.get(id) : undefined;
|
|
438
443
|
}
|
|
444
|
+
/**
|
|
445
|
+
* A symbol without a definition in the program that names a data set R finds as lazy data, such as `penguins`
|
|
446
|
+
* (from `datasets`), `starwars` once `dplyr` is loaded, or `dplyr::starwars`, has the shape of that data set.
|
|
447
|
+
*/
|
|
448
|
+
handleVariableUse(state, vertex, ctx) {
|
|
449
|
+
const node = ctx.getAstNode(vertex.id);
|
|
450
|
+
if (!r_symbol_1.RSymbol.is(node) || node.info.role === "call-name" /* RoleInParent.FunctionCallName */ || df_helper_1.Dataflow.origin(ctx.dfg, vertex.id)?.some(origin => origin.type === 0 /* OriginType.ReadVariableOrigin */)) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
const loaded = loadedPackages(ctx);
|
|
454
|
+
const shape = (0, r_datasets_1.datasetShape)(identifier_1.Identifier.getName(node.content), identifier_1.Identifier.getNamespace(node.content), pkg => loaded.has(String(pkg)) || ctx.context.deps.getDependency(pkg) !== undefined);
|
|
455
|
+
if (shape !== undefined) {
|
|
456
|
+
/* the table keeps at most the first columns of a very wide data set, which then are not all its names */
|
|
457
|
+
const colnames = shape.columns.length < MaxDatasetColumns ? [...shape.columns] : undefined;
|
|
458
|
+
applyDataFrameExpression(state, node, [{ operation: 'read', operand: undefined, source: `${shape.pkg}::${shape.name}`, colnames, rows: shape.rows }], ctx, this.operations);
|
|
459
|
+
}
|
|
460
|
+
}
|
|
439
461
|
/**
|
|
440
462
|
* Applies the abstract semantics defined for the called replacement function, or over-approximates
|
|
441
463
|
* the modified data frame operand of any other replacement function by the `unknown` abstract operation.
|
|
@@ -450,6 +472,32 @@ class DataFrameShapeSemantics extends value_semantics_1.ValueSemantics {
|
|
|
450
472
|
}
|
|
451
473
|
}
|
|
452
474
|
exports.DataFrameShapeSemantics = DataFrameShapeSemantics;
|
|
475
|
+
/** the packages the program names in a `library` call or the like, per dataflow graph */
|
|
476
|
+
const loadedOf = new WeakMap();
|
|
477
|
+
/** The packages the program loads by name, whose data sets R then finds as well (whether or not flowR knows anything else of them). */
|
|
478
|
+
function loadedPackages(ctx) {
|
|
479
|
+
let loaded = loadedOf.get(ctx.dfg);
|
|
480
|
+
if (loaded === undefined) {
|
|
481
|
+
const names = new Set();
|
|
482
|
+
for (const [, vertex] of ctx.dfg.vertices(true)) {
|
|
483
|
+
if (vertex_1.DfgVertex.isFunctionCall(vertex) && vertex_1.DfgVertex.hasOrigin(vertex, built_in_proc_name_1.BuiltInProcName.Library)) {
|
|
484
|
+
for (const arg of vertex.args) {
|
|
485
|
+
const value = arg === r_function_call_1.EmptyArgument ? undefined : ctx.getAstNode(arg.nodeId);
|
|
486
|
+
const named = r_argument_1.RArgument.is(value) ? value.value : value;
|
|
487
|
+
if (r_symbol_1.RSymbol.is(named)) {
|
|
488
|
+
names.add(String(identifier_1.Identifier.getName(named.content)));
|
|
489
|
+
}
|
|
490
|
+
else if (r_string_1.RString.is(named)) {
|
|
491
|
+
names.add(named.content.str);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
loaded = names;
|
|
497
|
+
loadedOf.set(ctx.dfg, loaded);
|
|
498
|
+
}
|
|
499
|
+
return loaded;
|
|
500
|
+
}
|
|
453
501
|
/**
|
|
454
502
|
* Creates the declarative definition of the abstract semantics of the data frame domain (see {@link DataFrameSemantics}).
|
|
455
503
|
* @param operations - An optional map to store the abstract data frame operations the expressions are mapped to
|
|
@@ -1145,6 +1193,11 @@ function mapDataFrameJoin(args, params, ctx, info) {
|
|
|
1145
1193
|
byCols = byValue;
|
|
1146
1194
|
}
|
|
1147
1195
|
}
|
|
1196
|
+
/* `by = c(k1 = "k2")` and `join_by(k1 == k2)` pair different columns, of which the result keeps only one of the two */
|
|
1197
|
+
const byNode = byArg === undefined || byArg === r_function_call_1.EmptyArgument ? undefined : byArg.value;
|
|
1198
|
+
if (r_function_call_1.RFunctionCall.isNamed(byNode) && (byNode.arguments.some(a => a !== r_function_call_1.EmptyArgument && a.name !== undefined) || identifier_1.Identifier.getName(byNode.functionName.content) === 'join_by')) {
|
|
1199
|
+
byCols = undefined;
|
|
1200
|
+
}
|
|
1148
1201
|
if (byCols?.some(isColName)) {
|
|
1149
1202
|
result.push({
|
|
1150
1203
|
operation: 'accessCols',
|
|
@@ -1239,6 +1292,10 @@ function maxAbs(indices) {
|
|
|
1239
1292
|
}
|
|
1240
1293
|
return max;
|
|
1241
1294
|
}
|
|
1295
|
+
/** whether the shape pins the number of columns down to exactly one */
|
|
1296
|
+
function isSingleColumn(shape) {
|
|
1297
|
+
return shape !== undefined && shape.cols.isValue() && shape.cols.lower === 1 && shape.cols.upper === 1;
|
|
1298
|
+
}
|
|
1242
1299
|
/**
|
|
1243
1300
|
* Maps an index-based access of the rows and columns of a data frame, such as `df[1, ]` or `df[["id"]]`, to abstract data frame operations.
|
|
1244
1301
|
*/
|
|
@@ -1292,10 +1349,12 @@ function mapDataFrameIndexColRowAccess(access, ctx, info) {
|
|
|
1292
1349
|
columns: columns?.every(isIndex) ? columns.map(Math.abs) : columns
|
|
1293
1350
|
});
|
|
1294
1351
|
}
|
|
1352
|
+
// A selection of rows from a data frame with exactly one column drops it to a vector, as `drop` defaults to `TRUE` there
|
|
1353
|
+
const singleColumn = args.length === 2 && rowArg !== undefined && r_argument_1.RArgument.isNotEmpty(rowArg) && (colArg === undefined || r_argument_1.RArgument.isEmpty(colArg)) && isSingleColumn(ctx.getAbstractValue(dataFrame));
|
|
1295
1354
|
// The data frame extent is dropped if the operator `[[` is used, the argument `drop` is true, or only one column is accessed
|
|
1296
1355
|
const dropExtent = access.operator === '[[' ? true :
|
|
1297
1356
|
args.length === 2 && typeof drop === 'boolean' ? drop :
|
|
1298
|
-
rowArg !== undefined && columns?.length === 1 && (isColName(columns[0]) || columns[0] > 0);
|
|
1357
|
+
singleColumn || rowArg !== undefined && columns?.length === 1 && (isColName(columns[0]) || columns[0] > 0);
|
|
1299
1358
|
if (!dropExtent) {
|
|
1300
1359
|
const rowSubset = rows === undefined || rows.every(row => row >= 0);
|
|
1301
1360
|
const colSubset = columns === undefined || columns.every(col => isColName(col) || col >= 0);
|
|
@@ -309,37 +309,30 @@ function applyJoinSemantics(value, { other, by }, options) {
|
|
|
309
309
|
}
|
|
310
310
|
return interval1.bottom();
|
|
311
311
|
};
|
|
312
|
-
// Creating the Cartesian product of two intervals by keeping the lower bound and multiplying the upper bounds
|
|
312
|
+
// Creating the Cartesian product of two intervals by keeping the lower bound and multiplying the upper bounds (but never below the upper bound of the rows kept anyway)
|
|
313
313
|
const productInterval = (lower, interval1, interval2) => {
|
|
314
314
|
if (lower.isValue() && interval1.isValue() && interval2.isValue()) {
|
|
315
|
-
return new positive_interval_domain_1.PosIntervalDomain([lower.lower, interval1.upper * interval2.upper]);
|
|
315
|
+
return new positive_interval_domain_1.PosIntervalDomain([lower.lower, Math.max(lower.upper, interval1.upper * interval2.upper)]);
|
|
316
316
|
}
|
|
317
317
|
return lower.bottom();
|
|
318
318
|
};
|
|
319
319
|
let duplicateCols; // columns that may be renamed due to occurring in both data frames
|
|
320
|
-
let productRows; // whether the resulting rows may be a Cartesian product of the rows of the data frames
|
|
321
320
|
if (options?.natural) {
|
|
322
|
-
const commonCols = value.colnames.intersect(other.colnames).upper();
|
|
323
321
|
duplicateCols = [];
|
|
324
|
-
productRows = commonCols !== lattice_1.Bottom && commonCols !== lattice_1.Top && commonCols.size === 0;
|
|
325
322
|
}
|
|
326
323
|
else if (by === undefined) {
|
|
327
324
|
duplicateCols = undefined;
|
|
328
|
-
productRows = true;
|
|
329
325
|
}
|
|
330
326
|
else if (by.length === 0) {
|
|
331
327
|
const commonCols = value.colnames.intersect(other.colnames).upper();
|
|
332
328
|
duplicateCols = commonCols !== lattice_1.Bottom ? commonCols !== lattice_1.Top ? [...commonCols] : undefined : [];
|
|
333
|
-
productRows = true;
|
|
334
329
|
}
|
|
335
330
|
else if (by.every(assert_1.isNotUndefined)) {
|
|
336
331
|
const remainingCols = value.colnames.intersect(other.colnames).subtract(setRange(by)).upper();
|
|
337
332
|
duplicateCols = remainingCols !== lattice_1.Bottom ? remainingCols !== lattice_1.Top ? [...remainingCols] : undefined : [];
|
|
338
|
-
productRows = false;
|
|
339
333
|
}
|
|
340
334
|
else {
|
|
341
335
|
duplicateCols = undefined;
|
|
342
|
-
productRows = false;
|
|
343
336
|
}
|
|
344
337
|
const joinType = options?.join ?? JoinType.Inner;
|
|
345
338
|
let rows;
|
|
@@ -362,7 +355,8 @@ function applyJoinSemantics(value, { other, by }, options) {
|
|
|
362
355
|
return value.create({
|
|
363
356
|
colnames: duplicateCols === undefined ? value.colnames.top() : duplicateCols.length > 0 ? value.colnames.union(other.colnames).subtract(setRange(duplicateCols)).widenUp() : value.colnames.union(other.colnames),
|
|
364
357
|
cols: by !== undefined ? value.cols.add(other.cols).subtract([by.length, by.length]) : mergeInterval(value.cols, other.cols),
|
|
365
|
-
|
|
358
|
+
// the keys need not be unique, so every row of one may match every row of the other
|
|
359
|
+
rows: productInterval(rows, value.rows, other.rows)
|
|
366
360
|
});
|
|
367
361
|
}
|
|
368
362
|
function applyIdentitySemantics(value, _args) {
|
|
@@ -11,7 +11,7 @@ type BoundedSetTop = typeof Top;
|
|
|
11
11
|
/** The type of the Bottom element of the bounded set domain as empty set */
|
|
12
12
|
type BoundedSetBottom = typeof SetBottom;
|
|
13
13
|
/** The type of the abstract values of the bounded set domain that are Top, Bottom, or actual values */
|
|
14
|
-
type BoundedSetLift<T> = BoundedSetValue<T> | BoundedSetTop | BoundedSetBottom;
|
|
14
|
+
export type BoundedSetLift<T> = BoundedSetValue<T> | BoundedSetTop | BoundedSetBottom;
|
|
15
15
|
/**
|
|
16
16
|
* The bounded set abstract domain as sets of possible values bounded by a `limit` indicating the maximum number of inferred values.
|
|
17
17
|
* The Bottom element is defined as the empty set and the Top element is defined as {@link Top} symbol.
|
package/cli/repl/core.js
CHANGED
|
@@ -72,6 +72,9 @@ const repl_signature_1 = require("./commands/repl-signature");
|
|
|
72
72
|
const strings_1 = require("../../util/text/strings");
|
|
73
73
|
const instrument_dataflow_count_1 = require("../../dataflow/instrument/instrument-dataflow-count");
|
|
74
74
|
const proc_1 = require("../../util/proc");
|
|
75
|
+
const default_builtin_config_1 = require("../../dataflow/environments/default-builtin-config");
|
|
76
|
+
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
77
|
+
const r_datasets_1 = require("../../util/r-datasets");
|
|
75
78
|
let _replCompleterKeywords = undefined;
|
|
76
79
|
function replCompleterKeywords() {
|
|
77
80
|
if (_replCompleterKeywords === undefined) {
|
|
@@ -134,9 +137,57 @@ function computeCompletions(line, config) {
|
|
|
134
137
|
return [preFiltered ? completions : (0, strings_1.matchByPrefixOrSubsequence)(completions, currentArg), currentArg, labels, hints?.filter(h => h.startsWith(currentArg))];
|
|
135
138
|
}
|
|
136
139
|
}
|
|
140
|
+
/* a plain R line, which runs in R: the name typed last completes to what R finds without the script binding it */
|
|
141
|
+
if (line.trim().length > 0 && !line.trimStart().startsWith(':')) {
|
|
142
|
+
return completeRName(line);
|
|
143
|
+
}
|
|
137
144
|
// if no command is already typed, just return all commands that match
|
|
138
145
|
return [replCompleterKeywords().filter(k => k.startsWith(line)).map(k => `${k} `), line];
|
|
139
146
|
}
|
|
147
|
+
/** the most names a plain R line is offered, the first ones in order */
|
|
148
|
+
const MaxRNames = 40;
|
|
149
|
+
/** the functions flowR knows and the data sets R always finds (`penguins`), by name, with the packages they come from */
|
|
150
|
+
let rNames;
|
|
151
|
+
/** whether the end of `line` is within a string or a comment, where nothing names an R object */
|
|
152
|
+
function endsInText(line) {
|
|
153
|
+
let quote;
|
|
154
|
+
for (let at = 0; at < line.length; at++) {
|
|
155
|
+
const c = line[at];
|
|
156
|
+
if (quote !== undefined) {
|
|
157
|
+
quote = c === '\\' ? (at++, quote) : c === quote ? undefined : quote;
|
|
158
|
+
}
|
|
159
|
+
else if (c === '"' || c === "'" || c === '`') {
|
|
160
|
+
quote = c;
|
|
161
|
+
}
|
|
162
|
+
else if (c === '#') {
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
return quote !== undefined;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Completes the name `line` ends in, as `Vi` to `View`, from {@link rNames}, only from the package named in
|
|
170
|
+
* `base::pri`. Nothing after `$` or `@`, which name a column or slot, within a number, a string, or a comment.
|
|
171
|
+
*/
|
|
172
|
+
function completeRName(line) {
|
|
173
|
+
rNames ??= (() => {
|
|
174
|
+
const found = new Map();
|
|
175
|
+
const add = (name, pkg) => found.set(name, [...found.get(name) ?? [], pkg]);
|
|
176
|
+
(0, r_datasets_1.datasetsOf)('datasets').forEach(name => add(String(name), 'datasets'));
|
|
177
|
+
default_builtin_config_1.DefaultBuiltinConfig.forEach(d => d.names.forEach(id => add(String(identifier_1.Identifier.getName(id)), String(identifier_1.Identifier.getNamespace(id) ?? ''))));
|
|
178
|
+
return found;
|
|
179
|
+
})();
|
|
180
|
+
const typed = /(?:([A-Za-z][\w.]*):::?)?((?<![\w.$@])[A-Za-z.][\w.]*)$/.exec(line);
|
|
181
|
+
if (typed === null || endsInText(line) || /^\.\d/.test(typed[2])) {
|
|
182
|
+
return [[], '', new Map()];
|
|
183
|
+
}
|
|
184
|
+
const [, pkg, fragment] = typed;
|
|
185
|
+
const known = rNames;
|
|
186
|
+
const found = [...known.keys()].filter(name => name.startsWith(fragment) && name !== fragment && (pkg === undefined || known.get(name)?.includes(pkg)))
|
|
187
|
+
.sort((a, b) => a.length - b.length || a.localeCompare(b)).slice(0, MaxRNames);
|
|
188
|
+
const what = (name) => known.get(name)?.includes('datasets') ? 'data set of datasets' : 'flowR built-in';
|
|
189
|
+
return [found, fragment, new Map(found.map(name => [name, `${name} ${what(name)}`]))];
|
|
190
|
+
}
|
|
140
191
|
/**
|
|
141
192
|
* Used by the repl to provide automatic completions for a given (partial) input line. Returns every matching
|
|
142
193
|
* option, so Tab shows the full menu and only completes when a single option remains (standard readline behavior).
|
|
@@ -23,7 +23,7 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
|
|
|
23
23
|
cachedStatements = new Map();
|
|
24
24
|
cachedSwitch = new Map();
|
|
25
25
|
caught = new Map();
|
|
26
|
-
|
|
26
|
+
raises;
|
|
27
27
|
getValue(id) {
|
|
28
28
|
const has = this.cachedConditions.get(id);
|
|
29
29
|
if (has) {
|
|
@@ -33,7 +33,8 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
|
|
|
33
33
|
return this.cachedConditions.get(id) ?? logic_1.Ternary.Maybe;
|
|
34
34
|
}
|
|
35
35
|
isUnconditionalJump(id) {
|
|
36
|
-
|
|
36
|
+
/* a `stop()` in a promise of `delayedAssign("x", stop())` does not run where it is written */
|
|
37
|
+
if (this.isCaught(id) || this.config.dfg.isQuoted(id)) {
|
|
37
38
|
return false;
|
|
38
39
|
}
|
|
39
40
|
const has = this.cachedStatements.get(id);
|
|
@@ -134,18 +135,19 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
|
|
|
134
135
|
this.cachedStatements.set(data.call.id, !arg);
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
/** whether the call is in an argument that may never be evaluated: `stop("x")` in `f(1, stop("x"))` only runs if `f` uses it */
|
|
138
|
+
/** whether the call is in an argument that may never be evaluated or is caught where it is forced: `stop("x")` in `f(1, stop("x"))` only runs if `f` uses it */
|
|
138
139
|
mayStayUnforced(id) {
|
|
139
140
|
const promised = this.config.dfg.getVertex(id)?.cds?.filter(cd => cd.byPromise === true) ?? [];
|
|
140
141
|
if (promised.length === 0) {
|
|
141
142
|
return false;
|
|
142
143
|
}
|
|
143
|
-
this.
|
|
144
|
-
return promised.some(cd => this.
|
|
144
|
+
this.raises ??= function_semantics_1.FunctionSemantics.promiseRaises(this.config.dfg, { ctx: this.config.ctx });
|
|
145
|
+
return promised.some(cd => this.raises?.(cd.id, id) !== true);
|
|
145
146
|
}
|
|
146
147
|
/**
|
|
147
148
|
* Whether an error raised here is caught before it can cut the flow, which is what `try` and `tryCatch`
|
|
148
|
-
* do to a `stop()` nested in them
|
|
149
|
+
* do to a `stop()` nested in them, or not raised here at all, as in `quote(stop())`, whose code an `eval` may
|
|
150
|
+
* run elsewhere (which links it in place). The enclosing calls come from the AST: in the control flow graph a
|
|
149
151
|
* construct is where its parts join again, so there is no edge that would delimit it on its own.
|
|
150
152
|
*/
|
|
151
153
|
isCaught(id) {
|
|
@@ -154,7 +156,10 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
|
|
|
154
156
|
return cached;
|
|
155
157
|
}
|
|
156
158
|
const result = model_1.RNode.iterateParents(this.getNormalizedAst(id), this.config.normalizedAst.idMap)
|
|
157
|
-
.some(node =>
|
|
159
|
+
.some(node => {
|
|
160
|
+
const vertex = this.getDataflowGraph(node.info.id);
|
|
161
|
+
return vertex_1.DfgVertex.hasOrigin(vertex, built_in_proc_name_1.BuiltInProcName.Try) || vertex_1.DfgVertex.hasOrigin(vertex, built_in_proc_name_1.BuiltInProcName.Quote);
|
|
162
|
+
});
|
|
158
163
|
this.caught.set(id, result);
|
|
159
164
|
return result;
|
|
160
165
|
}
|
package/data/packed.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value packed by `scripts/pack-generated.ts`: a table of nodes in which every distinct string, number, array and object is
|
|
3
|
+
* stored once, the last node being the value. An array node lists the indices of its elements, an object node starts with
|
|
4
|
+
* `-1 - i` for the node `i` listing its keys, followed by the indices of their values. Any other node is the plain value.
|
|
5
|
+
*/
|
|
6
|
+
export type Packed = readonly (string | number | boolean | null | readonly number[])[];
|
|
7
|
+
/** The value of a {@link Packed} table. Equal parts are shared, do not change them. */
|
|
8
|
+
export declare function unpack<T>(nodes: Packed): T;
|
|
9
|
+
/** Decompresses generated data on the first call. The data is the JSON of a {@link Packed} table (prefix `p`) or of the value (prefix `r`). */
|
|
10
|
+
export declare function unpacked<T>(data: string): () => T;
|
package/data/packed.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unpack = unpack;
|
|
4
|
+
exports.unpacked = unpacked;
|
|
5
|
+
const lz_string_1 = require("lz-string");
|
|
6
|
+
/** The value of a {@link Packed} table. Equal parts are shared, do not change them. */
|
|
7
|
+
function unpack(nodes) {
|
|
8
|
+
const done = [];
|
|
9
|
+
const at = (i) => i in done ? done[i] : (done[i] = build(nodes[i]));
|
|
10
|
+
const build = (node) => {
|
|
11
|
+
if (!Array.isArray(node)) {
|
|
12
|
+
return node;
|
|
13
|
+
}
|
|
14
|
+
else if (node.length === 0 || node[0] >= 0) {
|
|
15
|
+
return node.map(at);
|
|
16
|
+
}
|
|
17
|
+
const keys = at(-1 - node[0]);
|
|
18
|
+
return Object.fromEntries(keys.map((k, j) => [k, at(node[j + 1])]));
|
|
19
|
+
};
|
|
20
|
+
return at(nodes.length - 1);
|
|
21
|
+
}
|
|
22
|
+
/** Decompresses generated data on the first call. The data is the JSON of a {@link Packed} table (prefix `p`) or of the value (prefix `r`). */
|
|
23
|
+
function unpacked(data) {
|
|
24
|
+
let value;
|
|
25
|
+
return () => {
|
|
26
|
+
if (value === undefined) {
|
|
27
|
+
const json = JSON.parse((0, lz_string_1.decompressFromBase64)(data.slice(1)));
|
|
28
|
+
value = data[0] === 'p' ? unpack(json) : json;
|
|
29
|
+
}
|
|
30
|
+
return value;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=packed.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BaseGuards } from '../dataflow/fn/guards/built-in-guards';
|
|
2
|
+
/** What the closures of the base packages ask of their arguments, as `package -> name -> guards`. */
|
|
3
|
+
export declare const RBaseGuards: () => BaseGuards;
|
|
4
|
+
/** The R version {@link RBaseGuards} was read off. */
|
|
5
|
+
export declare const RBaseGuardsVersion: string;
|
|
6
|
+
/** The day {@link RBaseGuards} was read off, as an ISO date. */
|
|
7
|
+
export declare const RBaseGuardsDate: string;
|