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 ofEachcan build the identical text out of runtimeExprs (string concatenation,loop_descbaked 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, aRender into <el>:block, or a component’sView:— in source order they appear incrate::parser::Parser::views.
Enums§
- Attr
- One attribute-position item of an element, in source order.
- Bound
Input - 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. - View
Node - One node of a view tree.
- View
Root - 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
bindon it writes. SeeBoundInput. - duplicate_
keyed_ loop_ message - The message a
keyed byloop whose siblings share a key fails with — the SAME wording on every tier, because the lowering ofEachbuilds it at run time from the segments this function formats (duplicate_keyed_loop_message_parts).loop_descnames what is being iterated (expr_shapeon the loop’s owniterable, e.g."todos");keyis 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 asa's b, interpolation with{…}holes; anything else prints as_.