Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
kamva9697 committed Dec 17, 2023
1 parent 2ca43c3 commit b2984d4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/token.zig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,14 @@ pub const TokenType = enum {
EOF,
};

pub const Token = struct { Type: TokenType, Literal: []const u8 };
pub const Token = struct {
Type: TokenType,
Literal: []const u8,

pub inline fn isEqual(self: Token, other: TokenType) bool {
return self.Type == other;
}
};

pub const keywords = std.ComptimeStringMap(TokenType, .{
.{ "fn", .FUNCTION },
Expand Down

0 comments on commit b2984d4

Please sign in to comment.