Simplify a condition in lexer.cpp
This commit is contained in:
parent
e8c633d545
commit
74a7a5f2f7
@ -39,7 +39,7 @@ vector<tok> lex(const string& in)
|
||||
string formedString;
|
||||
for (;i < in.size(); ++i) {
|
||||
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]);
|
||||
} else {
|
||||
resVal.emplace_back(type, formedString);
|
||||
|
Loading…
Reference in New Issue
Block a user