From d9f60b347366143575d26938a2f59b9fa6886894 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 25 Jul 2020 02:38:46 +0200 Subject: [PATCH] Remove compatibility in parser for Python 2 --- parso/python/parser.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/parso/python/parser.py b/parso/python/parser.py index ada60fb..7e3794d 100644 --- a/parso/python/parser.py +++ b/parso/python/parser.py @@ -43,10 +43,8 @@ class Parser(BaseParser): # Not sure if this is the best idea, but IMO it's the easiest way to # avoid extreme amounts of work around the subtle difference of 2/3 # grammar in list comoprehensions. - 'list_for': tree.SyncCompFor, 'decorator': tree.Decorator, 'lambdef': tree.Lambda, - 'old_lambdef': tree.Lambda, 'lambdef_nocond': tree.Lambda, } default_node = tree.PythonNode @@ -96,12 +94,6 @@ class Parser(BaseParser): # ones and therefore have pseudo start/end positions and no # prefixes. Just ignore them. children = [children[0]] + children[2:-1] - elif nonterminal == 'list_if': - # Make transitioning from 2 to 3 easier. - nonterminal = 'comp_if' - elif nonterminal == 'listmaker': - # Same as list_if above. - nonterminal = 'testlist_comp' node = self.default_node(nonterminal, children) for c in children: c.parent = node