From 73b3d406eb1c3a0087397393a68c799c4741e8b6 Mon Sep 17 00:00:00 2001 From: Goren Barak Date: Sun, 19 Nov 2023 17:41:51 -0500 Subject: [PATCH] Removed `println!()` from inside FASM codegen. --- src/codegen/fasm.rs | 1 - src/main.rs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/codegen/fasm.rs b/src/codegen/fasm.rs index 8629a17..2ac116e 100644 --- a/src/codegen/fasm.rs +++ b/src/codegen/fasm.rs @@ -124,6 +124,5 @@ pub fn fasm_codegen(exprs: &Vec, not_a_function: bool) -> String { } let asm = format!("{}{}{}", asm_start, asm_text, asm_data); - println!("{}", asm); asm } diff --git a/src/main.rs b/src/main.rs index bd08a98..fdb9362 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,5 +7,6 @@ use crate::parse::ast::*; pub mod parse; fn main() { - fasm_codegen(&vec![Expr::VarDefinition(VarDefinition {name: "goren", value: Value::Number(10)}), Expr::MathExpr(Math { left: Value::Var(VarReference { name: "goren"}), right: Value::Number(17), operator: MathOperator::OP_MULT}), Expr::FunDefinition(FunDefinition {name: "adder", contents: vec![Expr::MathExpr(Math {left: Value::Param(ParamReference {param_number: 0}), right: Value::Param(ParamReference {param_number: 1}), operator: MathOperator::OP_ADD})]}), Expr::Breakpoint], true); + let fc = fasm_codegen(&vec![Expr::VarDefinition(VarDefinition {name: "goren", value: Value::Number(10)}), Expr::MathExpr(Math { left: Value::Var(VarReference { name: "goren"}), right: Value::Number(17), operator: MathOperator::OP_MULT}), Expr::FunDefinition(FunDefinition {name: "adder", contents: vec![Expr::MathExpr(Math {left: Value::Param(ParamReference {param_number: 0}), right: Value::Param(ParamReference {param_number: 1}), operator: MathOperator::OP_ADD})]}), Expr::Breakpoint], true); + println!("{}", fc); }