diff Parser/Python.asdl @ 36418:a625e8876407 legacy-trunk

Improved handling of syntax errors. Expand set of errors caught in set_context(). Some new errors, some old error messages changed for consistency. Fixed error checking in generator expression code. The first set of tests were impossible condition given the grammar. In general, the ast code uses REQ() for those sanity checks. Fix some error handling for augmented assignments. As comments in the code explain, set_context() ought to work here, but I got unexpected crashes when I tried it. Should come back to this. Add note to Grammar that yield expression is a special case. Add doctest cases for SyntaxErrors raised by ast.c.
author Jeremy Hylton <jeremy@alum.mit.edu>
date Fri, 27 Jan 2006 15:18:39 +0000
parents 4ac3fa158927
children 6165927431d6
line wrap: on
line diff
--- a/Parser/Python.asdl	Fri Jan 27 07:06:15 2006 +0000
+++ b/Parser/Python.asdl	Fri Jan 27 15:18:39 2006 +0000
@@ -55,6 +55,7 @@
 	     | Dict(expr* keys, expr* values)
 	     | ListComp(expr elt, comprehension* generators)
 	     | GeneratorExp(expr elt, comprehension* generators)
+	     -- the grammar constrains where yield expressions can occur
 	     | Yield(expr? value)
 	     -- need sequences for compare to distinguish between
 	     -- x < 4 < 3 and (x < 4) < 3