Improved override

This commit is contained in:
2026-06-09 13:51:32 +02:00
parent 0347892056
commit a9f6cce1b3
7 changed files with 23 additions and 39 deletions
+1 -1
View File
@@ -54,7 +54,7 @@ pub enum TopLevelKind {
visibility: Visibility,
name: Identifier,
generics: GenericsDecl,
inherits: Option<TypeExpr>,
inherits: Option<ExprPath>,
fields: Vec<Spanned<FieldDeclStmt>>,
constructor: Spanned<ClassConstructor>,
items: Vec<ClassItem>,
+1 -1
View File
@@ -294,7 +294,7 @@ class_item = _{
}
class_decl = {
visibility? ~ "class" ~ identifier ~ generics_decl? ~ (":" ~ type_expr)? ~ "{" ~ class_fields ~ class_constructor ~ class_item* ~ "}"
visibility? ~ "class" ~ identifier ~ generics_decl? ~ (":" ~ expr_path)? ~ "{" ~ class_fields ~ class_constructor ~ class_item* ~ "}"
}
// ======================================================
+2 -2
View File
@@ -69,8 +69,8 @@ impl<'a> TryFrom<pest::iterators::Pair<'a, Rule>> for TopLevelKind {
.transpose()
.map(|v| v.unwrap_or_default()),
inherits: consume_rule(&mut inner, Rule::type_expr)
.map(TypeExpr::try_from)
inherits: consume_rule(&mut inner, Rule::expr_path)
.map(ExprPath::try_from)
.transpose(),
fields: collect_recovered(inner.next().unwrap().into_inner()),