Only flush the currentToken when encountering a semi-colon IF the currentToken is non-empty

This commit is contained in:
Tristan B. Velloza Kildaire 2021-03-02 22:33:38 +02:00
parent b178528ece
commit ce7ea36b0b
1 changed files with 7 additions and 4 deletions

View File

@ -40,10 +40,13 @@ public final class Lexer
}
else if(currentChar == ';' && !stringMode)
{
/* Flush the current token */
currentTokens ~= currentToken;
currentToken = "";
/* Flush the current token (if one exists) */
if(currentToken.length)
{
currentTokens ~= currentToken;
currentToken = "";
}
/* Add the ; token */
currentTokens ~= ";";