@eagleoutice/flowr 2.12.2 → 2.13.0
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 +38 -91
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +3 -3
- package/abstract-interpretation/data-frame/dataframe-domain.js +14 -6
- package/abstract-interpretation/data-frame/semantics.js +12 -16
- package/abstract-interpretation/domains/abstract-domain.d.ts +46 -44
- package/abstract-interpretation/domains/abstract-domain.js +146 -6
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +16 -25
- package/abstract-interpretation/domains/bounded-set-domain.js +22 -69
- package/abstract-interpretation/domains/interval-domain.d.ts +27 -36
- package/abstract-interpretation/domains/interval-domain.js +111 -146
- package/abstract-interpretation/domains/lattice.d.ts +3 -3
- package/abstract-interpretation/domains/multi-value-state-domain.js +3 -3
- package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -19
- package/abstract-interpretation/domains/partial-product-domain.js +21 -54
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +8 -12
- package/abstract-interpretation/domains/positive-interval-domain.js +21 -50
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/product-domain.js +4 -4
- package/abstract-interpretation/domains/set-range-domain.d.ts +60 -56
- package/abstract-interpretation/domains/set-range-domain.js +141 -200
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +17 -23
- package/abstract-interpretation/domains/set-upper-bound-domain.js +59 -103
- package/abstract-interpretation/domains/singleton-domain.d.ts +15 -18
- package/abstract-interpretation/domains/singleton-domain.js +33 -72
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +12 -16
- package/abstract-interpretation/domains/state-abstract-domain.js +36 -126
- package/abstract-interpretation/domains/state-domain-like.d.ts +2 -2
- package/abstract-interpretation/domains/value-abstract-domain.d.ts +120 -0
- package/abstract-interpretation/domains/{satisfiable-domain.js → value-abstract-domain.js} +14 -2
- package/benchmark/slicer.d.ts +2 -2
- package/benchmark/slicer.js +6 -5
- package/cli/common/options.d.ts +10 -0
- package/cli/common/options.js +2 -0
- package/cli/common/scripts-info.d.ts +10 -0
- package/cli/flowr-main-options.d.ts +4 -0
- package/cli/flowr-main-options.js +5 -0
- package/cli/flowr.d.ts +5 -0
- package/cli/flowr.js +15 -7
- package/cli/repl/commands/repl-query.js +42 -20
- package/cli/repl/commands/repl-signature.js +2 -2
- package/cli/repl/core.d.ts +14 -5
- package/cli/repl/core.js +32 -17
- package/cli/repl/parser/slice-query-parser.d.ts +69 -8
- package/cli/repl/parser/slice-query-parser.js +82 -13
- package/cli/repl/path-input.d.ts +6 -0
- package/cli/repl/path-input.js +41 -0
- package/cli/repl/print-version.js +3 -5
- package/cli/slicer-app.d.ts +2 -0
- package/cli/slicer-app.js +2 -1
- package/config.d.ts +54 -6
- package/config.js +133 -12
- package/control-flow/control-flow-graph.d.ts +3 -2
- package/control-flow/control-flow-graph.js +34 -14
- package/control-flow/semantic-cfg-guided-visitor.d.ts +3 -0
- package/control-flow/semantic-cfg-guided-visitor.js +3 -0
- package/core/steps/all/static-slicing/10-reconstruct.d.ts +6 -0
- package/core/steps/all/static-slicing/10-reconstruct.js +3 -1
- package/data/r-base-packages.generated.d.ts +1 -1
- package/data/r-base-packages.generated.js +3 -3
- package/data/sigdb/sigdb.remote.json +53 -53
- package/dataflow/environments/built-in-proc-name.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.js +2 -0
- package/dataflow/environments/built-in.d.ts +2 -0
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +3 -5
- package/dataflow/environments/default-builtin-config.js +2 -2
- package/dataflow/environments/environment.d.ts +9 -0
- package/dataflow/environments/environment.js +28 -7
- package/dataflow/environments/identifier.d.ts +1 -2
- package/dataflow/environments/identifier.js +1 -5
- package/dataflow/extractor.js +1 -2
- package/dataflow/graph/dataflowgraph-builder.js +42 -3
- package/dataflow/graph/df-helper.d.ts +15 -0
- package/dataflow/graph/df-helper.js +20 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +57 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +12 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +233 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +5 -3
- package/documentation/data/faq/faqs.js +12 -1
- package/documentation/doc-readme.js +1 -1
- package/documentation/doc-util/doc-files.d.ts +2 -2
- package/documentation/doc-util/doc-files.js +4 -7
- package/documentation/doc-util/doc-query.d.ts +12 -9
- package/documentation/doc-util/doc-query.js +63 -28
- package/documentation/wiki-absint.js +1 -4
- package/documentation/wiki-analyzer.js +8 -3
- package/documentation/wiki-cfg.js +3 -2
- package/documentation/wiki-dataflow-graph.js +14 -4
- package/documentation/wiki-interface.js +29 -16
- package/documentation/wiki-mk/doc-maker.js +1 -1
- package/documentation/wiki-query.js +189 -30
- package/documentation/wiki-signature-database.d.ts +1 -1
- package/documentation/wiki-signature-database.js +53 -27
- package/linter/linter-output.d.ts +24 -0
- package/linter/linter-output.js +117 -0
- package/linter/linter-rules.d.ts +2 -4
- package/linter/rules/dataframe-access-validation.js +4 -4
- package/linter/rules/deprecated-functions.d.ts +2 -4
- package/linter/rules/deprecated-functions.js +58 -3
- package/linter/rules/undefined-symbol.js +18 -10
- package/linter/rules/unused-definition.js +24 -0
- package/package.json +5 -2
- package/project/context/flowr-analyzer-context.d.ts +59 -1
- package/project/context/flowr-analyzer-context.js +118 -3
- package/project/context/flowr-analyzer-dependencies-context.d.ts +32 -7
- package/project/context/flowr-analyzer-dependencies-context.js +33 -3
- package/project/context/flowr-analyzer-files-context.d.ts +32 -0
- package/project/context/flowr-analyzer-files-context.js +132 -14
- package/project/context/flowr-analyzer-loading-order-context.d.ts +6 -0
- package/project/context/flowr-analyzer-loading-order-context.js +20 -0
- package/project/context/flowr-analyzer-meta-context.d.ts +92 -10
- package/project/context/flowr-analyzer-meta-context.js +64 -23
- package/project/context/flowr-file.d.ts +7 -0
- package/project/context/flowr-file.js +7 -0
- package/project/context/project-kind.d.ts +22 -0
- package/project/context/project-kind.js +27 -0
- package/project/dependency-version-space.d.ts +166 -0
- package/project/dependency-version-space.js +564 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/flowr-analyzer.d.ts +4 -0
- package/project/flowr-analyzer.js +5 -0
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +7 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +5 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +739 -0
- package/project/plugins/file-plugins/files/flowr-rda-file.js +2407 -0
- package/project/plugins/file-plugins/files/flowr-rproject-file.d.ts +31 -0
- package/project/plugins/file-plugins/files/flowr-rproject-file.js +66 -0
- package/project/plugins/file-plugins/files/r-fun-tab.d.ts +828 -0
- package/project/plugins/file-plugins/files/r-fun-tab.js +1039 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-inst-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-license-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.d.ts +26 -0
- package/project/plugins/file-plugins/flowr-analyzer-rda-file-plugin.js +38 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.d.ts +17 -0
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +30 -0
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/flowr-analyzer-rproject-file-plugin.js +36 -0
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +3 -4
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +5 -6
- package/project/plugins/flowr-analyzer-plugin.js +5 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.d.ts +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.d.ts +14 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-implicit-sources-plugin.js +53 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-plugin.js +1 -1
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.d.ts +15 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-rprofile-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +18 -13
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.d.ts +13 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-rproject-file-plugin.js +32 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +8 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +70 -7
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.d.ts +18 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +62 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +4 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +5 -13
- package/project/plugins/package-version-plugins/package.d.ts +4 -1
- package/project/plugins/package-version-plugins/package.js +8 -5
- package/project/plugins/plugin-registry.d.ts +11 -3
- package/project/plugins/plugin-registry.js +24 -5
- package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.d.ts +51 -0
- package/project/plugins/project-discovery/flowr-analyzer-ignore-file-project-discovery-plugin.js +101 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +10 -5
- package/project/sigdb/build.js +12 -2
- package/project/sigdb/decode.d.ts +7 -0
- package/project/sigdb/decode.js +35 -4
- package/project/sigdb/decompress.d.ts +2 -0
- package/project/sigdb/decompress.js +5 -0
- package/project/sigdb/manifest.d.ts +5 -0
- package/project/sigdb/manifest.js +37 -6
- package/project/sigdb/reader.d.ts +82 -2
- package/project/sigdb/reader.js +226 -14
- package/project/sigdb/schema.d.ts +31 -5
- package/project/sigdb/schema.js +7 -3
- package/project/sigdb/{version.d.ts → sigdb-version.d.ts} +21 -1
- package/project/sigdb/sigdb-version.js +119 -0
- package/queries/catalog/absint-query/absint-query-format.d.ts +2 -0
- package/queries/catalog/absint-query/absint-query-format.js +2 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +30 -3
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -0
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/call-graph-query/call-graph-query-executor.js +3 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +6 -0
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -0
- package/queries/catalog/call-graph-query/expand-library-internals.d.ts +19 -0
- package/queries/catalog/call-graph-query/expand-library-internals.js +59 -0
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -0
- package/queries/catalog/cluster-query/cluster-query-format.js +1 -0
- package/queries/catalog/config-query/config-query-executor.js +15 -6
- package/queries/catalog/config-query/config-query-format.d.ts +18 -4
- package/queries/catalog/config-query/config-query-format.js +246 -96
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -0
- package/queries/catalog/control-flow-query/control-flow-query-format.js +1 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -0
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -0
- package/queries/catalog/dataflow-query/dataflow-query-format.js +1 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +13 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +117 -17
- package/queries/catalog/dice-query/dice-query-executor.js +6 -9
- package/queries/catalog/dice-query/dice-query-format.d.ts +4 -5
- package/queries/catalog/dice-query/dice-query-format.js +10 -6
- package/queries/catalog/does-call-query/does-call-query-executor.js +15 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +8 -0
- package/queries/catalog/does-call-query/does-call-query-format.js +4 -1
- package/queries/catalog/files-query/files-query-format.d.ts +2 -0
- package/queries/catalog/files-query/files-query-format.js +2 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.d.ts +6 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +277 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +119 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +331 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -0
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -0
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -0
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -0
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -0
- package/queries/catalog/linter-query/linter-query-executor.js +11 -2
- package/queries/catalog/linter-query/linter-query-format.d.ts +9 -4
- package/queries/catalog/linter-query/linter-query-format.js +44 -21
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +2 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -0
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
- package/queries/catalog/origin-query/origin-query-format.js +2 -0
- package/queries/catalog/project-query/project-query-executor.d.ts +0 -15
- package/queries/catalog/project-query/project-query-executor.js +19 -62
- package/queries/catalog/project-query/project-query-format.d.ts +7 -18
- package/queries/catalog/project-query/project-query-format.js +3 -18
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -0
- package/queries/catalog/search-query/search-query-format.d.ts +1 -0
- package/queries/catalog/search-query/search-query-format.js +1 -0
- package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -0
- package/queries/catalog/signature-query/signature-query-executor.js +267 -57
- package/queries/catalog/signature-query/signature-query-format.d.ts +37 -6
- package/queries/catalog/signature-query/signature-query-format.js +41 -5
- package/queries/catalog/signature-query/signature-query-render.js +48 -6
- package/queries/catalog/slice-query-options.d.ts +49 -0
- package/queries/catalog/slice-query-options.js +50 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -12
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -15
- package/queries/catalog/static-slice-query/static-slice-query-format.js +9 -10
- package/queries/query-print.js +3 -1
- package/queries/query.d.ts +63 -3
- package/queries/query.js +9 -2
- package/r-bridge/data/data.d.ts +16 -0
- package/r-bridge/data/data.js +20 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +2 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +19 -16
- package/reconstruct/reconstruct.d.ts +18 -1
- package/reconstruct/reconstruct.js +42 -19
- package/slicing/criterion/parse.d.ts +4 -0
- package/slicing/criterion/parse.js +4 -0
- package/slicing/static/slice-call.js +17 -9
- package/slicing/static/static-slicer.d.ts +1 -1
- package/slicing/static/static-slicer.js +5 -4
- package/util/files.d.ts +19 -1
- package/util/files.js +45 -3
- package/util/glob.d.ts +19 -0
- package/util/glob.js +67 -0
- package/util/log.d.ts +12 -0
- package/util/log.js +17 -1
- package/util/logic.d.ts +6 -0
- package/util/logic.js +31 -1
- package/util/mermaid/dfg.js +17 -12
- package/util/mermaid/mermaid.js +2 -2
- package/util/objects.d.ts +5 -0
- package/util/objects.js +8 -0
- package/util/r-version.d.ts +9 -1
- package/util/r-version.js +27 -2
- package/util/schema.d.ts +16 -0
- package/util/schema.js +89 -4
- package/util/text/ansi.d.ts +4 -0
- package/util/text/ansi.js +27 -3
- package/util/text/strings.d.ts +9 -0
- package/util/text/strings.js +29 -0
- package/util/version.js +79 -6
- package/abstract-interpretation/domains/satisfiable-domain.d.ts +0 -29
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +0 -22
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +0 -52
- package/project/sigdb/version.js +0 -55
|
@@ -0,0 +1,739 @@
|
|
|
1
|
+
import type { FileRole, FlowrFileProvider } from '../../../context/flowr-file';
|
|
2
|
+
import { FlowrFile } from '../../../context/flowr-file';
|
|
3
|
+
/**
|
|
4
|
+
* This decorates a text file and provides access to its content in the format of an {@link RObjectData}.
|
|
5
|
+
*/
|
|
6
|
+
export declare class FlowrRDAFile extends FlowrFile<RObjectData[]> {
|
|
7
|
+
private readonly wrapped;
|
|
8
|
+
private readonly shortcut;
|
|
9
|
+
/**
|
|
10
|
+
* Prefer the static {@link FlowrRDAFile.from} method to create instances of this class as it will not re-create if already a description file
|
|
11
|
+
* and handle role assignments.
|
|
12
|
+
* @param file - The underlying file provider whose path points to an RDA file.
|
|
13
|
+
* @param shortcut - When `true`, only top-level object names and types are
|
|
14
|
+
* collected during parsing. Payload data is skipped.
|
|
15
|
+
*/
|
|
16
|
+
constructor(file: FlowrFileProvider, shortcut?: boolean);
|
|
17
|
+
/**
|
|
18
|
+
* Loads and parses the content of the wrapped file as an RDA structure.
|
|
19
|
+
* @see {@link parse} for details on the parsing logic.
|
|
20
|
+
* @returns An array of top-level {@link RObjectData}s or `[{}]` when the
|
|
21
|
+
* file contains no R objects.
|
|
22
|
+
*/
|
|
23
|
+
protected loadContent(): RObjectData[];
|
|
24
|
+
/**
|
|
25
|
+
* RDA file lifter, this does not re-create if already an RDA file.
|
|
26
|
+
* @param file - A raw {@link FlowrFileProvider} or an existing {@link FlowrRDAFile}.
|
|
27
|
+
* @param role - Optional {@link FileRole} to assign before returning.
|
|
28
|
+
* @returns The (possibly newly created) {@link FlowrRDAFile}.
|
|
29
|
+
*/
|
|
30
|
+
static from(file: FlowrFileProvider | FlowrRDAFile, role?: FileRole): FlowrRDAFile;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Compression algorithm wrapping an RDA file.
|
|
34
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/connections.c#L2673 | R source: comp_type}
|
|
35
|
+
*/
|
|
36
|
+
export declare enum CompressionType {
|
|
37
|
+
CompGz = "COMP_GZ",
|
|
38
|
+
CompBz = "COMP_BZ",
|
|
39
|
+
CompXz = "COMP_XZ",
|
|
40
|
+
CompLzma = "COMP_LZMA",
|
|
41
|
+
CompZstd = "COMP_ZSTD",
|
|
42
|
+
CompUnknownOrNo = "COMP_UNKNOWN_OR_NO"
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* RDA file serialization format and version.
|
|
46
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/saveload.c#L61-L72 | R source: saveload.c}
|
|
47
|
+
*/
|
|
48
|
+
export declare enum SerializationTypeTag {
|
|
49
|
+
MagicEmpty = "R_MAGIC_EMPTY",
|
|
50
|
+
MagicCorrupt = "R_MAGIC_CORRUPT",
|
|
51
|
+
MagicAsciiV1 = "R_MAGIC_ASCII_V1",
|
|
52
|
+
MagicBinaryV1 = "R_MAGIC_BINARY_V1",
|
|
53
|
+
MagicXdrV1 = "R_MAGIC_XDR_V1",
|
|
54
|
+
MagicAsciiV2 = "R_MAGIC_ASCII_V2",
|
|
55
|
+
MagicBinaryV2 = "R_MAGIC_BINARY_V2",
|
|
56
|
+
MagicXdrV2 = "R_MAGIC_XDR_V2",
|
|
57
|
+
MagicAsciiV3 = "R_MAGIC_ASCII_V3",
|
|
58
|
+
MagicBinaryV3 = "R_MAGIC_BINARY_V3",
|
|
59
|
+
MagicXdrV3 = "R_MAGIC_XDR_V3",
|
|
60
|
+
MagicMaybeTooNew = "R_MAGIC_MAYBE_TOONEW"
|
|
61
|
+
}
|
|
62
|
+
type SerializationTypes = SerializationTypeTag | number;
|
|
63
|
+
type RObject = RValues.NilValue | RObjectData;
|
|
64
|
+
type Real = number | RValues.NilValue | RValues.NaReal | RValues.NaN | RValues.PosInf | RValues.NegInf;
|
|
65
|
+
type Complex = {
|
|
66
|
+
r: Real;
|
|
67
|
+
i: Real;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Structured representation of a deserialized R SEXP node.
|
|
71
|
+
*
|
|
72
|
+
* Not all fields are populated on every instance. If a field is populated depends on the {@link SexpType}.
|
|
73
|
+
*/
|
|
74
|
+
export interface RObjectData {
|
|
75
|
+
name?: string;
|
|
76
|
+
type?: SexpType;
|
|
77
|
+
levels?: number;
|
|
78
|
+
object?: boolean;
|
|
79
|
+
hasAttribute?: boolean;
|
|
80
|
+
attributes?: RObjectData[];
|
|
81
|
+
hasTag?: boolean;
|
|
82
|
+
tag?: RObject;
|
|
83
|
+
value?: RObject | RObject[] | RValues | number | (number | RValues | Complex | Real)[] | string | (string | RValues)[] | null[];
|
|
84
|
+
frame?: RObject;
|
|
85
|
+
_isObject?: boolean;
|
|
86
|
+
_isLocked?: boolean;
|
|
87
|
+
car?: RObject;
|
|
88
|
+
cdr?: RObject;
|
|
89
|
+
enClos?: RObject;
|
|
90
|
+
address?: object | null;
|
|
91
|
+
protected?: RObject;
|
|
92
|
+
cloEnv?: RValues;
|
|
93
|
+
prEnv?: RValues;
|
|
94
|
+
key?: unknown;
|
|
95
|
+
finalizer?: unknown;
|
|
96
|
+
next?: unknown;
|
|
97
|
+
gp?: number;
|
|
98
|
+
hashTab?: unknown;
|
|
99
|
+
offset?: number;
|
|
100
|
+
altRep?: boolean;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Numeric identifiers for R SEXP types.
|
|
104
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/include/Rinternals.h#L111-L144 | R source: SEXP}
|
|
105
|
+
* @see {@link http://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L681-L711 | R source: SEXP}
|
|
106
|
+
*/
|
|
107
|
+
export declare enum SexpType {
|
|
108
|
+
NilSxp = 0,
|
|
109
|
+
SymSxp = 1,
|
|
110
|
+
ListSxp = 2,
|
|
111
|
+
CloSxp = 3,
|
|
112
|
+
EnvSxp = 4,
|
|
113
|
+
PromSxp = 5,
|
|
114
|
+
LangSxp = 6,
|
|
115
|
+
SpecialSxp = 7,
|
|
116
|
+
BuiltInSxp = 8,
|
|
117
|
+
CharSxp = 9,
|
|
118
|
+
LglSxp = 10,
|
|
119
|
+
IntSxp = 13,
|
|
120
|
+
RealSxp = 14,
|
|
121
|
+
CplxSxp = 15,
|
|
122
|
+
StrSxp = 16,
|
|
123
|
+
DotSxp = 17,
|
|
124
|
+
AnySxp = 18,
|
|
125
|
+
VecSxp = 19,
|
|
126
|
+
ExprSxp = 20,
|
|
127
|
+
BcodesSxp = 21,
|
|
128
|
+
ExtPtrSxp = 22,
|
|
129
|
+
WeakRefSxp = 23,
|
|
130
|
+
RawSxp = 24,
|
|
131
|
+
ObjSxp = 25,
|
|
132
|
+
NewSxp = 30,
|
|
133
|
+
FreeSxp = 31,
|
|
134
|
+
FunSxp = 99,
|
|
135
|
+
RefSxp = 255,
|
|
136
|
+
NilValueSxp = 254,
|
|
137
|
+
GlobalEnvSxp = 253,
|
|
138
|
+
UnboundValueSxp = 252,
|
|
139
|
+
MissingArgSxp = 251,
|
|
140
|
+
BaseNamespaceSxp = 250,
|
|
141
|
+
NamespaceSxp = 249,
|
|
142
|
+
PackageSxp = 248,
|
|
143
|
+
PersistSxp = 247,
|
|
144
|
+
ClassRefSxp = 246,
|
|
145
|
+
GenericRefSxp = 245,
|
|
146
|
+
BcRepDef = 244,
|
|
147
|
+
BcRepRef = 243,
|
|
148
|
+
EmptyEnvSxp = 242,
|
|
149
|
+
BaseEnvSxp = 241,
|
|
150
|
+
AltLangSxp = 240,
|
|
151
|
+
AttrListSxp = 239,
|
|
152
|
+
AltRepSxp = 238
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Special values used internally by R serialization.
|
|
156
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/include/Rinternals.h#L401-L471 | R source: RValues}
|
|
157
|
+
*/
|
|
158
|
+
declare enum RValues {
|
|
159
|
+
NilValue = "NIL",
|
|
160
|
+
EmptyEnv = "EMPTY_ENV",
|
|
161
|
+
BaseEnv = "BASE_ENV",
|
|
162
|
+
GlobalEnv = "GLOBAL_ENV",
|
|
163
|
+
UnboundValue = "UNBOUND_VALUE",
|
|
164
|
+
MissingArg = "MISSING_ARG",
|
|
165
|
+
BaseNamespace = "BASE_NAMESPACE",
|
|
166
|
+
ClassSymbol = "CLASS",
|
|
167
|
+
NaString = "NA_character_",
|
|
168
|
+
NaInteger = "NA_integer_",
|
|
169
|
+
NaReal = "NA_real_",
|
|
170
|
+
NaComplex = "NA_complex_",
|
|
171
|
+
NaN = "NaN",
|
|
172
|
+
PosInf = "Pos_Inf",
|
|
173
|
+
NegInf = "Neg_inf"
|
|
174
|
+
}
|
|
175
|
+
export declare enum SerializationFormat {
|
|
176
|
+
Xdr = "XDR",
|
|
177
|
+
Ascii = "ASCII",
|
|
178
|
+
Binary = "BINARY"
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Parser for RDA files.
|
|
182
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c | R source: serialize.c}
|
|
183
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/saveload.c | R source: saveload.c}
|
|
184
|
+
*/
|
|
185
|
+
export declare class RDAParser {
|
|
186
|
+
private readonly file;
|
|
187
|
+
private readonly shortcut;
|
|
188
|
+
private buffer;
|
|
189
|
+
private currentDepth;
|
|
190
|
+
private static readonly INITIAL_DEPTH;
|
|
191
|
+
private lastName;
|
|
192
|
+
private setLastName;
|
|
193
|
+
private offset;
|
|
194
|
+
private static readonly R_CODE_SET_MAX;
|
|
195
|
+
private RWeakRefs;
|
|
196
|
+
private static readonly CHUNK_SIZE;
|
|
197
|
+
private static readonly SIZE_OF_DOUBLE;
|
|
198
|
+
private static readonly WORD_SIZE;
|
|
199
|
+
private static readonly MAX_VECTOR_LENGTH;
|
|
200
|
+
private format;
|
|
201
|
+
private readonly refTable;
|
|
202
|
+
private Registry;
|
|
203
|
+
private opinfo;
|
|
204
|
+
constructor(file: FlowrFileProvider, shortcut?: boolean);
|
|
205
|
+
/**
|
|
206
|
+
* Parses an RDA file.
|
|
207
|
+
*
|
|
208
|
+
* The file is decompressed, deserialized and converted into a flattened
|
|
209
|
+
* object representation.
|
|
210
|
+
* @param file - RDA file provider.
|
|
211
|
+
* @param shortcut - When `true`, only names and types are collected.
|
|
212
|
+
* @returns List of found {@link RObjectData} or `null` if the file is empty.
|
|
213
|
+
*/
|
|
214
|
+
parse(): RObjectData[] | null;
|
|
215
|
+
/**
|
|
216
|
+
* Detects the compression algorithm used for an RDA file.
|
|
217
|
+
* @param buf - Raw file buffer.
|
|
218
|
+
* @param with_zlib - Whether zlib headers should also be considered.
|
|
219
|
+
* @returns Detected {@link CompressionType}.
|
|
220
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/connections.c#L2675-L2710 | R source: comp_type_from_memory}
|
|
221
|
+
*/
|
|
222
|
+
detectCompression(buf: Buffer, with_zlib?: boolean): CompressionType;
|
|
223
|
+
/**
|
|
224
|
+
* Decompresses the given RDA file buffer.
|
|
225
|
+
* @param fileContent - Raw compressed file buffer.
|
|
226
|
+
* @param compressionType - {@link CompressionType} as returned by {@link detectCompression}.
|
|
227
|
+
* @returns Decompressed buffer.
|
|
228
|
+
* @throws Error for unsupported compression types.
|
|
229
|
+
*/
|
|
230
|
+
decompress(fileContent: Buffer, compressionType: CompressionType): Buffer;
|
|
231
|
+
/**
|
|
232
|
+
* Detects the serialization type used for the RDA-file.
|
|
233
|
+
* @param buf - Buffer with decompressed RDA-file content
|
|
234
|
+
* @returns The identified {@link SerializationTypes} of decompressed RDA-file
|
|
235
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/saveload.c#L1808-L1858 | R source: R_ReadMagic}
|
|
236
|
+
*/
|
|
237
|
+
determineSerializationType(buf: Buffer): SerializationTypes;
|
|
238
|
+
/**
|
|
239
|
+
* Deserializes a decompressed RDA-file.
|
|
240
|
+
* @returns Deserialized RDA-file as {@link RObject} or {@link RValues.NilValue}, if the deserialization fails
|
|
241
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/saveload.c#L1923-L1972 | R source: R_LoadFromFile}
|
|
242
|
+
*/
|
|
243
|
+
deserialize2(): RObject;
|
|
244
|
+
/**
|
|
245
|
+
* Deserializes a decompressed RDA-file.
|
|
246
|
+
* @returns Deserialized RDA-file as {@link RObject}
|
|
247
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2237-L2292 | R source: R_Unserialize}
|
|
248
|
+
*/
|
|
249
|
+
deserialize(): RObject;
|
|
250
|
+
/**
|
|
251
|
+
* Reads a serialized integer value from the current buffer position.
|
|
252
|
+
* @returns Parsed integer value or {@link RValues.NaInteger}.
|
|
253
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L396-L420 | R source: inInteger}
|
|
254
|
+
*/
|
|
255
|
+
inInteger(): number | RValues.NaInteger;
|
|
256
|
+
/**
|
|
257
|
+
* Advances the buffer offset past a serialized integer value.
|
|
258
|
+
*
|
|
259
|
+
* Mirrors {@link inInteger}.
|
|
260
|
+
*/
|
|
261
|
+
skipInteger(): void;
|
|
262
|
+
/**
|
|
263
|
+
* Ensures that the given value is not {@link RValues.NaInteger}.
|
|
264
|
+
* @param value - Integer value to be tested.
|
|
265
|
+
* @returns The validated integer value.
|
|
266
|
+
* @throws Error if the value equals `RValues.NaInteger`.
|
|
267
|
+
*/
|
|
268
|
+
assertInteger(value: number | RValues.NaInteger): number;
|
|
269
|
+
/**
|
|
270
|
+
* Ensures that the given object is not {@link RValues.NilValue}.
|
|
271
|
+
* @param obj - R object to validate.
|
|
272
|
+
* @returns The validated {@link RObjectData}.
|
|
273
|
+
* @throws Error if the object equals {@link RValues.NilValue}.
|
|
274
|
+
*/
|
|
275
|
+
assertRObjectData(obj: RObject): RObjectData;
|
|
276
|
+
/**
|
|
277
|
+
* Reads an ASCII word from the input buffer.
|
|
278
|
+
* @param size - Maximum allowed word size.
|
|
279
|
+
* @returns The parsed word.
|
|
280
|
+
* @throws Error if EOF is reached or the word exceeds the allowed size.
|
|
281
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L378-L394 | R source: inWord}
|
|
282
|
+
*/
|
|
283
|
+
inWord(size: number): string;
|
|
284
|
+
/**
|
|
285
|
+
* Skips an ASCII word in the input buffer.
|
|
286
|
+
*
|
|
287
|
+
* Mirrors {@link inWord}
|
|
288
|
+
* @returns An empty string.
|
|
289
|
+
* @throws Error if EOF is reached or the word exceeds {@link RDAParser.WORD_SIZE}.
|
|
290
|
+
*/
|
|
291
|
+
skipWord(): string;
|
|
292
|
+
/**
|
|
293
|
+
* Reads the next character from the input buffer.
|
|
294
|
+
* @returns The next character or `-1` on EOF.
|
|
295
|
+
*/
|
|
296
|
+
inChar(): number;
|
|
297
|
+
/**
|
|
298
|
+
* Checks whether the given byte represents a whitespace character.
|
|
299
|
+
* @param c - Character code to check.
|
|
300
|
+
* @returns `true` if the character is whitespace.
|
|
301
|
+
*/
|
|
302
|
+
isSpace(c: number): boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Reads a serialized string from the buffer.
|
|
305
|
+
* @param len - Length of the serialized string.
|
|
306
|
+
* @returns Decoded string.
|
|
307
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L505-L550 | R source: inString}
|
|
308
|
+
*/
|
|
309
|
+
inString(len: number): string;
|
|
310
|
+
/**
|
|
311
|
+
* Skips a serialized string depending on the current serialization format.
|
|
312
|
+
*
|
|
313
|
+
* Mirrors {@link inString}
|
|
314
|
+
* @param len - Length of the serialized string.
|
|
315
|
+
*/
|
|
316
|
+
skipString(len: number): void;
|
|
317
|
+
/**
|
|
318
|
+
* Decodes an R writer version integer into v, p, and s.
|
|
319
|
+
* @param writerVersion - Encoded writer version.
|
|
320
|
+
* @returns Tuple containing version components `[v,p,s]`.
|
|
321
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2230-L2235 | R source: decodeVersion}
|
|
322
|
+
*/
|
|
323
|
+
decodeVersion(writerVersion: number): number[];
|
|
324
|
+
/**
|
|
325
|
+
* Reads the next flags and dispatches to {@link readItemRecursive}.
|
|
326
|
+
* This is the main recursive entry point called for every R object encountered
|
|
327
|
+
* during deserialization.
|
|
328
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2117-L2121 | R source: ReadItem}
|
|
329
|
+
*/
|
|
330
|
+
readItem(): RObject;
|
|
331
|
+
/**
|
|
332
|
+
* Resolves a namespace reference by name using `getNamespace()` in R.
|
|
333
|
+
* Simpler variant of {@link R_FindNamespace1}.
|
|
334
|
+
* @param info - The {@link RObjectData} holding the namespace/package info.
|
|
335
|
+
* @returns An {@link RObjectData} of type {@link SexpType.EnvSxp} whose
|
|
336
|
+
* `value` is set to the resolved environment. Currently only
|
|
337
|
+
* `R_GlobalEnv` is handled; other results are logged as warnings.
|
|
338
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/envir.c#L3795-L3804 | R source: R_FindNamespace}
|
|
339
|
+
*/
|
|
340
|
+
R_FindNamespace(info: RObjectData): RObjectData;
|
|
341
|
+
/**
|
|
342
|
+
* Resolves a serialized namespace reference by executing R at runtime.
|
|
343
|
+
* @param info - The {@link RObjectData} holding the namespace/package info.
|
|
344
|
+
* @returns An {@link RObjectData} of type {@link SexpType.EnvSxp} whose
|
|
345
|
+
* `value` is set to the resolved environment. Currently only
|
|
346
|
+
* `R_GlobalEnv` is handled; other results are logged as warnings.
|
|
347
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1785-L1796 | R source: R_FindNamespace1}
|
|
348
|
+
*/
|
|
349
|
+
R_FindNamespace1(info: RObjectData): RObjectData;
|
|
350
|
+
/**
|
|
351
|
+
* Deserializes a single SEXP node recursively.
|
|
352
|
+
*
|
|
353
|
+
* The method dispatches to the corresponding deserialization logic
|
|
354
|
+
* depending on the encoded {@link SexpType}.
|
|
355
|
+
* @param flags - Serialized SEXP flags word.
|
|
356
|
+
* @returns Deserialized {@link RObjectData}.
|
|
357
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1871-L2115 | R source: ReadItem_Recursive}
|
|
358
|
+
*/
|
|
359
|
+
readItemRecursive(flags: number): RObjectData;
|
|
360
|
+
/**
|
|
361
|
+
* Skips a serialized SEXP node, only filling in its type and calling other skip methods to
|
|
362
|
+
* advance the buffer position.
|
|
363
|
+
*
|
|
364
|
+
* Mirrors the structure of {@link readItemRecursive} but skips payload data.
|
|
365
|
+
* @returns A minimal {@link RObjectData} with little to no payload.
|
|
366
|
+
*/
|
|
367
|
+
skipItem(): RObjectData;
|
|
368
|
+
/**
|
|
369
|
+
* Reads `len` raw bytes from the buffer into a number array.
|
|
370
|
+
* @param len - Number of raw bytes to read.
|
|
371
|
+
* @returns Array of unsigned byte values.
|
|
372
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2062-L2084 | R source: ReadItem_Recursive}
|
|
373
|
+
*/
|
|
374
|
+
inRaw(len: number): number[];
|
|
375
|
+
/**
|
|
376
|
+
* Advances the buffer offset past `len` raw bytes without reading values.
|
|
377
|
+
*
|
|
378
|
+
* Mirrors {@link inRaw}.
|
|
379
|
+
* @param len - Number of raw bytes to skip.
|
|
380
|
+
*/
|
|
381
|
+
skipRaw(len: number): void;
|
|
382
|
+
/**
|
|
383
|
+
* Resolves package environments.
|
|
384
|
+
* @param s - String-vec {@link RObject} identifying the package.
|
|
385
|
+
*
|
|
386
|
+
* Not implemented yet!
|
|
387
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/envir.c#L3732-L3741 | R source: R_FindPackageEnv}
|
|
388
|
+
*/
|
|
389
|
+
rFindPackageEnv(s: RObjectData): RObjectData;
|
|
390
|
+
/**
|
|
391
|
+
* Decodes the SEXP flags.
|
|
392
|
+
* @param flags - Raw 32-bit flags word.
|
|
393
|
+
* @returns `[type, levels, isObject, hasAttribute, hasTag]`.
|
|
394
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L748-L756 | R source: UnpackFlags}
|
|
395
|
+
*/
|
|
396
|
+
unpackFlags(flags: number): [number, number, boolean, boolean, boolean];
|
|
397
|
+
/**
|
|
398
|
+
* Retrieves an object from the reference table.
|
|
399
|
+
* @param index - 1-based reference index.
|
|
400
|
+
* @returns A registered {@link RObjectData}.
|
|
401
|
+
* @throws Error if the index is out of range.
|
|
402
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1461-L1469 | R source: GetReadRef}
|
|
403
|
+
*/
|
|
404
|
+
getReadRef(index: number): RObjectData;
|
|
405
|
+
/**
|
|
406
|
+
* Extracts the reference index from the given flags.
|
|
407
|
+
*
|
|
408
|
+
* When bits 8–31 are non-zero they encode the index directly;
|
|
409
|
+
* otherwise the index is read as the next integer from the stream.
|
|
410
|
+
* @param flags - Raw 32-bit flags word.
|
|
411
|
+
* @returns A 1-based reference index.
|
|
412
|
+
* @see {@link http://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L782-L789 | R source: InRefIndex}
|
|
413
|
+
*/
|
|
414
|
+
inRefIndex(flags: number): number;
|
|
415
|
+
/**
|
|
416
|
+
* Appends an object to the reference table so it can be resolved later by {@link getReadRef}.
|
|
417
|
+
* @param value - The {@link RObject} to register.
|
|
418
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1471-L1490 | R source: AddReadRef}
|
|
419
|
+
*/
|
|
420
|
+
addReadRef(value: RObject): void;
|
|
421
|
+
/**
|
|
422
|
+
* Reads a persistent string vector from the stream.
|
|
423
|
+
* @returns An {@link RObjectData} of type `CharSxp` whose `value` array holds the deserialized string items.
|
|
424
|
+
* @throws Error if the names flag is non-zero.
|
|
425
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1492-L1504 | R source: InStringVec}
|
|
426
|
+
*/
|
|
427
|
+
inStringVec(): RObjectData;
|
|
428
|
+
/**
|
|
429
|
+
* Advances the buffer past a persistent string vector without reading values.
|
|
430
|
+
*
|
|
431
|
+
* Mirrors {@link inStringVec}.
|
|
432
|
+
* @throws Error if the names flag is non-zero.
|
|
433
|
+
*/
|
|
434
|
+
skipStringVec(): void;
|
|
435
|
+
/**
|
|
436
|
+
* Sets the enclosing environment of an environment object.
|
|
437
|
+
* @param x - Environment whose enclosure should be set.
|
|
438
|
+
* @param v - Parent environment.
|
|
439
|
+
* @throws Error if the parent is invalid or would introduce a cycle.
|
|
440
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4677-L4690 | R source: SET_ENCLOS}
|
|
441
|
+
*/
|
|
442
|
+
SetEnClos(x: RObjectData, v: RObjectData): void;
|
|
443
|
+
/**
|
|
444
|
+
* Iteratively deserializes linked-list based SEXP structures.
|
|
445
|
+
* @param flags - Initial flags.
|
|
446
|
+
* @returns Head node of the reconstructed pairlist chain as {@link RObjectData}.
|
|
447
|
+
* @throws Error if the initial type is not a valid pairlist type.
|
|
448
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1800-L1868 | R source: ReadItem_Iterative}
|
|
449
|
+
*/
|
|
450
|
+
readItemIterative(flags: number): RObjectData;
|
|
451
|
+
/**
|
|
452
|
+
* Creates a weak reference object.
|
|
453
|
+
* @param key - Weak reference key object.
|
|
454
|
+
* @param val - Referenced value.
|
|
455
|
+
* @param fin - Finalizer function or NULL.
|
|
456
|
+
* @param onexit - Whether the finalizer should run on exit.
|
|
457
|
+
* @returns The created weak reference object as {@link RObject}.
|
|
458
|
+
* @throws Error if the finalizer type is invalid.
|
|
459
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L1424-L1435 | R source: R_MakeWeakRef}
|
|
460
|
+
*/
|
|
461
|
+
R_MakeWeakRef(key: RObjectData, val: RObject, fin: RObjectData, onexit: boolean): RObject;
|
|
462
|
+
/**
|
|
463
|
+
* Allocates and initializes a weak reference object.
|
|
464
|
+
* @param key - Weak reference key object.
|
|
465
|
+
* @param val - Referenced value.
|
|
466
|
+
* @param fin - Finalizer function.
|
|
467
|
+
* @param onexit - Whether the finalizer should run on exit.
|
|
468
|
+
* @returns The initialized weak reference object as {@link RObject}.
|
|
469
|
+
* @throws Error if the key type is invalid.
|
|
470
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L1388-L1422 | R source: NewWeakRef}
|
|
471
|
+
*/
|
|
472
|
+
newWeakRef(key: RObjectData, val: RObject, fin: RObjectData, onexit: boolean): RObject;
|
|
473
|
+
/**
|
|
474
|
+
* Creates or retrieves a cached primitive function object.
|
|
475
|
+
* @param index - Primitive function table index.
|
|
476
|
+
* @param evaluation - Non-zero for {@link SexpType.BuiltInSxp}, zero for {@link SexpType.SpecialSxp}.
|
|
477
|
+
* @returns of type {@link SexpType.BuiltInSxp} or {@link SexpType.SpecialSxp}.
|
|
478
|
+
* @throws Error if the index is out of range or the cached type mismatches.
|
|
479
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/dstruct.c#L37-L68 | R source: mkPRIMSXP}
|
|
480
|
+
*/
|
|
481
|
+
mkPrimSxp(index: number, evaluation: number): RObjectData;
|
|
482
|
+
/**
|
|
483
|
+
* Reads `len` bytes as a character string and applies encoding from the GP bits.
|
|
484
|
+
*
|
|
485
|
+
* Encoding flags: bit 3 = UTF-8, bit 2 = Latin-1, bit 6 = bytes (returned as-is).
|
|
486
|
+
* @param len - Number of bytes to read.
|
|
487
|
+
* @param levels - GP levels bits from the `CharSxp` flags word.
|
|
488
|
+
* @returns The decoded string, or `''` when the encoding is not yet handled.
|
|
489
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1689-L1759 | R source: ReadChar}
|
|
490
|
+
*/
|
|
491
|
+
readChar(len: number, levels: number): string;
|
|
492
|
+
/**
|
|
493
|
+
* Reads a vector length from the stream.
|
|
494
|
+
* @returns The vector length.
|
|
495
|
+
* @throws Error for negative lengths or an invalid high-word value.
|
|
496
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1761-L1782 | R source: ReadLENGTH}
|
|
497
|
+
*/
|
|
498
|
+
readLength(): number;
|
|
499
|
+
/**
|
|
500
|
+
* Reads `len` integers from the buffer.
|
|
501
|
+
* @param len - Number of integers to read.
|
|
502
|
+
* @returns Array of integer values or {@link RValues.NaInteger}.
|
|
503
|
+
* @throws Error for BINARY format or XDR buffer overrun.
|
|
504
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1507-L1541 | R source: InIntegerVec}
|
|
505
|
+
*/
|
|
506
|
+
inIntegerVec(len: number): (number | RValues.NaInteger)[];
|
|
507
|
+
/**
|
|
508
|
+
* Advances the buffer past `len` serialized integers without reading values.
|
|
509
|
+
*
|
|
510
|
+
* Mirrors {@link inIntegerVec}.
|
|
511
|
+
* @param len - Number of integers to skip.
|
|
512
|
+
* @returns An empty array.
|
|
513
|
+
* @throws Error for BINARY format or XDR buffer overrun.
|
|
514
|
+
*/
|
|
515
|
+
skipIntegerVec(len: number): (number | RValues.NaInteger)[];
|
|
516
|
+
/**
|
|
517
|
+
* Reads `len` doubles from the buffer.
|
|
518
|
+
* @param len - Number of doubles to read.
|
|
519
|
+
* @returns Array of numbers or {@link RValues}.
|
|
520
|
+
* @throws Error for BINARY format.
|
|
521
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1543-L1577 | R source: InRealVec}
|
|
522
|
+
*/
|
|
523
|
+
inRealVec(len: number): (number | RValues)[] | null[];
|
|
524
|
+
/**
|
|
525
|
+
* Advances the buffer past `len` serialized doubles without reading values.
|
|
526
|
+
*
|
|
527
|
+
* Mirrors {@link inRealVec}.
|
|
528
|
+
* @param len - Number of doubles to skip.
|
|
529
|
+
* @returns An empty array.
|
|
530
|
+
* @throws Error for BINARY format.
|
|
531
|
+
*/
|
|
532
|
+
skipRealVec(len: number): (number | RValues)[] | null[];
|
|
533
|
+
/**
|
|
534
|
+
* Reads the next double from the buffer.
|
|
535
|
+
* @returns A number or an {@link RValues}.
|
|
536
|
+
* @throws TypeError if the ASCII token is not a valid float.
|
|
537
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L427-L463 | R source: InReal}
|
|
538
|
+
*/
|
|
539
|
+
inReal(): Real;
|
|
540
|
+
/**
|
|
541
|
+
* Advances the buffer past the next serialized double without reading it.
|
|
542
|
+
*
|
|
543
|
+
* Mirrors {@link inReal}.
|
|
544
|
+
*/
|
|
545
|
+
skipReal(): void;
|
|
546
|
+
/**
|
|
547
|
+
* Reads `len` complex numbers from the buffer.
|
|
548
|
+
*
|
|
549
|
+
* Each value is read as two consecutive doubles via {@link inComplex}.
|
|
550
|
+
* @param len - Number of complex values to read.
|
|
551
|
+
* @returns Array of {@link Complex} objects.
|
|
552
|
+
* @throws Error for BINARY format.
|
|
553
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L1579-L1616 | R source: InComplexVec}
|
|
554
|
+
*/
|
|
555
|
+
inComplexVec(len: number): Complex[];
|
|
556
|
+
/**
|
|
557
|
+
* Advances the buffer past `len` serialized complex numbers.
|
|
558
|
+
*
|
|
559
|
+
* Mirrors {@link inComplexVec}.
|
|
560
|
+
* @param len - Number of complex values to skip.
|
|
561
|
+
* @throws Error for BINARY format.
|
|
562
|
+
*/
|
|
563
|
+
skipComplexVec(len: number): void;
|
|
564
|
+
/**
|
|
565
|
+
* Reads a single complex number as two consecutive real values.
|
|
566
|
+
* @returns A {@link Complex} object with `r` (real) and `i` (imaginary) parts.
|
|
567
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L465-L471 | R source: InComplex}
|
|
568
|
+
*/
|
|
569
|
+
inComplex(): Complex;
|
|
570
|
+
/**
|
|
571
|
+
* Advances the buffer past a single serialized complex number (two doubles).
|
|
572
|
+
*
|
|
573
|
+
* Mirrors {@link inComplex}.
|
|
574
|
+
*/
|
|
575
|
+
skipComplex(): void;
|
|
576
|
+
/**
|
|
577
|
+
* Sets the `i`-th element of a character vector.
|
|
578
|
+
* @param x - The character vector with type {@link SexpType.StrSxp} to modify.
|
|
579
|
+
* @param i - index to set.
|
|
580
|
+
* @param v - The {@link SexpType.CharSxp} {@link RObjectData} whose `name` is stored.
|
|
581
|
+
* @throws Error if `x` is not a {@link SexpType.StrSxp} or `i` is out of bounds.
|
|
582
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4283-L4301 | R source: SET_STRING_ELT}
|
|
583
|
+
*/
|
|
584
|
+
SET_STRING_ELT(x: RObjectData, i: number, _v: RObjectData): void;
|
|
585
|
+
/**
|
|
586
|
+
* Sets the `i`-th element of a generic list or vector.
|
|
587
|
+
*
|
|
588
|
+
* Mirrors R's `SET_VECTOR_ELT` macro.
|
|
589
|
+
* @param x - The list or vector to modify.
|
|
590
|
+
* @param i - index to set.
|
|
591
|
+
* @param v - The {@link RObject} to store at position `i`.
|
|
592
|
+
* @throws Error if `x` is not a list type or `i` is out of bounds.
|
|
593
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4303-L4322 | R source: SET_VECTOR_ELT}
|
|
594
|
+
*/
|
|
595
|
+
SET_VECTOR_ELT(x: RObjectData, i: number, v: RObject): void;
|
|
596
|
+
/**
|
|
597
|
+
* Deserializes an R bytecode object.
|
|
598
|
+
* @returns A {@link SexpType.BcodesSxp} {@link RObject}.
|
|
599
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2221-L2228 | R source: ReadBC}
|
|
600
|
+
*/
|
|
601
|
+
readBC(): RObject;
|
|
602
|
+
/**
|
|
603
|
+
* Advances the buffer past a bytecode object without reading it.
|
|
604
|
+
*
|
|
605
|
+
* Mirrors {@link readBC}.
|
|
606
|
+
*/
|
|
607
|
+
skipBC(): void;
|
|
608
|
+
/**
|
|
609
|
+
* Advances past a single bytecode.
|
|
610
|
+
*
|
|
611
|
+
* Mirrors {@link readBC1}.
|
|
612
|
+
*/
|
|
613
|
+
skipBC1(): void;
|
|
614
|
+
/**
|
|
615
|
+
* Advances past all bytecode constants.
|
|
616
|
+
*
|
|
617
|
+
* Mirrors {@link ReadBCConsts}.
|
|
618
|
+
*/
|
|
619
|
+
skipBCConsts(): void;
|
|
620
|
+
/**
|
|
621
|
+
* Registers a bytecode object after encoding.
|
|
622
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L8820-L8885 | R source: R_registerBC}
|
|
623
|
+
*/
|
|
624
|
+
R_registerBC(_bytes: RObject, _s: RObject): void;
|
|
625
|
+
/**
|
|
626
|
+
* Deserializes a single bytecode object.
|
|
627
|
+
* @param reps - Pre-allocated repetition table shared across all constants.
|
|
628
|
+
* @returns A {@link SexpType.BcodesSxp} {@link RObjectData}.
|
|
629
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2205-L2219 | R source: ReadBC1}
|
|
630
|
+
*/
|
|
631
|
+
readBC1(reps: RObjectData): RObjectData;
|
|
632
|
+
/**
|
|
633
|
+
* Encodes bytecode instructions.
|
|
634
|
+
* @param _bytes - integer array
|
|
635
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L8723-L8771 | R source: R_bcEncode}
|
|
636
|
+
*/
|
|
637
|
+
_R_bcEncode(_bytes: Int32Array): void;
|
|
638
|
+
/**
|
|
639
|
+
* Reads the constants of a bytecode object.
|
|
640
|
+
* @param reps - Shared repetition table for `BcRepDef`/`BcRepRef` resolution.
|
|
641
|
+
* @returns A `VecSxp` {@link RObjectData} holding all `n` constants.
|
|
642
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2173-L2203 | R source: ReadBCConsts}
|
|
643
|
+
*/
|
|
644
|
+
ReadBCConsts(reps: RObjectData): RObjectData;
|
|
645
|
+
/**
|
|
646
|
+
* Reads a single language object from bytecode constants.
|
|
647
|
+
* @param type - {@link SexpType} read from the constants.
|
|
648
|
+
* @param reps - Shared repetition table.
|
|
649
|
+
* @returns The deserialized language {@link RObjectData}.
|
|
650
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/serialize.c#L2125-L2171 | R source: ReadBCLang}
|
|
651
|
+
*/
|
|
652
|
+
ReadBCLang(type: SexpType, reps: RObjectData): RObjectData;
|
|
653
|
+
/**
|
|
654
|
+
* Advances the buffer past a single language object.
|
|
655
|
+
*
|
|
656
|
+
* Mirrors {@link ReadBCLang}.
|
|
657
|
+
* @param type - read {@link SexpType}.
|
|
658
|
+
*/
|
|
659
|
+
skipBCLang(type: SexpType): void;
|
|
660
|
+
/**
|
|
661
|
+
* Retrieves the `i`-th element of a generic list or vector.
|
|
662
|
+
* @param x - The list / expression / weak-ref vector.
|
|
663
|
+
* @param i - The index to retrieve.
|
|
664
|
+
* @returns The {@link RObject} at position `i`.
|
|
665
|
+
* @throws Error if `x` is not a list type or `i` is out of bounds.
|
|
666
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/memory.c#L4122-L4142 | R source: VECTOR_ELT}
|
|
667
|
+
*/
|
|
668
|
+
VECTOR_ELT(x: RObjectData, i: number): RObject;
|
|
669
|
+
/**
|
|
670
|
+
* Checks whether a bytecode object's version is within the supported range.
|
|
671
|
+
* @param s - The {@link SexpType.BcodesSxp} {@link RObjectData} to check.
|
|
672
|
+
* @returns `true` if the version is supported.
|
|
673
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L7166-L7175 | R source: R_BCVersionOK}
|
|
674
|
+
*/
|
|
675
|
+
R_BCVersionOK(s: RObjectData): boolean;
|
|
676
|
+
/**
|
|
677
|
+
* Returns the source-language expression for an unsupported bytecode object.
|
|
678
|
+
* @param s - The {@link SexpType.BcodesSxp} {@link RObjectData}.
|
|
679
|
+
* @returns First constant pool entry if available, otherwise {@link RValues.NilValue}.
|
|
680
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/eval.c#L5566-L5574 | R source: bytecodeExpr}
|
|
681
|
+
*/
|
|
682
|
+
R_BytecodeExpr(s: RObjectData): RObject;
|
|
683
|
+
/**
|
|
684
|
+
* Attempts to unserialize an ALTREP object.
|
|
685
|
+
* @param info - The info to be unserialized.
|
|
686
|
+
* @param _state - Serialized state.
|
|
687
|
+
* @param _attr - Serialized attributes.
|
|
688
|
+
* @param _objf - IS_OBJECT flag.
|
|
689
|
+
* @param _levs - GP levels bits.
|
|
690
|
+
* @returns The {@link RObjectData} or .
|
|
691
|
+
* @throws Error if the base type is not a supported vector type.
|
|
692
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L298-L338 | R source: ALTREP_UNSERIALIZE_EX}
|
|
693
|
+
*/
|
|
694
|
+
AltRepUnserializeEx(info: RObjectData, _state: RObjectData, _attr: RObjectData, _objf: boolean, _levs: number): RObjectData;
|
|
695
|
+
/**
|
|
696
|
+
* Looks up the ALTREP class for the given class/package symbol pair.
|
|
697
|
+
* @param info - The info to be looked up.
|
|
698
|
+
* @returns The class {@link RObjectData} when found, `undefined` if unregistered, or `null` if `info` is not a `ListSxp`.
|
|
699
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L279-L296 | R source: ALTREP_UNSERIALIZE_CLASS}
|
|
700
|
+
*/
|
|
701
|
+
ALTREP_UNSERIALIZE_CLASS(info: RObjectData): RObjectData | null | undefined;
|
|
702
|
+
/**
|
|
703
|
+
* Looks up an ALTREP class entry by class and package symbol.
|
|
704
|
+
* @param cSym - Class symbol.
|
|
705
|
+
* @param pSym - Package symbol.
|
|
706
|
+
* @returns The {@link RObjectData} or `undefined` if not registered.
|
|
707
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L90-L94 | R source: LookupClass}
|
|
708
|
+
*/
|
|
709
|
+
LookupClass(cSym: RObjectData, pSym: RObjectData): RObjectData | undefined;
|
|
710
|
+
/**
|
|
711
|
+
* Searches the ALTREP class registry for an entry matching the given symbols.
|
|
712
|
+
* @param cSym - Class symbol to match.
|
|
713
|
+
* @param pSym - Package symbol to match.
|
|
714
|
+
* @returns The matching registry node or `null` if not found.
|
|
715
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/altrep.c#L53-L59 | R source: LookupClassEntry}
|
|
716
|
+
*/
|
|
717
|
+
LookupClassEntry(cSym: RObject, pSym: RObject): RObjectData | null;
|
|
718
|
+
/**
|
|
719
|
+
* Creates a length-1 character vector wrapping the given string.
|
|
720
|
+
* @param x - The string value to wrap.
|
|
721
|
+
* @returns A {@link SexpType.StrSxp} {@link RObjectData} with one element.
|
|
722
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/include/Rinlinedfuns.h#L1044-L1052 | R source: ScalarString}
|
|
723
|
+
*/
|
|
724
|
+
ScalarString(x: string): RObjectData;
|
|
725
|
+
/**
|
|
726
|
+
* Recomputes and restores the cached hash-table priority count for an environment.
|
|
727
|
+
* @param s - The {@link RObjectData} whose hash table is to be repaired.
|
|
728
|
+
* @see {@link https://github.com/wch/r-source/blob/2196e6982a8f49082ee5c3d3521f6dd6596ea72c/src/main/envir.c#L3685-L3698 | R source: R_RestoreHashCount}
|
|
729
|
+
*/
|
|
730
|
+
restoreHashCount(s: RObjectData): void;
|
|
731
|
+
/**
|
|
732
|
+
* Converts a linked-list based R object tree into a flat array representation.
|
|
733
|
+
* @param node - Root node of the deserialized object tree.
|
|
734
|
+
* @param shortcut - Whether payload values should be omitted.
|
|
735
|
+
* @returns Flattened array of top-level objects.
|
|
736
|
+
*/
|
|
737
|
+
flattenRObject(node: RObject, shortcut: boolean): RObjectData[];
|
|
738
|
+
}
|
|
739
|
+
export {};
|