pub mod catcode;
pub mod compiler;
pub mod expand;
pub mod ir;
pub mod lexer;
pub mod lower;
pub mod runtime;
pub mod token;
pub use expand::{Engine, TexError};
pub fn run_messages(src: &str) -> Result<String, TexError> {
let cmds = crate::lower::Lowerer::new().lower(src)?;
let chunk = crate::compiler::Compiler::new().compile(&cmds);
let msgs = crate::runtime::run(chunk).map_err(TexError)?;
Ok(msgs.join(" "))
}
pub fn compile(src: &str) -> Result<fusevm::Chunk, TexError> {
let cmds = crate::lower::Lowerer::new().lower(src)?;
Ok(crate::compiler::Compiler::new().compile(&cmds))
}