fix(parser): correctly identify EOF
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user