Update Tokenizer Dump Function

fix missed `loc` field
This commit is contained in:
Ali Chraghi 2022-02-21 00:58:59 +03:30 committed by Andrew Kelley
parent 2c8541bdde
commit a4df443f96

View File

@ -345,7 +345,7 @@ pub const Tokenizer = struct {
/// For debugging purposes
pub fn dump(self: *Tokenizer, token: *const Token) void {
std.debug.print("{s} \"{s}\"\n", .{ @tagName(token.tag), self.buffer[token.start..token.end] });
std.debug.print("{s} \"{s}\"\n", .{ @tagName(token.tag), self.buffer[token.loc.start..token.loc.end] });
}
pub fn init(buffer: [:0]const u8) Tokenizer {