From 25417e964048b18ed7f295b81ab9743c057b0814 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Tue, 13 Feb 2024 00:50:00 +0100 Subject: [PATCH] :fire: handle multiple passes, even better --- src/pass.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/pass.c b/src/pass.c index fdde35a5..1fb31961 100644 --- a/src/pass.c +++ b/src/pass.c @@ -12,15 +12,14 @@ #define N_SCANPASS 4 static m_bool typecheck_ast(const Env env, Ast *ast) { - env->scope->poison = false; // move me - scan0_ast(env, ast); - if(env->scope->poison)env->context->error = true; - scan1_ast(env, ast); - if(env->scope->poison)env->context->error = true; - scan2_ast(env, ast); - if(env->scope->poison)env->context->error = true; - CHECK_b(check_ast(env, ast)); - if(env->scope->poison)env->context->error = true; + if(!scan0_ast(env, ast)) + env->context->error = true; + if(!scan1_ast(env, ast)) + env->context->error = true; + if(!scan2_ast(env, ast)) + env->context->error = true; + if(!check_ast(env, ast)) + env->context->error = true; // CHECK_b(traverse_ast(env, ast)); // if(env->scope->poison)env->context->error = true; if(env->context->error)return GW_ERROR; -- 2.43.0