Function brane_ast::traversals::null::do_traversal

source ·
pub fn do_traversal(root: Program) -> Result<Program, Vec<AstError>>
Expand description

Resolves null-typing in the given brane-dsl AST.

Note that the symbol tables must already have been constructed.

The goal of this traversal is to get rid of DataType::Null occurrances, asserting that null is only used in let-assignments.

§Arguments

  • 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 proper null-usage.

§Errors

This pass may throw multiple AstError::NullErrors if the user made mistakes with their variable references.