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

Method add_function_stack

crates/papyrus/src/miden_generator.rs:540–545  ·  view source on GitHub ↗

Modifies the stack to include values from developer written functions in Yul For example, if someone were to write a function called return_two_numbers() that returns two values, when that function is called, we have to modify our stack by pushing those two numbers to the top of the stack.

(&mut self, function_stack: &Stack)

Source from the content-addressed store, hash-verified

538 //For example, if someone were to write a function called return_two_numbers() that returns two values,
539 //when that function is called, we have to modify our stack by pushing those two numbers to the top of the stack.
540 fn add_function_stack(&mut self, function_stack: &Stack) {
541 let mut new_stack = Stack::default();
542 new_stack.0.append(&mut self.stack.0.clone());
543 new_stack.0.append(&mut function_stack.0.clone());
544 self.stack = new_stack;
545 }
546
547 //Get the data type for a specific variable
548 fn get_typed_identifier(&self, identifier: &str) -> &TypedIdentifier {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected