aboutsummaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
authorMathias Magnusson <mathias@magnusson.space>2025-07-24 22:15:03 +0200
committerMathias Magnusson <mathias@magnusson.space>2025-07-24 22:17:19 +0200
commit0fa2f445eb7140214471074fc544adfd0f8a524f (patch)
treecb3bca4a9604df71cfe0cfcdb0c0f1e3590923ea /src/main.zig
parentb3909efb3a6bf76870b686b5062f9a4282fbdd66 (diff)
downloadhuginn-0fa2f445eb7140214471074fc544adfd0f8a524f.tar.gz
continue implementing procedure calls
multiple procedures can now exist, but you cannot call them, the first one is the "main" procedure since it happens to be placed first in the binary, and all procedures end with an exit system call
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.zig b/src/main.zig
index 5873c66..55b7e0e 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -47,9 +47,9 @@ pub fn main() !void {
if (lexer.peek().type != .eof) {
std.debug.print("Unexpected token {}, expected end of file\n", .{lexer.next()});
}
- const procedure = try compile.compile(allocator, source, ast);
- std.debug.print("Bytecode instructions:\n{}", .{procedure});
- const elf = try codegen.create_elf(allocator, procedure);
+ const module = try compile.compile(allocator, source, ast);
+ std.debug.print("Bytecode instructions:\n{}", .{module});
+ const elf = try codegen.create_elf(allocator, module);
try out_file.writer().writeAll(elf);
std.debug.print("Run output:\n", .{});
if (run) {