Improve infer and transforms
This commit is contained in:
@@ -1,16 +1,17 @@
|
||||
mod declosure;
|
||||
mod flatten;
|
||||
mod infer;
|
||||
mod libqjs;
|
||||
mod regify;
|
||||
mod transform;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::Read;
|
||||
|
||||
use declosure::declosure;
|
||||
use flatten::flatten;
|
||||
use infer::infer_types;
|
||||
use libqjs::compile;
|
||||
use regify::regify;
|
||||
use transform::transform;
|
||||
|
||||
fn main() {
|
||||
// Load source file
|
||||
@@ -25,11 +26,11 @@ fn main() {
|
||||
file.read_to_end(&mut src).unwrap();
|
||||
|
||||
// Compile to bytecode
|
||||
let binary = libqjs::compile(&src, filename);
|
||||
let binary = compile(&src, filename);
|
||||
|
||||
// Process it
|
||||
let (flat_fns, captures, atoms) = flatten(binary);
|
||||
let flat_fns = declosure(flat_fns, &captures);
|
||||
let flat_fns = transform(flat_fns, &captures);
|
||||
let reg_fns = regify(flat_fns);
|
||||
let type_cache = infer_types(®_fns, &atoms);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user