Add files

This commit is contained in:
2026-09-01 20:22:11 +00:00
parent 6dc95c412f
commit a8acb7706c
7 changed files with 1595 additions and 1 deletions
+28 -1
View File
@@ -1,3 +1,30 @@
mod flatten;
mod parse;
mod ssa;
use std::process::Command;
use flatten::flatten;
use parse::QuickJSBinary;
const QJSC: &str = "../third_party/quickjs/build/qjsc";
const BIN_OUT: &str = "/tmp/qjsrt.bin";
fn main() {
println!("Hello, world!");
let args = std::env::args().collect::<Vec<String>>();
let filename = args.get(1).unwrap();
// Compile source file
let output = Command::new(QJSC)
.args(["-b", "-m", "-o", BIN_OUT])
.arg(filename)
.output()
.unwrap();
assert!(output.status.success());
// Parse, then flatten
let bin = std::fs::read(BIN_OUT).unwrap();
let (_, parsed) = QuickJSBinary::parse(&bin).unwrap();
let (flat_fns, atoms) = flatten(parsed);
}