X-Git-Url: https://git.ayoreis.com/zlox.git/blobdiff_plain/6d286699938880d7a1482be65e5e4771788c6b6f..60ca4a9e7c56ac47f67add12ec7d2edf5bd89e5a:/src/Token.zig?ds=sidebyside diff --git a/src/Token.zig b/src/Token.zig index 596b1ba..bceba6e 100644 --- a/src/Token.zig +++ b/src/Token.zig @@ -1,20 +1,14 @@ const std = @import("std"); const TokenType = @import("token_type.zig").TokenType; +const Object = @import("object.zig").Object; const Token = @This(); type: TokenType, lexeme: []const u8, -literal: ?Literal, +literal: ?Object, line: u32, -pub const Literal = union(enum) { - string: []const u8, - number: f64, - boolean: bool, - nil: void, -}; - -pub fn init(@"type": TokenType, lexeme: []const u8, literal: ?Literal, line: u32) Token { +pub fn init(@"type": TokenType, lexeme: []const u8, literal: ?Object, line: u32) Token { return .{ .type = @"type", .lexeme = lexeme,