From 0fa2f445eb7140214471074fc544adfd0f8a524f Mon Sep 17 00:00:00 2001 From: Mathias Magnusson Date: Thu, 24 Jul 2025 22:15:03 +0200 Subject: 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 --- src/Lexer.zig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Lexer.zig') 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, }); } -- cgit v1.2.3