Smarten up attribute highlighting
This commit is contained in:
30
rust.mm
30
rust.mm
@@ -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;
|
||||
}
|
||||
|
||||
13
smoke.rs
13
smoke.rs
@@ -50,6 +50,8 @@
|
||||
r##"there's a " in this string"## // the string shouldn't end until ##
|
||||
r##"there's a # in this string"## // even if there's a # in the middle
|
||||
|
||||
// " // in case the above failed :)
|
||||
|
||||
// Decimal Numbers
|
||||
// ---------------
|
||||
|
||||
@@ -84,7 +86,7 @@
|
||||
7.348e+22 // uppercase E and plus
|
||||
|
||||
let tuple = ((8, 4), 48);
|
||||
let a = tuple.1.1
|
||||
let a = tuple.0.0;
|
||||
|
||||
// Numeric Suffixes
|
||||
// ----------------
|
||||
@@ -99,3 +101,12 @@
|
||||
0.1f32
|
||||
12E+99_f64
|
||||
2.f64 // Invalid!
|
||||
|
||||
// Attributes
|
||||
// ----------
|
||||
|
||||
#[attribute]
|
||||
#![top_level_attribute]
|
||||
#not_an_attribute
|
||||
|
||||
#[macro_use] use this_is_not_an_attribute;
|
||||
|
||||
Reference in New Issue
Block a user