[Python-checkins] python/dist/src/Lib/test test_grammar.py, 1.40.8.3, 1.40.8.4

nascheme@users.sourceforge.net nascheme at users.sourceforge.net
Thu Jun 2 07:14:36 CEST 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13883/Lib/test

Modified Files:
      Tag: ast-branch
	test_grammar.py 
Log Message:
Use block type attribute from symbol table to catch 'return' and 'yield'
syntax errors.


Index: test_grammar.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_grammar.py,v
retrieving revision 1.40.8.3
retrieving revision 1.40.8.4
diff -u -d -r1.40.8.3 -r1.40.8.4
--- test_grammar.py	7 Jan 2005 06:59:09 -0000	1.40.8.3
+++ test_grammar.py	2 Jun 2005 05:14:34 -0000	1.40.8.4
@@ -413,6 +413,10 @@
 def g2(): return 1
 g1()
 x = g2()
+check_syntax("class foo:return 1")
+
+print 'yield_stmt'
+check_syntax("class foo:yield 1")
 
 print 'raise_stmt' # 'raise' test [',' test]
 try: raise RuntimeError, 'just testing'



More information about the Python-checkins mailing list