mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Fixed obscure EOF bug in lexer
This commit is contained in:
@@ -242,7 +242,6 @@ static Toy_Token makeString(Toy_Lexer* lexer, char terminator) {
|
||||
while (!isAtEnd(lexer)) {
|
||||
//stop if you've hit the terminator
|
||||
if (peek(lexer) == terminator) {
|
||||
advance(lexer); //eat the terminator
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -261,6 +260,8 @@ static Toy_Token makeString(Toy_Lexer* lexer, char terminator) {
|
||||
return makeErrorToken(lexer, "Unterminated string");
|
||||
}
|
||||
|
||||
advance(lexer); //eat the terminator
|
||||
|
||||
//make the token
|
||||
Toy_Token token;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user