Skip to main content

Module stack

Module stack 

Source
Expand description

Stack graph: name-resolution paths from references to their definitions.

Structs§

Definition
What makes a SymbolPop a definition rather than a plain re-export.
ForwardStitcher
Extends walks from the references of one file, phase by phase, with the stored partial paths.
ImportBinding
How an import’s SymbolPop binds the module it imports from.
ImportSite
One import or re-export resolved to what it binds.
MinimalPartialPaths
The walks a search found, and the endpoints whose search ran out of work.
PartialBindings
The symbol stack each variable of unified partial stacks stands for.
PartialPath
A walk from start to end: the symbol stack it needs on entry and the one it leaves.
PartialPathDatabase
The minimal partial paths of each file, kept with the graph they walk.
PartialPathId
Where a stored partial path lives: its file and its place among the file’s paths.
PartialSymbolStack
A symbol stack pattern: known symbols, top first, over an optional unknown rest.
PathEdge
An edge a partial path follows.
StackGraph
The stack graph: every push/pop/scope node plus the paths between them.
StackScope
A scope node: where name lookups stop descending further down the stack.
StackState
The symbol stack a path carries through the graph, top first.
StitchedPath
A walk the stitcher built, and the file of the node it ends at.
SymbolPop
A definition: a symbol popped off the stack, ending a reference’s search.
SymbolPush
A reference: a symbol pushed onto the stack to be resolved against a definition.
SymbolStackVariable
Stands for the unknown rest of a partial symbol stack.
UnifyError
Two partial symbol stacks have no stack in common.

Enums§

BindingReach
Who can look up the name an ImportSite binds.
PathError
Why two partial paths do not form one walk.
ScopeType
The lexical construct a StackScope stands for.
StackNode
One node of a file’s stack graph: a step in the push/pop path name resolution walks to connect a reference to its definition.
TransitionError
Why a node cannot be applied to a StackState.

Constants§

DEFAULT_MAX_STITCH_WORK
The stored paths a stitcher tries from one reference when no other limit is given.
DEFAULT_MAX_WORK
The edges a search from one endpoint tries before it stops by default.

Functions§

build_stack_graph
Builds the stack graph of one file from its finished syntax graph.
import_sites
Every import and re-export site in syntax, for the languages this resolves imports for.
minimal_partial_paths
Every walk of graph from one endpoint to the next, without passing another endpoint, trying at most max_work edges from each endpoint.