Skip to content

Commit 61fb165

Browse files
committed
feat: add expr_for_loop to make in syntax
1 parent eea2149 commit 61fb165

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/syntax/src/ast/make.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ pub fn expr_if(
222222
};
223223
expr_from_text(&format!("if {} {} {}", condition, then_branch, else_branch))
224224
}
225+
pub fn expr_for_loop(pat: ast::Pat, expr: ast::Expr, block: ast::BlockExpr) -> ast::Expr {
226+
expr_from_text(&format!("for {} in {} {}", pat, expr, block))
227+
}
225228
pub fn expr_prefix(op: SyntaxKind, expr: ast::Expr) -> ast::Expr {
226229
let token = token(op);
227230
expr_from_text(&format!("{}{}", token, expr))

0 commit comments

Comments
 (0)