summaryrefslogtreecommitdiff
path: root/src/codegen/codegen.c
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-17 16:33:36 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-17 16:33:36 +0000
commit6b2545224752be74de35166c3dcda9ff5bdb79e3 (patch)
treeaa2765253769a0a1635d9ffc22738ec6598254c1 /src/codegen/codegen.c
parentb885629239d04d2860a8853799a3d335d8bec154 (diff)
Add C++ interop support.
Diffstat (limited to 'src/codegen/codegen.c')
-rw-r--r--src/codegen/codegen.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/codegen/codegen.c b/src/codegen/codegen.c
index 25ae5b3..1d825dc 100644
--- a/src/codegen/codegen.c
+++ b/src/codegen/codegen.c
@@ -174,7 +174,7 @@ static void codegen_match_internal(ParserContext *ctx, ASTNode *node, FILE *out,
}
else
{
- fprintf(out, "__auto_type %s = _m_%d.val; ", c->match_case.binding_name, id);
+ fprintf(out, "ZC_AUTO %s = _m_%d.val; ", c->match_case.binding_name, id);
}
}
if (is_result)
@@ -188,8 +188,7 @@ static void codegen_match_internal(ParserContext *ctx, ASTNode *node, FILE *out,
}
else
{
- fprintf(out, "__auto_type %s = _m_%d.val; ", c->match_case.binding_name,
- id);
+ fprintf(out, "ZC_AUTO %s = _m_%d.val; ", c->match_case.binding_name, id);
}
}
else
@@ -201,8 +200,7 @@ static void codegen_match_internal(ParserContext *ctx, ASTNode *node, FILE *out,
}
else
{
- fprintf(out, "__auto_type %s = _m_%d.err; ", c->match_case.binding_name,
- id);
+ fprintf(out, "ZC_AUTO %s = _m_%d.err; ", c->match_case.binding_name, id);
}
}
}
@@ -217,7 +215,7 @@ static void codegen_match_internal(ParserContext *ctx, ASTNode *node, FILE *out,
{
f = c->match_case.pattern;
}
- fprintf(out, "__auto_type %s = _m_%d.data.%s; ", c->match_case.binding_name, id, f);
+ fprintf(out, "ZC_AUTO %s = _m_%d.data.%s; ", c->match_case.binding_name, id, f);
}
}
@@ -1838,7 +1836,7 @@ void codegen_node_single(ParserContext *ctx, ASTNode *node, FILE *out)
}
else
{
- fprintf(out, "__auto_type %s = ", node->for_range.var_name);
+ fprintf(out, "ZC_AUTO %s = ", node->for_range.var_name);
}
codegen_expression(ctx, node->for_range.start, out);
fprintf(out, "; %s < ", node->for_range.var_name);