Added expression statement

This commit is contained in:
Rafał Grodziński
2025-06-01 11:37:01 +09:00
parent 28e892ca12
commit 265ce4c94d
5 changed files with 71 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ vector<Token> Lexer::getTokens() {
Token token = nextToken();
// Abort scanning if we got an error
if (token.getKind() == Token::Kind::INVALID) {
if (!token.isValid()) {
cerr << "Unexpected character '" << token.getLexme() << "' at " << token.getLine() << ":" << token.getColumn() << endl;
return vector<Token>();
}