Expanded on diagnostics, make whitespace completely ignored

This commit is contained in:
2019-05-21 15:11:00 +02:00
parent 8f2f122215
commit ae25598864
7 changed files with 67 additions and 20 deletions

View File

@@ -13,8 +13,10 @@ vector<IToken*> Lexer::Lex() {
vector<IToken*> tokens;
while (true){
IToken* next = this -> LexNext(this -> Next());
tokens.push_back(next);
if (next->GetKind() == TokenKind::EndOfFile)
auto nextKind = next -> GetKind();
if (nextKind != TokenKind::WhiteSpace)
tokens.push_back(next);
if (nextKind == TokenKind::EndOfFile)
break;
}
return tokens;