(&mut self, bytecode: &Bytecode)
| 655 | } |
| 656 | |
| 657 | pub fn attach_bytecode(&mut self, bytecode: &Bytecode) { |
| 658 | self.bytecode = Some(bytecode.clone()); |
| 659 | self.attach_main_fn(); |
| 660 | |
| 661 | let native_fn_max_id = bytecode |
| 662 | .native_functions |
| 663 | .iter() |
| 664 | .max_by_key(|n| n.1.id) |
| 665 | .unwrap() |
| 666 | .1 |
| 667 | .id; |
| 668 | |
| 669 | // TODO: Fix the native functions detection |
| 670 | self.native_functions = vec![ |
| 671 | NativeFunction::new(Self::invalidate_native_call, 0); |
| 672 | native_fn_max_id as usize + 1 |
| 673 | ]; |
| 674 | } |
| 675 | |
| 676 | pub fn interpret(&mut self) { |
| 677 | self.attach_main_fn(); |
no test coverage detected