MCPcopy Index your code
hub / github.com/endbasic/endbasic / append

Method append

core/src/image.rs:237–254  ·  view source on GitHub ↗

Appends `delta` to the image, replacing the current trailing EOF terminator.

(&mut self, delta: ImageDelta)

Source from the content-addressed store, hash-verified

235
236 /// Appends `delta` to the image, replacing the current trailing EOF terminator.
237 pub(crate) fn append(&mut self, delta: ImageDelta) {
238 debug_assert_eq!(self.code.last().copied(), Some(bytecode::make_eof()));
239 debug_assert_eq!(self.debug_info.instrs.len(), self.code.len());
240 debug_assert_eq!(delta.code.len(), delta.instrs.len());
241 debug_assert_eq!(delta.code.last().copied(), Some(bytecode::make_eof()));
242
243 self.code.pop();
244 self.debug_info.instrs.pop();
245
246 self.code.extend(delta.code);
247 self.upcalls.extend(delta.upcalls);
248 self.constants.extend(delta.constants);
249 self.data.extend(delta.data);
250 self.debug_info.instrs.extend(delta.instrs);
251 self.debug_info.callables = delta.callables;
252 self.debug_info.global_vars = delta.global_vars;
253 self.debug_info.program_vars = delta.program_vars;
254 }
255
256 /// Disassembles the image into a textual representation for debugging.
257 pub fn disasm(&self) -> Vec<String> {

Callers 6

compile_moreMethod · 0.80
build_imageMethod · 0.80
take_captured_outMethod · 0.80
expect_clearMethod · 0.80
expect_outputMethod · 0.80
expect_printsMethod · 0.80

Calls

no outgoing calls

Tested by 4

take_captured_outMethod · 0.64
expect_clearMethod · 0.64
expect_outputMethod · 0.64
expect_printsMethod · 0.64