From ab46d0bcefef543f93c12393d412e12058ab35f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 2 Jan 2023 21:36:50 +0100 Subject: [PATCH] AST - Removed useless field from Lambda --- src/ast.rs | 2 -- src/parser.rs | 6 +----- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index 325c43c..f0fd062 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -98,8 +98,6 @@ pub enum ExprNode { /// A lambda function. Lambda { - /// The `fun` token which creates the lambda. - token: Token, params: Vec, body: Vec, }, diff --git a/src/parser.rs b/src/parser.rs index 87bcd21..70acf22 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -685,11 +685,7 @@ impl Parser { }) } else if let Some(token) = self.expect(&[TokenType::Fun]) { let (params, body) = self.parse_function_info(FunctionKind::Lambda)?; - Ok(ast::ExprNode::Lambda { - token, - params, - body, - }) + Ok(ast::ExprNode::Lambda { params, body }) } else if let Some(token) = self.expect(&[TokenType::False, TokenType::True, TokenType::Nil]) {