Lines Matching refs:Expr
4 use crate::expr::Expr;
228 expr: &Expr, in leftmost_subexpression_with_operator() argument
262 pub fn leftmost_subexpression_with_dot(self, expr: &Expr) -> (Precedence, Self) { in leftmost_subexpression_with_dot()
287 fn leftmost_subexpression_precedence(self, expr: &Expr) -> Precedence { in leftmost_subexpression_precedence()
313 expr: &Expr, in rightmost_subexpression() argument
352 pub fn rightmost_subexpression_precedence(self, expr: &Expr) -> Precedence { in rightmost_subexpression_precedence()
379 pub fn parenthesize(self, expr: &Expr) -> bool { in parenthesize()
381 || ((self.stmt || self.leftmost_subexpression_in_stmt) && matches!(expr, Expr::Let(_))) in parenthesize()
384 || (self.condition && matches!(expr, Expr::Struct(_))) in parenthesize()
388 Expr::Return(ExprReturn { expr: None, .. }) in parenthesize()
389 | Expr::Yield(ExprYield { expr: None, .. }) in parenthesize()
395 Expr::Break(ExprBreak { expr: None, .. }) in parenthesize()
396 | Expr::Path(_) in parenthesize()
397 | Expr::Range(ExprRange { end: None, .. }) in parenthesize()
400 … && matches!(expr, Expr::Block(expr) if expr.attrs.is_empty() && expr.label.is_none())) in parenthesize()
405 fn precedence(self, expr: &Expr) -> Precedence { in precedence()
411 if let Expr::Break(ExprBreak { expr: None, .. }) in precedence()
412 | Expr::Return(ExprReturn { expr: None, .. }) in precedence()
413 | Expr::Yield(ExprYield { expr: None, .. }) = expr in precedence()
424 Expr::Break(_) in precedence()
425 | Expr::Closure(_) in precedence()
426 | Expr::Let(_) in precedence()
427 | Expr::Return(_) in precedence()
428 | Expr::Yield(_) => { in precedence()
431 Expr::Range(e) if e.start.is_none() => return Precedence::Prefix, in precedence()
437 if let Expr::Cast(cast) = expr { in precedence()
481 fn scan_left(expr: &Expr, fixup: FixupContext) -> bool { in scan_left() argument
483 Expr::Assign(_) => fixup.previous_operator <= Precedence::Assign, in scan_left()
484 Expr::Binary(e) => match Precedence::of_binop(&e.op) { in scan_left()
488 Expr::Cast(_) => fixup.previous_operator < Precedence::Cast, in scan_left()
489 Expr::Range(e) => e.start.is_none() || fixup.previous_operator < Precedence::Assign, in scan_left()
496 expr: &Expr, in scan_right() argument
515 Expr::Assign(e) if e.attrs.is_empty() => { in scan_right()
541 Expr::Binary(e) if e.attrs.is_empty() => { in scan_right()
581 Expr::RawAddr(ExprRawAddr { expr, .. }) in scan_right()
582 | Expr::Reference(ExprReference { expr, .. }) in scan_right()
583 | Expr::Unary(ExprUnary { expr, .. }) => { in scan_right()
617 Expr::Range(e) if e.attrs.is_empty() => match &e.end { in scan_right()
655 Expr::Break(e) => match &e.expr { in scan_right()
671 Expr::Return(ExprReturn { expr, .. }) | Expr::Yield(ExprYield { expr, .. }) => match expr { in scan_right()
688 Expr::Closure(e) => { in scan_right()
690 … || matches!(&*e.body, Expr::Block(body) if body.attrs.is_empty() && body.label.is_none()) in scan_right()
705 Expr::Let(e) => { in scan_right()
736 Expr::Array(_) in scan_right()
737 | Expr::Assign(_) in scan_right()
738 | Expr::Async(_) in scan_right()
739 | Expr::Await(_) in scan_right()
740 | Expr::Binary(_) in scan_right()
741 | Expr::Block(_) in scan_right()
742 | Expr::Call(_) in scan_right()
743 | Expr::Cast(_) in scan_right()
744 | Expr::Const(_) in scan_right()
745 | Expr::Continue(_) in scan_right()
746 | Expr::Field(_) in scan_right()
747 | Expr::ForLoop(_) in scan_right()
748 | Expr::Group(_) in scan_right()
749 | Expr::If(_) in scan_right()
750 | Expr::Index(_) in scan_right()
751 | Expr::Infer(_) in scan_right()
752 | Expr::Lit(_) in scan_right()
753 | Expr::Loop(_) in scan_right()
754 | Expr::Macro(_) in scan_right()
755 | Expr::Match(_) in scan_right()
756 | Expr::MethodCall(_) in scan_right()
757 | Expr::Paren(_) in scan_right()
758 | Expr::Path(_) in scan_right()
759 | Expr::Range(_) in scan_right()
760 | Expr::Repeat(_) in scan_right()
761 | Expr::Struct(_) in scan_right()
762 | Expr::Try(_) in scan_right()
763 | Expr::TryBlock(_) in scan_right()
764 | Expr::Tuple(_) in scan_right()
765 | Expr::Unsafe(_) in scan_right()
766 | Expr::Verbatim(_) in scan_right()
767 | Expr::While(_) => match fixup.next_operator { in scan_right()