pos = s.position()
not_none = 0
default = None
- base_type = p_c_base_type(s, cmethod_flag, nonempty = nonempty)
+ if s.in_python_file:
+ # empty type declaration
+ base_type = Nodes.CSimpleBaseTypeNode(pos,
+ name = None, module_path = [],
+ is_basic_c_type = 0, signed = 0,
+ complex = 0, longness = 0,
+ is_self_arg = cmethod_flag, templates = None)
+ else:
+ base_type = p_c_base_type(s, cmethod_flag, nonempty = nonempty)
declarator = p_c_declarator(s, ctx, nonempty = nonempty)
- if s.sy == 'not':
+ if s.sy == 'not' and not s.in_python_file:
s.next()
if s.sy == 'IDENT' and s.systring == 'None':
s.next()
cdef public bint compile_time_eval
cdef public bint compile_time_expr
cdef public bint parse_comments
+ cdef public bint in_python_file
cdef public source_encoding
cdef set keywords
cdef public list indentation_stack
self.parse_comments = parse_comments
self.source_encoding = source_encoding
if filename.is_python_file():
+ self.in_python_file = True
self.keywords = cython.set(py_reserved_words)
else:
+ self.in_python_file = False
self.keywords = cython.set(pyx_reserved_words)
self.trace = trace_scanner
self.indentation_stack = [0]