Changes to the way numbers are highlighted

They were being highlighted after underscores in variable names, and underscores weren't being catered for in non-base-ten numeric literals. Now, fixed!
This commit is contained in:
Ben S
2014-12-24 14:11:32 +00:00
parent c98ec54134
commit 79a65307f0
+4 -4
View File
@@ -196,15 +196,15 @@ SInt32 skipNumber(BBLMTextIterator &iter)
{
length++;
}
else if ((base == 2) && (ch == '0' || ch == '1'))
else if ((base == 2) && (ch == '0' || ch == '1' || ((ch == '_' || ch == '.') && length > 0)))
{
length++;
}
else if ((base == 8) && (ch >= '0' && ch <= '7'))
else if ((base == 8) && ((ch >= '0' && ch <= '7') || ((ch == '_' || ch == '.') && length > 0)))
{
length++;
}
else if ((base == 16) && ((ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F') || isdigit(ch)))
else if ((base == 16) && ((ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F') || isdigit(ch) || ((ch == '_' || ch == '.') && length > 0)))
{
length++;
}
@@ -762,7 +762,7 @@ OSErr calculateRuns(BBLMParamBlock &params, const BBLMCallbackBlock *callbacks)
runStart = iter.Offset();
}
wordchr = isalpha(ch) || isdigit(ch);
wordchr = isalpha(ch) || isdigit(ch) || ch == '_';
}
makeCodeRun(iter, runStart, *callbacks);