Add support for fill match arms of boolean values

- Add support for boolean inside tuple
This commit is contained in:
Comonad 2021-04-21 19:33:45 +08:00
parent 7ae0bc1bd4
commit 09147c3303
2 changed files with 207 additions and 23 deletions

View file

@ -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