This commit is contained in:
2026-05-10 17:18:53 +02:00
parent 81d0286226
commit 6f7f11719d
2 changed files with 15 additions and 6 deletions
+9
View File
@@ -303,6 +303,15 @@ impl From<pest::iterators::Pair<'_, Rule>> for TopLevelKind {
Rule::mod_package => TopLevelKind::Mod(Identifier::from(inner.next().unwrap())),
Rule::impl_for_decl => TopLevelKind::ImplDecl(ImplDecl {
generics: consume_rule(&mut inner, Rule::generics)
.map(Generics::from)
.unwrap_or_default(),
trait_: Some(TypeExpr::from(inner.next().unwrap())),
target: TypeExpr::from(inner.next().unwrap()),
methods: inner.map(FunctionDecl::from).collect(),
}),
_ => unimplemented!("{rule:#?}"),
}
}