mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Tim Peters writes:
Fix bad auto-indent I recently introduced when replacing the regexp that
could cause re to blow up:
if or_any_other_block_opener:
# one indenting comment line
^ cursor ended up at the caret (the bug)
^ but belongs here (the post-patch behavior)
This commit is contained in:
parent
76bd689a8d
commit
7f1cd296c6
1 changed files with 5 additions and 4 deletions
|
|
@ -385,13 +385,14 @@ class Parser:
|
||||||
m = _chew_ordinaryre(str, p, q)
|
m = _chew_ordinaryre(str, p, q)
|
||||||
if m:
|
if m:
|
||||||
# we skipped at least one boring char
|
# we skipped at least one boring char
|
||||||
p = m.end()
|
newp = m.end()
|
||||||
# back up over totally boring whitespace
|
# back up over totally boring whitespace
|
||||||
i = p-1 # index of last boring char
|
i = newp - 1 # index of last boring char
|
||||||
while i >= 0 and str[i] in " \t\n":
|
while i >= p and str[i] in " \t\n":
|
||||||
i = i-1
|
i = i-1
|
||||||
if i >= 0:
|
if i >= p:
|
||||||
lastch = str[i]
|
lastch = str[i]
|
||||||
|
p = newp
|
||||||
if p >= q:
|
if p >= q:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue