diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-06-09 17:29:51 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-06-09 17:29:51 (GMT) |
commit | 654924626eaee2fadb674ed9c4d4004195dbadea (patch) | |
tree | 229b853c26dedc65a5cd412932e5832d10e851d5 /Grammar | |
parent | 80ce61c0533c1bb9113be3371d43a6f82c122f36 (diff) | |
download | cpython-654924626eaee2fadb674ed9c4d4004195dbadea.zip cpython-654924626eaee2fadb674ed9c4d4004195dbadea.tar.gz cpython-654924626eaee2fadb674ed9c4d4004195dbadea.tar.bz2 |
explain why keyword names are not just NAME
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/Grammar | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar index 266ba41..38a1408 100644 --- a/Grammar/Grammar +++ b/Grammar/Grammar @@ -133,7 +133,9 @@ classdef: 'class' NAME ['(' [testlist] ')'] ':' suite arglist: (argument ',')* (argument [','] |'*' test (',' argument)* [',' '**' test] |'**' test) -argument: test [gen_for] | test '=' test # Really [keyword '='] test +# The reason that keywords are test nodes instead of NAME is that using NAME +# results in an amiguity. ast.c makes sure it's a NAME. +argument: test [gen_for] | test '=' test list_iter: list_for | list_if list_for: 'for' exprlist 'in' testlist_safe [list_iter] |