Skip to main content

Module view

Module view 

Source
Expand description

The LGX view IR — what a template PARSES INTO before anything is lowered.

A view is a tree of elements, text, holes, control flow, and component uses. The parser builds this tree first (pure structure, no statements), then a separate lowering emits whatever the execution tiers consume. Keeping the tree explicit is what lets the same template be checked, server-rendered, compiled to fine-grained DOM patches, inspected by tooling, and printed back (shape) for locks.

Every expression a node carries is an arena &'a Expr<'a> parsed by the ordinary expression parser, so holes and conditions are first-class LOGOS expressions; the tree itself is owned (Vec children), like the rest of the imperative AST.

Modules§

duplicate_keyed_loop_message_parts
The literal segments of duplicate_keyed_loop_message, PUBLIC so a compiled tier’s own lowering of Each can build the identical text out of runtime Exprs (string concatenation, loop_desc baked in as a literal since it is known at lowering time; key/the two positions are not) without a second, hand-copied version of the wording that could drift from this one.

Structs§

ViewArm
One {when Pattern:} arm of a view {inspect …:}.
ViewDef
One complete view: a Render: block, a Render into <el>: block, or a component’s View: — in source order they appear in crate::parser::Parser::views.

Enums§

Attr
One attribute-position item of an element, in source order.
BoundInput
What a bind={field} on an element actually WRITES — the one place the whole language decides, so no two walks can disagree about a checkbox.
ViewNode
One node of a view tree.
ViewRoot
The render target of a ViewDef.

Constants§

LOOP_INDEX_BASE
The position {for each x in xs, at index i:} gives the first item.

Functions§

bound_input_kind
Decide, from an element’s TAG and attributes, what a bind on it writes. See BoundInput.
duplicate_keyed_loop_message
The message a keyed by loop whose siblings share a key fails with — the SAME wording on every tier, because the lowering of Each builds it at run time from the segments this function formats (duplicate_keyed_loop_message_parts). loop_desc names what is being iterated (expr_shape on the loop’s own iterable, e.g. "todos"); key is the colliding key’s own display value (its evaluated VALUE, not source text — two items collide on what a key IS, at runtime, never on how it was spelled).
expr_shape
A compact expression rendering for shapes: literals verbatim, identifiers by name, calls as f(args), field access as a's b, interpolation with {…} holes; anything else prints as _.