chore: cargo fmt

This commit is contained in:
2025-05-19 11:33:18 +08:00
parent e17c48f2d9
commit 6d26716412
14 changed files with 209 additions and 79 deletions

View File

@@ -7,14 +7,13 @@ use inkwell::context::Context;
use ecow::EcoString;
use rpds::vector_sync;
use crate::builtins::env;
use crate::compile::compile;
use crate::ir::downgrade;
use crate::ty::public::*;
use crate::ty::common::Const;
use crate::jit::JITContext;
use crate::ty::common::Const;
use crate::ty::public::*;
use crate::vm::VM;
use crate::builtins::env;
#[inline]
fn test_expr(expr: &str, expected: Value) {
@@ -23,9 +22,19 @@ fn test_expr(expr: &str, expected: Value) {
dbg!(&prog);
let ctx = Context::create();
let jit = JITContext::new(&ctx);
let vm = VM::new(prog.thunks, prog.funcs, prog.symbols.into(), prog.symmap.into(), prog.consts, jit);
let vm = VM::new(
prog.thunks,
prog.funcs,
prog.symbols.into(),
prog.symmap.into(),
prog.consts,
jit,
);
let env = env(&vm);
let value = vm.eval(prog.top_level.into_iter(), env).unwrap().to_public(&vm, &mut HashSet::new());
let value = vm
.eval(prog.top_level.into_iter(), env)
.unwrap()
.to_public(&vm, &mut HashSet::new());
assert_eq!(value, expected);
}