save work, working on function clause guards, extra pop instructions are showing up after function definitions
This commit is contained in:
parent
0f8645d2eb
commit
5ae4742840
|
@ -1083,7 +1083,6 @@ impl<'a> Compiler<'a> {
|
||||||
self.emit_constant(init_val);
|
self.emit_constant(init_val);
|
||||||
self.bind(name);
|
self.bind(name);
|
||||||
|
|
||||||
// TODO: close over everything accessed in the function
|
|
||||||
for upvalue in upvalues {
|
for upvalue in upvalues {
|
||||||
self.emit_op(Op::SetUpvalue);
|
self.emit_op(Op::SetUpvalue);
|
||||||
self.emit_byte(upvalue.stack_pos);
|
self.emit_byte(upvalue.stack_pos);
|
||||||
|
|
|
@ -76,12 +76,11 @@ pub fn run(src: &'static str) {
|
||||||
pub fn main() {
|
pub fn main() {
|
||||||
env::set_var("RUST_BACKTRACE", "1");
|
env::set_var("RUST_BACKTRACE", "1");
|
||||||
let src = "
|
let src = "
|
||||||
fn foo {
|
fn foo () -> :foo
|
||||||
() if false -> :no
|
|
||||||
() if true -> :yes
|
foo
|
||||||
}
|
|
||||||
|
|
||||||
foo ()
|
|
||||||
";
|
";
|
||||||
run(src);
|
run(src);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user