diff --git a/src/compiler.rs b/src/compiler.rs index 52bad71..f277a7b 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -1083,7 +1083,6 @@ impl<'a> Compiler<'a> { self.emit_constant(init_val); self.bind(name); - // TODO: close over everything accessed in the function for upvalue in upvalues { self.emit_op(Op::SetUpvalue); self.emit_byte(upvalue.stack_pos); diff --git a/src/main.rs b/src/main.rs index 1723d52..b880a65 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,12 +76,11 @@ pub fn run(src: &'static str) { pub fn main() { env::set_var("RUST_BACKTRACE", "1"); let src = " -fn foo { - () if false -> :no - () if true -> :yes -} +fn foo () -> :foo + +foo + -foo () "; run(src); }