Fixed issue with macro (basically I wrote false
when I needed to write true
and vice versa)
This commit is contained in:
parent
1a6089b2a9
commit
325ae07f1c
|
@ -1,13 +1,14 @@
|
|||
use crate::parse::ast::*;
|
||||
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! fasm_codegen {
|
||||
// Macro to make calling fasm_codegen function easier.
|
||||
($exprs:expr) => {
|
||||
fasm_codegen($exprs, false)
|
||||
fasm_codegen(&$exprs, true)
|
||||
};
|
||||
|
||||
(function: $exprs:expr) => {
|
||||
fasm_codegen($exprs, true)
|
||||
fasm_codegen($exprs, false)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -177,5 +178,6 @@ pub fn fasm_codegen(exprs: &Vec<Expr>, not_a_function: bool) -> String {
|
|||
// Get the final `asm` string derived from all of the other strings that we have manipulated (finally!).
|
||||
let asm = format!("{}{}{}", asm_start, asm_func, asm_data);
|
||||
// Return the final `asm` string.
|
||||
|
||||
asm
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ use crate::parse::ast::*;
|
|||
pub mod parse;
|
||||
|
||||
fn main() {
|
||||
let fc = fasm_codegen(&
|
||||
let fc = fasm_codegen!(
|
||||
vec![
|
||||
Expr::VarDefinition(VarDefinition {name: "goren", value: Value::Number(10)}),
|
||||
Expr::MathExpr(Math {
|
||||
|
@ -36,8 +36,8 @@ fn main() {
|
|||
),
|
||||
|
||||
Expr::Breakpoint
|
||||
],
|
||||
true
|
||||
]
|
||||
);
|
||||
|
||||
println!("{}", fc);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue