Closed tdp2110 closed 2 years ago
We have many examples in treewalk_interpreter.rs that look like
match interpreter.lox_functions.get(initializer_id) { Some(initializer) => Some(initializer.clone()), None => panic!( "Internal interpreter error! couldn't find an initializer method with id {}.", initializer_id ), },
We should pull these out into functions like
fn get_lox_function(&self, id: i64) -> &LoxFunction { match self.lox_functions.get(id) { Some(func) => func, None => panic!( "Internal interpreter error! couldn't find an initializer method with id {}.", id ), } }
fixed in 38b1e25, 94d8579, 0e9b03b
We have many examples in treewalk_interpreter.rs that look like
We should pull these out into functions like