Highlight hex literals

This commit is contained in:
Ben S
2014-11-25 19:44:29 +00:00
parent 01998a20bc
commit 91d69de57f

26
rust.mm
View File

@@ -178,8 +178,28 @@ SInt32 skipUse(BBLMTextIterator &iter)
SInt32 skipNumber(BBLMTextIterator &iter)
{
UInt32 length = 0;
UniChar ch;
UniChar ch = iter.GetNextChar();
bool hasSuffix = false;
bool isHex = false;
if (ch == '0')
{
ch = iter.GetNextChar();
if (ch == 'x')
{
isHex = true;
length += 2;
}
else if (ch)
{
length++;
iter--;
}
}
else if (ch)
{
iter--;
}
while ((ch = iter.GetNextChar()))
{
@@ -187,6 +207,10 @@ SInt32 skipNumber(BBLMTextIterator &iter)
{
length++;
}
else if (isHex && ((ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F')))
{
length++;
}
else if (ch == 'f' || ch == 'u' || ch == 'i')
{
hasSuffix = true;