Skip to content

Commit

Permalink
Temp
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert Lucas committed Aug 1, 2024
1 parent d7abd14 commit 67bc348
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 64 deletions.

Large diffs are not rendered by default.

64 changes: 2 additions & 62 deletions build/out.asm
Original file line number Diff line number Diff line change
Expand Up @@ -6,69 +6,9 @@ main:
push rbp
mov rbp, rsp
mov qword [rbp-8], 3
mov rax, qword [rbp-8]
mov qword [rbp-16], rax
sub rsp, 16
call _9
add rsp, 16
mov rax, rbp
add rax, -8
mov qword [rbp-24], rax
mov rdx, qword [rbp-24]
mov rax, qword [rdx+0]
mov qword [rbp-16], rax
mov rdi, __8_fstr
mov rsi, [rbp-16]
mov al, 0
sub rsp, 24
extern printf
call printf
add rsp, 24
mov qword [rbp-32], 8
mov rax, qword [rbp-32]
mov qword [rbp-16], 8
mov rax, qword [rbp-16]
leave
ret


_9:
push rbp
mov rbp, rsp
mov rax, rbp
add rax, 16
mov qword [rbp-16], rax
mov rdx, qword [rbp-16]
mov rax, qword [rdx+0]
mov qword [rbp-8], rax
mov rdi, __8_fstr
mov rsi, [rbp-8]
mov al, 0
sub rsp, 16
extern printf
call printf
add rsp, 16
mov rax, rbp
add rax, 16
mov qword [rbp-24], rax
mov qword [rbp-32], 1
mov rax, qword [rbp-24]
mov rdx, qword [rbp-32]
add qword [rax], rdx
mov rax, rbp
add rax, 16
mov qword [rbp-48], rax
mov rdx, qword [rbp-48]
mov rax, qword [rdx+0]
mov qword [rbp-40], rax
mov rdi, __8_fstr
mov rsi, [rbp-40]
mov al, 0
sub rsp, 48
extern printf
call printf
add rsp, 48

leave
ret

section .data_readonly
__8_fstr db `Integer: %ld\n`,0
Binary file modified build/out.o
Binary file not shown.
Binary file modified build/out.out
Binary file not shown.
2 changes: 1 addition & 1 deletion main.why
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ fn main() -> int {
+ a +

return 8;
}
}
17 changes: 16 additions & 1 deletion src/root/parser/parse_function/parse_evaluable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ impl FullNameTokens {
}
}

pub struct STempEvaluableTokenOne<'a> {
pub inner: TempEvaluableTokensOne,
pub s: Span<'a>
}

#[allow(private_interfaces)]
#[derive(Debug)]
enum TempEvaluableTokensOne {
Expand All @@ -147,6 +152,11 @@ enum TempEvaluableTokensOne {
DynamicFunctionCall(SimpleNameToken, Vec<EvaluableToken>),
}

pub struct STempEvaluableTokenTwo<'a> {
pub inner: TempEvaluableTokensTwo,
pub s: Span<'a>
}

#[derive(Debug)]
enum TempEvaluableTokensTwo {
EvaluableToken(EvaluableToken),
Expand Down Expand Up @@ -274,7 +284,12 @@ pub fn parse_evaluable<'a, 'b>(
// Recursively parse bracketed sections
let ns = if let Ok((ns, inner)) = parse_terminator_default_set(s, &BRACKET_TERMINATOR) {
let (_, evaluable) = parse_evaluable(inner, containing_class, false)?;
evaluables.push(TempEvaluableTokensOne::EvaluableToken(evaluable));
evaluables.push(
STempEvaluableTokenOne {
inner: TempEvaluableTokensOne::EvaluableToken(evaluable)),
s: inner
}
);
ns
}
// Parse evaluable
Expand Down

0 comments on commit 67bc348

Please sign in to comment.