From ddb2c94ae54cc5f85fd1ec9291897a5002970a87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Sat, 14 Jan 2023 10:56:10 +0100 Subject: [PATCH] AST - Added property getters/setters --- src/ast.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/ast.rs b/src/ast.rs index f77306c..2ae2e10 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -16,11 +16,22 @@ pub struct FunDecl { pub body: Vec, } +/// A getter method for a property +#[derive(Debug, Clone)] +pub struct PropertyAccessor { + pub name: Token, + pub body: Vec, +} + /// The declaration of a class member. #[derive(Debug, Clone)] pub enum ClassMemberDecl { Method(FunDecl), StaticMethod(FunDecl), + PropertyGetter(PropertyAccessor), + StaticPropertyGetter(PropertyAccessor), + PropertySetter(PropertyAccessor), + StaticPropertySetter(PropertyAccessor), } /// A class declaration.