handle expressions + conditionals + return statemetnts + function calls

This commit is contained in:
YannAhlgrim
2026-07-12 15:24:53 +02:00
parent 5869d8acc2
commit e747ba1562
5 changed files with 715 additions and 41 deletions
+3 -1
View File
@@ -1,3 +1,5 @@
use std::rc::Rc;
use crate::{
ast::{self},
lexer::{self, LexerTraits},
@@ -378,7 +380,7 @@ impl Parser {
if !self.expect_peek(TokenType::Lbrace) {
return None;
}
let body = self.parse_block_statement()?;
let body = Rc::new(self.parse_block_statement()?);
Some(ast::Expression::FunctionLiteral(ast::FunctionLiteral {
token,
parameters,