Module brane_ast::traversals::flatten
source · Expand description
Implements a traversal that flattens the scopes (i.e., symbol tables) of the given program. This effectively brings all nested scopes back to the toplevel.
Re-exports§
pub use crate::errors::FlattenError as Error;
Functions§
- Flattens the symbol tables in the given AST to only have a global and function-wide scope.
- Passes a block, collecting all of its definitions (i.e., symbol table entries) into the given CompileState.
- Passes a Stmt, collecting any definitions it makes into the given CompileState, effectively flattening its own symbol tables.