Fixed various Parser bugs.

This commit is contained in:
2022-10-03 19:58:44 -05:00
parent be91e3c112
commit cd1258a724
4 changed files with 95 additions and 451 deletions
+9
View File
@@ -98,6 +98,15 @@ List* GenerateTokenList(const char* source) {
token = NULL;
}
if (tokens->size > 0) {
token = tokens->content[tokens->size - 1];
if (token->Class == PunctuationClass && token->Value.Punctuation == NewLine) {
//If the last token is a line break, remove it as its not too meaningful.
tokens->size--;
}
}
token = CreateToken(Line, PunctuationClass);
token->EndOfFile = 1;