charon_lib::ast::ullbc_ast

Type Alias ExprBody

source
pub type ExprBody = GExprBody<BodyContents>;

Aliased Type§

struct ExprBody {
    pub span: Span,
    pub arg_count: usize,
    pub locals: Vector<VarId, Var>,
    pub comments: Vec<(usize, Vec<String>)>,
    pub body: Vector<BlockId, BlockData>,
}

Fields§

§span: Span§arg_count: usize

The number of local variables used for the input arguments.

§locals: Vector<VarId, Var>

The local variables. We always have, in the following order:

  • the local used for the return value (index 0)
  • the input arguments
  • the remaining locals, used for the intermediate computations
§comments: Vec<(usize, Vec<String>)>

For each line inside the body, we record any whole-line // comments found before it. They are added to statements in the late recover_body_comments pass.

§body: Vector<BlockId, BlockData>

Implementations§

source§

impl ExprBody

source

pub fn transform_sequences<F>(&mut self, f: &mut F)
where F: FnMut(&mut Vector<VarId, Var>, &mut [Statement]) -> Vec<(usize, Vec<Statement>)>,

source

pub fn visit_statements<F: FnMut(&mut Statement)>(&mut self, f: &mut F)

Apply a function to all the statements, in a bottom-up manner.