match astgen

This commit is contained in:
2026-05-07 22:44:54 +02:00
parent 2d56cf1212
commit 6f6c32b646
+13
View File
@@ -375,6 +375,19 @@ impl From<pest::iterators::Pair<'_, Rule>> for Statement {
value: Expression::from(inner.next().unwrap()),
}),
Rule::match_stmt => Statement::Match(
Expression::from(inner.next().unwrap()),
inner
.map(|match_itms| {
let mut match_inner = match_itms.into_inner();
(
Pattern::from(match_inner.next().unwrap()),
Block::from(match_inner.next().unwrap()),
)
})
.collect(),
),
_ => unimplemented!("{rule:#?}"),
}
}