[Pyrex] Pyrex parser bug

John J Lee jjl at pobox.com
Sat Jul 19 18:42:49 CEST 2003


The following file causes a traceback instead of a Pyrex syntax error
with Pyrex 0.8.2, Python 2.3b2 (0.7.2 / Python 2.2.1 also gives a
traceback).

Note the syntax error (using C-style () cast syntax instead of <>), and
that BLAH is a macro which is (unintentionally) not declared in the Pyrex
file.

------CUT HERE------
ctypedef int foo

cdef foo bar():
    cdef int i

    return (((foo)(i) << 1) | BLAH)
------CUT HERE------


Here's the tail of the traceback:

...
  File
"/usr/local/lib/python2.3/site-packages/Pyrex/Compiler/ExprNodes.py", line
304, in allocate_subexpr_temps
    node.allocate_temps(env)
  File
"/usr/local/lib/python2.3/site-packages/Pyrex/Compiler/ExprNodes.py", line
290, in allocate_temps
    self.allocate_subexpr_temps(env)
  File
"/usr/local/lib/python2.3/site-packages/Pyrex/Compiler/ExprNodes.py", line
304, in allocate_subexpr_temps
    node.allocate_temps(env)
  File
"/usr/local/lib/python2.3/site-packages/Pyrex/Compiler/ExprNodes.py", line
291, in allocate_temps
    self.allocate_temp(env, result)
  File
"/usr/local/lib/python2.3/site-packages/Pyrex/Compiler/ExprNodes.py", line
331, in allocate_temp
    self.result = self.result_code()
  File
"/usr/local/lib/python2.3/site-packages/Pyrex/Compiler/ExprNodes.py", line
1180, in result_code
    return self.c_call_code(as_extension_type = 0)
  File
"/usr/local/lib/python2.3/site-packages/Pyrex/Compiler/ExprNodes.py", line
1188, in c_call_code
    formal_args = self.function.type.args
AttributeError: CIntType instance has no attribute 'args'
make: *** [all] Error 1


John





More information about the Pyrex mailing list