Porting unicode code

This commit is contained in:
Krzosa Karol
2022-06-15 10:12:40 +02:00
parent 43f424c414
commit e984049429
4 changed files with 87 additions and 8 deletions

View File

@@ -262,7 +262,9 @@ gen_expr(Ast_Expr *ast, Ast_Type *type_of_var){
CASE(INDEX, Index){
gen("(");
gen_expr(node->expr);
if(node->expr->resolved_type == type_string) gen(".str");
if(is_string(node->resolved_type))
if(!(type_of_var && type_of_var == type_pointer_to_char))
gen(".str");
gen("[");
gen_expr(node->index);
gen("]");