use nova_diagnostics::Spanned;
use crate::{expr::Literal, Path};
#[derive(Debug, Clone)]
pub enum Pattern {
Wildcard,
Lit(Literal),
Ident { is_mut: bool, name: Spanned<String> },
Binding {
name: Spanned<String>,
inner: Box<Spanned<Pattern>>,
},
TupleStruct {
path: Path,
fields: Vec<Spanned<Pattern>>,
},
Record {
path: Path,
fields: Vec<FieldPat>,
rest: bool,
},
Tuple(Vec<Spanned<Pattern>>),
Array(Vec<Spanned<Pattern>>),
Or(Vec<Spanned<Pattern>>),
Range {
lo: Box<Spanned<Pattern>>,
hi: Box<Spanned<Pattern>>,
inclusive: bool,
},
Path(Path),
}
#[derive(Debug, Clone)]
pub struct FieldPat {
pub name: Spanned<String>,
pub pattern: Option<Spanned<Pattern>>,
}