1
Fork 0

Add heuristic to avoid treating x + +2 as increment

This commit is contained in:
Noah Lev 2022-02-17 16:30:48 -08:00
parent 29a5c363c7
commit 4212835d99
3 changed files with 11 additions and 18 deletions

View file

@ -269,6 +269,7 @@ impl<'a> Parser<'a> {
if self.prev_token == token::BinOp(token::Plus)
&& self.token == token::BinOp(token::Plus)
&& self.prev_token.span.between(self.token.span).is_empty()
{
let op_span = self.prev_token.span.to(self.token.span);
// Eat the second `+`