about summary refs log tree commit diff
path: root/src/tokenizer.zig
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-01-21 00:32:14 +0100
committerBaitinq <[email protected]>2025-01-21 00:32:14 +0100
commitfbdf799d6081ffd86137e62f3e58d828a4d0335f (patch)
treedd038d87758bfe17edba4c1ba5457b1ebbde9184 /src/tokenizer.zig
parentParser: Add support for parenthesis grouping (diff)
downloadpry-lang-fbdf799d6081ffd86137e62f3e58d828a4d0335f.tar.gz
pry-lang-fbdf799d6081ffd86137e62f3e58d828a4d0335f.tar.bz2
pry-lang-fbdf799d6081ffd86137e62f3e58d828a4d0335f.zip
Feature: Add support for NOT unary expression
Diffstat (limited to 'src/tokenizer.zig')
-rw-r--r--src/tokenizer.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tokenizer.zig b/src/tokenizer.zig
index 6765ea9..d137763 100644
--- a/src/tokenizer.zig
+++ b/src/tokenizer.zig
@@ -22,6 +22,7 @@ pub const TokenType = enum {
     EQUALS,
     PLUS,
     MINUS,
+    NOT,
 
     // Punctuation
     SEMICOLON,
@@ -43,6 +44,7 @@ pub const Token = union(TokenType) {
     EQUALS: void,
     PLUS: void,
     MINUS: void,
+    NOT: void,
     SEMICOLON: void,
     COMMA: void,
     LPAREN: void,
@@ -79,6 +81,7 @@ pub const Tokenizer = struct {
         if (c == '=') return Token{ .EQUALS = void{} };
         if (c == '+') return Token{ .PLUS = void{} };
         if (c == '-') return Token{ .MINUS = void{} };
+        if (c == '!') return Token{ .NOT = void{} };
 
         const string = self.consume_string();
         if (string.len == 0) return TokenizerError.TokenizingError;