Commit c90cf42d authored by Łukasz Langa's avatar Łukasz Langa
Browse files

blib2to3: Never put prefixes on DEDENT leaves

parent 497de7fa
Loading
Loading
Loading
Loading
+5 −0
Changes for blib2to3/pgen2/driver.py: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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