From 1f7ce62bd61488d5d721896a36a1b43befab88b5 Mon Sep 17 00:00:00 2001 From: Nick Coghlan Date: Fri, 13 Jan 2012 21:43:40 +1000 Subject: Implement PEP 380 - 'yield from' (closes #11682) --- Grammar/Grammar | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Grammar') diff --git a/Grammar/Grammar b/Grammar/Grammar index 544852cc48..38320ef26f 100644 --- a/Grammar/Grammar +++ b/Grammar/Grammar @@ -121,7 +121,7 @@ arglist: (argument ',')* (argument [','] |'**' test) # The reason that keywords are test nodes instead of NAME is that using NAME # results in an ambiguity. ast.c makes sure it's a NAME. -argument: test [comp_for] | test '=' test # Really [keyword '='] test +argument: (test) [comp_for] | test '=' test # Really [keyword '='] test comp_iter: comp_for | comp_if comp_for: 'for' exprlist 'in' or_test [comp_iter] comp_if: 'if' test_nocond [comp_iter] @@ -129,4 +129,5 @@ comp_if: 'if' test_nocond [comp_iter] # not used in grammar, but may appear in "node" passed from Parser to Compiler encoding_decl: NAME -yield_expr: 'yield' [testlist] +yield_expr: 'yield' [yield_arg] +yield_arg: 'from' test | testlist -- cgit v1.2.1