From: Robert Bradshaw Date: Wed, 20 May 2009 20:16:03 +0000 (-0700) Subject: cppclass not a keyword X-Git-Tag: 0.13.beta0~353^2~91 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2bc546f04c512ec881b2b58f41c5eabf846f2f2e;p=cython.git cppclass not a keyword --- diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 08707fc3..cf7f982c 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -2093,11 +2093,10 @@ def p_cdef_statement(s, ctx): if ctx.overridable: error(pos, "Extension types cannot be declared cpdef") return p_c_class_definition(s, pos, ctx) - elif s.sy == 'cppclass': - if ctx.visibility == 'extern': - return p_cpp_class_definition(s, pos, ctx) - else: + elif s.sy == 'IDENT' and s.systring == 'cppclass': + if ctx.visibility != 'extern': error(pos, "C++ classes need to be declared extern") + return p_cpp_class_definition(s, pos, ctx) elif s.sy == 'IDENT' and s.systring in ("struct", "union", "enum", "packed"): if ctx.level not in ('module', 'module_pxd'): error(pos, "C struct/union/enum definition not allowed here")