Fixing line directive codegen for ifs, handling vkey codes

This commit is contained in:
Krzosa Karol
2022-10-01 22:40:13 +02:00
parent 84254fb6dc
commit 4451553e85
4 changed files with 23 additions and 12 deletions

View File

@@ -572,7 +572,7 @@ gen_ast(Ast *ast){
CASE(IF, If){
For(node->ifs){
gen_line(node);
gen_line(it);
genln("");
if(it->init) {
gen_expr(it->init);
@@ -586,7 +586,7 @@ gen_ast(Ast *ast){
gen_stmt_scope(it->scope);
}
else{
genln("else");
gen("else");
if(it->expr){
gen(" if(");
gen_expr(it->expr);
@@ -788,6 +788,7 @@ compile_to_c_code(){
#define CORE_Assert(x) do{if(!(x))__debugbreak();}while(0)
#define CORE_AssertMessage(x,...) CORE_Assert(x)
#define CORE_BufferSize(x) (sizeof(x)/sizeof((x)[0]))
typedef struct String{
uint8_t *str;
int64_t len;
@@ -863,6 +864,7 @@ CORE_MemoryCopy(void *dst, void *src, size_t size){
}
genln("");
gen_lambda(it.item[0]->unique_name, it.item[0]->lambda, false);
}
}