Module

compiler.utils

Compiler utilities for Kida.

Provides operator mapping utilities for AST generation.

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

Classes

OperatorUtilsMixin 3
Mixin providing operator mapping utilities. Maps Kida operator strings to Python AST operator node…

Mixin providing operator mapping utilities.

Maps Kida operator strings to Python AST operator nodes. No external dependencies - self-contained utility mixin.

Methods

Internal Methods 3
_get_binop 1 ast.operator
Map operator string to AST operator.
def _get_binop(self, op: str) -> ast.operator
Parameters
Name Type Description
op
Returns
ast.operator
_get_unaryop 1 ast.unaryop
Map unary operator string to AST operator.
def _get_unaryop(self, op: str) -> ast.unaryop
Parameters
Name Type Description
op
Returns
ast.unaryop
_get_cmpop 1 ast.cmpop
Map comparison operator string to AST operator.
def _get_cmpop(self, op: str) -> ast.cmpop
Parameters
Name Type Description
op
Returns
ast.cmpop