This commit is contained in:
Chris Fallin
2021-09-02 22:24:40 -07:00
parent e08160845e
commit 6a567924cd
3 changed files with 32 additions and 3 deletions

View File

@@ -1 +1,11 @@
//! Compilation process, from AST to Sema to Sequences of Insts.
use crate::{ast, sema, ir, codegen};
use crate::error::Error;
pub fn compile(defs: &ast::Defs) -> Result<codegen::Automata, Error> {
let mut typeenv = sema::TypeEnv::from_ast(defs)?;
let termenv = sema::TermEnv::from_ast(&mut typeenv, defs)?;
let automata = codegen::Automata::compile(&typeenv, &termenv)?;
Ok(automata)
}