Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse arbitrarily nested f-strings #1026

Merged
merged 1 commit into from
Oct 1, 2023
Merged

Parse arbitrarily nested f-strings #1026

merged 1 commit into from
Oct 1, 2023

Conversation

zsol
Copy link
Member

@zsol zsol commented Oct 1, 2023

Summary

PEP 701 relaxed restrictions on f-string grammar significantly. LibCST's parser already supported these changes, but the tokenizer had a severe bug related to nested f-strings. This PR fixes that.

Fixes #993.

Test Plan

Added test cases

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Oct 1, 2023
@codecov-commenter
Copy link

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (e1da64b) 91.08% compared to head (0778145) 91.09%.
Report is 1 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1026      +/-   ##
==========================================
+ Coverage   91.08%   91.09%   +0.01%     
==========================================
  Files         255      255              
  Lines       26560    26564       +4     
==========================================
+ Hits        24191    24198       +7     
+ Misses       2369     2366       -3     

see 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zsol zsol changed the title Allow arbitrarily nested f-strings Parse arbitrarily nested f-strings Oct 1, 2023
@zsol zsol merged commit 03179b5 into main Oct 1, 2023
24 of 25 checks passed
manmartgarc pushed a commit to manmartgarc/LibCST that referenced this pull request Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tokenizer error for nested f-string inside another f-string expression
3 participants