Restructuring
This commit is contained in:
@@ -275,7 +275,6 @@ type_lambda(Ast *ast, Array<Ast_Type *> return_vals, Array<Ast_Type *> args){
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function Ast_Type *
|
function Ast_Type *
|
||||||
type_enum(Ast_Decl *ast, Ast_Type *type){
|
type_enum(Ast_Decl *ast, Ast_Type *type){
|
||||||
if(!type){
|
if(!type){
|
||||||
@@ -691,13 +690,6 @@ try_converting_untyped_to_default_type(Operand *op){
|
|||||||
try_converting_untyped_to_default_type(&op->value);
|
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
|
function void
|
||||||
make_sure_value_is_compatible_with_type(Token *pos, Operand *expr, Ast_Type *type, Typecheck_Flag debug_flag){
|
make_sure_value_is_compatible_with_type(Token *pos, Operand *expr, Ast_Type *type, Typecheck_Flag debug_flag){
|
||||||
if(type == expr->type){
|
if(type == expr->type){
|
||||||
@@ -755,16 +747,6 @@ _rewrite_into_const(Ast *node, U64 ast_size, Value value){
|
|||||||
ast->resolved_type = value.type;
|
ast->resolved_type = value.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct Scope_Search {
|
|
||||||
Array<Ast_Decl *> results;
|
|
||||||
Intern_String name;
|
|
||||||
Ast_Scope *scope;
|
|
||||||
|
|
||||||
bool exit_on_find;
|
|
||||||
bool search_only_current_scope;
|
|
||||||
U32 scope_visit_id;
|
|
||||||
};
|
|
||||||
|
|
||||||
function void
|
function void
|
||||||
inside_scope_search(Scope_Search *search, Ast_Scope *scope, int level){
|
inside_scope_search(Scope_Search *search, Ast_Scope *scope, int level){
|
||||||
if(scope->visit_id == search->scope_visit_id) return;
|
if(scope->visit_id == search->scope_visit_id) return;
|
||||||
|
|||||||
@@ -7,6 +7,23 @@ struct Operand{
|
|||||||
U8 pound_strict: 1;
|
U8 pound_strict: 1;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct Scope_Search {
|
||||||
|
Array<Ast_Decl *> 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;
|
typedef U32 Resolve_Flag;
|
||||||
enum{
|
enum{
|
||||||
AST_CANT_BE_NULL = bit_flag(0),
|
AST_CANT_BE_NULL = bit_flag(0),
|
||||||
|
|||||||
Reference in New Issue
Block a user