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
Fix formatter panic with comment after parenthesized dict value #5293
Fix formatter panic with comment after parenthesized dict value #5293
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
PR Check ResultsEcosystem✅ ecosystem check detected no changes. BenchmarkLinux
Windows
|
.. | ||
} | ||
)); | ||
while let Some(first) = tokens.next() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add '{'.text_len()
on line 982 instead of skipping over the {
in the iteration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i tried it, but this didn't work for me
d6f0cd1
to
8010d93
Compare
## Summary This snippet used to panic because it expected to see a comma or something similar after the `2` but met the closing parentheses that is not part of the range and panicked ```python a = { 1: (2), # comment 3: True, } ``` Originally found in https://github.com/bolucat/Firefox/blob/636a717ef025c16434997dc89e42351ef740ee6b/testing/marionette/client/marionette_driver/geckoinstance.py#L109 This snippet is also the test plan.
8010d93
to
b963c7f
Compare
Summary
This snippet used to panic because it expected to see a comma or something similar after the
2
but met the closing parentheses that is not part of the range and panickedOriginally found in https://github.com/bolucat/Firefox/blob/636a717ef025c16434997dc89e42351ef740ee6b/testing/marionette/client/marionette_driver/geckoinstance.py#L109
This snippet is also the test plan.