pub struct StateBranch {
pub cond_conversion: Vec<Conversion>,
pub cond: VarId,
pub code_if_true: Box<StateElement>,
pub true_returns: Vec<VarAssignment>,
pub true_end_conv: Vec<Conversion>,
pub code_if_false: Box<StateElement>,
pub false_end_conv: Vec<Conversion>,
pub false_returns: Vec<VarAssignment>,
pub pushes: Vec<VarAssignment>,
}Expand description
A branch between two state elements with variable assignments computed.
Fields§
§cond_conversion: Vec<Conversion>Conversions applied to acquire the branch condition.
cond: VarIdVariable which will contain the bool branch condition.
code_if_true: Box<StateElement>Code to execute if the condition is true.
true_returns: Vec<VarAssignment>Assignments of the pushed values from the true branch. These will be collected
into a tuple and assigned to the pushes of the branch in the outer block.
true_end_conv: Vec<Conversion>Conversions to apply at the end of the true branch to align its types to the false branch.
code_if_false: Box<StateElement>Code to execute if the condition is false.
false_end_conv: Vec<Conversion>Conversions to apply at the end of the false branch to align its types to the true branch.
false_returns: Vec<VarAssignment>Assignments of the pushed values from the false branch. These will be collected
into a tuple and assigned to the pushes of the branch in the outer block.
pushes: Vec<VarAssignment>Values pushed onto the parent’s stack in the scope outside of the branch.