Smarten up attribute highlighting

This commit is contained in:
Ben S
2015-02-15 13:07:24 +00:00
parent 5452afbb9c
commit e6c0074733
2 changed files with 39 additions and 4 deletions

30
rust.mm
View File

@@ -134,13 +134,37 @@ SInt32 skipWord(BBLMTextIterator &iter)
SInt32 skipAttribute(BBLMTextIterator &iter)
{
SInt32 length = 1;
SInt32 length = 0;
UniChar ch;
iter++;
if (iter.strcmp("#[", 2) == 0)
{
length += 2;
iter += 2;
}
else if (iter.strcmp("#![", 3) == 0)
{
length += 3;
iter += 3;
}
else if (iter.strcmp("#", 1) == 0)
{
iter++;
return 1;
}
else
{
return 0;
}
while ((ch = iter.GetNextChar()))
{
if (ch == '\n' || ch == '\r')
if (ch == ']')
{
length++;
break;
}
else if (ch == '\n' || ch == '\r')
{
break;
}