Commit f230a861 authored by Stefan Behnel's avatar Stefan Behnel

disable some Cython syntax in .py compilation mode: typecasts, &..., sizeof()

parent 293a9b51
...@@ -278,17 +278,17 @@ def _p_factor(s): ...@@ -278,17 +278,17 @@ def _p_factor(s):
pos = s.position() pos = s.position()
s.next() s.next()
return ExprNodes.unop_node(pos, op, p_factor(s)) return ExprNodes.unop_node(pos, op, p_factor(s))
elif sy == '&': elif not s.in_python_file:
pos = s.position() if sy == '&':
s.next() pos = s.position()
arg = p_factor(s) s.next()
return ExprNodes.AmpersandNode(pos, operand = arg) arg = p_factor(s)
elif sy == "<": return ExprNodes.AmpersandNode(pos, operand = arg)
return p_typecast(s) elif sy == "<":
elif sy == 'IDENT' and s.systring == "sizeof": return p_typecast(s)
return p_sizeof(s) elif sy == 'IDENT' and s.systring == "sizeof":
else: return p_sizeof(s)
return p_power(s) return p_power(s)
def p_typecast(s): def p_typecast(s):
# s.sy == "<" # s.sy == "<"
......
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