-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge string parsing to single entrypoint (#10339)
This PR merges the different string parsing functions into a single entry point function. Previously there were two entry points, one for string or byte literal and the other for f-strings. The reason for this separation is that our old parser raised a hard syntax error if an f-string was used as a pattern literal. But, it's actually a soft syntax error as evident through the CPython parser which raises it during the runtime. This function basically implements the following grammar: ``` strings: (string|fstring)+ ``` And it delegates it to the list parsing for better error recovery. - [x] All tests pass - [x] No performance regression
- Loading branch information
1 parent
fc8d542
commit 70731cb
Showing
3 changed files
with
97 additions
and
117 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
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