From ea160abc678e9578b5e140121a6d7c59a3b9dd06 Mon Sep 17 00:00:00 2001 From: Zuhaitz Méndez Fernández de Aránguiz Date: Sat, 17 Jan 2026 00:10:30 +0000 Subject: Improved struct pointer codegen, template instantiation and docs... --- src/parser/parser_expr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/parser/parser_expr.c') diff --git a/src/parser/parser_expr.c b/src/parser/parser_expr.c index d0f3337..975d237 100644 --- a/src/parser/parser_expr.c +++ b/src/parser/parser_expr.c @@ -1464,7 +1464,10 @@ ASTNode *parse_primary(ParserContext *ctx, Lexer *l) if (lexer_peek(&lookahead).type == TOK_RANGLE) { lexer_next(l); - char *concrete_type = parse_type(ctx, l); + Type *formal_type = parse_type_formal(ctx, l); + char *concrete_type = type_to_string(formal_type); // mangled for naming + char *unmangled_type = + type_to_c_string(formal_type); // C-compatible for substitution lexer_next(l); int is_struct = 0; @@ -1485,7 +1488,7 @@ ASTNode *parse_primary(ParserContext *ctx, Lexer *l) if (is_struct) { - instantiate_generic(ctx, acc, concrete_type, t); + instantiate_generic(ctx, acc, concrete_type, unmangled_type, t); char *clean_type = sanitize_mangled_name(concrete_type); @@ -1498,7 +1501,8 @@ ASTNode *parse_primary(ParserContext *ctx, Lexer *l) } else { - char *m = instantiate_function_template(ctx, acc, concrete_type); + char *m = + instantiate_function_template(ctx, acc, concrete_type, unmangled_type); if (m) { free(acc); -- cgit v1.2.3