diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-06 09:53:01 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-06 09:53:01 +0400 |
commit | 906cd4d8a68c36abed99f98b35c725b27b32304b (patch) | |
tree | d72bc8a53e0c00e62a5f551f02f6a1cfcd6b650b /source/blender/blenkernel/intern/text.c | |
parent | df29e91a697fbc89dea9c38282f3283e2fee7cc5 (diff) |
update python keywords (remove exec, print, add nonlocal)
Diffstat (limited to 'source/blender/blenkernel/intern/text.c')
-rw-r--r-- | source/blender/blenkernel/intern/text.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 9715058c51f..4ce159b8aaf 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -622,7 +622,7 @@ void write_text(Text *text, const char *str) /* called directly from rna */ /* Editing utility functions */ /*****************************/ -static void make_new_line (TextLine *line, char *newline) +static void make_new_line(TextLine *line, char *newline) { if (line->line) MEM_freeN(line->line); if (line->format) MEM_freeN(line->format); @@ -770,7 +770,7 @@ static void txt_curs_first (Text *text, TextLine **linep, int *charp) /* Cursor movement functions */ /*****************************/ -int txt_utf8_offset_to_index(char *str, int offset) +int txt_utf8_offset_to_index(const char *str, int offset) { int index= 0, pos= 0; while (pos != offset) { @@ -780,7 +780,7 @@ int txt_utf8_offset_to_index(char *str, int offset) return index; } -int txt_utf8_index_to_offset(char *str, int index) +int txt_utf8_index_to_offset(const char *str, int index) { int offset= 0, pos= 0; while (pos != index) { @@ -3244,7 +3244,7 @@ TextMarker *txt_next_marker(Text *text, TextMarker *marker) /* Character utility functions */ /*******************************/ -int text_check_bracket(char ch) +int text_check_bracket(const char ch) { int a; char opens[] = "([{"; @@ -3259,10 +3259,11 @@ int text_check_bracket(char ch) return 0; } -int text_check_delim(char ch) +/* TODO, have a function for operators - http://docs.python.org/py3k/reference/lexical_analysis.html#operators */ +int text_check_delim(const char ch) { int a; - char delims[] = "():\"\' ~!%^&*-+=[]{};/<>|.#\t,"; + char delims[] = "():\"\' ~!%^&*-+=[]{};/<>|.#\t,@"; for (a=0; a<(sizeof(delims)-1); a++) { if (ch==delims[a]) @@ -3271,14 +3272,14 @@ int text_check_delim(char ch) return 0; } -int text_check_digit(char ch) +int text_check_digit(const char ch) { if (ch < '0') return 0; if (ch <= '9') return 1; return 0; } -int text_check_identifier(char ch) +int text_check_identifier(const char ch) { if (ch < '0') return 0; if (ch <= '9') return 1; @@ -3289,7 +3290,7 @@ int text_check_identifier(char ch) return 0; } -int text_check_whitespace(char ch) +int text_check_whitespace(const char ch) { if (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n') return 1; |