From: Stefan Behnel Date: Fri, 12 Dec 2008 18:30:27 +0000 (+0100) Subject: fix for dict literals that end with ',' X-Git-Tag: 0.11-beta~141 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=c46addfacf1bd15085d1b8d9fa7deef4830e3761;p=cython.git fix for dict literals that end with ',' --- diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 553c1e2a..c95de0ea 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -761,6 +761,8 @@ def p_dict_or_set_maker(s): values = [item] while s.sy == ',': s.next() + if s.sy == '}': + break values.append( p_simple_expr(s) ) s.expect('}') return ExprNodes.SetNode(pos, args=values) @@ -789,6 +791,8 @@ def p_dict_or_set_maker(s): items = [ExprNodes.DictItemNode(key.pos, key=key, value=value)] while s.sy == ',': s.next() + if s.sy == '}': + break key = p_simple_expr(s) s.expect(':') value = p_simple_expr(s)