Started working on a holeybytes backend.

This commit is contained in:
Goren Barak 2023-12-24 10:43:15 -05:00
parent 71ed4cea39
commit e3cdfec0d9
3 changed files with 9 additions and 6 deletions

View file

@ -16,7 +16,7 @@ impl FasmCodegen {
($exprs:expr) => {{
self.fasm_codegen($exprs, true)
}};
(fun: $exprs:expr) => {{
self.fasm_codegen($exprs, false)
}};

View file

@ -1 +1,2 @@
pub mod holeybytes;
pub mod fasm;

View file

@ -1,3 +1,6 @@
#![allow(warnings)]
#![feature(unsized_locals)]
#![feature(arc_unwrap_or_clone)]
#![feature(associated_type_bounds)]
pub mod lex;
pub mod codegen;
@ -16,13 +19,12 @@ macro_rules! arrow {
}
fn main() {
let parsed = "3*10+5/5%12";
let mut lexer = Token::lexer(parsed);
let mut args = std::env::args();
let (_, parsed) = (args.next(), args.next().unwrap());
let mut lexer = Token::lexer(parsed.as_str());
println!("\"{}\"", parsed);
arrow!(" ");
println!("{:?}", lex_str(parsed));
println!("{:?}", lex_str(parsed.as_str()));
arrow!(" ");
let parsed = parse_math(lexer);
println!("{:?}", parsed);