diff --git a/src/codegen/fasm.rs b/src/codegen/fasm.rs index a682f50..7932e09 100644 --- a/src/codegen/fasm.rs +++ b/src/codegen/fasm.rs @@ -16,7 +16,7 @@ impl FasmCodegen { ($exprs:expr) => {{ self.fasm_codegen($exprs, true) }}; - + (fun: $exprs:expr) => {{ self.fasm_codegen($exprs, false) }}; diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 6688d7b..d62b332 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -1 +1,2 @@ +pub mod holeybytes; pub mod fasm; diff --git a/src/main.rs b/src/main.rs index f0d216b..773498a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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);