google / pasta

Library to refactor python code through AST manipulation.
Apache License 2.0
341 stars 40 forks source link

fstring tokenization fix #106

Closed martinwicke closed 2 years ago

martinwicke commented 2 years ago

During fstring parsing, we unleash the tokenizer on non-Python code, because we start tokenizing embedded expressions, but pass the remaining fstring content to the tokenizer. In this situation the tokenizer can throw SyntaxErrors (IndentationErrors in particular). This happens in the non-Python part, we can simply ignore these errors.

soupytwist commented 2 years ago

Thanks!