aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src
diff options
context:
space:
mode:
authorComonad <[email protected]>2021-04-21 12:33:45 +0100
committerComonad <[email protected]>2021-04-21 12:33:45 +0100
commit09147c3303f0ffe607c0decb2979980f9a296a5c (patch)
treebc0b13766f35ee23cf4bdd8603d24d83ebdc7231 /crates/syntax/src
parent7ae0bc1bd40286200f5e5b7a4d3b086312055ed5 (diff)
Add support for fill match arms of boolean values
- Add support for boolean inside tuple
Diffstat (limited to 'crates/syntax/src')
-rw-r--r--crates/syntax/src/ast/make.rs8
1 files changed, 8 insertions, 0 deletions
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 {
294 } 294 }
295} 295}
296 296
297pub fn literal_pat(lit: &str) -> ast::LiteralPat {
298 return from_text(lit);
299
300 fn from_text(text: &str) -> ast::LiteralPat {
301 ast_from_text(&format!("fn f() {{ match x {{ {} => {{}} }} }}", text))
302 }
303}
304
297/// Creates a tuple of patterns from an iterator of patterns. 305/// Creates a tuple of patterns from an iterator of patterns.
298/// 306///
299/// Invariant: `pats` must be length > 0 307/// Invariant: `pats` must be length > 0