From: Stefan Behnel Date: Sat, 20 Dec 2008 20:10:14 +0000 (+0100) Subject: small cleanup in parser X-Git-Tag: 0.11-beta~92 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bca5e85c70d1a2bb2648db5e2f348f8b9741ff2d;p=cython.git small cleanup in parser --- diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 72e59cfa..21b94883 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -84,12 +84,9 @@ def p_simple_expr(s): if s.sy == 'if': s.next() test = p_or_test(s) - if s.sy == 'else': - s.next() - other = p_test(s) - return ExprNodes.CondExprNode(pos, test=test, true_val=expr, false_val=other) - else: - s.error("Expected 'else'") + s.expect('else') + other = p_test(s) + return ExprNodes.CondExprNode(pos, test=test, true_val=expr, false_val=other) else: return expr