diff options
| author | Nic Gaffney <gaffney_nic@protonmail.com> | 2025-02-19 18:28:18 -0600 |
|---|---|---|
| committer | Nic Gaffney <gaffney_nic@protonmail.com> | 2025-02-19 18:28:18 -0600 |
| commit | 4ea2876e8243a86276917e691a335caed7a8fd74 (patch) | |
| tree | 79554a528e70d0a810692560f659ca6270a77f50 /src/tokenize.zig | |
| parent | fe851bcb542dac5f3af312da02ff617aa817f118 (diff) | |
| download | calico-4ea2876e8243a86276917e691a335caed7a8fd74.tar.gz | |
Added while loop
Diffstat (limited to 'src/tokenize.zig')
| -rw-r--r-- | src/tokenize.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/tokenize.zig b/src/tokenize.zig index 038a4d3..93d1f87 100644 --- a/src/tokenize.zig +++ b/src/tokenize.zig @@ -20,6 +20,7 @@ pub const TokenType = enum { exit, fun, import, + whilestmt, // Operators plus, minus, @@ -55,6 +56,7 @@ pub const Token = union(TokenType) { exit, fun, import, + whilestmt, // Operators plus, minus, @@ -109,6 +111,7 @@ pub const Token = union(TokenType) { if (eql(u8, str, "fn")) return .fun; if (eql(u8, str, "if")) return .ifstmt; if (eql(u8, str, "import")) return .import; + if (eql(u8, str, "while")) return .whilestmt; return Token{ .ident = str }; } @@ -124,6 +127,7 @@ pub const Token = union(TokenType) { .exit => "EXIT", .fun => "FUN", .import => "IMPORT", + .whilestmt => "WHILESTMT", .plus => "PLUS", .minus => "MINUS", .star => "STAR", |
