зеркало из https://github.com/mozilla/gecko-dev.git
Allow hex values in numbers
This commit is contained in:
Родитель
bca1b5126d
Коммит
04c36259c9
|
@ -1131,12 +1131,16 @@ void IdlScanner::Number(int aStartChar, Token *aToken)
|
||||||
if (isdigit(aStartChar)) {
|
if (isdigit(aStartChar)) {
|
||||||
digit = aStartChar - '0';
|
digit = aStartChar - '0';
|
||||||
}
|
}
|
||||||
else {
|
else if ((aStartChar >= 'a') && (aStartChar <= 'f')) {
|
||||||
digit = 10 + (aStartChar - 'a');
|
digit = 10 + (aStartChar - 'a');
|
||||||
}
|
}
|
||||||
|
else if ((aStartChar >= 'A') && (aStartChar <= 'F')) {
|
||||||
|
digit = 10 + (aStartChar - 'A');
|
||||||
|
}
|
||||||
|
|
||||||
value = value * base + digit;
|
value = value * base + digit;
|
||||||
aStartChar = mInputFile->get();
|
aStartChar = mInputFile->get();
|
||||||
} while ((' ' != aStartChar) && ('.' != aStartChar));
|
} while (isdigit(aStartChar) || ((aStartChar >= 'a') && (aStartChar <= 'f')) || ((aStartChar >= 'A') && (aStartChar <= 'F')));
|
||||||
|
|
||||||
if (aStartChar == '.') {
|
if (aStartChar == '.') {
|
||||||
// double. Deal with it later
|
// double. Deal with it later
|
||||||
|
|
Загрузка…
Ссылка в новой задаче