Started working on a holeybytes backend.
This commit is contained in:
parent
71ed4cea39
commit
e3cdfec0d9
|
@ -16,7 +16,7 @@ impl FasmCodegen {
|
||||||
($exprs:expr) => {{
|
($exprs:expr) => {{
|
||||||
self.fasm_codegen($exprs, true)
|
self.fasm_codegen($exprs, true)
|
||||||
}};
|
}};
|
||||||
|
|
||||||
(fun: $exprs:expr) => {{
|
(fun: $exprs:expr) => {{
|
||||||
self.fasm_codegen($exprs, false)
|
self.fasm_codegen($exprs, false)
|
||||||
}};
|
}};
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
pub mod holeybytes;
|
||||||
pub mod fasm;
|
pub mod fasm;
|
||||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -1,3 +1,6 @@
|
||||||
|
#![allow(warnings)]
|
||||||
|
#![feature(unsized_locals)]
|
||||||
|
#![feature(arc_unwrap_or_clone)]
|
||||||
#![feature(associated_type_bounds)]
|
#![feature(associated_type_bounds)]
|
||||||
pub mod lex;
|
pub mod lex;
|
||||||
pub mod codegen;
|
pub mod codegen;
|
||||||
|
@ -16,13 +19,12 @@ macro_rules! arrow {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let parsed = "3*10+5/5%12";
|
let mut args = std::env::args();
|
||||||
|
let (_, parsed) = (args.next(), args.next().unwrap());
|
||||||
let mut lexer = Token::lexer(parsed);
|
let mut lexer = Token::lexer(parsed.as_str());
|
||||||
|
|
||||||
println!("\"{}\"", parsed);
|
println!("\"{}\"", parsed);
|
||||||
arrow!(" ");
|
arrow!(" ");
|
||||||
println!("{:?}", lex_str(parsed));
|
println!("{:?}", lex_str(parsed.as_str()));
|
||||||
arrow!(" ");
|
arrow!(" ");
|
||||||
let parsed = parse_math(lexer);
|
let parsed = parse_math(lexer);
|
||||||
println!("{:?}", parsed);
|
println!("{:?}", parsed);
|
||||||
|
|
Loading…
Reference in a new issue