Add typedefs in codegen, globals is working
This commit is contained in:
@@ -277,8 +277,12 @@ gen_ast(Ast *ast){
|
||||
else if(sym->type == type_string){
|
||||
gen("String %s = LIT(\"%s\");", node->name.str, sym->intern_val.str);
|
||||
}
|
||||
else if(sym->type == type_type){
|
||||
gen("typedef ");
|
||||
gen_simple_decl(sym->type_val, node->name);
|
||||
}
|
||||
else{
|
||||
parsing_error(node->pos, "Unhandled type of constant expression");
|
||||
parsing_error(node->pos, "C_Codegen: Unhandled type of constant expression");
|
||||
}
|
||||
|
||||
Ast_End();
|
||||
|
||||
Reference in New Issue
Block a user