commit a4df443f966514a7dedbe3eec4bd3303cf1797c1 (tree)
parent 2c8541bdde0b5ffd291600639b6123e512496923
Author: Ali Chraghi <63465728+AliChraghi@users.noreply.github.com>
Date: Mon, 21 Feb 2022 00:58:59 +0330
Update Tokenizer Dump Function
fix missed `loc` field
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/std/zig/tokenizer.zig b/lib/std/zig/tokenizer.zig
@@ -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 {