about summary refs log tree commit diff
path: root/src/tokenizer.zig
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-03-08 20:53:46 +0100
committerBaitinq <[email protected]>2025-03-08 20:53:46 +0100
commit5f132c8422cb88e3f0ca266f4de9cc0129d44775 (patch)
treeab4acc5dbed602b19c4eea4e451175f4fa265200 /src/tokenizer.zig
parentCodegen: Fix bug with recursive functions as variables (diff)
downloadinterpreter-5f132c8422cb88e3f0ca266f4de9cc0129d44775.tar.gz
interpreter-5f132c8422cb88e3f0ca266f4de9cc0129d44775.tar.bz2
interpreter-5f132c8422cb88e3f0ca266f4de9cc0129d44775.zip
Feature: Add support for GT and LT operators
Diffstat (limited to 'src/tokenizer.zig')
-rw-r--r--src/tokenizer.zig4
1 files changed, 4 insertions, 0 deletions
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;