mirror of
https://github.com/MorizzG/rlox.git
synced 2025-12-06 04:12:42 +00:00
fixed closures
This commit is contained in:
parent
d040d92052
commit
671f7d5306
6 changed files with 106 additions and 72 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue