Move types to Core_Ctx

This commit is contained in:
Krzosa Karol
2023-01-01 16:27:42 +01:00
parent d441abcddb
commit d120d05eee
8 changed files with 191 additions and 131 deletions

View File

@@ -23,7 +23,7 @@ _ast_new(size_t size, Ast_Kind kind, Token *pos, Ast_Flag flags = 0){
CORE_Static Ast_Atom *
ast_str(Token *pos, Intern_String string){
AST_NEW(Atom, VALUE, pos, AST_EXPR | AST_ATOM);
result->type = untyped_string;
result->type = pctx->untyped_string;
result->intern_val = string;
return result;
}
@@ -39,14 +39,14 @@ CORE_Static Ast_Atom *
ast_bool(Token *pos, B32 bool_val){
AST_NEW(Atom, VALUE, pos, AST_EXPR | AST_ATOM);
result->bool_val = bool_val;
result->type = untyped_bool;
result->type = pctx->untyped_bool;
return result;
}
CORE_Static Ast_Atom *
ast_float(Token *pos, F64 value){
AST_NEW(Atom, VALUE, pos, AST_EXPR | AST_ATOM);
result->type = untyped_float;
result->type = pctx->untyped_float;
result->f64_val = value;
return result;
}
@@ -54,7 +54,7 @@ ast_float(Token *pos, F64 value){
CORE_Static Ast_Atom *
ast_int(Token *pos, BigInt val){
AST_NEW(Atom, VALUE, pos, AST_EXPR | AST_ATOM);
result->type = untyped_int;
result->type = pctx->untyped_int;
result->big_int_val = bigint_copy(pctx->perm, &val);
return result;
}
@@ -256,7 +256,7 @@ ast_const(Token *pos, Intern_String name, Ast_Expr *expr){
CORE_Static Ast_Decl *
ast_type(Token *pos, Intern_String name, Ast_Type *type){
AST_NEW(Decl, TYPE, pos, AST_DECL);
result->type = type_type;
result->type = pctx->type_type;
result->type_val = type;
result->name = name;
return result;
@@ -332,7 +332,7 @@ CORE_Static Value
value_bool(B32 v){
Value value;
value.bool_val = v;
value.type = untyped_bool;
value.type = pctx->untyped_bool;
return value;
}
@@ -340,14 +340,14 @@ CORE_Static Value
value_int(BigInt b){
Value value;
value.big_int_val = b;
value.type = untyped_int;
value.type = pctx->untyped_int;
return value;
}
CORE_Static Value
value_int(S64 s64){
Value value;
value.type = untyped_int;
value.type = pctx->untyped_int;
bigint_init_signed(&value.big_int_val, s64);
return value;
}
@@ -356,7 +356,7 @@ CORE_Static Value
value_float(F64 b){
Value value;
value.f64_val = b;
value.type = untyped_float;
value.type = pctx->untyped_float;
return value;
}
@@ -364,7 +364,7 @@ CORE_Static Value
value_float(BigInt a){
Value value;
value.f64_val = bigint_as_float(&a);
value.type = untyped_float;
value.type = pctx->untyped_float;
return value;
}