From bca5e85c70d1a2bb2648db5e2f348f8b9741ff2d Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 20 Dec 2008 21:10:14 +0100 Subject: [PATCH] small cleanup in parser --- Cython/Compiler/Parsing.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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 -- 2.26.2