From: Robert Bradshaw Date: Thu, 2 Apr 2009 23:00:08 +0000 (-0700) Subject: Add c99 keywords to invalid name list X-Git-Tag: 0.11.1.alpha~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7c34236c7b0220c927efd197056205618d5a2e35;p=cython.git Add c99 keywords to invalid name list --- diff --git a/Cython/Compiler/Symtab.py b/Cython/Compiler/Symtab.py index 53e93057..885c9ad1 100644 --- a/Cython/Compiler/Symtab.py +++ b/Cython/Compiler/Symtab.py @@ -23,16 +23,17 @@ except NameError: possible_identifier = re.compile(ur"(?![0-9])\w+$", re.U).match nice_identifier = re.compile('^[a-zA-Z0-0_]+$').match -ansi_c_keywords = set( +iso_c99_keywords = set( ['auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'do', 'double', 'else', 'enum', 'extern', 'float', 'for', 'goto', 'if', 'int', 'long', 'register', 'return', 'short', 'signed', 'sizeof', 'static', 'struct', 'switch', 'typedef', 'union', 'unsigned', 'void', - 'volatile', 'while']) + 'volatile', 'while', + '_Bool', '_Complex'', _Imaginary', 'inline', 'restrict']) def c_safe_identifier(cname): # There are some C limitations on struct entry names. - if (cname[:2] == '__' and not cname.startswith(Naming.pyrex_prefix)) or cname in ansi_c_keywords: + if (cname[:2] == '__' and not cname.startswith(Naming.pyrex_prefix)) or cname in iso_c99_keywords: cname = Naming.pyrex_prefix + cname return cname