syntax highlighting for decorators, correct doc example

This commit is contained in:
2010-08-17 14:56:10 +00:00
parent b278279c95
commit fab0f053e7
2 changed files with 16 additions and 2 deletions

View File

@@ -222,6 +222,18 @@ static int find_specialvar(char *string)
return i;
}
static int find_decorator(char *string)
{
if(string[0] == '@') {
int i = 1;
while(text_check_identifier(string[i])) {
i++;
}
return i;
}
return -1;
}
static int find_bool(char *string)
{
int i = 0;
@@ -375,6 +387,8 @@ static void txt_format_line(SpaceText *st, TextLine *line, int do_next)
prev = 'v';
else if((i=find_builtinfunc(str)) != -1)
prev = 'b';
else if((i=find_decorator(str)) != -1)
prev = 'v'; /* could have a new color for this */
if(i>0) {
while(i>1) {
*fmt = prev; fmt++; str++;

View File

@@ -3,8 +3,8 @@ from math import radians
vec = mathutils.Vector((1.0, 2.0, 3.0))
mat_rot = mathutils.RotationMatrix(radians(90), 4, 'X')
mat_trans = mathutils.TranslationMatrix(vec)
mat_rot = mathutils.Matrix.Rotation(radians(90), 4, 'X')
mat_trans = mathutils.Matrix.Translation(vec)
mat = mat_trans * mat_rot
mat.invert()