From c9f74cdc5526f11425c860e74471d67018f7f3f5 Mon Sep 17 00:00:00 2001 From: Emmanuel Benoit Date: Mon, 9 Jan 2023 07:53:56 +0100 Subject: [PATCH] AST - "this" keyword --- src/ast.rs | 2 ++ src/dumper.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ast.rs b/src/ast.rs index 7532df0..63029f4 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -145,6 +145,8 @@ pub enum ExprNode { /// A reference to a variable. Variable(VariableExpr), + /// The "this" keyword. + This(VariableExpr), /// A lambda function. Lambda { diff --git a/src/dumper.rs b/src/dumper.rs index 20c4ccd..f7431fc 100644 --- a/src/dumper.rs +++ b/src/dumper.rs @@ -217,7 +217,7 @@ fn dump_expr_node(dumper: &mut Dumper, expr: &ExprNode) { dumper.current_line().push_str(&value.lexeme); } - ExprNode::Variable(var) => { + ExprNode::Variable(var) | ExprNode::This(var) => { dumper.current_line().push_str(&var.token.lexeme); }