dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.79k stars 306 forks source link

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

Closed dtolnay closed 1 month ago

dtolnay commented 1 month ago

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.