Logo Xantham

RenderScope_Prelude Module

Nested modules

Modules Description

ArenaInterner

TestHelper

Functions and values

Function or value Description

boundName full

Full Usage: boundName full

Parameters:
    full : string

Returns: string

Bound an underscore-joined token string to a legible identifier. A short name (<=40 char) is kept verbatim; a long one is truncated to a readable prefix (first 3 tokens, capped 28 char) plus a content-stable FNV-1a hash of the FULL string for UNIQUENESS. Deterministic and collision-safe (distinct full strings differ in the hash). Shared by every canonical-home name path (literal-union enums AND shared object-literals) so the two cannot diverge — an unbounded SharedLiterals name (335-char keyof-Array smash) was exactly such a divergence.

full : string
Returns: string

isHoistableObjectLiteral typeLiteral

Full Usage: isHoistableObjectLiteral typeLiteral

Parameters:
Returns: bool

True when a `TypeLiteral` renders as a HOISTED named object-type (the `_, _` arm of the TypeLiteral prerender below) rather than inlining to `obj` (empty) or a bare function signature (single inline call-signature). Only such literals are placed under a per-owner transient and can therefore become owner-dependent shared-literal dangles — so only these are candidates for the union-member reference-owner counting.

typeLiteral : TypeLiteral
Returns: bool

literalUnionModule

Full Usage: literalUnionModule

Returns: ModulePath
Returns: ModulePath

literalUnionName literals

Full Usage: literalUnionName literals

Parameters:
Returns: Name<MeasureProduct<pascal, MeasureOne>>

literalUnionTypePath literals

Full Usage: literalUnionTypePath literals

Parameters:
Returns: TypePath
literals : ResolvedTypeLiteralLike list
Returns: TypePath

prerender ctx scope lazyResolvedType

Full Usage: prerender ctx scope lazyResolvedType

Parameters:
Returns: TypeRefRender
ctx : GeneratorContext
scope : RenderScopeStore
lazyResolvedType : LazyResolvedType
Returns: TypeRefRender

reRegisterStructuralLiterals ctx scope rootRt

Full Usage: reRegisterStructuralLiterals ctx scope rootRt

Parameters:

Structural companion of `recordUnionMemberRefOwners` at the RENDER seam (see the cache-hit fall-through in `prerender`): walk a cached molecule's structural subtree and re-prerender every hoistable object literal against the CURRENT scope, restoring the TypeStore registration the first owner's descent performed. Nominal heads stop the walk (another owner's body); only lazies the first render already forced are re-entered, so this adds dictionary entries, not render work. The root itself is NOT re-prerendered — a homed literal's own cache-hit lands here and must only descend (self-re-entry would not terminate). Cycle-safe per walk by reference identity.

ctx : GeneratorContext
scope : RenderScopeStore
rootRt : ResolvedType

recordUnionMemberRefOwners ctx rootRt

Full Usage: recordUnionMemberRefOwners ctx rootRt

Parameters:

During the counting pre-pass, walk a top-level owner's ResolvedType graph (rooted at `rootRt`) and record — against the current owner (`ctx.CurrentRefOwner`) — every hoistable object-literal it REFERENCES (in any position: direct property/array element, union member, etc). This is a STRUCTURAL walk over the ResolvedType graph, deliberately independent of `prerender`'s cache: a shared literal's whole reference subtree (`ResizeArray`, `option>>`) is interned and shared across owners, so `prerender`/anchoring only descend into it under the FIRST owner (every later owner hits the cache and never sees the literal as a def-home). That is exactly why the def-VISIT gate misses these — both the union-wrapped literals AND direct array-element shared literals whose subtree is interned. Walking the resolved graph per owner instead captures the FULL set of distinct referencing owners; `markSharedLiterals` canonicalizes any literal referenced through >1 distinct owner (a single-owner literal stays nested — the control case). Cycle-safe via a per-walk visited set (the graph is cyclic). No-op outside the counting pass.

ctx : GeneratorContext
rootRt : ResolvedType

sharedLiteralModule

Full Usage: sharedLiteralModule

Returns: ModulePath
Returns: ModulePath

sharedLiteralNameStem typeLiteral

Full Usage: sharedLiteralNameStem typeLiteral

Parameters:
Returns: string

A readable base token for a shared object-literal's canonical name, derived from its member NAMES (properties/methods/accessors), like `literalUnionName` derives from a union's values. Member names alone do NOT uniquely identify a literal (two literals with identical property names but different property TYPES are distinct ResolvedTypes), so `markSharedLiterals` disambiguates collisions deterministically — this only supplies the human-readable stem.

typeLiteral : TypeLiteral
Returns: string

Type extensions

Type extension Description

GeneratorContext.Empty()

Full Usage: GeneratorContext.Empty()

Parameters:
    () : unit

Returns: GeneratorContext

Extended Type: GeneratorContext

() : unit
Returns: GeneratorContext

GeneratorContext.EmptyWithCustomisation(customisation)

Full Usage: GeneratorContext.EmptyWithCustomisation(customisation)

Parameters:
Returns: GeneratorContext

Extended Type: GeneratorContext

customisation : Customisation -> Customisation
Returns: GeneratorContext

Type something to start searching.