Fix things related to git.
This commit is contained in:
parent
fb098123d5
commit
db6d6a91a1
|
@ -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");
|
||||
},
|
||||
|
|
|
@ -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)]
|
||||
|
|
Loading…
Reference in a new issue