added a way to create env function that have access to the executor

This commit is contained in:
afonya2 2025-05-24 19:29:11 +02:00
parent 58b1b2f94b
commit 7399a6d2ef
Signed by: afonya
GPG key ID: EBB9C4CAFAAFB2DC
4 changed files with 14 additions and 6 deletions

View file

@ -1,6 +1,6 @@
use core::panic;
use crate::lexer::{Token, TokenType};
use crate::{executor::Executor, lexer::{Token, TokenType}};
#[derive(Debug, Clone, PartialEq)]
pub enum ASTPart {
@ -120,7 +120,7 @@ pub struct AstContinue {
}
#[derive(Debug, Clone, PartialEq)]
pub struct AstRustFunction {
pub func: fn(Vec<ASTPart>) -> ASTPart,
pub func: fn(&mut Executor, Vec<ASTPart>) -> ASTPart,
pub pos: usize
}