Fix the definition of an identifier in indexed search to include a dash followed a digit

This commit is contained in:
Jason Haslam 2020-07-14 10:44:41 -06:00
parent 7b7c29c1df
commit bbb4f78a73

View File

@ -85,7 +85,8 @@ Lexer::Lexeme GenericLexer::next()
case Identifier: {
char nextCh = safeAt(mBuffer, mIndex + 1);
bool compound = (ch == '-' || ch == '\'') && isAlpha(nextCh);
bool compound = ((ch == '\'' && isAlpha(nextCh)) ||
(ch == '-' && (isAlpha(nextCh) || isDigit(nextCh))));
if (ch != '_' && !alpha && !digit && !compound)
return {Identifier, mBuffer.mid(startPos, mIndex - startPos)};
break;