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/editors/space_text | |
parent | df29e91a697fbc89dea9c38282f3283e2fee7cc5 (diff) |
update python keywords (remove exec, print, add nonlocal)
Diffstat (limited to 'source/blender/editors/space_text')
-rw-r--r-- | source/blender/editors/space_text/text_draw.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 98560be477d..84f960ecf2a 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -184,16 +184,23 @@ void flatten_string_free(FlattenString *fs) * a non-identifier (see text_check_identifier(char)) or null character. * * If a built-in function is found, the length of the matching name is returned. - * Otherwise, -1 is returned. */ + * Otherwise, -1 is returned. + * + * See: + * http://docs.python.org/py3k/reference/lexical_analysis.html#keywords + */ static int find_builtinfunc(char *string) { int a, i; - char builtinfuncs[][9] = {"and", "as", "assert", "break", "class", "continue", "def", - "del", "elif", "else", "except", "exec", "finally", - "for", "from", "global", "if", "import", "in", - "is", "lambda", "not", "or", "pass", "print", - "raise", "return", "try", "while", "yield", "with"}; + const char *builtinfuncs[] = { + /* "False", "None", "True", */ /* see find_bool() */ + "and", "as", "assert", "break", + "class", "continue", "def", "del", "elif", "else", "except", + "finally", "for", "from", "global", "if", "import", "in", + "is", "lambda", "nonlocal", "not", "or", "pass", "raise", + "return", "try", "while", "with", "yield", + }; for (a = 0; a < sizeof(builtinfuncs) / sizeof(builtinfuncs[0]); a++) { i = 0; |