Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buffers in cdef function argument list #618

Closed
robertwb opened this issue Aug 24, 2008 · 3 comments
Closed

Buffers in cdef function argument list #618

robertwb opened this issue Aug 24, 2008 · 3 comments

Comments

@robertwb
Copy link
Contributor

The parser doesn't allow

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

This is because the parser has to support

cdef void foo(int[](float]) 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.

Migrated from http://trac.cython.org/ticket/61

@robertwb
Copy link
Contributor Author

@dagss commented

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...

@robertwb
Copy link
Contributor Author

@dagss changed keywords from buffer cdef parser to buffer cdef parser numerics
commented

@robertwb
Copy link
Contributor Author

scoder changed milestone from wishlist to 0.14
resolution to worksforme
status from new to closed
commented

Fixed according to

http://thread.gmane.org/gmane.comp.python.cython.user/2294/focus=2296

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant