fixed closures

This commit is contained in:
Moritz Gmeiner 2024-09-03 00:48:10 +02:00
commit 671f7d5306
6 changed files with 106 additions and 72 deletions

View file

@ -15,7 +15,7 @@ pub struct LoxFunction {
name: SmolStr,
closure: ClosureScope,
param_names: Vec<SmolStr>,
body: Box<Stmt>,
body: Stmt,
}
impl LoxFunction {
@ -26,7 +26,6 @@ impl LoxFunction {
body: Stmt,
) -> Rc<Self> {
let name = name.into();
let body = Box::new(body);
let fun = LoxFunction {
name,
closure,