Module

compiler.statements.basic

Basic statement compilation for Kida compiler.

Provides mixin for compiling basic output statements (data, output).

Uses inline TYPE_CHECKING declarations for host attributes. See: plan/rfc-mixin-protocol-typing.md

Classes

BasicStatementMixin 2
Mixin for compiling basic output statements. Host attributes and cross-mixin dependencies are decl…

Mixin for compiling basic output statements.

Host attributes and cross-mixin dependencies are declared via inline TYPE_CHECKING blocks.

Methods

Internal Methods 2
_compile_data 1 list[ast.stmt]
Compile raw text data.
def _compile_data(self, node: Any) -> list[ast.stmt]
Parameters
Name Type Description
node
Returns
list[ast.stmt]
_compile_output 1 list[ast.stmt]
Compile {{ expression }} output. Uses cached local functions for hot path: _e …
def _compile_output(self, node: Any) -> list[ast.stmt]

Compile {{ expression }} output.

Uses cached local functions for hot path:

_e = _escape, _s = _str, _append = buf.append

Note: _escape handles str conversion internally to preserve Markup type

Parameters
Name Type Description
node
Returns
list[ast.stmt]