aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/syntax/src')
-rw-r--r--crates/syntax/src/ast/make.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs
index 5f6b96c23..5eee33545 100644
--- a/crates/syntax/src/ast/make.rs
+++ b/crates/syntax/src/ast/make.rs
@@ -200,6 +200,9 @@ pub fn expr_return(expr: Option<ast::Expr>) -> ast::Expr {
200 None => expr_from_text("return"), 200 None => expr_from_text("return"),
201 } 201 }
202} 202}
203pub fn expr_try(expr: ast::Expr) -> ast::Expr {
204 expr_from_text(&format!("{}?", expr))
205}
203pub fn expr_match(expr: ast::Expr, match_arm_list: ast::MatchArmList) -> ast::Expr { 206pub fn expr_match(expr: ast::Expr, match_arm_list: ast::MatchArmList) -> ast::Expr {
204 expr_from_text(&format!("match {} {}", expr, match_arm_list)) 207 expr_from_text(&format!("match {} {}", expr, match_arm_list))
205} 208}