fix(parser): correctly identify EOF

This commit is contained in:
2026-02-06 01:12:32 +01:00
parent 330486fb81
commit 40c6e65acc

View File

@@ -43,7 +43,7 @@ class Parser:
self.advance()
def is_at_end(self) -> bool:
return self.current >= self.length
return self.peek().type == TokenType.EOF
def peek(self) -> Token:
return self.tokens[self.current]