summaryrefslogtreecommitdiff
path: root/Cython/Parser
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@gmail.com>2014-08-22 15:15:18 -0700
committerRobert Bradshaw <robertwb@gmail.com>2014-08-22 15:15:18 -0700
commit61966bb0e393a87a905899ffb57aea07792bbe2c (patch)
treeda9be499280d4c364a8d0030c8b2d6fba7730ce7 /Cython/Parser
parent353cdf0eb1b82b79ca345e65975e42b6cd3c08b1 (diff)
downloadcython-61966bb0e393a87a905899ffb57aea07792bbe2c.tar.gz
Add IF and DEF to grammar.
Diffstat (limited to 'Cython/Parser')
-rw-r--r--Cython/Parser/Grammar5
1 files changed, 4 insertions, 1 deletions
diff --git a/Cython/Parser/Grammar b/Cython/Parser/Grammar
index 134824ec3..0af4d2ab2 100644
--- a/Cython/Parser/Grammar
+++ b/Cython/Parser/Grammar
@@ -31,7 +31,7 @@ varargslist: ((fpdef ['=' test] ',')*
fpdef: maybe_typed_name | '(' fplist ')'
fplist: fpdef (',' fpdef)* [',']
-stmt: simple_stmt | compound_stmt | cdef_stmt | ctypedef_stmt
+stmt: simple_stmt | compound_stmt | cdef_stmt | ctypedef_stmt | DEF_stmt | IF_stmt
simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE
small_stmt: (expr_stmt | print_stmt | del_stmt | pass_stmt | flow_stmt |
import_stmt | global_stmt | exec_stmt | assert_stmt)
@@ -204,3 +204,6 @@ cy_type_kwd: 'struct' | 'union' | 'fused' | 'cppclass' | 'int' | 'double' | 'com
cy_kwd: cy_type_kwd | signedness | longness | visibility | 'gil' | 'nogil' | 'namespace' | 'const' | 'by' | 'extern' | 'namespace'
PY_NAME: NAME | cy_kwd
+# TODO: Do we really want these? Don't play well with include...
+DEF_stmt: 'DEF' NAME '=' testlist
+IF_stmt: 'IF' test ':' suite ('ELIF' test ':' suite)* ['ELSE' ':' suite]