Highlight hex literals
This commit is contained in:
26
rust.mm
26
rust.mm
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user