Expand description
Lexical binding and capture analysis shared by compiler and typechecker.
AST visitors answer structural questions. Capture analysis is different: an identifier only captures a binding when it resolves outside the callable that contains the reference. Keeping that resolution here avoids each consumer inventing a slightly different notion of scope and shadowing.
Structs§
- Binding
Id - Stable identity for a source binding. Patterns do not carry individual spans, so the declaration span plus the bound name is the narrowest source identity available without changing the AST.
- Match
Pattern Catalog - Compiler-resolved enum metadata needed to distinguish call-shaped enum patterns from ordinary expression-equality patterns.
Enums§
- Bare
Variant Resolution - Resolution of a bare call-shaped match pattern such as
Ok(value). Compiler lowering and lexical analysis share this decision so a pattern cannot bind payload names in one subsystem and act as an expression in the other.
Functions§
- ambiguous_
bare_ variant_ message - binding_
pattern_ ids - Return the source identities introduced by
patternatdeclaration. - binding_
pattern_ names - Return every name introduced by a destructuring pattern, in source order. The projection is intentionally shared by the compiler and typechecker.
- captured_
bindings_ in_ compiled_ module - Bindings captured under module execution order.
- captured_
bindings_ in_ nested_ callables - Bindings in the current compiled body referenced by a nested callable.
- captured_
bindings_ in_ pipeline_ lineage - Bindings captured across one pipeline inheritance chain.
- is_
deferred_ module_ declaration - Whether module compilation defers this declaration until after executable top-level statements. Capture analysis and bytecode lowering share this predicate so their visibility phases cannot drift.
- module_
scope_ node_ slices - Node slices whose declarations are predeclared in the module type scope.
- nested_
callable_ reassigned_ names - Names reassigned by a nested callable that are free relative to the current callable body. Type-flow narrowing uses this conservative summary: unknown names remain included so parameter captures continue to invalidate their narrowing at the caller-owned scope.
- resolve_
bare_ variant_ owners