diff options
| author | Robert Bradshaw <robertwb@gmail.com> | 2014-08-22 01:38:28 -0700 |
|---|---|---|
| committer | Robert Bradshaw <robertwb@gmail.com> | 2014-08-22 02:15:52 -0700 |
| commit | 49c6c6d63a0c2d19fecf4a01101e0666d9c27bd7 (patch) | |
| tree | 16279ccca4b5ef8caad624bebe128d358b3e01da /Cython/Parser | |
| parent | af01f9aa57c50a94137538267919758cb754a15c (diff) | |
| download | cython-49c6c6d63a0c2d19fecf4a01101e0666d9c27bd7.tar.gz | |
Add cdef function declarations to the grammar.
Diffstat (limited to 'Cython/Parser')
| -rw-r--r-- | Cython/Parser/Grammar | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Cython/Parser/Grammar b/Cython/Parser/Grammar index e98284ccf..f91821acc 100644 --- a/Cython/Parser/Grammar +++ b/Cython/Parser/Grammar @@ -157,15 +157,18 @@ new_expr: 'new' type '(' [arglist] ')' cdef_stmt: ('cdef' | 'cpdef') (cvar_def | cdef_type_decl | extern_block) cdef_type_decl: ctype_decl | fused | cclass ctype_decl: struct | enum | cppclass +ctypedef_stmt: 'ctypedef' (cvar_decl | struct | enum) # These two are similar but can't be used in an or clause # as it would cause ambiguity in the LL(1) parser. # Requires a type -cvar_decl: type NAME NEWLINE +cvar_decl: type NAME (NEWLINE | cfunc) # Allows an assignment -cvar_def: maybe_typed_name NEWLINE +cvar_def: maybe_typed_name (NEWLINE | cfunc) -ctypedef_stmt: 'ctypedef' (cvar_decl | struct | enum) +cfunc: [teplate_params] parameters [gil_spec] [exception_value] (':' suite | NEWLINE) +exception_value: 'except' (['?'] expr | '*' | '+' [NAME]) +gil_spec: 'with' ('gil' | 'nogil') | 'nogil' cclass: classdef fused: 'fused' NAME ':' NEWLINE INDENT ( type NEWLINE)+ DEDENT |
