l0_check_lookup::SemanticLookup class

Defined in module l0_check_lookup (l0_check_lookup.py).

Local and type lookup, declaration rules, and qualifier validation.

Public static attributes

static CheckerState state

Protected functions

auto _declare_local(self, str name, Type typ, Node node) -> None
Declare a local variable in the innermost scope.
auto _lookup_local(self, str name) -> Type|None
Look up a local variable's type in the scope stack.
auto _lookup_local_scope_index(self, str name) -> int|None
Return scope index where local resolves (nearest scope wins).
auto _try_resolve_type_name(self, str name, *Node|None node = None, list|None module_path[str] = None) -> Type|None
Try to resolve an identifier as a type name.
auto _resolve_type_ref(self, tref) -> Type|None
Resolve a TypeRef to a semantic Type.
auto _reject_name_qualifier(self, Node node, str name, list|None name_qualifier[str], list|None module_path[str]) -> bool
Check for and reject unsupported qualified name syntax (::).
auto _describe_lvalue(self, Expr expr) -> str
Generate a human-readable description of an lvalue expression.

Function documentation

None l0_check_lookup::SemanticLookup::_declare_local(self, str name, Type typ, Node node) protected

Declare a local variable in the innermost scope.

Parameters
name The name of the variable.
typ The resolved Type of the variable.
node The AST node where the declaration occurs.