From 52c4b6315ebb3ee4d30628a3ba6c38485e067e6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Thu, 12 Jan 2023 08:05:07 +0100 Subject: [PATCH] AST - Refactored class member representation --- src/ast.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ast.rs b/src/ast.rs index 63029f4..87e39bc 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -16,11 +16,18 @@ pub struct FunDecl { pub body: Vec, } +/// 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, + pub members: Vec, } /// An AST node that represents a statement.