explain why keyword names are not just NAME

This commit is contained in:
Benjamin Peterson 2009-06-09 17:29:51 +00:00
parent 80ce61c053
commit 654924626e
1 changed files with 3 additions and 1 deletions

View File

@ -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]