Fix things related to git.

This commit is contained in:
Goren Barak 2023-11-28 19:23:20 -05:00
parent fb098123d5
commit db6d6a91a1
2 changed files with 4 additions and 15 deletions

View file

@ -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<Expr>, not_a_function: bool) -> String {
// In x86-64 assembly, a function is defined as <function_name>:. 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");
},

View file

@ -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<Expr<'a>>
=======
pub struct IfStatement<'a> {
pub condition: Condition<'a>,
pub if_true: Vec<Expr<'a>>,
}
#[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)]