Function brane_ast::traversals::resolve::do_traversal
source · pub fn do_traversal(
state: &mut CompileState,
package_index: &PackageIndex,
data_index: &DataIndex,
root: Program,
) -> Result<Program, Vec<AstError>>
Expand description
Builds symbol tables for the given brane-dsl
AST.
This effectively resolves variable references.
§Arguments
state
: The CompileState that we can use to remember definitions in between runs.package_index
: The PackageIndex which we use to resolve external function calls.data_index
: The DataIndex which we use to resolve external data assets.root
: The root node of the tree on which this compiler pass will be done.
§Returns
The same nodes as went in, but now with non-empty symbol tables.
§Errors
TThis pass may throw AstError::ResolveError
s if the user made mistakes with their variable references.