Closed sin-ack closed 2 years ago
Noticed while using the REPL script.
Typing in the following works:
> 'Hello world' printLine Hello world
Typing in the following fails:
> 'Hello world' printLine. thread 14593 panic: Shouldn't reach here! self/src/language/lexer.zig:113:5: 0x25d0d7 in language.lexer.nextToken (self) @panic("Shouldn't reach here!"); ^ self/src/language/parser.zig:123:41: 0x25d264 in language.parser.parseStatement (self) _ = try self.lexer.nextToken(); ^ self/src/language/parser.zig:88:36: 0x25c806 in language.parser.parse (self) if (try self.parseStatement(.EOF)) |*statement| { ^ self/src/language/script.zig:83:42: 0x253ac8 in language.script.parseScript (self) self.ast_root = try self.parser.parse(); ^ ...
It seems like we are not setting the EOF condition correctly when the input does not end in whitespace.
Fixed by 9386c38
Noticed while using the REPL script.
Typing in the following works:
Typing in the following fails:
It seems like we are not setting the EOF condition correctly when the input does not end in whitespace.