fix: char > 127 when test in fix point exponent

This commit is contained in:
Roy Qu 2024-03-27 20:14:39 +08:00
parent 7034742741
commit 37f98eb605
1 changed files with 5 additions and 3 deletions

View File

@ -3598,7 +3598,7 @@ bool ASFormatter::isInExponent() const
return false; return false;
int i = charNum - 1; int i = charNum - 1;
char prevChar = currentLine[i]; unsigned char prevChar = currentLine[i];
if (prevChar == 'e' || prevChar == 'E') { if (prevChar == 'e' || prevChar == 'E') {
i--; i--;
@ -3613,7 +3613,8 @@ bool ASFormatter::isInExponent() const
} else if (isDigit(prevChar)) { } else if (isDigit(prevChar)) {
numCount++; numCount++;
} else { } else {
if (isLetterOrUnderLine(prevChar) || prevChar == '$') if (isLetterOrUnderLine(prevChar) || prevChar == '$'
|| prevChar>127)
return false; return false;
break; break;
} }
@ -3647,7 +3648,8 @@ bool ASFormatter::isInExponent() const
return false; return false;
hasX = true; hasX = true;
} else { } else {
if (isLetterOrUnderLine(prevChar) || prevChar == '$') if (isLetterOrUnderLine(prevChar) || prevChar == '$'
|| prevChar>127)
return false; return false;
break; break;
} }