[Cython] PATH: special-case Py_ssize_t and size_t in the parser

Stefan Behnel stefan_ml at behnel.de
Thu Feb 19 13:29:40 CET 2009


Lisandro Dalcin wrote:
> Then I'll try to make this work, but this would still need to
> special-case when parsing basic C types. If not, the mix of
> <modifiers> <Py_ssize_t | size_t> get consumed and a the ctypedef
> parsing will fail because of a empty typedef name (the same if you
> wrote "typedef double" instead of "typedef double MyDouble").

You can let the parser parse them as usual and once that succeeded, have
it check for the two names to drop the declaration with a warning. From my
side, it's ok to do that in the parser.


> Just a question: if the ctypedef is ignored, what should be the return
> of p_ctypedef_statement() ??? None? a PassNode?

A PassNode should be safe and allowed wherever we allow a ctypedef statement.

Stefan



More information about the Cython-dev mailing list