-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Report precise location for invalid conversion flag (#7809)
## Summary This PR updates the parser definition to use the precise location when reporting an invalid f-string conversion flag error. Taking the following example code: ```python f"{foo!x}" ``` On earlier version, ``` Error: f-string: invalid conversion character at byte offset 6 ``` Now, ``` Error: f-string: invalid conversion character at byte offset 7 ``` This becomes more useful when there's whitespace between `!` and the flag value although that is not valid but we can't detect that now. ## Test Plan As mentioned above.
- Loading branch information
1 parent
adb6580
commit 17fba99
Showing
2 changed files
with
15 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters