l0_locals::Scope class

Defined in module l0_locals (l0_locals.py).

A lexical scope for local bindings.

Scopes form a tree structure via parent pointers, mirroring the nested structure of the source code.

Public static attributes

static Optional parent
static Dict symbols

Public functions

auto lookup(self, str name) -> Optional[LocalSymbol]
Look up a name in this scope and all enclosing scopes.

Function documentation

Optional[LocalSymbol] l0_locals::Scope::lookup(self, str name)

Look up a name in this scope and all enclosing scopes.

Parameters
name The name to look up.
Returns The LocalSymbol if found, otherwise None.