From 2bc546f04c512ec881b2b58f41c5eabf846f2f2e Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Wed, 20 May 2009 13:16:03 -0700 Subject: [PATCH] cppclass not a keyword --- Cython/Compiler/Parsing.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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") -- 2.26.2