@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
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LibrarySearchPath = exports.SetsEntry = exports.SetsEntryNamedBy = exports.
|
|
4
|
-
exports.PlotCreateConfig = exports.AttachSearchPath = exports.ImportSearchPath = exports.DetachSearchPath =
|
|
3
|
+
exports.LoaderSearchPath = exports.LibrarySearchPath = exports.SetsEntry = exports.SetsEntryNamedBy = exports.ReadsNumberFormat = exports.PrintDispatched = exports.ReadPrintingOptions = exports.WithrDevices = exports.PlotAddonConfig = exports.ReadsPlot = exports.BuildsPlot = exports.MayAddToPlot = exports.AddsToPlot = exports.NewPlot = exports.RGenerics = exports.InternalGenerics = exports.LinkToLastGgPlot = exports.RegexConvIn = exports.BasePrimitiveTopics = exports.PrimitivesPerTopic = exports.WithSig = exports.ModelFits = exports.OtherTransforms = exports.DataTableSetter = exports.Downloads = exports.CopiesFiles = exports.SetsAnyEnvVar = exports.DbPackages = exports.DbReadsWrites = exports.DbReads = exports.DbConnSig = exports.DbConnectSig = exports.TidyEvalPackages = exports.MagrittrPipePackages = exports.GgPlotAddons = exports.GraphicsPlotAddons = exports.PlotFunctionsWithAddParam = exports.GgPlotImplicitAddons = exports.InvisibleGgPlotAddons = exports.TinyPlotAddons = exports.PlotObjectCreate = exports.VisiblePlotCreate = exports.PlotCreate = exports.GraphicsPlotCreate = exports.TinyPlotCrate = exports.GgPlotCreate = exports.PlotFunctionOwners = exports.PlotFunctionPackages = exports.StackEnvBuiltins = exports.StackEnvKind = void 0;
|
|
4
|
+
exports.PlotCreateConfig = exports.AttachSearchPath = exports.ImportSearchPath = exports.DetachSearchPath = void 0;
|
|
5
5
|
exports.plotFunctionOwners = plotFunctionOwners;
|
|
6
6
|
exports.namespacePlotFunctions = namespacePlotFunctions;
|
|
7
7
|
exports.statedSignatureOf = statedSignatureOf;
|
|
8
8
|
exports.toRegex = toRegex;
|
|
9
|
-
exports.closesActiveDevice = closesActiveDevice;
|
|
10
9
|
exports.markGenerics = markGenerics;
|
|
11
10
|
exports.markPrimitives = markPrimitives;
|
|
12
|
-
exports.appendsToPlot = appendsToPlot;
|
|
13
11
|
const define_helpers_1 = require("./define-helpers");
|
|
14
12
|
const shared_signatures_1 = require("./shared-signatures");
|
|
15
|
-
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
16
13
|
const base_operators_1 = require("./base-operators");
|
|
17
|
-
const vertex_1 = require("../../graph/vertex");
|
|
18
|
-
const cascade_action_1 = require("../../../queries/catalog/call-context-query/cascade-action");
|
|
19
14
|
const identifier_1 = require("../identifier");
|
|
20
15
|
const built_in_props_1 = require("../built-in-props");
|
|
21
16
|
const r_base_packages_1 = require("../../../util/r-base-packages");
|
|
@@ -23,6 +18,8 @@ const r_base_primitives_generated_1 = require("../../../data/r-base-primitives.g
|
|
|
23
18
|
const r_base_packages_generated_1 = require("../../../data/r-base-packages.generated");
|
|
24
19
|
const built_in_kinds_1 = require("../built-in-kinds");
|
|
25
20
|
const ambient_state_name_1 = require("../ambient-state-name");
|
|
21
|
+
const group_generics_1 = require("../group-generics");
|
|
22
|
+
const ambient_effect_1 = require("../ambient-effect");
|
|
26
23
|
/** Which stack environment an env-returning/-transforming builtin denotes (see {@link StackEnvBuiltins}). */
|
|
27
24
|
var StackEnvKind;
|
|
28
25
|
(function (StackEnvKind) {
|
|
@@ -43,6 +40,8 @@ exports.StackEnvBuiltins = {
|
|
|
43
40
|
environment: StackEnvKind.Current,
|
|
44
41
|
'parent.env': StackEnvKind.Parent,
|
|
45
42
|
'parent.frame': StackEnvKind.CallerFrame,
|
|
43
|
+
/* `sys.frame(-1)` counts back from the current frame */
|
|
44
|
+
'sys.frame': StackEnvKind.CallerFrame,
|
|
46
45
|
'as.environment': StackEnvKind.Named,
|
|
47
46
|
/* `.env$x` reaches past the data mask */
|
|
48
47
|
'.env': StackEnvKind.Current,
|
|
@@ -53,12 +52,15 @@ exports.StackEnvBuiltins = {
|
|
|
53
52
|
/** The package exporting each plotting function flowR models, so {@link namespacePlotFunctions} can namespace it instead of leaving it bare (bare stays always-on, which is the conservative default for an unknown owner). */
|
|
54
53
|
exports.PlotFunctionPackages = {
|
|
55
54
|
DHARMa: ['plotSimulatedResiduals'],
|
|
55
|
+
emmeans: ['emmip'],
|
|
56
56
|
ape: ['tiplabels'],
|
|
57
57
|
car: ['densityPlot', 'qqPlot'],
|
|
58
|
-
|
|
58
|
+
corrplot: ['corrplot'],
|
|
59
|
+
cowplot: ['ggdraw', 'plot_grid', 'theme_map'],
|
|
59
60
|
fBasics: ['boxPlot', 'densityPlot', 'histPlot'],
|
|
60
61
|
factoextra: ['fviz_cluster', 'fviz_dend', 'fviz_mca', 'fviz_mca_biplot', 'fviz_mca_ind', 'fviz_mca_var', 'fviz_pca', 'fviz_pca_biplot', 'fviz_pca_ind', 'fviz_pca_var',
|
|
61
62
|
'fviz_screeplot'],
|
|
63
|
+
fields: ['image.plot'],
|
|
62
64
|
forecast: ['ggseasonplot'],
|
|
63
65
|
ggExtra: ['ggMarginal', 'removeGrid', 'removeGridX', 'removeGridY', 'rotateTextX'],
|
|
64
66
|
ggalt: ['geom_dumbbell', 'geom_encircle'],
|
|
@@ -99,8 +101,8 @@ exports.PlotFunctionPackages = {
|
|
|
99
101
|
'theme_light', 'theme_linedraw', 'theme_minimal', 'theme_replace', 'theme_sub_axis', 'theme_sub_axis_bottom', 'theme_sub_axis_left', 'theme_sub_axis_right',
|
|
100
102
|
'theme_sub_axis_top', 'theme_sub_axis_x', 'theme_sub_axis_y', 'theme_sub_legend', 'theme_sub_panel', 'theme_sub_plot', 'theme_sub_strip', 'theme_test', 'theme_update',
|
|
101
103
|
'theme_void', 'xlab', 'xlim', 'ylab', 'ylim'],
|
|
102
|
-
ggpubr: ['ggballoonplot', 'ggbarplot', 'ggdensity', 'ggdonutchart', 'ggdotchart', 'ggdotplot', 'ggecdf', 'ggerrorplot', 'gghistogram', 'ggline', 'ggmaplot', 'ggpaired', 'ggpie',
|
|
103
|
-
'ggqqplot', 'ggscatterhist', 'ggstripchart', 'ggviolin', 'gradient_color'],
|
|
104
|
+
ggpubr: ['ggarrange', 'ggballoonplot', 'ggbarplot', 'ggboxplot', 'ggdensity', 'ggdonutchart', 'ggdotchart', 'ggdotplot', 'ggecdf', 'ggerrorplot', 'gghistogram', 'ggline', 'ggmaplot', 'ggpaired', 'ggpie',
|
|
105
|
+
'ggqqplot', 'ggscatter', 'ggscatterhist', 'ggstripchart', 'ggviolin', 'gradient_color'],
|
|
104
106
|
ggthemes: ['scale_color_calc', 'scale_color_canva', 'scale_color_colorblind', 'scale_color_continuous_tableau', 'scale_color_economist', 'scale_color_excel',
|
|
105
107
|
'scale_color_excel_new', 'scale_color_few', 'scale_color_fivethirtyeight', 'scale_color_gdocs', 'scale_color_gradient2_tableau', 'scale_color_gradient_tableau',
|
|
106
108
|
'scale_color_hc', 'scale_color_pander', 'scale_color_ptol', 'scale_color_solarized', 'scale_color_stata', 'scale_color_tableau', 'scale_color_wsj', 'scale_colour_calc',
|
|
@@ -120,7 +122,7 @@ exports.PlotFunctionPackages = {
|
|
|
120
122
|
ggstatsplot: ['ggbarstats', 'ggbetweenstats', 'ggcoefstats', 'ggcorrmat', 'ggdotplotstats', 'gghistostats', 'ggpiestats', 'ggscatterstats', 'ggwithinstats', 'grouped_ggbarstats',
|
|
121
123
|
'grouped_ggbetweenstats', 'grouped_ggcorrmat', 'grouped_ggdotplotstats', 'grouped_gghistostats', 'grouped_ggpiestats', 'grouped_ggscatterstats',
|
|
122
124
|
'grouped_ggwithinstats'],
|
|
123
|
-
sjPlot: ['plot_frq', 'plot_grpfrq', 'plot_likert', 'plot_models', 'plot_residuals', 'plot_scatter', 'plot_stackfrq', 'plot_xtab'],
|
|
125
|
+
sjPlot: ['plot_frq', 'plot_grpfrq', 'plot_likert', 'plot_model', 'plot_models', 'plot_residuals', 'plot_scatter', 'plot_stackfrq', 'plot_xtab'],
|
|
124
126
|
EnhancedVolcano: ['EnhancedVolcano'],
|
|
125
127
|
qgraph: ['centralityPlot', 'clusteringPlot', 'qgraph'],
|
|
126
128
|
semPlot: ['semPaths'],
|
|
@@ -128,11 +130,12 @@ exports.PlotFunctionPackages = {
|
|
|
128
130
|
mirt: ['itemplot'],
|
|
129
131
|
gplots: ['bandplot', 'barplot2', 'boxplot2', 'bubbleplot', 'heatmap.2', 'lmplot2', 'overplot', 'plotCI', 'plotmeans', 'residplot', 'sinkplot', 'textplot'],
|
|
130
132
|
gridExtra: ['grid.arrange'],
|
|
131
|
-
lattice: ['bwplot', 'dotplot', 'histogram', 'splom', 'stripplot', 'trellis.device', 'xyplot'],
|
|
133
|
+
lattice: ['bwplot', 'dotplot', 'histogram', 'levelplot', 'splom', 'stripplot', 'trellis.device', 'xyplot'],
|
|
132
134
|
leaflet: ['leaflet'],
|
|
133
135
|
magick: ['image_draw', 'image_graph'],
|
|
134
136
|
maps: ['map'],
|
|
135
137
|
openintro: ['boxPlot', 'densityPlot', 'histPlot'],
|
|
138
|
+
patchwork: ['wrap_plots'],
|
|
136
139
|
pheatmap: ['pheatmap'],
|
|
137
140
|
jmcm: ['bootcurve', 'meanplot', 'regressogram'],
|
|
138
141
|
seqinr: ['dotPlot'],
|
|
@@ -180,7 +183,7 @@ exports.GgPlotCreate = ['ggplot', 'ggplotly', 'ggMarginal', 'ggcorrplot', 'ggsea
|
|
|
180
183
|
'plot_grpfrq', 'plot_likert', 'plot_models', 'plot_residuals', 'plot_scatter', 'plot_stackfrq', 'plot_xtab', 'EnhancedVolcano', 'centralityPlot',
|
|
181
184
|
'clusteringPlot'];
|
|
182
185
|
exports.TinyPlotCrate = ['tinyplot', 'plt'];
|
|
183
|
-
exports.GraphicsPlotCreate = ['plot', 'plot.new', 'xspline', 'map', 'curve', 'image', 'boxplot', 'dotchart', 'sunflowerplot', 'barplot', 'matplot', 'hist', 'smoothScatter',
|
|
186
|
+
exports.GraphicsPlotCreate = ['plot', 'plot.new', 'filled.contour', 'cdplot', 'xspline', 'map', 'curve', 'image', 'boxplot', 'dotchart', 'sunflowerplot', 'barplot', 'matplot', 'hist', 'smoothScatter',
|
|
184
187
|
'contour', 'persp', 'xyplot', 'stripplot', 'bwplot', 'dotPlot', 'dotplot', 'histPlot', 'densityPlot', 'qqplot', 'qqPlot', 'boxPlot', 'bxp',
|
|
185
188
|
'assocplot', 'mosaicplot', 'stripchart', 'fourfoldplot', 'plot.xy', 'plot.formula', 'plot.default', 'plot.design', 'stars', 'cotabplot',
|
|
186
189
|
'pheatmap', 'spineplot', 'regressogram', 'bootcurve', 'meanplot', 'vioplot', 'pairs', 'coplot', 'histogram', 'splom', 'leaflet', 'tm_shape',
|
|
@@ -193,8 +196,6 @@ exports.PlotCreate = exports.GraphicsPlotCreate.concat(exports.TinyPlotCrate, ex
|
|
|
193
196
|
exports.VisiblePlotCreate = new Set(['xyplot', 'stripplot', 'bwplot', 'dotplot', 'histogram', 'splom', 'leaflet', 'plot_ly', 'tm_shape', 'itemplot']);
|
|
194
197
|
/** the plot creators that return the plot to draw when printed, where base graphics draw at once and return something else */
|
|
195
198
|
exports.PlotObjectCreate = new Set([...exports.GgPlotCreate.filter(f => f !== 'grid.arrange'), 'last_plot', ...exports.VisiblePlotCreate, 'pheatmap']);
|
|
196
|
-
exports.GraphicDeviceOpen = ['pdf', 'jpeg', 'png', 'windows', 'postscript', 'xfig', 'bitmap', 'pictex', 'cairo_pdf', 'svg', 'bmp', 'tiff', 'X11', 'quartz', 'image_graph',
|
|
197
|
-
'image_draw', 'dev.new', 'trellis.device', 'raster_pdf', 'agg_png', 'agg_jpeg', 'agg_tiff', 'agg_ppm', 'agg_webp', 'agg_capture'];
|
|
198
199
|
exports.TinyPlotAddons = ['tinyplot_add', 'plt_add'];
|
|
199
200
|
/** the addons that change the theme of later plots and hand back the old one invisibly */
|
|
200
201
|
exports.InvisibleGgPlotAddons = ['theme_update', 'theme_replace'];
|
|
@@ -253,10 +254,9 @@ exports.GgPlotImplicitAddons = ['geom_count', 'geom_bin_2d', 'geom_spoke', 'geom
|
|
|
253
254
|
'scale_fill_gdocs', 'scale_color_hc', 'scale_color_gdocs', 'scale_color_canva', 'scale_color_gradient_tableau', 'scale_fill_solarized',
|
|
254
255
|
'scale_fill_continuous_tableau', 'scale_colour_wsj', 'gradient_color', 'ggsurvplot_add_all'];
|
|
255
256
|
exports.PlotFunctionsWithAddParam = new Set(['map', 'matplot', 'barplot', 'boxplot', 'curve', 'image', 'plotCI', 'bandplot', 'barplot2', 'bubbleplot']);
|
|
256
|
-
exports.GraphicsPlotAddons = ['points', 'abline', 'mtext', 'lines', 'text', 'legend', 'title', 'axis', 'polygon', 'polypath', 'pie', 'rect', 'segments', 'arrows', 'symbols',
|
|
257
|
+
exports.GraphicsPlotAddons = ['plot.window', 'points', 'abline', 'mtext', 'lines', 'text', 'legend', 'title', 'axis', 'polygon', 'polypath', 'pie', 'rect', 'segments', 'arrows', 'symbols',
|
|
257
258
|
'qqline', 'qqnorm', 'rasterImage', 'tiplabels', 'rug', 'grid', 'box', 'clip', 'matpoints', 'matlines'];
|
|
258
259
|
exports.GgPlotAddons = ['ggdraw', 'last_plot'];
|
|
259
|
-
exports.PlotAddons = exports.GraphicsPlotAddons.concat(exports.GgPlotImplicitAddons, ...exports.PlotFunctionsWithAddParam);
|
|
260
260
|
/** The packages exporting magrittr's `%>%`: the tidyverse and friends re-export the very same function. */
|
|
261
261
|
exports.MagrittrPipePackages = ["magrittr" /* PkgName.Magrittr */, "dplyr" /* PkgName.Dplyr */, "purrr" /* PkgName.Purrr */, "stringr" /* PkgName.Stringr */, "tibble" /* PkgName.Tibble */,
|
|
262
262
|
"tidyr" /* PkgName.TidyR */, "testthat" /* PkgName.Testthat */, "magick" /* PkgName.Magick */, "promises" /* PkgName.Promises */];
|
|
@@ -265,12 +265,12 @@ exports.TidyEvalPackages = ["rlang" /* PkgName.Rlang */, "dplyr" /* PkgName.Dply
|
|
|
265
265
|
/** the database a connection opens is a file: its tables are read and changed through the connection */
|
|
266
266
|
exports.DbConnectSig = (0, shared_signatures_1.sig)({ drv: shared_signatures_1.Forced.Value, dbname: shared_signatures_1.Forced.Resource, '...': shared_signatures_1.Forced.Value });
|
|
267
267
|
exports.DbConnSig = (0, shared_signatures_1.sig)({ conn: shared_signatures_1.Forced.Resource });
|
|
268
|
-
exports.DbReads = {
|
|
269
|
-
const DbReadsWrites = (sig) => [{
|
|
268
|
+
exports.DbReads = { ...ambient_effect_1.Ambient.files.reads, sig: exports.DbConnSig };
|
|
269
|
+
const DbReadsWrites = (sig) => [{ ...ambient_effect_1.Ambient.files.reads, sig }, { ...ambient_effect_1.Ambient.files.writes, sig }];
|
|
270
270
|
exports.DbReadsWrites = DbReadsWrites;
|
|
271
271
|
exports.DbPackages = ["DBI" /* PkgName.Dbi */, "RSQLite" /* PkgName.Rsqlite */, 'RPostgres', 'RMariaDB', 'odbc', 'pool'];
|
|
272
272
|
/** reads the files some arguments name and writes the ones its {@link ArgProp.Written} arguments name, like `file.copy` or `unzip` */
|
|
273
|
-
exports.SetsAnyEnvVar =
|
|
273
|
+
exports.SetsAnyEnvVar = { ...ambient_effect_1.Ambient.env.writes, member: { from: 'constant', keys: [ambient_state_name_1.UnknownKey] } };
|
|
274
274
|
exports.CopiesFiles = [built_in_props_1.SemanticCallTag.File, built_in_props_1.SemanticCallTag.Reads, built_in_props_1.SemanticCallTag.Writes];
|
|
275
275
|
/** reads what its URL (or remote object) arguments name from the network and writes the file its {@link ArgProp.Written} arguments name, like `download.file` */
|
|
276
276
|
exports.Downloads = [built_in_props_1.SemanticCallTag.Network, built_in_props_1.SemanticCallTag.File, built_in_props_1.SemanticCallTag.Reads, built_in_props_1.SemanticCallTag.Writes];
|
|
@@ -352,32 +352,18 @@ exports.RegexConvIn = /[-/\\^$*+?.()|[\]{}]/g;
|
|
|
352
352
|
function toRegex(n) {
|
|
353
353
|
return new RegExp(`^(${Array.from(new Set(n.map(identifier_1.Identifier.getName)), s => s.replaceAll(exports.RegexConvIn, String.raw `\$&`)).filter(s => s.length > 0).join('|')})$`);
|
|
354
354
|
}
|
|
355
|
-
|
|
356
|
-
/** `dev.off()` closes the active device, `dev.off(which)` maybe another one */
|
|
357
|
-
function closesActiveDevice(target) {
|
|
358
|
-
if (!vertex_1.DfgVertex.isFunctionCall(target)) {
|
|
359
|
-
return false;
|
|
360
|
-
}
|
|
361
|
-
const name = identifier_1.Identifier.getName(target.name);
|
|
362
|
-
return name === 'graphics.off' || (name === 'dev.off' && target.args.length === 0);
|
|
363
|
-
}
|
|
364
|
-
/** what ggplot's `last_plot()` is: the last ggplot created or added to */
|
|
355
|
+
/** what ggplot's `last_plot()` is: the last ggplot created or added to, which is no state of the device */
|
|
365
356
|
exports.LinkToLastGgPlot = {
|
|
366
357
|
type: 'link-to-last-call',
|
|
367
358
|
callName: toRegex(exports.GgPlotCreate.concat(exports.GgPlotImplicitAddons, exports.GgPlotAddons))
|
|
368
359
|
};
|
|
369
|
-
/** what closing or exporting a device links back to: the plot calls that filled it */
|
|
370
|
-
exports.LinkToLastPlot = {
|
|
371
|
-
type: 'link-to-last-call',
|
|
372
|
-
callName: toRegex(exports.GraphicDeviceOpen.concat(exports.PlotCreate, exports.PlotAddons, exports.GgPlotAddons, exports.TinyPlotAddons))
|
|
373
|
-
};
|
|
374
360
|
/** The internal generics: they dispatch in C rather than through `UseMethod`, so the list has to be written down. */
|
|
375
361
|
exports.InternalGenerics = new Set(['$', '[', '[[', '+', '-', '*', '/', '^', '%%', '%/%', '==', '!=', '<', '>', '<=', '>=', '&', '|', '!', 'c', 'length',
|
|
376
362
|
'dim', 'dimnames', 'names', 'max', 'min', 'range', 'sum', 'prod', 'abs', 'sqrt', 'exp', 'log', 'floor', 'ceiling',
|
|
377
363
|
'round', 'signif', 'trunc', 'cumsum', 'cumprod', 'cummax', 'cummin', 'as.character', 'as.integer', 'as.double',
|
|
378
364
|
'as.logical', 'as.complex', 'as.numeric', 'as.raw', 'is.na', 'is.nan', 'is.finite', 'is.infinite', 'is.matrix',
|
|
379
365
|
'is.numeric', 'cbind', 'rbind', 'anyNA', 'as.environment', 'as.call', 'is.array', 'log2', 'log10', 'rep', 'seq.int',
|
|
380
|
-
'xtfrm']);
|
|
366
|
+
'xtfrm', 'unlist', 'as.vector', 'lengths', 'nchar', 'rep_len', ...Object.values(group_generics_1.RGroupGenerics).flat()]);
|
|
381
367
|
/** Every name R dispatches on: the generated closure generics plus the {@link InternalGenerics} (no R body, so {@link fnInfoFromSignature} never sees them). */
|
|
382
368
|
exports.RGenerics = new Set([...r_base_packages_generated_1.RBasePackageStore.generics, ...exports.InternalGenerics]);
|
|
383
369
|
/** Label the names of every function definition that `has` with `prop`, splitting an entry that mixes them with names that do not. */
|
|
@@ -406,78 +392,56 @@ function markGenerics(definitions) {
|
|
|
406
392
|
function markPrimitives(definitions) {
|
|
407
393
|
return labelNames(definitions, built_in_props_1.CallProp.Primitive, n => r_base_primitives_generated_1.RBasePrimitives.has(identifier_1.Identifier.getName(n)) && (identifier_1.Identifier.getNamespace(n) ?? "base" /* PkgName.Base */) === "base" /* PkgName.Base */);
|
|
408
394
|
}
|
|
409
|
-
/**
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
return node?.type === type_1.RType.Logical && node.content === true;
|
|
423
|
-
}
|
|
424
|
-
/** Whether the call names a plot function with an `add` parameter ({@link PlotFunctionsWithAddParam}), and if so whether its `add` argument says that it appends to the existing plot, and `undefined` for any other function. */
|
|
425
|
-
function appendsToPlot(source, graph) {
|
|
426
|
-
const vertex = graph.getVertex(source);
|
|
427
|
-
return exports.PlotFunctionsWithAddParam.has(identifier_1.Identifier.getName(vertex.name)) ? addsToPlot(graph, vertex) : undefined;
|
|
428
|
-
}
|
|
395
|
+
/** what every base graphics plot reads */
|
|
396
|
+
const BasePlot = [ambient_effect_1.Ambient.par.reads, ambient_effect_1.Ambient.palette.reads];
|
|
397
|
+
/** a base graphics plot, see {@link AmbientStateName.plot} */
|
|
398
|
+
exports.NewPlot = [ambient_effect_1.Ambient.plot.resets, ...BasePlot];
|
|
399
|
+
exports.AddsToPlot = [ambient_effect_1.Ambient.plot.adds, ...BasePlot];
|
|
400
|
+
/** `curve(f, add = TRUE)` adds to the plot, `curve(f)` starts a new one */
|
|
401
|
+
exports.MayAddToPlot = [{ ...ambient_effect_1.Ambient.plot.adds, when: { flag: 'add' } }, { ...ambient_effect_1.Ambient.plot.resets, unless: { flag: 'add' } }, ...BasePlot];
|
|
402
|
+
/** a plot object (`ggplot`, `xyplot`), which draws once printed */
|
|
403
|
+
exports.BuildsPlot = ambient_effect_1.Ambient.plot.builds;
|
|
404
|
+
/** what building or adding to a ggplot does: the plot (the `+` the call is part of) becomes what `last_plot()` returns */
|
|
405
|
+
const BuildsGgPlot = [exports.BuildsPlot, ambient_effect_1.Ambient.lastPlot.writes];
|
|
406
|
+
/** what queries the coordinates of the plot (`strwidth`): it reads the plot and opens a device if none is open */
|
|
407
|
+
exports.ReadsPlot = [ambient_effect_1.Ambient.plot.reads, ...BasePlot];
|
|
429
408
|
/** what adding to a plot does */
|
|
430
409
|
exports.PlotAddonConfig = {
|
|
431
410
|
treatAsFnCall: {
|
|
432
411
|
'facet_grid': ['labeller']
|
|
433
412
|
},
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
ignoreIf: (source, graph) => appendsToPlot(source, graph) === false,
|
|
438
|
-
cascadeIf: (targetVertex, _, graph) => {
|
|
439
|
-
const target = targetVertex;
|
|
440
|
-
/* `add = TRUE` appends to an existing plot, so the chain carries on through it */
|
|
441
|
-
return identifier_1.Identifier.getName(target.name) && addsToPlot(graph, target, 11) ? cascade_action_1.CascadeAction.Continue : cascade_action_1.CascadeAction.Stop;
|
|
442
|
-
}
|
|
443
|
-
},
|
|
444
|
-
tags: [built_in_props_1.SemanticCallTag.Graphics], sig: (0, shared_signatures_1.sig)({ '...': built_in_props_1.ArgProp.Forced })
|
|
413
|
+
ambient: BuildsGgPlot,
|
|
414
|
+
tags: [built_in_props_1.SemanticCallTag.Graphics],
|
|
415
|
+
sig: (0, shared_signatures_1.sig)({ '...': built_in_props_1.ArgProp.Forced })
|
|
445
416
|
};
|
|
446
417
|
/** the devices withr opens for a scope, as `with_<device>` and `local_<device>` */
|
|
447
418
|
exports.WithrDevices = ['bmp', 'cairo_pdf', 'cairo_ps', 'jpeg', 'pdf', 'png', 'svg', 'tiff', 'xfig', 'postscript'];
|
|
448
|
-
exports.
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
exports.
|
|
453
|
-
/** the devices that are open, which `dev.cur()` and `dev.list()` report */
|
|
454
|
-
exports.ReadDevices = [ambient_state_name_1.AmbientStateName.device, ambient_state_name_1.AmbientStateName.otherDevicesOpenedBy].map(state => ({ type: "read-state" /* AmbientStateAccessType.ReadState */, state }));
|
|
419
|
+
exports.ReadPrintingOptions = { ...ambient_effect_1.Ambient.option.reads, member: { from: 'constant', keys: built_in_kinds_1.PrintingOptions } };
|
|
420
|
+
/* a method for the printed value may read any option, see {@link AmbientEffect#dispatchOn} */
|
|
421
|
+
exports.PrintDispatched = { ...exports.ReadPrintingOptions, dispatchOn: 0 };
|
|
422
|
+
/** what turning a number into text reads */
|
|
423
|
+
exports.ReadsNumberFormat = { ...ambient_effect_1.Ambient.option.reads, member: { from: 'constant', keys: built_in_kinds_1.NumberFormatOptions } };
|
|
455
424
|
/** sets the entries of an environment variable, a locale or a search path state that the call names with the parameter `name` of the given signature */
|
|
456
|
-
const SetsEntryNamedBy = (state, signature, name, rest = {}) => ({
|
|
425
|
+
const SetsEntryNamedBy = (state, signature, name, rest = {}) => ({ family: state, access: ambient_effect_1.AmbientVerb.Writes, member: { from: 'parameter', signature, names: [name], ...rest } });
|
|
457
426
|
exports.SetsEntryNamedBy = SetsEntryNamedBy;
|
|
458
|
-
const SetsEntry = (state, key) => ({
|
|
427
|
+
const SetsEntry = (state, key) => ({ family: state, access: ambient_effect_1.AmbientVerb.Writes, member: { from: 'constant', keys: [key] } });
|
|
459
428
|
exports.SetsEntry = SetsEntry;
|
|
460
429
|
/** `library(pkg)` and `library("pkg")` name the package, `library(pkg, character.only = TRUE)` looks the variable up */
|
|
461
430
|
exports.LibrarySearchPath = (0, exports.SetsEntryNamedBy)(ambient_state_name_1.KeyedState.SearchPath, ['package', 'help', 'pos', 'lib.loc', 'character.only'], 'package', { quoted: 'character.only' });
|
|
462
|
-
const LoaderSearchPath = (quoted) => ({
|
|
431
|
+
const LoaderSearchPath = (quoted) => ({ ...ambient_effect_1.Ambient.searchPath.writes, member: { from: 'unnamed', quoted } });
|
|
463
432
|
exports.LoaderSearchPath = LoaderSearchPath;
|
|
464
433
|
/* which entry a detach removes depends on every earlier attach, so it reads the search path as well */
|
|
465
434
|
exports.DetachSearchPath = [
|
|
466
|
-
(0, exports.SetsEntryNamedBy)(ambient_state_name_1.KeyedState.SearchPath, ['name', 'pos', 'unload', 'character.only', 'force'], 'name', { quoted: 'character.only' }),
|
|
467
|
-
|
|
435
|
+
{ ...(0, exports.SetsEntryNamedBy)(ambient_state_name_1.KeyedState.SearchPath, ['name', 'pos', 'unload', 'character.only', 'force'], 'name', { quoted: 'character.only' }), access: ambient_effect_1.AmbientVerb.Kills },
|
|
436
|
+
ambient_effect_1.Ambient.searchPath.reads
|
|
468
437
|
];
|
|
469
438
|
exports.ImportSearchPath = (0, exports.SetsEntryNamedBy)(ambient_state_name_1.KeyedState.SearchPath, ['.from', '...', '.into', '.library', '.directory', '.all', '.except', '.chdir', '.character_only', '.S3'], '.into', { fallback: 'imports' });
|
|
470
439
|
/** `attach(df)` is named `df`, `attach(df, name = "data")` is named `data` */
|
|
471
|
-
exports.AttachSearchPath = {
|
|
440
|
+
exports.AttachSearchPath = { ...ambient_effect_1.Ambient.searchPath.writes, member: { from: 'parameter', signature: ['what', 'pos', 'name', 'warn.conflicts'], names: ['name', 'what'], quoted: true } };
|
|
472
441
|
/** what creating a plot does; restated by the deprecated plot creators, which do the same but should not be used */
|
|
473
442
|
exports.PlotCreateConfig = {
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
callName: toRegex(exports.GraphicDeviceOpen.concat(exports.DeviceClose)),
|
|
478
|
-
/* a device closed in between is not the one the plot goes to (the graphics state knows which one it is) */
|
|
479
|
-
cascadeIf: (target) => closesActiveDevice(target) ? cascade_action_1.CascadeAction.Block : cascade_action_1.CascadeAction.Stop
|
|
480
|
-
},
|
|
481
|
-
tags: [built_in_props_1.SemanticCallTag.Graphics], sig: (0, shared_signatures_1.sig)({ '...': built_in_props_1.ArgProp.Forced })
|
|
443
|
+
ambient: BuildsGgPlot,
|
|
444
|
+
tags: [built_in_props_1.SemanticCallTag.Graphics],
|
|
445
|
+
sig: (0, shared_signatures_1.sig)({ '...': built_in_props_1.ArgProp.Forced })
|
|
482
446
|
};
|
|
483
447
|
//# sourceMappingURL=shared-configs.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { BuiltInProcName } from '../built-in-proc-name';
|
|
2
2
|
/** The built-in definitions of the stats package and statistical modeling packages. */
|
|
3
|
-
export declare const StatsDefinitions: [import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefineArgument>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.Apply>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.Default>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>];
|
|
3
|
+
export declare const StatsDefinitions: [import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefineArgument>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.Apply>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.Default>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>, import("../built-in-config").BuiltInFunctionDefinition<BuiltInProcName.DefaultReadAllArgs>];
|
|
@@ -6,6 +6,7 @@ const define_helpers_1 = require("./define-helpers");
|
|
|
6
6
|
const identifier_1 = require("../identifier");
|
|
7
7
|
const built_in_proc_name_1 = require("../built-in-proc-name");
|
|
8
8
|
const built_in_props_1 = require("../built-in-props");
|
|
9
|
+
const ambient_effect_1 = require("../ambient-effect");
|
|
9
10
|
/** The built-in definitions of the stats package and statistical modeling packages. */
|
|
10
11
|
exports.StatsDefinitions = [
|
|
11
12
|
(0, define_helpers_1.fn)((0, define_helpers_1.stats)('na.omit'), built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, { props: built_in_props_1.CallProp.Pure, tags: [built_in_props_1.SemanticCallTag.Transforms], sig: (0, shared_signatures_1.sig)({ object: shared_signatures_1.Forced.Value, '...': shared_signatures_1.Forced.Value }) }, define_helpers_1.Primitive),
|
|
@@ -23,10 +24,12 @@ exports.StatsDefinitions = [
|
|
|
23
24
|
(0, define_helpers_1.fn)((0, define_helpers_1.pkg)("Hmisc" /* PkgName.Hmisc */, 'getHdata'), built_in_proc_name_1.BuiltInProcName.DefineArgument, { superAssignment: true, sig: (0, shared_signatures_1.sig)({ '...': 0, list: built_in_props_1.ArgProp.Value, package: 0, 'lib.loc': 0, verbose: 0, envir: 0, overwrite: 0 }) }),
|
|
24
25
|
(0, define_helpers_1.fn)((0, define_helpers_1.pkg)("inferference" /* PkgName.Inferference */, 'interference'), built_in_proc_name_1.BuiltInProcName.Apply, { unquoteFunction: true, nameOfFunctionArgument: 'propensity_integrand', libFn: true }),
|
|
25
26
|
(0, define_helpers_1.fn)([...(0, define_helpers_1.stats)('setNames'), ...(0, define_helpers_1.pkg)("FastUtils" /* PkgName.FastUtils */, 'setNames')], built_in_proc_name_1.BuiltInProcName.Default, { props: built_in_props_1.CallProp.Pure, sig: (0, shared_signatures_1.sig)({ object: shared_signatures_1.Forced.Value, nm: shared_signatures_1.Forced.Value }) }),
|
|
27
|
+
(0, define_helpers_1.fn)((0, define_helpers_1.base)('scale'), built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, { props: built_in_props_1.CallProp.Pure, tags: [built_in_props_1.SemanticCallTag.Transforms] }),
|
|
28
|
+
(0, define_helpers_1.fn)((0, define_helpers_1.utils)('combn'), built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs),
|
|
26
29
|
(0, define_helpers_1.fn)((0, define_helpers_1.stats)('filter'), built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, { props: built_in_props_1.CallProp.Pure, sig: (0, shared_signatures_1.sig)({ x: shared_signatures_1.Forced.Value, filter: shared_signatures_1.Forced.Value, method: shared_signatures_1.Forced.Flag, sides: shared_signatures_1.Forced.Value, circular: shared_signatures_1.Forced.Flag, init: shared_signatures_1.Forced.Value }) }),
|
|
27
30
|
(0, define_helpers_1.fn)((0, define_helpers_1.stats)('step'), built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, { tags: [built_in_props_1.SemanticCallTag.Prints], sig: (0, shared_signatures_1.sig)({ object: shared_signatures_1.Forced.Value, scope: shared_signatures_1.Forced.Value, scale: shared_signatures_1.Forced.Value, direction: shared_signatures_1.Forced.Flag, trace: shared_signatures_1.Forced.Flag, steps: shared_signatures_1.Forced.Value, k: shared_signatures_1.Forced.Value }) }),
|
|
28
31
|
(0, define_helpers_1.fn)((0, define_helpers_1.stats)('median'), built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, { props: built_in_props_1.CallProp.Pure, sig: (0, shared_signatures_1.sig)({ x: shared_signatures_1.Forced.Value, 'na.rm': shared_signatures_1.Forced.Flag, '...': shared_signatures_1.Forced.Value }) }, { overrides: true, assumePrimitive: true }),
|
|
29
32
|
(0, define_helpers_1.fn)([...(0, define_helpers_1.stats)('princomp'), identifier_1.Identifier.from(['rmvnorm', 'mvtnorm']), identifier_1.Identifier.from(['randomForest', 'randomForest']), identifier_1.Identifier.from(['rvonmises', 'circular']),
|
|
30
|
-
...identifier_1.Identifier.fromAll('permute', ['permute', 'shuffle', 'shuffleSet']), ...(0, define_helpers_1.pkg)("dplyr" /* PkgName.Dplyr */, 'sample_n', 'sample_frac')], built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, { ambient:
|
|
33
|
+
...identifier_1.Identifier.fromAll('permute', ['permute', 'shuffle', 'shuffleSet']), ...(0, define_helpers_1.pkg)("dplyr" /* PkgName.Dplyr */, 'sample_n', 'sample_frac')], built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs, { ambient: ambient_effect_1.Ambient.rng.adds, tags: [built_in_props_1.SemanticCallTag.Random] }, define_helpers_1.Overrides),
|
|
31
34
|
];
|
|
32
35
|
//# sourceMappingURL=statistics.js.map
|
|
@@ -8,6 +8,9 @@ const environment_1 = require("./environment");
|
|
|
8
8
|
const json_1 = require("../../util/json");
|
|
9
9
|
const identifier_1 = require("./identifier");
|
|
10
10
|
const info_1 = require("../info");
|
|
11
|
+
function sameName(a, b) {
|
|
12
|
+
return a === undefined || b === undefined ? a === b : identifier_1.Identifier.view(a)?.equals(b) === true;
|
|
13
|
+
}
|
|
11
14
|
/**
|
|
12
15
|
* Compares two identifier references and reports differences.
|
|
13
16
|
*/
|
|
@@ -18,7 +21,7 @@ function diffIdentifierReferences(a, b, info) {
|
|
|
18
21
|
}
|
|
19
22
|
return;
|
|
20
23
|
}
|
|
21
|
-
if (a.name
|
|
24
|
+
if (!sameName(a.name, b.name)) {
|
|
22
25
|
info.report.addComment(`${info.position}Different identifier names: ${info.leftname}: ${a.name ? identifier_1.Identifier.toString(a.name) : 'undefined'} vs. ${info.rightname}: ${b.name ? identifier_1.Identifier.toString(b.name) : 'undefined'}`);
|
|
23
26
|
}
|
|
24
27
|
if (a.nodeId !== b.nodeId) {
|
|
@@ -39,7 +42,7 @@ function diffMemory(a, b, info) {
|
|
|
39
42
|
for (let i = 0; i < value.length; ++i) {
|
|
40
43
|
const aVal = sorted[i];
|
|
41
44
|
const bVal = sorted2[i];
|
|
42
|
-
if (aVal.name
|
|
45
|
+
if (!sameName(aVal.name, bVal.name)) {
|
|
43
46
|
info.report.addComment(`${info.position}Different names for ${key}. ${info.leftname}: ${aVal.name ? identifier_1.Identifier.toString(aVal.name) : 'undefined'} vs. ${info.rightname}: ${bVal.name ? identifier_1.Identifier.toString(bVal.name) : undefined}`);
|
|
44
47
|
}
|
|
45
48
|
if (aVal.nodeId !== bVal.nodeId) {
|
|
@@ -53,6 +53,8 @@ export declare class Environment implements IEnvironment {
|
|
|
53
53
|
n?: BrandedNamespace;
|
|
54
54
|
/** which search-path layer this env is (package/namespace/imports), if any */
|
|
55
55
|
t?: EnvType;
|
|
56
|
+
/** the load (`library()`) that attached this package layer, set for a package shipping data sets, which the load binds as lazy data */
|
|
57
|
+
d?: NodeId;
|
|
56
58
|
/** if created by a closure, the node id of that closure */
|
|
57
59
|
private c?;
|
|
58
60
|
parent: Environment;
|
|
@@ -64,6 +66,12 @@ export declare class Environment implements IEnvironment {
|
|
|
64
66
|
builtInEnv?: true;
|
|
65
67
|
/** set on the built-in environment once a definition below binds a promise or a text connection, which reads then look for */
|
|
66
68
|
forcing?: true;
|
|
69
|
+
/** set on the built-in environment once a call may have locked a binding or an environment, so binding a name may fail from then on */
|
|
70
|
+
locking?: true;
|
|
71
|
+
/** set on the built-in environment once the code binds a method of a built-in generic (`length.foo`), which a call of the generic looks for from then on */
|
|
72
|
+
methods?: true;
|
|
73
|
+
/** on the built-in environment, the calls binding names we cannot tell, each of which may be a method of any generic */
|
|
74
|
+
unknownMethodsAt?: NodeId[];
|
|
67
75
|
/** {@link memory} is shared with a clone; writing needs {@link writableMemory} to unshare it first */
|
|
68
76
|
private sharedMemory?;
|
|
69
77
|
/** {@link parent} is shared with the environment this was cloned from; writing through it needs {@link writableParent} */
|
|
@@ -117,6 +125,18 @@ export declare class Environment implements IEnvironment {
|
|
|
117
125
|
/** Only sound on an environment nobody else holds yet. */
|
|
118
126
|
private apply;
|
|
119
127
|
private defineInNamespace;
|
|
128
|
+
/**
|
|
129
|
+
* Forgets what an earlier analysis noted on this (built-in) environment, {@link forcing}, {@link locking}, {@link methods}, and {@link unknownMethodsAt}:
|
|
130
|
+
* the built-in environment is shared by every analysis of a context, but what these say holds for one program only.
|
|
131
|
+
*/
|
|
132
|
+
forgetProgramMarks(): void;
|
|
133
|
+
/**
|
|
134
|
+
* What this frame binds `name` to for a `<<-` from a function written in it: its own binding, or, for the emptied stand-in of a function
|
|
135
|
+
* around it, what the frame it stands in for held when the closure was created (see {@link superMemory}).
|
|
136
|
+
*/
|
|
137
|
+
boundForSuper(name: BrandedIdentifier): readonly IdentifierDefinition[] | undefined;
|
|
138
|
+
/** The binding a `<<-` from this frame replaces in a function frame around it, `undefined` if it binds globally, see {@link defineSuper}. */
|
|
139
|
+
superTargetIn(name: BrandedIdentifier): readonly IdentifierDefinition[] | undefined;
|
|
120
140
|
defineSuper(definition: IdentifierDefinition & {
|
|
121
141
|
name: Identifier;
|
|
122
142
|
}, append?: boolean): Environment;
|
|
@@ -43,6 +43,8 @@ class Environment {
|
|
|
43
43
|
n;
|
|
44
44
|
/** which search-path layer this env is (package/namespace/imports), if any */
|
|
45
45
|
t;
|
|
46
|
+
/** the load (`library()`) that attached this package layer, set for a package shipping data sets, which the load binds as lazy data */
|
|
47
|
+
d;
|
|
46
48
|
/** if created by a closure, the node id of that closure */
|
|
47
49
|
c;
|
|
48
50
|
parent;
|
|
@@ -54,6 +56,12 @@ class Environment {
|
|
|
54
56
|
builtInEnv;
|
|
55
57
|
/** set on the built-in environment once a definition below binds a promise or a text connection, which reads then look for */
|
|
56
58
|
forcing;
|
|
59
|
+
/** set on the built-in environment once a call may have locked a binding or an environment, so binding a name may fail from then on */
|
|
60
|
+
locking;
|
|
61
|
+
/** set on the built-in environment once the code binds a method of a built-in generic (`length.foo`), which a call of the generic looks for from then on */
|
|
62
|
+
methods;
|
|
63
|
+
/** on the built-in environment, the calls binding names we cannot tell, each of which may be a method of any generic */
|
|
64
|
+
unknownMethodsAt;
|
|
57
65
|
/** {@link memory} is shared with a clone; writing needs {@link writableMemory} to unshare it first */
|
|
58
66
|
sharedMemory;
|
|
59
67
|
/** {@link parent} is shared with the environment this was cloned from; writing through it needs {@link writableParent} */
|
|
@@ -169,6 +177,7 @@ class Environment {
|
|
|
169
177
|
env.c = this.c;
|
|
170
178
|
env.n = this.n;
|
|
171
179
|
env.t = this.t;
|
|
180
|
+
env.d = this.d;
|
|
172
181
|
env.globalEnv = this.globalEnv;
|
|
173
182
|
env.superMemory = this.superMemory;
|
|
174
183
|
return env;
|
|
@@ -239,6 +248,33 @@ class Environment {
|
|
|
239
248
|
current.parent = env.define(definition);
|
|
240
249
|
return newEnvironment;
|
|
241
250
|
}
|
|
251
|
+
/**
|
|
252
|
+
* Forgets what an earlier analysis noted on this (built-in) environment, {@link forcing}, {@link locking}, {@link methods}, and {@link unknownMethodsAt}:
|
|
253
|
+
* the built-in environment is shared by every analysis of a context, but what these say holds for one program only.
|
|
254
|
+
*/
|
|
255
|
+
forgetProgramMarks() {
|
|
256
|
+
this.forcing = undefined;
|
|
257
|
+
this.locking = undefined;
|
|
258
|
+
this.methods = undefined;
|
|
259
|
+
this.unknownMethodsAt = undefined;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* What this frame binds `name` to for a `<<-` from a function written in it: its own binding, or, for the emptied stand-in of a function
|
|
263
|
+
* around it, what the frame it stands in for held when the closure was created (see {@link superMemory}).
|
|
264
|
+
*/
|
|
265
|
+
boundForSuper(name) {
|
|
266
|
+
return this.lookup(name) ?? this.superMemory?.get(name);
|
|
267
|
+
}
|
|
268
|
+
/** The binding a `<<-` from this frame replaces in a function frame around it, `undefined` if it binds globally, see {@link defineSuper}. */
|
|
269
|
+
superTargetIn(name) {
|
|
270
|
+
for (let frame = this.parent; !frame.globalEnv && !frame.builtInEnv; frame = frame.parent) {
|
|
271
|
+
const bound = frame.boundForSuper(name);
|
|
272
|
+
if (bound !== undefined) {
|
|
273
|
+
return bound;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return undefined;
|
|
277
|
+
}
|
|
242
278
|
defineSuper(definition, append = false) {
|
|
243
279
|
const [name, ns] = identifier_1.Identifier.toArray(definition.name);
|
|
244
280
|
/* isolate the cds from the originating reference, see {@link define} */
|
|
@@ -250,11 +286,10 @@ class Environment {
|
|
|
250
286
|
newEnvironment.parent = newEnvironment.parent.defineInNamespace(definition, ns);
|
|
251
287
|
return newEnvironment;
|
|
252
288
|
}
|
|
253
|
-
|
|
254
|
-
const holdsName = (env) => env.lookup(name) !== undefined || env.superMemory?.has(name) === true;
|
|
289
|
+
const holdsName = (env) => env.boundForSuper(name) !== undefined;
|
|
255
290
|
let current = newEnvironment;
|
|
256
|
-
// `<<-` falls back to the global env, never an attached package below it
|
|
257
|
-
while (!holdsName(current) && !current.globalEnv) {
|
|
291
|
+
// `<<-` starts its search in the parent of the frame it runs in, a local binding of the same name is not its target, and falls back to the global env, never an attached package below it
|
|
292
|
+
while ((current === newEnvironment || !holdsName(current)) && !current.globalEnv) {
|
|
258
293
|
const last = current;
|
|
259
294
|
current.parent = current.parent.clone(false);
|
|
260
295
|
current = current.parent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BrandedIdentifier, Identifier } from './identifier';
|
|
2
2
|
/** R's group generics: a class claims every member of a group at once, with an `Ops.cls` (S3) or a `setMethod('Arith', ...)` (S4), so a call to any member may dispatch to a method named after the group. */
|
|
3
3
|
export declare const RGroupGenerics: {
|
|
4
4
|
readonly Arith: readonly ["+", "-", "*", "/", "^", "**", "%%", "%/%"];
|
|
@@ -23,7 +23,11 @@ export declare function s4GroupGenericsOf(name: BrandedIdentifier): readonly Bra
|
|
|
23
23
|
export declare function groupGenericMembers(name: BrandedIdentifier): readonly BrandedIdentifier[] | undefined;
|
|
24
24
|
/** The members an S3 `<group>.<class>` method answers for; S3 has no `Math2`, so `Math` covers both (see {@link MathS3}). */
|
|
25
25
|
export declare function s3GroupGenericMembers(name: BrandedIdentifier): readonly BrandedIdentifier[] | undefined;
|
|
26
|
+
/** the S3 groups, `Ops` standing for the three S4 groups it unites and `Math` covering `Math2` */
|
|
27
|
+
export declare const S3Groups: readonly ["Ops", "Math", "Summary", "Complex", "matrixOps"];
|
|
26
28
|
/** The S3 group generic whose `<group>.<class>` methods a call of `name` may dispatch to (`==` to `Ops`), `undefined` for a name in none. */
|
|
27
29
|
export declare function s3GroupGenericOf(name: BrandedIdentifier): BrandedIdentifier | undefined;
|
|
30
|
+
/** The names whose `<name>.<class>` methods a call of `name` may dispatch to: its own and that of the S3 group generic it is a member of. */
|
|
31
|
+
export declare function s3MethodPrefixesOf(name: Identifier): readonly BrandedIdentifier[];
|
|
28
32
|
/** Whether `name` is one of R's group generics (see {@link RGroupGenerics}). */
|
|
29
33
|
export declare function isGroupGeneric(name: BrandedIdentifier): name is RGroupGeneric;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.S4GroupOfMember = exports.RGroupGenerics = void 0;
|
|
3
|
+
exports.S3Groups = exports.S4GroupOfMember = exports.RGroupGenerics = void 0;
|
|
4
4
|
exports.groupGenericOf = groupGenericOf;
|
|
5
5
|
exports.s4GroupGenericsOf = s4GroupGenericsOf;
|
|
6
6
|
exports.groupGenericMembers = groupGenericMembers;
|
|
7
7
|
exports.s3GroupGenericMembers = s3GroupGenericMembers;
|
|
8
8
|
exports.s3GroupGenericOf = s3GroupGenericOf;
|
|
9
|
+
exports.s3MethodPrefixesOf = s3MethodPrefixesOf;
|
|
9
10
|
exports.isGroupGeneric = isGroupGeneric;
|
|
11
|
+
const identifier_1 = require("./identifier");
|
|
10
12
|
/** R's group generics, kept apart from the builtin configuration so anything may ask about them without pulling the whole dataflow setup in (the signature database does, and that would be a cycle). */
|
|
11
13
|
const Arith = ['+', '-', '*', '/', '^', '**', '%%', '%/%'];
|
|
12
14
|
const Compare = ['==', '!=', '<', '<=', '>', '>='];
|
|
@@ -48,12 +50,20 @@ function s3GroupGenericMembers(name) {
|
|
|
48
50
|
return name === 'Math' ? MathS3 : groupGenericMembers(name);
|
|
49
51
|
}
|
|
50
52
|
/** the S3 groups, `Ops` standing for the three S4 groups it unites and `Math` covering `Math2` */
|
|
51
|
-
|
|
52
|
-
const S3GroupOfMember = new Map(S3Groups.flatMap(group => (s3GroupGenericMembers(group) ?? []).map(member => [member, group])));
|
|
53
|
+
exports.S3Groups = ['Ops', 'Math', 'Summary', 'Complex', 'matrixOps'];
|
|
54
|
+
const S3GroupOfMember = new Map(exports.S3Groups.flatMap(group => (s3GroupGenericMembers(group) ?? []).map(member => [member, group])));
|
|
53
55
|
/** The S3 group generic whose `<group>.<class>` methods a call of `name` may dispatch to (`==` to `Ops`), `undefined` for a name in none. */
|
|
54
56
|
function s3GroupGenericOf(name) {
|
|
55
57
|
return S3GroupOfMember.get(name);
|
|
56
58
|
}
|
|
59
|
+
/** the primitives that are another one, whose methods alone they run (`as.numeric(x)` runs `as.double.<class>`) */
|
|
60
|
+
const DispatchesAs = new Map([['as.numeric', 'as.double']]);
|
|
61
|
+
/** The names whose `<name>.<class>` methods a call of `name` may dispatch to: its own and that of the S3 group generic it is a member of. */
|
|
62
|
+
function s3MethodPrefixesOf(name) {
|
|
63
|
+
const plain = DispatchesAs.get(identifier_1.Identifier.getName(name)) ?? identifier_1.Identifier.getName(name);
|
|
64
|
+
const group = s3GroupGenericOf(plain);
|
|
65
|
+
return group === undefined ? [plain] : [plain, group];
|
|
66
|
+
}
|
|
57
67
|
/** Whether `name` is one of R's group generics (see {@link RGroupGenerics}). */
|
|
58
68
|
function isGroupGeneric(name) {
|
|
59
69
|
return Object.hasOwn(exports.RGroupGenerics, name);
|