From 082acaaa1e7aaa361adb02eab04ae610391dd58a Mon Sep 17 00:00:00 2001 From: Emmanuel Benoit Date: Mon, 9 Jan 2023 06:54:03 +0100 Subject: [PATCH] AST - Set expressions --- src/ast.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ast.rs b/src/ast.rs index 8ff779e..3deb1a0 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -83,6 +83,17 @@ pub struct GetExpr { pub name: Token, } +/// A setter expression. +#[derive(Debug, Clone)] +pub struct SetExpr { + /// The instance being accessed. + pub instance: Box, + /// The name of the property. + pub name: Token, + /// The value to set + pub value: Box, +} + /// An AST node that represents an expression. #[derive(Debug, Clone)] pub enum ExprNode { @@ -146,4 +157,6 @@ pub enum ExprNode { /// A get expression. Get(GetExpr), + /// A set expression. + Set(SetExpr), }