AST - Added property getters/setters
This commit is contained in:
parent
373668fc23
commit
ddb2c94ae5
1 changed files with 11 additions and 0 deletions
11
src/ast.rs
11
src/ast.rs
|
@ -16,11 +16,22 @@ pub struct FunDecl {
|
|||
pub body: Vec<StmtNode>,
|
||||
}
|
||||
|
||||
/// A getter method for a property
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct PropertyAccessor {
|
||||
pub name: Token,
|
||||
pub body: Vec<StmtNode>,
|
||||
}
|
||||
|
||||
/// 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.
|
||||
|
|
Loading…
Reference in a new issue