[x] CHANGELOG.md has been updated (bullet points added to the Unreleased section)
[x] Tests have been added, or are not relevant
Description
Fixes #98
In order to dedent a given else, elif, etc., we look for its corresponding if, try, etc.. This was done naively just looking for colons and the corresponding if, try on the same line, so if a multi-line if/try was used we wouldn't find it.
Checklist
Description
Fixes #98
In order to dedent a given
else
,elif
, etc., we look for its correspondingif
,try
, etc.. This was done naively just looking for colons and the correspondingif
,try
on the same line, so if a multi-line if/try was used we wouldn't find it.This MR vendors in the parser from https://github.com/DSpeckhals/python-indent-parser and updates it to track the last observed line for the different indentation keywords.
The logic for dedenting is updated to use this last-observed line for the corresponding indenting keywords.