AST - Refactored class member representation

This commit is contained in:
Emmanuel BENOîT 2023-01-12 08:05:07 +01:00
parent 6387615f68
commit 52c4b6315e

View file

@ -16,11 +16,18 @@ pub struct FunDecl {
pub body: Vec<StmtNode>,
}
/// The declaration of a class member.
#[derive(Debug, Clone)]
pub enum ClassMemberDecl {
Method(FunDecl),
StaticMethod(FunDecl),
}
/// A class declaration.
#[derive(Debug, Clone)]
pub struct ClassDecl {
pub name: Token,
pub methods: Vec<FunDecl>,
pub members: Vec<ClassMemberDecl>,
}
/// An AST node that represents a statement.