diff Parser/Python.asdl @ 36666:6165927431d6 legacy-trunk

PEP 308 implementation, including minor refdocs and some testcases. It breaks the parser module, because it adds the if/else construct as well as two new grammar rules for backward compatibility. If no one else fixes parsermodule, I guess I'll go ahead and fix it later this week. The TeX code was checked with texcheck.py, but not rendered. There is actually a slight incompatibility: >>> (x for x in lambda:0) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: iteration over non-sequence changes into >>> (x for x in lambda: 0) File "<stdin>", line 1 (x for x in lambda: 0) ^ SyntaxError: invalid syntax Since there's no way the former version can be useful, it's probably a bugfix ;)
author Thomas Wouters <thomas@python.org>
date Mon, 27 Feb 2006 00:24:13 +0000
parents a625e8876407
children b6d2f6fd3e11
line wrap: on
line diff
--- a/Parser/Python.asdl	Mon Feb 27 00:09:50 2006 +0000
+++ b/Parser/Python.asdl	Mon Feb 27 00:24:13 2006 +0000
@@ -52,6 +52,7 @@
 	     | BinOp(expr left, operator op, expr right)
 	     | UnaryOp(unaryop op, expr operand)
 	     | Lambda(arguments args, expr body)
+	     | IfExp(expr test, expr body, expr orelse)
 	     | Dict(expr* keys, expr* values)
 	     | ListComp(expr elt, comprehension* generators)
 	     | GeneratorExp(expr elt, comprehension* generators)