mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
add make::expr_op
This commit is contained in:
parent
c943057038
commit
20c3b20db3
2 changed files with 39 additions and 0 deletions
|
@ -264,6 +264,9 @@ pub fn expr_path(path: ast::Path) -> ast::Expr {
|
|||
pub fn expr_continue() -> ast::Expr {
|
||||
expr_from_text("continue")
|
||||
}
|
||||
pub fn expr_op(op: ast::BinOp, lhs: ast::Expr, rhs: ast::Expr) -> ast::Expr {
|
||||
expr_from_text(&format!("{} {} {}", lhs, op, rhs))
|
||||
}
|
||||
pub fn expr_break(expr: Option<ast::Expr>) -> ast::Expr {
|
||||
match expr {
|
||||
Some(expr) => expr_from_text(&format!("break {}", expr)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue