Module

parser.blocks.functions

Function block parsing for Kida parser.

Provides mixin for parsing function related statements (def, call, slot).

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

Classes

FunctionBlockParsingMixin 3
Mixin for parsing function blocks. Host attributes and cross-mixin dependencies are declared via i…

Mixin for parsing function blocks.

Host attributes and cross-mixin dependencies are declared via inline TYPE_CHECKING blocks. Inherits block stack management from BlockStackMixin.

Methods

Internal Methods 3
_parse_def 0 Def
Parse {% def name(args) %}...{% end %} or {% enddef %. Kida functions with tru…
def _parse_def(self) -> Def

Parse {% def name(args) %}...{% end %} or {% enddef %.

Kida functions with true lexical scoping (can access outer scope). Uses stack-based parsing for proper nested block handling.

Returns
Def
_parse_call 0 CallBlock
Parse {% call name(args) %}body{% end %} or {% endcall %. Call a function/def …
def _parse_call(self) -> CallBlock

Parse {% call name(args) %}body{% end %} or {% endcall %.

Call a function/def with body content that fills {% slot %}.

Returns
CallBlock
_parse_slot 0 Slot
Parse {% slot %} or {% slot name %. Placeholder inside {% def %} where caller …
def _parse_slot(self) -> Slot

Parse {% slot %} or {% slot name %.

Placeholder inside {% def %} where caller content goes.

Returns
Slot