Commit 1c396f6
authored
Python: Fix f-string parsing for debug
When an f-string uses the debug specifier `=` combined with a format
spec but no conversion (e.g. `{last_error=:#x}`), the `:` token was
not advanced past before parsing the format spec. This caused the
format spec parser to consume `:` instead of the actual format text,
leaving the FSTRING_MIDDLE token unconsumed and the parser stuck.= with format spec (#6731)1 parent ad53660 commit 1c396f6
2 files changed
Lines changed: 11 additions & 3 deletions
File tree
- rewrite-python/rewrite
- src/rewrite/python
- tests/python/all/tree
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3488 | 3488 | | |
3489 | 3489 | | |
3490 | 3490 | | |
3491 | | - | |
| 3491 | + | |
3492 | 3492 | | |
3493 | | - | |
3494 | | - | |
| 3493 | + | |
| 3494 | + | |
3495 | 3495 | | |
3496 | 3496 | | |
3497 | 3497 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
162 | 170 | | |
163 | 171 | | |
164 | 172 | | |
| |||
0 commit comments