aboutsummaryrefslogtreecommitdiff
path: root/src/Lexer.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/Lexer.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/Lexer.zig')
-rw-r--r--src/Lexer.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Lexer.zig b/src/Lexer.zig
index 4b664fe..87ced92 100644
--- a/src/Lexer.zig
+++ b/src/Lexer.zig
@@ -26,6 +26,7 @@ pub const Token = struct {
@"if",
@"else",
@"while",
+ proc,
};
};
@@ -137,7 +138,7 @@ fn identifierOrKeyword(self: *Self) Token {
}
const value = self.source[self.start..self.pos];
return self.create(switch (std.meta.stringToEnum(Token.Type, value) orelse .invalid) {
- .@"if", .@"else", .@"while" => |t| t,
+ .@"if", .@"else", .@"while", .proc => |t| t,
else => .identifier,
});
}