dtolnay / syn

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

Parenthesize chained comparison on both sides #1699

Closed dtolnay closed 1 month ago

dtolnay commented 1 month ago

a < b < c is not valid syntax. Depending on whether the inner comparison is on the left or right of the outer one, syn needs to insert parentheses to print either (a < b) < c or a < (b < c).