Adding len() builtin and TYPE_SLICE

This commit is contained in:
Krzosa Karol
2022-06-14 09:33:46 +02:00
parent 1a6d2598a3
commit f189ca381e
6 changed files with 65 additions and 19 deletions

View File

@@ -60,7 +60,7 @@ gen_simple_decl_postfix(Ast_Type *ast, bool scope_names){
case TYPE_POINTER: gen_simple_decl_postfix(ast->base, scope_names); break;
case TYPE_ARRAY:
gen("[");
if(ast->arr.size != ARRAY_SIZE_INFERRED)
if(ast->arr.size != ARRAY_SIZE_SLICE)
gen("%d", (int)ast->arr.size);
gen("]");
gen_simple_decl_postfix(ast->arr.base, scope_names); break;