diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-17 16:33:36 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-17 16:33:36 +0000 |
| commit | 6b2545224752be74de35166c3dcda9ff5bdb79e3 (patch) | |
| tree | aa2765253769a0a1635d9ffc22738ec6598254c1 /src/codegen/codegen.c | |
| parent | b885629239d04d2860a8853799a3d335d8bec154 (diff) | |
Add C++ interop support.
Diffstat (limited to 'src/codegen/codegen.c')
| -rw-r--r-- | src/codegen/codegen.c | 12 |
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); |
