AST - Removed useless field from Lambda

This commit is contained in:
Emmanuel BENOîT 2023-01-02 21:36:50 +01:00
parent 2881eb5a61
commit ab46d0bcef
2 changed files with 1 additions and 7 deletions

View file

@ -98,8 +98,6 @@ pub enum ExprNode {
/// A lambda function.
Lambda {
/// The `fun` token which creates the lambda.
token: Token,
params: Vec<Token>,
body: Vec<StmtNode>,
},

View file

@ -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])
{