fixing compiler bugs

This commit is contained in:
Krzosa Karol
2022-06-17 10:35:05 +02:00
parent 6696fd80f0
commit ae62b6933e
9 changed files with 54 additions and 12 deletions

View File

@@ -164,8 +164,11 @@ gen_string_simple_decl(Allocator *a, Ast_Type *ast, String name, Ast_Scope *scop
function B32
gen_value(Value a){
B32 result = true;
if(is_enum(a.type))
goto integer;
switch(a.type->kind){
CASE_INT: {
integer:
Scratch scratch;
const char *string = bigint_to_error_string(scratch, &a.big_int_val, 10);
gen("%s", string);
@@ -768,6 +771,11 @@ typedef struct String{
if(it->kind == AST_STRUCT){
genln("typedef struct %Q %Q;", it->name, it->name);
}
else if(it->kind == AST_LAMBDA){
genln("");
gen_lambda(it->name, it->lambda, false);
}
}
Scratch scratch;