From 6b2545224752be74de35166c3dcda9ff5bdb79e3 Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sat, 17 Jan 2026 16:33:36 +0000 Subject: Add C++ interop support. --- src/codegen/codegen.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/codegen/codegen.c') 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); -- cgit v1.2.3