Function brane_ast::traversals::attributes::do_traversal

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

Processes annotation statements into annotations on the other statements in the AST.

The goal of this traversal is to get rid of Stmt::Attribute and Stmt::AttributeInner occurrances, populating the attrs-field in various Stmt variants.

§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 annotation statements translated to annotations on structs.

§Errors

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