Deduped methods

This commit is contained in:
2026-05-05 21:54:43 +02:00
parent 557b6b7720
commit 5be6ecb44e
3 changed files with 18 additions and 77 deletions
+9 -9
View File
@@ -15,6 +15,12 @@ pub enum TypePostfix {
RefMut,
}
#[derive(Debug, Clone, Serialize)]
pub enum Visibility {
Public,
Private,
}
#[derive(Debug, Clone, Serialize)]
pub enum Attribute {
/// #[test]
@@ -67,19 +73,13 @@ pub enum TopLevelKind {
name: String,
fields: FieldList,
},
FunctionDecl {
export: bool,
name: String,
params: ParamList,
return_type: TypeExpr,
body: Block,
},
FunctionDecl(FunctionDecl),
ClassDecl {
export: bool,
name: String,
fields: Vec<VarDeclStmt>,
constructor: ClassConstructor,
methods: Vec<ClassMethod>,
methods: Vec<FunctionDecl>,
},
}
@@ -91,7 +91,7 @@ pub struct ClassConstructor {
}
#[derive(Debug, Clone, Serialize)]
pub struct ClassMethod {
pub struct FunctionDecl {
pub export: bool,
pub name: String,
pub params: ParamList,