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

Nested f-strings aren't handled properly #5

Open
JelleZijlstra opened this issue Aug 15, 2017 · 0 comments
Open

Nested f-strings aren't handled properly #5

JelleZijlstra opened this issue Aug 15, 2017 · 0 comments

Comments

@JelleZijlstra
Copy link
Owner

Test cases like check("""f'{f"hello"}'""") fail. This is somewhat tricky to implement and it's not very pretty code, so I'm going to not worry about it for now.

hauntsaninja added a commit to hauntsaninja/ast_decompiler that referenced this issue Aug 21, 2017
Since there is no plan to fix this in the near future (see issues JelleZijlstra#5),
rather than fail mysteriously, we should be explicit about our (lack of)
intention.
JelleZijlstra pushed a commit that referenced this issue Aug 21, 2017
* refactor visit_FormattedValue, visit_JoinedStr

The idea here is that children nodes should be responsible for their own
rendering, even if it is dependent on their parents. This is consistent
with design choices elsewhere in ast_decompiler. The change also means
that self.node_stack reflects the truth, which is what caused the bug in
a5bd70e.

* raise NotImplementedError on nested f-strings

Since there is no plan to fix this in the near future (see issues #5),
rather than fail mysteriously, we should be explicit about our (lack of)
intention.

* fix f-string on {}-like objects

Add space so that we don't accidentally escape curly braces. Additional
test cases added.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant