mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-24 02:31:13 +08:00
13 lines
372 B
Rust
13 lines
372 B
Rust
use oxide_bytecode::module::CompiledModule;
|
|
use oxide_compiler::compiler::Compiler;
|
|
use oxide_parser::Allocator;
|
|
use oxide_vm::vm::Vm;
|
|
|
|
fn compile(source: &str) -> CompiledModule {
|
|
let allocator = Allocator::default();
|
|
let program = oxide_parser::parse(&allocator, source).expect("parse failed");
|
|
Compiler::new().compile(&program).expect("compile failed")
|
|
}
|
|
|
|
|