fixed additional comsumption of token if operator

development
Michael Ochmann 3 years ago
parent 8614e08569
commit e45abf48ba
  1. 5
      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();
}

Loading…
Cancel
Save