Project

EarthSciAST

The EarthSciML Abstract Syntax Tree format: schema, operators, coupling, and five language bindings.

Contents

emit_document

Stable function · Document I/O

Tier: stable · Kind: function · Topic: Document I/O

JuliaTypeScriptPythonRustGo
not exportedemitDocumentemit_documentnot exportednot exported

Julia

Julia does not export this function.

TypeScript

function emitDocument(rawSource: unknown, basePath: string, options?: TemplateResolveOptions): JsonObject

Produce the reference-preserving, self-contained emitted document (esm-spec §9.6.4 rule 5, RFC out-of-line-expression-templates §7.5) from a source document rawSource (a fixture, or an already-emitted document for the idempotency property; relative import refs resolve against basePath). Loads rawSource under Option B, then materializes each component’s surviving reference closure into its operators block, drops consumed imports, and version-stamps esm: 2.4.0 when any reference or operators block remains (§9.6.4 rule 8). emitEsmString ∘ emitDocument is a byte-wise fixed point under reload. Mirrors the Julia reference emit_document.

rawSource passes the same wire boundary a load applies (prepareDocumentOps), on a copy: a removed op is refused, and a deprecated neg / pow is rewritten with the deprecated_op warning, so neither spelling survives into the emitted document (esm-spec §4.2).

Source

Python

emit_document(raw_source: Any, base_path: str) -> dict

Produce the reference-preserving, self-contained emitted document (esm-spec §9.6.4 rule 5, RFC out-of-line-expression-templates §7.5) from a source document (a fixture, or an already-emitted document for the idempotency property). Loads raw_source under Option B, then for every component builds its emitted expression_templates block — authored entries first in authored order (a match rule only once a firing referenced it and rule 3 materialized it match-less), then the materialized transitive closure of its surviving references (match-less), sorted — drops consumed expression_template_imports, and version-stamps esm: 0.9.0 when any surviving reference or materialized entry remains (§9.6.4 rule 8). emit_esm_string ∘ emit_document is a byte-wise fixed point under reload.

raw_source passes the same wire boundary a load applies (earthsci_ast.parse.prepare_document_ops), on a copy: a removed op is refused, and a deprecated neg / pow is rewritten with the deprecated_op warning, so neither spelling survives into the emitted document (esm-spec §4.2).

Source

Rust

Rust does not export this function.

Go

Go does not export this function.