aboutsummaryrefslogtreecommitdiff
path: root/crates/syntax/src/ast
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-04-21 15:48:03 +0100
committerGitHub <[email protected]>2021-04-21 15:48:03 +0100
commitc7ae16e87291ce6ccc2233576c8a74cb7ab347d8 (patch)
treebc0b13766f35ee23cf4bdd8603d24d83ebdc7231 /crates/syntax/src/ast
parent7ae0bc1bd40286200f5e5b7a4d3b086312055ed5 (diff)
parent09147c3303f0ffe607c0decb2979980f9a296a5c (diff)
Merge #8611
8611: Add support for fill match arms of boolean values r=flodiebold a=komonad - Add support for boolean inside tuple closes #8593 Co-authored-by: Comonad <[email protected]>
Diffstat (limited to 'crates/syntax/src/ast')
-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