Handle testlist_safe as if it were testlist.

This commit is contained in:
Jeremy Hylton 2001-10-17 13:32:52 +00:00
parent 771f9146d5
commit d114261608
1 changed files with 4 additions and 0 deletions

View File

@ -515,9 +515,11 @@ class Transformer:
def testlist(self, nodelist): def testlist(self, nodelist):
# testlist: expr (',' expr)* [','] # testlist: expr (',' expr)* [',']
# testlist_safe: test [(',' test)+ [',']]
# exprlist: expr (',' expr)* [','] # exprlist: expr (',' expr)* [',']
return self.com_binary(Tuple, nodelist) return self.com_binary(Tuple, nodelist)
testlist_safe = testlist # XXX
exprlist = testlist exprlist = testlist
def test(self, nodelist): def test(self, nodelist):
@ -1254,6 +1256,7 @@ class Transformer:
_doc_nodes = [ _doc_nodes = [
symbol.expr_stmt, symbol.expr_stmt,
symbol.testlist, symbol.testlist,
symbol.testlist_safe,
symbol.test, symbol.test,
symbol.and_test, symbol.and_test,
symbol.not_test, symbol.not_test,
@ -1306,6 +1309,7 @@ _legal_node_types = [
symbol.try_stmt, symbol.try_stmt,
symbol.suite, symbol.suite,
symbol.testlist, symbol.testlist,
symbol.testlist_safe,
symbol.test, symbol.test,
symbol.and_test, symbol.and_test,
symbol.not_test, symbol.not_test,