From db6d6a91a1299937a2063f9d92be590dd06990e1 Mon Sep 17 00:00:00 2001 From: Goren Barak Date: Tue, 28 Nov 2023 19:23:20 -0500 Subject: [PATCH] Fix things related to git. --- src/codegen/fasm.rs | 4 ++-- src/parse/ast.rs | 15 ++------------- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/codegen/fasm.rs b/src/codegen/fasm.rs index 87a8d17..81ebabf 100644 --- a/src/codegen/fasm.rs +++ b/src/codegen/fasm.rs @@ -8,7 +8,7 @@ macro_rules! fasm_codegen { fasm_codegen($exprs, true) }; - (function: $exprs:expr) => { + (fun: $exprs:expr) => { fasm_codegen($exprs, false) } } @@ -174,7 +174,7 @@ pub fn fasm_codegen(exprs: &Vec, not_a_function: bool) -> String { // In x86-64 assembly, a function is defined as :. Push this to the `asm_func`. asm_func.push_str(format!("{}:\n", e.name).as_str()); // Call the function itself specifying that you are defining a function, and push the returned value to `asm_func`. - asm_func.push_str(fasm_codegen!(function: &e.contents).as_str()); + asm_func.push_str(fasm_codegen!(fun: &e.contents).as_str()); // Use the ret instruction to return from the procedure. asm_func.push_str("\tret\n"); }, diff --git a/src/parse/ast.rs b/src/parse/ast.rs index 1cc0379..c792afc 100644 --- a/src/parse/ast.rs +++ b/src/parse/ast.rs @@ -1,3 +1,5 @@ +use std::rc::Rc; + #[derive(Debug)] pub enum Expr<'a> { MathExpr(Math<'a>), @@ -78,24 +80,11 @@ pub struct ParamReference { // CONDITIONS #[derive(Debug)] -<<<<<<< HEAD pub struct IfCondition<'a> { pub left: Expr<'a>, pub right: Expr<'a>, pub cond: COND_OP, pub action: Vec> -======= -pub struct IfStatement<'a> { - pub condition: Condition<'a>, - pub if_true: Vec>, -} - -#[derive(Debug)] -pub struct Condition<'a> { - pub left: Value<'a>, - pub right: Value<'a>, - pub between: COND_OP, ->>>>>>> parent of 2f942d3 (Added if statements, and made `Expr::Return` work.) } #[derive(Debug)]