Found a rare lexer bug

This commit is contained in:
2022-09-10 19:11:16 +01:00
parent 60ddd151a6
commit cbc937884e
2 changed files with 6 additions and 1 deletions

View File

@@ -139,7 +139,7 @@ static Token makeIntegerOrFloat(Lexer* lexer) {
while(isDigit(lexer)) advance(lexer);
if (peek(lexer) == '.') {
if (peek(lexer) == '.' && (peekNext(lexer) >= '0' && peekNext(lexer) <= '9')) { //BUGFIX: peekNext == digit
type = TOKEN_LITERAL_FLOAT;
advance(lexer);
while(isDigit(lexer)) advance(lexer);