Adding yielding in

This commit is contained in:
Paul Tagliamonte 2012-12-25 22:47:29 -05:00
parent 9f5a8393d9
commit ae3c4c357a

View File

@ -85,6 +85,11 @@ def _ast_return(node, children, obj):
return ast.Return(value=children[-1])
def _ast_yield(node, chile, obj):
val = chile.pop(0)
# XXX: Check to make sure chile is now []
return ast.Yield(value=val)
special_cases = {
"print": _ast_print,
@ -101,6 +106,7 @@ special_cases = {
"if": _ast_if,
"do": _ast_do,
"raise": _ast_raise,
"yield": _ast_yield
}