Module graph

Source
Expand description

Defines the structure of a stack graph.

This module contains all of the types that you need to define the structure of a particular stack graph.

The stack graph as a whole lives in an instance of StackGraph. This type contains several Arenas, which are used to manage the life cycle of the data instances that comprise the stack graph. You cannot delete anything from the stack graph; all of its contents are dropped in a single operation when the graph itself is dropped.

There are several different kinds of node that can appear in a stack graph. As we search for a path representing a name binding, each kind of node has different rules for how it interacts with the symbol and scope stacks:

All nodes except for the singleton root node and jump to scope node belong to files.

Nodes are connected via edges.

Structs§

DebugEntry
A debug entry consisting of a string key-value air of strings.
DebugInfo
Contains debug info about a stack graph node as key-value pairs of strings.
DropScopesNode
Removes everything from the current scope stack.
Edge
Connects two nodes in a stack graph.
File
A source file that we have extracted stack graph data from.
InternedString
Arbitrary string content associated with some part of a stack graph.
JumpToNode
The singleton “jump to” node, which allows a name binding path to jump back to another part of the graph.
NodeID
Uniquely identifies a node in a stack graph.
PopScopedSymbolNode
Pops a scoped symbol from the symbol stack. If the top of the symbol stack doesn’t match the requested symbol, or if the top of the symbol stack doesn’t have an attached scope list, then the path is not allowed to enter this node.
PopSymbolNode
Pops a symbol from the symbol stack. If the top of the symbol stack doesn’t match the requested symbol, then the path is not allowed to enter this node.
PushScopedSymbolNode
Pushes a scoped symbol onto the symbol stack.
PushSymbolNode
Pushes a symbol onto the symbol stack.
RootNode
The singleton root node, which allows a name binding path to cross between files.
ScopeNode
A node that adds structure to the graph. If the node is exported, it can be referred to on the scope stack, which allows “jump to” nodes in any other part of the graph can jump back here.
SourceInfo
Contains information about a range of code in a source code file.
StackGraph
Contains all of the nodes and edges that make up a stack graph.
Symbol
A name that we are trying to resolve using stack graphs.

Enums§

Degree
Node
A node in a stack graph.