Commit 2bc546f0 authored by Robert Bradshaw's avatar Robert Bradshaw

cppclass not a keyword

parent e87022ac
...@@ -2093,11 +2093,10 @@ def p_cdef_statement(s, ctx): ...@@ -2093,11 +2093,10 @@ def p_cdef_statement(s, ctx):
if ctx.overridable: if ctx.overridable:
error(pos, "Extension types cannot be declared cpdef") error(pos, "Extension types cannot be declared cpdef")
return p_c_class_definition(s, pos, ctx) return p_c_class_definition(s, pos, ctx)
elif s.sy == 'cppclass': elif s.sy == 'IDENT' and s.systring == 'cppclass':
if ctx.visibility == 'extern': if ctx.visibility != 'extern':
return p_cpp_class_definition(s, pos, ctx)
else:
error(pos, "C++ classes need to be declared 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"): elif s.sy == 'IDENT' and s.systring in ("struct", "union", "enum", "packed"):
if ctx.level not in ('module', 'module_pxd'): if ctx.level not in ('module', 'module_pxd'):
error(pos, "C struct/union/enum definition not allowed here") error(pos, "C struct/union/enum definition not allowed here")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment