From a447d66015c9109c503cbbe53d2ebbf1a802d616 Mon Sep 17 00:00:00 2001 From: Krzosa Karol Date: Thu, 29 Sep 2022 13:21:04 +0200 Subject: [PATCH] Restructuring --- core_typechecking.cpp | 18 ------------------ core_typechecking.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/core_typechecking.cpp b/core_typechecking.cpp index f3b40d9..cae2db6 100644 --- a/core_typechecking.cpp +++ b/core_typechecking.cpp @@ -275,7 +275,6 @@ type_lambda(Ast *ast, Array return_vals, Array args){ return result; } - function Ast_Type * type_enum(Ast_Decl *ast, Ast_Type *type){ if(!type){ @@ -691,13 +690,6 @@ try_converting_untyped_to_default_type(Operand *op){ try_converting_untyped_to_default_type(&op->value); } -typedef U32 Typecheck_Flag; -enum { - TYPE_AND_EXPR_REQUIRED = 0, - TYPE_CAN_BE_NULL = 1, - EXPR_CAN_BE_NULL = 2 -}; - function void make_sure_value_is_compatible_with_type(Token *pos, Operand *expr, Ast_Type *type, Typecheck_Flag debug_flag){ if(type == expr->type){ @@ -755,16 +747,6 @@ _rewrite_into_const(Ast *node, U64 ast_size, Value value){ ast->resolved_type = value.type; } -struct Scope_Search { - Array results; - Intern_String name; - Ast_Scope *scope; - - bool exit_on_find; - bool search_only_current_scope; - U32 scope_visit_id; -}; - function void inside_scope_search(Scope_Search *search, Ast_Scope *scope, int level){ if(scope->visit_id == search->scope_visit_id) return; diff --git a/core_typechecking.h b/core_typechecking.h index 6e14f69..fbbd7ff 100644 --- a/core_typechecking.h +++ b/core_typechecking.h @@ -7,6 +7,23 @@ struct Operand{ U8 pound_strict: 1; }; +struct Scope_Search { + Array results; + Intern_String name; + Ast_Scope *scope; + + bool exit_on_find; + bool search_only_current_scope; + U32 scope_visit_id; +}; + +typedef U32 Typecheck_Flag; +enum { + TYPE_AND_EXPR_REQUIRED = 0, + TYPE_CAN_BE_NULL = 1, + EXPR_CAN_BE_NULL = 2 +}; + typedef U32 Resolve_Flag; enum{ AST_CANT_BE_NULL = bit_flag(0),