Ticket #61 (new defect)

Opened 4 months ago

Last modified 4 months ago

Buffers in cdef function argument list

Reported by: dagss Assigned to: dagss
Priority: minor Milestone: wishlist
Component: Parsing Version:
Keywords: buffer cdef parser numerics Cc:

Description

The parser doesn't allow

cdef void foo(np.ndarray[float] X):
    pass

This is because the parser has to support

cdef void foo(int[] X)

and at the point of parsing the [ it isn't known whether is is a definition or declaration (right?)

One could for instance parse to the end of the line and check for a ":" when encountering the [ in a cdef (and store info to coordinate this in the parsing context) -- as the two cases can be seperated on whether it is a definition or not.

Another option is to use a "TrailingBracketTypeNode?" rather than let the parser resolve it.

Change History

(in reply to: ↑ description ) 08/24/2008 01:25:44 PM changed by dagss

Replying to dagss:

This is because the parser has to support {{{ cdef void foo(int[] X) }}}

Here it should have been

cdef void foo(int[])

And it seems we can just look ahead a single word to fix it for now...

08/26/2008 05:26:55 AM changed by dagss

  • keywords changed from buffer cdef parser to buffer cdef parser numerics.