From e2276bb3feba22cf131debbca881d3e4d0ba705d Mon Sep 17 00:00:00 2001 From: Flavian Kaufmann Date: Tue, 20 May 2025 08:22:29 +0200 Subject: pass env to exec_stmt --- ast.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ast.h') diff --git a/ast.h b/ast.h index 7a58372..7dd9697 100644 --- a/ast.h +++ b/ast.h @@ -38,9 +38,15 @@ ASTNode *ast_bop(BOp bop, ASTNode *bexp1, ASTNode *bexp2); ASTNode *ast_not(ASTNode *bexp); ASTNode *ast_rop(ROp rop, ASTNode *aexp1, ASTNode *aexp2); -void exec_stmt(ASTNode *node); +typedef struct Env { + char *name; + int val; + struct Env *next; +} Env; + +void exec_stmt(Env **env, ASTNode *node); void free_ast(ASTNode *node); -void env_print(void); +void env_print(Env *env); #endif -- cgit v1.2.3