Skip to main content

Module lgx

Module lgx 

Source
Expand description

LGX — the LOGOS web framework’s template layer: real HTML with Jinja-style {…} tags, component-scoped CSS, and the structural checks a template needs before any LOGOS expression inside it is parsed.

Three pure, grammar-agnostic stages, each locked on its own:

  • html — the flat tokenizer: tags, attributes, text, {…} brace groups, entities, void elements, comments, and the refusals (<script>, <style>, a doctype);
  • template — the tree: nesting, {if}/{for each}/{inspect}/{let}/{extends}/ {block}/{children}/{raw}, holes with filters, components, directives, whitespace; every LOGOS expression stays text + offset for the real expression parser;
  • css — component scoping by a real tokenizer (.card h1 → .card h1.lgx-todos).

The parser (parser/component.rs) turns a template::TNode tree into the view IR (crate::ast::view) by sub-lexing each expression at its recorded offset.

Modules§

check
Structural and accessibility checks over a parsed template tree — the questions a template can answer before any LOGOS expression inside it is parsed.
css
Component-scoped CSS for the Style: section — a real tokenizer, not string surgery.
deps
The static dependency graph a fine-grained DOM update is compiled from.
entities
The WHATWG named character references — GENERATED, do not hand-edit.
html
The LGX HTML tokenizer — real markup for the View: section of a component.
raw
Offsets inside a captured section body, mapped back to the file.
selector
The CSS selector subset LGX understands — parsed ONCE, here.
template
The LGX template parser — HTML tokens plus Jinja-style {…} tags into a template tree.