mirror of
https://github.com/davidhalter/parso.git
synced 2026-01-19 09:33:06 +08:00
Fix: Dedent omission was wrong, see davidhalter/jedi#1499
This commit is contained in:
@@ -129,7 +129,7 @@ class Parser(BaseParser):
|
||||
or token.type == DEDENT and '\n' not in last_leaf.value
|
||||
and '\r' not in last_leaf.value):
|
||||
# In Python statements need to end with a newline. But since it's
|
||||
# possible (and valid in Python ) that there's no newline at the
|
||||
# possible (and valid in Python) that there's no newline at the
|
||||
# end of a file, we have to recover even if the user doesn't want
|
||||
# error recovery.
|
||||
if self.stack[-1].dfa.from_rule == 'simple_stmt':
|
||||
@@ -208,6 +208,7 @@ class Parser(BaseParser):
|
||||
o = self._omit_dedent_list
|
||||
if o and o[-1] == self._indent_counter:
|
||||
o.pop()
|
||||
self._indent_counter -= 1
|
||||
continue
|
||||
|
||||
self._indent_counter -= 1
|
||||
|
||||
Reference in New Issue
Block a user