MCPcopy Create free account
hub / github.com/ControlCplusControlV/Scribe / target_stack

Method target_stack

crates/papyrus/src/miden_generator.rs:122–139  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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) {

Callers 2

end_branchMethod · 0.80
transpile_repeatMethod · 0.80

Calls 1

Tested by

no test coverage detected