Fixed various Parser bugs.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user