2024-09-09 01:08:04 +02:00
|
|
|
// mod assembler;
|
|
|
|
mod lexer;
|
|
|
|
// mod parser;
|
2024-08-08 21:53:27 +02:00
|
|
|
|
|
|
|
mod error;
|
|
|
|
|
2024-09-09 01:08:04 +02:00
|
|
|
use color_eyre::eyre::Result;
|
|
|
|
// pub use error::*;
|
|
|
|
use lexer::TokenString;
|
2024-08-08 21:53:27 +02:00
|
|
|
|
2024-09-09 01:08:04 +02:00
|
|
|
fn main() -> Result<()> {
|
|
|
|
// let code = "(+ 1 (+ 5 5))".to_string();
|
|
|
|
color_eyre::install()?;
|
2024-08-08 21:53:27 +02:00
|
|
|
|
2024-09-09 01:08:04 +02:00
|
|
|
let code = "()".to_string();
|
|
|
|
|
|
|
|
let lexed: TokenString = code.parse()?;
|
|
|
|
|
|
|
|
dbg!(lexed);
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
|
|
|
|
/*
|
2024-08-11 04:25:14 +02:00
|
|
|
let parsed = dbg!(parser::Parser::parse(code).unwrap());
|
|
|
|
let assembled = assembler::Assembler::assemble(parsed).unwrap();
|
|
|
|
|
|
|
|
for byte in assembled {
|
|
|
|
print!("{byte:#X}, ");
|
|
|
|
}
|
|
|
|
|
2024-09-09 01:08:04 +02:00
|
|
|
println!(""); */
|
2024-08-08 21:53:27 +02:00
|
|
|
}
|