dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.81k stars 308 forks source link

Adjust loop structure of parse_expr #1639

Closed dtolnay closed 4 months ago

dtolnay commented 4 months ago

If input.parse::<BinOp>() is Ok, then input.peek(Token![=]) && !input.peek(Token![==]) is known to be false, input.peek(Token![..]) is known to be false, and input.peek(Token![as]) is known to be false, regardless of the precedences involved.

If input.parse::<BinOp>() is Err, then !input.peek(Token![==]) is known to be true.