summaryrefslogtreecommitdiff
path: root/Grammar
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2012-01-13 21:43:40 +1000
committerNick Coghlan <ncoghlan@gmail.com>2012-01-13 21:43:40 +1000
commit1f7ce62bd61488d5d721896a36a1b43befab88b5 (patch)
treee7c92d4429ce431c78d0b7816c93862629590223 /Grammar
parente51757f6de9db71b7ee0a6cbf7dde62e9f146804 (diff)
downloadcpython-git-1f7ce62bd61488d5d721896a36a1b43befab88b5.tar.gz
Implement PEP 380 - 'yield from' (closes #11682)
Diffstat (limited to 'Grammar')
-rw-r--r--Grammar/Grammar5
1 files changed, 3 insertions, 2 deletions
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