blib2to3: Never put prefixes on DEDENT leaves
This commit is contained in:
parent
497de7fa08
commit
c90cf42d7c
@ -69,11 +69,16 @@ def parse_tokens(self, tokens, debug=False):
|
|||||||
if debug:
|
if debug:
|
||||||
self.logger.debug("%s %r (prefix=%r)",
|
self.logger.debug("%s %r (prefix=%r)",
|
||||||
token.tok_name[type], value, prefix)
|
token.tok_name[type], value, prefix)
|
||||||
|
if type == token.DEDENT:
|
||||||
|
_prefix = prefix
|
||||||
|
prefix = ""
|
||||||
if p.addtoken(type, value, (prefix, start)):
|
if p.addtoken(type, value, (prefix, start)):
|
||||||
if debug:
|
if debug:
|
||||||
self.logger.debug("Stop.")
|
self.logger.debug("Stop.")
|
||||||
break
|
break
|
||||||
prefix = ""
|
prefix = ""
|
||||||
|
if type == token.DEDENT:
|
||||||
|
prefix = _prefix
|
||||||
lineno, column = end
|
lineno, column = end
|
||||||
if value.endswith("\n"):
|
if value.endswith("\n"):
|
||||||
lineno += 1
|
lineno += 1
|
||||||
|
Loading…
Reference in New Issue
Block a user