Simplify a condition in lexer.cpp

This commit is contained in:
Username404-59 2021-07-06 10:15:30 +02:00
parent e8c633d545
commit 74a7a5f2f7
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1

View File

@ -39,7 +39,7 @@ vector<tok> lex(const string& in)
string formedString; string formedString;
for (;i < in.size(); ++i) { for (;i < in.size(); ++i) {
bool isString = getIdentifierCharType(in[i]) == tok::STRING; bool isString = getIdentifierCharType(in[i]) == tok::STRING;
if ((getIdentifierCharType(in[i]) == type && !isString) || (type == tok::STRING && !isString)) { if ((getIdentifierCharType(in[i]) == type || type == tok::STRING) && !isString) {
formedString += string(1, in[i]); formedString += string(1, in[i]);
} else { } else {
resVal.emplace_back(type, formedString); resVal.emplace_back(type, formedString);