Skip to content

Improve precision of jump parentheses when next token cannot begin expr#1695

Merged
dtolnay merged 2 commits intomasterfrom
jumps
Jul 7, 2024
Merged

Improve precision of jump parentheses when next token cannot begin expr#1695
dtolnay merged 2 commits intomasterfrom
jumps

Conversation

@dtolnay
Copy link
Copy Markdown
Owner

@dtolnay dtolnay commented Jul 7, 2024

Previously syn would forcibly put parentheses when printing something like (break) + 1 or (return) + 1. Although parentheses are required in (break) - 1 and (return) - 1, they should not be required when the next token following the valueless jump is not a legal first token of an expression.

@dtolnay dtolnay merged commit 9ab3fba into master Jul 7, 2024
@dtolnay dtolnay deleted the jumps branch July 7, 2024 01:31
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

Successfully merging this pull request may close these issues.

1 participant