From 09147c3303f0ffe607c0decb2979980f9a296a5c Mon Sep 17 00:00:00 2001 From: Comonad Date: Wed, 21 Apr 2021 19:33:45 +0800 Subject: Add support for fill match arms of boolean values - Add support for boolean inside tuple --- crates/syntax/src/ast/make.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'crates/syntax/src/ast') diff --git a/crates/syntax/src/ast/make.rs b/crates/syntax/src/ast/make.rs index 94d4f2cf0..4cf6f871e 100644 --- a/crates/syntax/src/ast/make.rs +++ b/crates/syntax/src/ast/make.rs @@ -294,6 +294,14 @@ pub fn wildcard_pat() -> ast::WildcardPat { } } +pub fn literal_pat(lit: &str) -> ast::LiteralPat { + return from_text(lit); + + fn from_text(text: &str) -> ast::LiteralPat { + ast_from_text(&format!("fn f() {{ match x {{ {} => {{}} }} }}", text)) + } +} + /// Creates a tuple of patterns from an iterator of patterns. /// /// Invariant: `pats` must be length > 0 -- cgit v1.2.3