Function to return the state of the stack before branching. For more details on a branch, see the Branch struct.
(&mut self, target_stack: Stack)
| 120 | |
| 121 | //Function to return the state of the stack before branching. For more details on a branch, see the Branch struct. |
| 122 | fn target_stack(&mut self, target_stack: Stack) { |
| 123 | for v in target_stack.0.iter().rev() { |
| 124 | // TODO: can do a no-op or padding op if no identifiers |
| 125 | self.move_identifier_to_top( |
| 126 | v.typed_identifier |
| 127 | .clone() |
| 128 | .expect("Need to deal w/ this case"), |
| 129 | false, |
| 130 | ); |
| 131 | } |
| 132 | self.stack.0 = self |
| 133 | .stack |
| 134 | .0 |
| 135 | .clone() |
| 136 | .into_iter() |
| 137 | .take(target_stack.0.len()) |
| 138 | .collect(); |
| 139 | } |
| 140 | |
| 141 | //Function to tell the transpiler to begin a branch during when entering a conditional statement |
| 142 | fn begin_branch(&mut self) { |
no test coverage detected