diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-30 05:26:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-30 05:26:31 +0400 |
commit | e12354c4c5850864f925d22f53ec31578384bc63 (patch) | |
tree | bc7966010e1f3d01e255bd56476bb71e3f10c0c0 /source/blender/editors/space_text/text_format_osl.c | |
parent | 099d8c93904747fa39857684dce2bd228c3462eb (diff) |
add syntax highlighting color for symbols
Diffstat (limited to 'source/blender/editors/space_text/text_format_osl.c')
-rw-r--r-- | source/blender/editors/space_text/text_format_osl.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c index 433ff0a035b..38903d65ec0 100644 --- a/source/blender/editors/space_text/text_format_osl.c +++ b/source/blender/editors/space_text/text_format_osl.c @@ -154,8 +154,8 @@ static int txtfmt_osl_find_preprocessor(const char *string) { if (string[0] == '#') { int i = 1; - /* whitespace is ok '# foo' */ - while (string[i] == '\t' || string[i] == ' ') { + /* Whitespace is ok '# foo' */ + while (text_check_whitespace(string[i])) { i++; } while (text_check_identifier(string[i])) { @@ -166,24 +166,6 @@ static int txtfmt_osl_find_preprocessor(const char *string) return -1; } -/* not in OSL, keep for now though */ -#if 0 -static int txtfmt_osl_find_bool(const char *string) -{ - int i, len; - - if (STR_LITERAL_STARTSWITH(string, "None", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "True", len)) i = len; - else if (STR_LITERAL_STARTSWITH(string, "False", len)) i = len; - else i = 0; - - /* If next source char is an identifier (eg. 'i' in "Nonetheless") no match */ - if (i == 0 || text_check_identifier(string[i])) - return -1; - return i; -} -#endif - static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const int do_next) { FlattenString fs; |