diff --git a/src/Lexer.cpp b/src/Lexer.cpp index 3c364ff..fe2fc3a 100644 --- a/src/Lexer.cpp +++ b/src/Lexer.cpp @@ -203,7 +203,6 @@ namespace dumb { this->tokenStream.emplace_back(type, "", this->line, this->column); - this->consume(); } void Lexer::readStringLiteral() { @@ -267,6 +266,10 @@ namespace dumb { std::cout << "Unexpected token '" << this->current() << "' on line " << this->line << " column " << this->column << std::endl; exit(1); } + if (std::isdigit(this->current())) { + std::cout << "Unexpected token '" << this->current() << "' on line " << this->line << " column " << this->column << std::endl; + exit(1); + } this->tokenStream.emplace_back(Token::Type::INTEGER_LITERAL, std::to_string(value), line, column); this->resetBuffer(); }