blib2to3: Never put prefixes on DEDENT leaves

This commit is contained in:
Łukasz Langa 2018-03-16 21:47:15 -07:00
parent 497de7fa08
commit c90cf42d7c

View File

@ -69,11 +69,16 @@ def parse_tokens(self, tokens, debug=False):
if debug:
self.logger.debug("%s %r (prefix=%r)",
token.tok_name[type], value, prefix)
if type == token.DEDENT:
_prefix = prefix
prefix = ""
if p.addtoken(type, value, (prefix, start)):
if debug:
self.logger.debug("Stop.")
break
prefix = ""
if type == token.DEDENT:
prefix = _prefix
lineno, column = end
if value.endswith("\n"):
lineno += 1