Improved match item span

This commit is contained in:
2026-05-28 12:16:28 +02:00
parent 7a2ba74d9c
commit ad11a3bd6a
3 changed files with 24 additions and 12 deletions
+4 -1
View File
@@ -35,7 +35,7 @@ pub enum Statement {
iterator: Expression,
body: StatementBody,
},
Match(Expression, Vec<(Vec<Pattern>, Expression)>),
Match(Expression, Vec<Spanned<MatchItem>>),
VarDecl(VarDeclStmt),
Return(Option<Expression>),
@@ -43,6 +43,9 @@ pub enum Statement {
Continue,
}
#[derive(Debug, Clone, Serialize)]
pub struct MatchItem(pub Vec<Pattern>, pub Expression);
#[derive(Debug, Clone, Serialize)]
pub struct VarDecl {
pub name: Pattern,