First declosure impl
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use crate::{
|
||||
flatten::{Capture, FlatFn},
|
||||
parse::{AtomRef, ImmOperand, Instr, JsValue, opcodes::OpCode},
|
||||
parse::{AtomRef, ImmOperand, JsValue, opcodes::OpCode},
|
||||
};
|
||||
|
||||
pub struct RegInstr {
|
||||
@@ -51,7 +49,7 @@ impl RegFn {
|
||||
fn from_flat(flat_fn: FlatFn) -> Self {
|
||||
let mut stack = vec![];
|
||||
let mut output = Vec::with_capacity(flat_fn.code.len());
|
||||
let mut next_val = flat_fn.var_count;
|
||||
let mut next_val = flat_fn.var_count; // Reserve values for locals
|
||||
|
||||
let mut fresh_val = || {
|
||||
let v = next_val;
|
||||
|
||||
Reference in New Issue
Block a user