diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2024-07-18 19:26:06 -0500 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2024-07-18 19:26:06 -0500 |
| commit | 8f55e2fa7059ef215a1b8369300f0a85103b079b (patch) | |
| tree | c973088671120e8b0f1daa43b12359e877d77411 /src/main.zig | |
| parent | 0079d26b9d5a95b46c3a73f0aa5409a584d0bb1b (diff) | |
| download | calico-8f55e2fa7059ef215a1b8369300f0a85103b079b.tar.gz | |
ASt progress
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/main.zig b/src/main.zig index 4a0bbca..2ca0b68 100644 --- a/src/main.zig +++ b/src/main.zig @@ -45,21 +45,15 @@ pub fn main() !void { switch (t) { .ret => { const num = tokIter.next(); - switch (num.?) { - .intLit => {}, - else => break, - } - switch (tokIter.next().?) { - .semiCol => {}, - else => break, - } + if (!tok.checkType(num.?, tok.TokenType.intLit)) return error.SyntaxError; + + if (!tok.checkType(tokIter.next().?, tok.TokenType.semiCol)) return error.SyntaxError; try outWriter.print( \\ mov rax, 60 \\ mov rdi, {} \\ syscall \\ , .{num.?.intLit}); - gpa.allocator().free(t.ret); }, // No other commands else => {}, |
