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

Support Named Unicode Characters in f-strings #424

Merged
merged 2 commits into from
Nov 30, 2020

Conversation

thatch
Copy link
Contributor

@thatch thatch commented Nov 21, 2020

Summary

This is a port of davidhalter/parso#160 plus a fix to yield expressions

Test Plan

A couple of new tests, but primarily tested in davidhalter/parso#160

@thatch thatch requested review from zsol and jimmylai November 21, 2020 04:08
@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 Nov 21, 2020
@codecov-io
Copy link

codecov-io commented Nov 21, 2020

Codecov Report

Merging #424 (94b6866) into master (16b30fe) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #424   +/-   ##
=======================================
  Coverage   94.31%   94.32%           
=======================================
  Files         232      232           
  Lines       22531    22532    +1     
=======================================
+ Hits        21251    21253    +2     
+ Misses       1280     1279    -1     
Impacted Files Coverage Δ
libcst/_nodes/tests/test_atom.py 100.00% <ø> (ø)
libcst/_parser/conversions/expression.py 97.68% <ø> (ø)
libcst/_parser/parso/python/tokenize.py 83.18% <100.00%> (+0.02%) ⬆️
libcst/_typed_visitor.py 96.73% <0.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 16b30fe...94b6866. Read the comment docs.

@thatch
Copy link
Contributor Author

thatch commented Nov 22, 2020

Upstream has merged their PR. Escape (shape) is only validated in f-strings for the time being.

Thanks to davidhalter/parso#159 for catching
that yield (as an expression, I suppose) is allowed on 3.6.
@thatch
Copy link
Contributor Author

thatch commented Nov 24, 2020

Update based on testing thatch/python-grammar-changes@5cbc14e

                                                  23 24 25 26 27 30 31 32 33 34 35 36 37 38
examples/py36-0031-fstring-yield.py               .  .  .  .  .  .  .  .  .. .  .. oo oo oo 
examples/py36-0032-fstring-genexpr.py             .  .  .  .  .  .  .  .  .. .  .. oo oo oo 

Copy link
Contributor

@jimmylai jimmylai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for fixing this!

@jimmylai jimmylai merged commit 02fc440 into Instagram:master Nov 30, 2020
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.

4 participants