zanshin 16:23:27 ~/code/zig/codecrafters-interpreter-zig master $ zig build run – tokenize assignment_and_equal.lox
EQUAL_EQUAL = null
thread 24683 panic: index out of bounds: index 4, len 3
/home/zanshin/code/zig/codecrafters-interpreter-zig/src/main.zig:64:40: 0x10e2020 in main (main)
const token = file_contents[idx .. idx + 1];
^
/home/zanshin/.zvm/0.14.0/lib/std/start.zig:656:37: 0x10df70a in posixCallMainAndExit (main)
const result = root.main() catch |err| {
^
/home/zanshin/.zvm/0.14.0/lib/std/start.zig:271:5: 0x10df2bd in _start (main)
asm volatile (switch (native_arch) {
^
???:?:?: 0x0 in ??? (???)
run
└─ run main failure
error: the following command terminated unexpectedly:
/home/zanshin/code/zig/codecrafters-interpreter-zig/.zig-cache/o/ee9be5f3bbaa20429159599d18078bb7/main tokenize assignment_and_equal.lox
Build Summary: 1/3 steps succeeded; 1 failed
run transitive failure
└─ run main failure
error: the following build command failed with exit code 1:
/home/zanshin/code/zig/codecrafters-interpreter-zig/.zig-cache/o/97749b66c265ca29509748378a07701f/build /home/zanshin/.zvm/0.14.0/zig /home/zanshin/.zvm/0.14.0/lib /home/zanshin/code/zig/codecrafters-interpreter-zig /home/zanshin/code/zig/codecrafters-interpreter-zig/.zig-cache /home/zanshin/.cache/zig --seed 0x2ee7b0d1 -Zaebd6382d7b89e6c run – tokenize assignment_and_equal.lox
If I run the original code on my machine It parses just fine: