From 5f132c8422cb88e3f0ca266f4de9cc0129d44775 Mon Sep 17 00:00:00 2001 From: Baitinq Date: Sat, 8 Mar 2025 20:53:46 +0100 Subject: Feature: Add support for GT and LT operators --- src/tokenizer.zig | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/tokenizer.zig') diff --git a/src/tokenizer.zig b/src/tokenizer.zig index 908c016..99ed10d 100644 --- a/src/tokenizer.zig +++ b/src/tokenizer.zig @@ -26,6 +26,8 @@ pub const TokenType = union(enum) { MUL: void, DIV: void, BANG: void, + LESS: void, + GREATER: void, // Punctuation SEMICOLON: void, @@ -84,6 +86,8 @@ pub const Tokenizer = struct { if (self.accept_string("*")) return self.create_token(.{ .MUL = void{} }); if (self.accept_string("/")) return self.create_token(.{ .DIV = void{} }); if (self.accept_string("!")) return self.create_token(.{ .BANG = void{} }); + if (self.accept_string("<")) return self.create_token(.{ .LESS = void{} }); + if (self.accept_string(">")) return self.create_token(.{ .GREATER = void{} }); const string = self.consume_string(); if (string.len == 0) return TokenizerError.TokenizingError; -- cgit 1.4.1