+
return 'bar'
+
class A:
return None
cdef class B:
return None
+try: return None
+except: pass
+
+try: return None
+finally: pass
+
+for i in (1,2):
+ return None
+
+while True:
+ return None
+
+if True:
+ return None
+else:
+ return None
+
+
_ERRORS = u'''
-1:0: Return not inside a function body
-3:4: Return not inside a function body
-6:4: Return not inside a function body
+ 2:0: Return not inside a function body
+ 5:4: Return not inside a function body
+ 8:4: Return not inside a function body
+10:5: Return not inside a function body
+13:5: Return not inside a function body
+17:4: Return not inside a function body
+20:4: Return not inside a function body
+23:4: Return not inside a function body
+25:4: Return not inside a function body
'''
--- /dev/null
+
+break
+
+class A:
+ break
+
+cdef class B:
+ break
+
+def test():
+ break
+
+try: break
+except: pass
+
+try: break
+finally: pass
+
+if True:
+ break
+else:
+ break
+
+
+_ERRORS = u'''
+ 2:0: break statement not inside loop
+ 5:4: break statement not inside loop
+ 8:4: break statement not inside loop
+11:4: break statement not inside loop
+16:5: break statement not inside loop
+20:4: break statement not inside loop
+22:4: break statement not inside loop
+'''
--- /dev/null
+
+continue
+
+class A:
+ continue
+
+cdef class B:
+ continue
+
+def test():
+ continue
+
+try: continue
+except: pass
+
+try: continue
+finally: pass
+
+if True:
+ continue
+else:
+ continue
+
+
+_ERRORS = u'''
+ 2:0: continue statement not inside loop
+ 5:4: continue statement not inside loop
+ 8:4: continue statement not inside loop
+11:4: continue statement not inside loop
+16:5: continue statement not inside loop
+20:4: continue statement not inside loop
+22:4: continue statement not inside loop
+'''