l0_check_lookup.py

l0_check_lookup.py

Module: l0_check_lookup

Source: compiler/stage1_py/l0_check_lookup.py Language: Python

Symbols

Namespace l0_check_lookup

Class l0_check_lookup::SemanticLookup

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

Member Data l0_check_lookup.SemanticLookup.state

1
CheckerState state

Function l0_check_lookup.SemanticLookup._declare_local

1
None l0_check_lookup.SemanticLookup._declare_local(self, str name, Type typ, Node node)

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.

    Function l0_check_lookup.SemanticLookup._lookup_local

1
Type | None l0_check_lookup.SemanticLookup._lookup_local(self, str name)

Look up a local variable’s type in the scope stack.

Function l0_check_lookup.SemanticLookup._lookup_local_scope_index

1
int | None l0_check_lookup.SemanticLookup._lookup_local_scope_index(self, str name)

Return scope index where local resolves (nearest scope wins).

Function l0_check_lookup.SemanticLookup._try_resolve_type_name

1
Type | None l0_check_lookup.SemanticLookup._try_resolve_type_name(self, str name, *Node|None node=None, list[str]|None module_path=None)

Try to resolve an identifier as a type name.

Function l0_check_lookup.SemanticLookup._resolve_type_ref

1
Type | None l0_check_lookup.SemanticLookup._resolve_type_ref(self, tref)

Resolve a TypeRef to a semantic Type .

Function l0_check_lookup.SemanticLookup._reject_name_qualifier

1
bool l0_check_lookup.SemanticLookup._reject_name_qualifier(self, Node node, str name, list[str]|None name_qualifier, list[str]|None module_path)

Check for and reject unsupported qualified name syntax (::).

Function l0_check_lookup.SemanticLookup._describe_lvalue

1
str l0_check_lookup.SemanticLookup._describe_lvalue(self, Expr expr)

Generate a human-readable description of an lvalue expression.