Commit 14acb834 authored by Stefan Behnel's avatar Stefan Behnel

re-allow 'pass' statement in cdef blocks

parent e9db1e9a
...@@ -1498,6 +1498,9 @@ def p_statement(s, ctx, first_statement = 0): ...@@ -1498,6 +1498,9 @@ def p_statement(s, ctx, first_statement = 0):
decorators = p_decorators(s) decorators = p_decorators(s)
if s.sy not in ('def', 'cdef', 'cpdef'): if s.sy not in ('def', 'cdef', 'cpdef'):
s.error("Decorators can only be followed by functions ") s.error("Decorators can only be followed by functions ")
elif s.sy == 'pass' and cdef_flag:
# empty cdef block
return p_pass_statement(s, with_newline = 1)
overridable = 0 overridable = 0
if s.sy == 'cdef': if s.sy == 'cdef':
......
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