Compiles a chunk of code and appends it to `image`.
(&mut self, image: &mut Image, input: &mut dyn io::Read)
| 252 | |
| 253 | /// Compiles a chunk of code and appends it to `image`. |
| 254 | pub fn compile_more(&mut self, image: &mut Image, input: &mut dyn io::Read) -> Result<()> { |
| 255 | let mut new_context = self.context.clone(); |
| 256 | let mut new_symtable = self.symtable.clone(); |
| 257 | let program_scope = LocalSymtable::restore(&mut new_symtable, self.program_scope.clone()); |
| 258 | let (delta, snapshot) = top::compile(input, image, &mut new_context, program_scope)?; |
| 259 | image.append(delta); |
| 260 | self.context = new_context; |
| 261 | self.symtable = new_symtable; |
| 262 | self.program_scope = snapshot; |
| 263 | Ok(()) |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | #[cfg(test)] |