diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-17 14:02:17 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-17 14:02:17 +0000 |
| commit | 5609bc8a7994ae50790454ed6966d83148edd83f (patch) | |
| tree | 07534fd0cb86e92b68655df5bee0c528c3ecde2c | |
| parent | d15dbaf025df9265dce417faaa5ccf33ae04d4b5 (diff) | |
Solved duplicate and modified test script.
| -rw-r--r-- | src/codegen/codegen_decl.c | 51 | ||||
| -rwxr-xr-x | tests/run_tests.sh | 4 |
2 files changed, 2 insertions, 53 deletions
diff --git a/src/codegen/codegen_decl.c b/src/codegen/codegen_decl.c index 0ee4cd6..11970a5 100644 --- a/src/codegen/codegen_decl.c +++ b/src/codegen/codegen_decl.c @@ -881,55 +881,4 @@ void print_type_defs(ParserContext *ctx, FILE *out, ASTNode *nodes) } local = local->next; } - - // THEN: Emit typedefs for instantiated generics - Instantiation *i = ctx->instantiations; - while (i) - { - if (i->struct_node->type == NODE_RAW_STMT) - { - fprintf(out, "%s\n", i->struct_node->raw_stmt.content); - } - else - { - fprintf(out, "typedef struct %s %s;\n", i->struct_node->strct.name, - i->struct_node->strct.name); - codegen_node(ctx, i->struct_node, out); - } - i = i->next; - } - - StructRef *sr = ctx->parsed_structs_list; - while (sr) - { - if (sr->node && sr->node->type == NODE_STRUCT && !sr->node->strct.is_template) - { - const char *keyword = sr->node->strct.is_union ? "union" : "struct"; - fprintf(out, "typedef %s %s %s;\n", keyword, sr->node->strct.name, - sr->node->strct.name); - } - - if (sr->node && sr->node->type == NODE_ENUM && !sr->node->enm.is_template) - { - fprintf(out, "typedef struct %s %s;\n", sr->node->enm.name, sr->node->enm.name); - } - sr = sr->next; - } - - // Also check instantiated_structs list. - ASTNode *inst_s = ctx->instantiated_structs; - while (inst_s) - { - if (inst_s->type == NODE_STRUCT && !inst_s->strct.is_template) - { - const char *keyword = inst_s->strct.is_union ? "union" : "struct"; - fprintf(out, "typedef %s %s %s;\n", keyword, inst_s->strct.name, inst_s->strct.name); - } - - if (inst_s->type == NODE_ENUM && !inst_s->enm.is_template) - { - fprintf(out, "typedef struct %s %s;\n", inst_s->enm.name, inst_s->enm.name); - } - inst_s = inst_s->next; - } } diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 771e77d..ab2601a 100755 --- a/tests/run_tests.sh +++ b/tests/run_tests.sh @@ -36,7 +36,7 @@ fi while read -r test_file; do [ -e "$test_file" ] || continue - echo -n "Testing $(basename "$test_file")... " + echo -n "Testing $test_file... " output=$($ZC run "$test_file" "$@" 2>&1) exit_code=$? @@ -47,7 +47,7 @@ while read -r test_file; do else echo "FAIL" ((FAILED++)) - FAILED_TESTS="$FAILED_TESTS\n- $(basename "$test_file")" + FAILED_TESTS="$FAILED_TESTS\n- $test_file" fi done < <(find "$TEST_DIR" -name "*.zc" | sort) |
