On Tue, Aug 24, 2010 at 11:54 PM, Dag Sverre Seljebotn
<[email protected]> wrote:
> On 08/25/2010 08:46 AM, Robert Bradshaw wrote:
>> On Tue, Aug 24, 2010 at 10:50 PM, Stefan Behnel<[email protected]>  wrote:
>>
>>> Robert Bradshaw, 25.08.2010 02:37:
>>>
>>>> On Tue, Aug 24, 2010 at 5:34 PM, Greg Ewing wrote:
>>>>
>>>>> Darren Dale wrote:
>>>>>
>>>>>
>>>>>>     herr_t    H5Diterate(void *buf, hid_t type_id, hid_t space_id,
>>>>>>                           H5D_operator_t operator, void* operator_data) 
>>>>>> except *
>>>>>>                                                   ^
>>>>>> ------------------------------------------------------------
>>>>>>
>>>>>> /Users/darren/Projects/h5py/h5py/defs.pxd:190:49: Overloading operator
>>>>>> ',' not yet supported.
>>>>>>
>>>>> Looks like "operator" has become a keyword, and it thinks
>>>>> "operator," is referring to the C++ comma operator.
>>>>>
>>>> Yes, that is exactly the problem (and also the problem with namespaces
>>>> in function arguments), the question is how to best fix it.
>>>>
>>> Well, the right fix, first of all, would be to disallow this kind of C++
>>> syntax extensions in Cython code that is known to compile into C code (as
>>> opposed to C++ code), similar to what we do for .py files. Then, I'm pretty
>>> sure the above would not be a valid position for "operator," in C++. So,
>>> most likely, "operator" shouldn't be a keyword at all, but behave more like
>>> qualifiers, i.e. it should only be special cased in a specific syntactical
>>> context.
>>>
>> It is, the context in question is "c variable/function declaration"
>> which needs to be narrowed.
>>
>
> Can't you do it conditional on being in a "cdef cppclass" block? While
> not perfect, that at least gives us backwards compatability with
> currently working Cython code.

Not easily, given the structure of the parser. As I mentioned, this is
the same bug that causes C++ namespaces to get prepended to argument
names (I think). Essentially, we need to make parsing function
arguments and parsing variable declarations more distinct. The
contexts are not granular enough.

- Robert
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to