From b0f03db51dc84aac56c807ecf4da8151c01e3c04 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 13 Aug 2020 11:32:45 +0200 Subject: Remove deprecated function --- crates/syntax/src/ast/make.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/syntax/src/ast') diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index 3009faed7..d20c085aa 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs @@ -134,6 +134,9 @@ pub fn expr_prefix(op: SyntaxKind, expr: ast::Expr) -> ast::Expr { let token = token(op); expr_from_text(&format!("{}{}", token, expr)) } +pub fn expr_call(f: ast::Expr, arg_list: ast::ArgList) -> ast::Expr { + expr_from_text(&format!("{}{}", f, arg_list)) +} fn expr_from_text(text: &str) -> ast::Expr { ast_from_text(&format!("const C: () = {};", text)) } @@ -151,6 +154,10 @@ pub fn condition(expr: ast::Expr, pattern: Option) -> ast::Condition { } } +pub fn arg_list(args: impl IntoIterator) -> ast::ArgList { + ast_from_text(&format!("fn main() {{ ()({}) }}", args.into_iter().format(", "))) +} + pub fn ident_pat(name: ast::Name) -> ast::IdentPat { return from_text(name.text()); -- cgit v1.2.3