"""
unop_method_nodes = {
'typeof': TypeofNode,
+
+ 'operator.address': AmpersandNode,
+ 'operator.dereference': DereferenceNode,
+ 'operator.preincrement' : inc_dec_constructor(True, '++'),
+ 'operator.predecrement' : inc_dec_constructor(True, '--'),
+ 'operator.postincrement': inc_dec_constructor(False, '++'),
+ 'operator.postdecrement': inc_dec_constructor(False, '--'),
+
+ # For backwards compatability.
'address': AmpersandNode,
- 'dereference': DereferenceNode,
- 'preincrement' : inc_dec_constructor(True, '++'),
- 'predecrement' : inc_dec_constructor(True, '--'),
- 'postincrement': inc_dec_constructor(False, '++'),
- 'postdecrement': inc_dec_constructor(False, '--'),
}
special_methods = set(['declare', 'union', 'struct', 'typedef', 'sizeof', 'cast', 'pointer', 'compiled', 'NULL']
self.cython_module_names.add(modname)
elif node.module_name.startswith(u"cython."):
if node.as_name:
- modname = node.as_name
+ self.directive_names[node.as_name] = node.module_name[7:]
else:
- modname = u"cython"
- self.directive_names[modname] = node.module_name[7:]
+ self.cython_module_names.add(u"cython")
else:
return node
elif node.module_name == u"cython":
is_cython_module = True
submodule = u""
+ else:
+ is_cython_module = False
if is_cython_module:
newimp = []
for pos, name, as_name, kind in node.imported_names:
elif node.module.module_name.value == u"cython":
is_cython_module = True
submodule = u""
+ else:
+ is_cython_module = False
if is_cython_module:
newimp = []
for name, name_node in node.items:
-cimport cython
-from cython cimport dereference as deref
+cimport cython.operator
+from cython.operator cimport dereference as deref
cdef extern from "cpp_operators_helper.h":
cdef cppclass TestOps:
post --
"""
cdef TestOps* t = new TestOps()
- print cython.preincrement(t[0])
- print cython.predecrement(t[0])
- print cython.postincrement(t[0])
- print cython.postdecrement(t[0])
+ print cython.operator.preincrement(t[0])
+ print cython.operator.predecrement(t[0])
+ print cython.operator.postincrement(t[0])
+ print cython.operator.postdecrement(t[0])
del t
def test_binop():