wip: compiler

This commit is contained in:
Jordan Pittman 2024-10-12 19:36:25 -04:00
parent 86e824aeee
commit 3f199d0745
2 changed files with 19 additions and 0 deletions

View file

@ -0,0 +1,18 @@
use std::error::Error;
use crate::css::parser::parse;
use crate::css::ast::Stylesheet;
struct Compiler {
ast: Stylesheet,
}
impl Compiler {
fn new(css: &[u8]) -> Result<Compiler, Box<dyn Error>> {
let ast = parse(css)?;
Ok(Compiler {
ast,
})
}
}

View file

@ -1,6 +1,7 @@
mod compat;
mod css;
mod util;
mod compiler;
mod engine;
use css::optimize::optimize_ast;