Generic lifetimes

This commit is contained in:
2026-05-08 20:08:03 +02:00
parent 0bf32b16cd
commit 020dd3b76b
5 changed files with 46 additions and 21 deletions
+8 -4
View File
@@ -238,10 +238,14 @@ impl From<pest::iterators::Pair<'_, Rule>> for Generics {
inner
.map(|pair| {
let mut inner = pair.into_inner();
(
Identifier::from(inner.next().unwrap()),
inner.map(Path::from).collect(),
)
if let Some(pair) = consume_rule(&mut inner, Rule::lifetime) {
Generic::Lifetime(Identifier::from(pair.into_inner().next().unwrap()))
} else {
Generic::Type(
Identifier::from(inner.next().unwrap()),
inner.map(TypeExpr::from).collect(),
)
}
})
.collect(),
),