authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-23 15:18:02-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2016-09-23 15:18:02-04:00
loge06885d64e3569719e9479c7069da7ad426a70d3
tree075258e85acce6c4d5fb3a29225fc0d97fabfb26
parent9ec6a78f121c8f61c10ea02f6949f27b0228ba16

enums support member functions


7 files changed, 103 insertions(+), 43 deletions(-)

src/all_types.hpp+1-1
...@@ -924,7 +924,7 @@ struct TypeTableEntryError {...@@ -924,7 +924,7 @@ struct TypeTableEntryError {
924924
925struct TypeTableEntryEnum {925struct TypeTableEntryEnum {
926 AstNode *decl_node;926 AstNode *decl_node;
927 uint32_t field_count;927 uint32_t src_field_count;
928 uint32_t gen_field_count;928 uint32_t gen_field_count;
929 TypeEnumField *fields;929 TypeEnumField *fields;
930 bool is_invalid; // true if any fields are invalid930 bool is_invalid; // true if any fields are invalid
src/analyze.cpp+63-34
...@@ -1325,7 +1325,7 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt...@@ -1325,7 +1325,7 @@ static void resolve_enum_type(CodeGen *g, ImportTableEntry *import, TypeTableEnt
13251325
1326 uint32_t field_count = decl_node->data.struct_decl.fields.length;1326 uint32_t field_count = decl_node->data.struct_decl.fields.length;
13271327
1328 enum_type->data.enumeration.field_count = field_count;1328 enum_type->data.enumeration.src_field_count = field_count;
1329 enum_type->data.enumeration.fields = allocate<TypeEnumField>(field_count);1329 enum_type->data.enumeration.fields = allocate<TypeEnumField>(field_count);
1330 ZigLLVMDIEnumerator **di_enumerators = allocate<ZigLLVMDIEnumerator*>(field_count);1330 ZigLLVMDIEnumerator **di_enumerators = allocate<ZigLLVMDIEnumerator*>(field_count);
13311331
...@@ -2451,8 +2451,8 @@ static LabelTableEntry *find_label(CodeGen *g, BlockContext *orig_context, Buf *...@@ -2451,8 +2451,8 @@ static LabelTableEntry *find_label(CodeGen *g, BlockContext *orig_context, Buf *
2451 return nullptr;2451 return nullptr;
2452}2452}
24532453
2454static TypeEnumField *get_enum_field(TypeTableEntry *enum_type, Buf *name) {2454static TypeEnumField *find_enum_type_field(TypeTableEntry *enum_type, Buf *name) {
2455 for (uint32_t i = 0; i < enum_type->data.enumeration.field_count; i += 1) {2455 for (uint32_t i = 0; i < enum_type->data.enumeration.src_field_count; i += 1) {
2456 TypeEnumField *type_enum_field = &enum_type->data.enumeration.fields[i];2456 TypeEnumField *type_enum_field = &enum_type->data.enumeration.fields[i];
2457 if (buf_eql_buf(type_enum_field->name, name)) {2457 if (buf_eql_buf(type_enum_field->name, name)) {
2458 return type_enum_field;2458 return type_enum_field;
...@@ -2467,7 +2467,7 @@ static TypeTableEntry *analyze_enum_value_expr(CodeGen *g, ImportTableEntry *imp...@@ -2467,7 +2467,7 @@ static TypeTableEntry *analyze_enum_value_expr(CodeGen *g, ImportTableEntry *imp
2467{2467{
2468 assert(field_access_node->type == NodeTypeFieldAccessExpr);2468 assert(field_access_node->type == NodeTypeFieldAccessExpr);
24692469
2470 TypeEnumField *type_enum_field = get_enum_field(enum_type, field_name);2470 TypeEnumField *type_enum_field = find_enum_type_field(enum_type, field_name);
2471 if (type_enum_field->type_entry->id == TypeTableEntryIdInvalid) {2471 if (type_enum_field->type_entry->id == TypeTableEntryIdInvalid) {
2472 return g->builtin_types.entry_invalid;2472 return g->builtin_types.entry_invalid;
2473 }2473 }
...@@ -2715,6 +2715,41 @@ static TypeTableEntry *analyze_container_init_expr(CodeGen *g, ImportTableEntry...@@ -2715,6 +2715,41 @@ static TypeTableEntry *analyze_container_init_expr(CodeGen *g, ImportTableEntry
2715 }2715 }
2716}2716}
27172717
2718static TypeTableEntry *analyze_member_access(CodeGen *g, bool wrapped_in_fn_call,
2719 TypeTableEntry *bare_struct_type, Buf *field_name, AstNode *node, TypeTableEntry *struct_type)
2720{
2721 assert(node->type == NodeTypeFieldAccessExpr);
2722 if (wrapped_in_fn_call && !is_slice(bare_struct_type)) {
2723 BlockContext *container_block_context = get_container_block_context(bare_struct_type);
2724 assert(container_block_context);
2725 auto entry = container_block_context->decl_table.maybe_get(field_name);
2726 AstNode *fn_decl_node = entry ? entry->value : nullptr;
2727 if (fn_decl_node && fn_decl_node->type == NodeTypeFnProto) {
2728 resolve_top_level_decl(g, fn_decl_node, false);
2729 TopLevelDecl *tld = get_as_top_level_decl(fn_decl_node);
2730 if (tld->resolution == TldResolutionInvalid) {
2731 return g->builtin_types.entry_invalid;
2732 }
2733
2734 node->data.field_access_expr.is_member_fn = true;
2735 FnTableEntry *fn_entry = fn_decl_node->data.fn_proto.fn_table_entry;
2736 if (fn_entry->type_entry->id == TypeTableEntryIdGenericFn) {
2737 return resolve_expr_const_val_as_generic_fn(g, node, fn_entry->type_entry, false);
2738 } else {
2739 return resolve_expr_const_val_as_fn(g, node, fn_entry, false);
2740 }
2741 } else {
2742 add_node_error(g, node, buf_sprintf("no function named '%s' in '%s'",
2743 buf_ptr(field_name), buf_ptr(&bare_struct_type->name)));
2744 return g->builtin_types.entry_invalid;
2745 }
2746 } else {
2747 add_node_error(g, node,
2748 buf_sprintf("no member named '%s' in '%s'", buf_ptr(field_name), buf_ptr(&struct_type->name)));
2749 return g->builtin_types.entry_invalid;
2750 }
2751}
2752
2718static TypeTableEntry *analyze_field_access_expr(CodeGen *g, ImportTableEntry *import, BlockContext *context,2753static TypeTableEntry *analyze_field_access_expr(CodeGen *g, ImportTableEntry *import, BlockContext *context,
2719 TypeTableEntry *expected_type, AstNode *node)2754 TypeTableEntry *expected_type, AstNode *node)
2720{2755{
...@@ -2742,34 +2777,28 @@ static TypeTableEntry *analyze_field_access_expr(CodeGen *g, ImportTableEntry *i...@@ -2742,34 +2777,28 @@ static TypeTableEntry *analyze_field_access_expr(CodeGen *g, ImportTableEntry *i
2742 node->data.field_access_expr.type_struct_field = find_struct_type_field(bare_struct_type, field_name);2777 node->data.field_access_expr.type_struct_field = find_struct_type_field(bare_struct_type, field_name);
2743 if (node->data.field_access_expr.type_struct_field) {2778 if (node->data.field_access_expr.type_struct_field) {
2744 return node->data.field_access_expr.type_struct_field->type_entry;2779 return node->data.field_access_expr.type_struct_field->type_entry;
2745 } else if (wrapped_in_fn_call && !is_slice(bare_struct_type)) {2780 } else {
2746 BlockContext *container_block_context = get_container_block_context(bare_struct_type);2781 return analyze_member_access(g, wrapped_in_fn_call, bare_struct_type, field_name,
2747 assert(container_block_context);2782 node, struct_type);
2748 auto entry = container_block_context->decl_table.maybe_get(field_name);2783 }
2749 AstNode *fn_decl_node = entry ? entry->value : nullptr;2784 } else if (struct_type->id == TypeTableEntryIdEnum || (struct_type->id == TypeTableEntryIdPointer &&
2750 if (fn_decl_node && fn_decl_node->type == NodeTypeFnProto) {2785 struct_type->data.pointer.child_type->id == TypeTableEntryIdEnum))
2751 resolve_top_level_decl(g, fn_decl_node, false);2786 {
2752 TopLevelDecl *tld = get_as_top_level_decl(fn_decl_node);2787 TypeTableEntry *bare_struct_type = (struct_type->id == TypeTableEntryIdEnum) ?
2753 if (tld->resolution == TldResolutionInvalid) {2788 struct_type : struct_type->data.pointer.child_type;
2754 return g->builtin_types.entry_invalid;
2755 }
27562789
2757 node->data.field_access_expr.is_member_fn = true;2790 if (!bare_struct_type->data.enumeration.complete) {
2758 FnTableEntry *fn_entry = fn_decl_node->data.fn_proto.fn_table_entry;2791 resolve_struct_type(g, bare_struct_type->data.enumeration.decl_node->owner, bare_struct_type);
2759 if (fn_entry->type_entry->id == TypeTableEntryIdGenericFn) {2792 }
2760 return resolve_expr_const_val_as_generic_fn(g, node, fn_entry->type_entry, false);2793
2761 } else {2794 node->data.field_access_expr.bare_struct_type = bare_struct_type;
2762 return resolve_expr_const_val_as_fn(g, node, fn_entry, false);2795 node->data.field_access_expr.type_enum_field = find_enum_type_field(bare_struct_type, field_name);
2763 }2796
2764 } else {2797 if (node->data.field_access_expr.type_enum_field) {
2765 add_node_error(g, node, buf_sprintf("no function named '%s' in '%s'",2798 return node->data.field_access_expr.type_enum_field->type_entry;
2766 buf_ptr(field_name), buf_ptr(&bare_struct_type->name)));
2767 return g->builtin_types.entry_invalid;
2768 }
2769 } else {2799 } else {
2770 add_node_error(g, node,2800 return analyze_member_access(g, wrapped_in_fn_call, bare_struct_type, field_name,
2771 buf_sprintf("no member named '%s' in '%s'", buf_ptr(field_name), buf_ptr(&struct_type->name)));2801 node, struct_type);
2772 return g->builtin_types.entry_invalid;
2773 }2802 }
2774 } else if (struct_type->id == TypeTableEntryIdArray) {2803 } else if (struct_type->id == TypeTableEntryIdArray) {
2775 if (buf_eql_str(field_name, "len")) {2804 if (buf_eql_str(field_name, "len")) {
...@@ -5269,7 +5298,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry...@@ -5269,7 +5298,7 @@ static TypeTableEntry *analyze_builtin_fn_call_expr(CodeGen *g, ImportTableEntry
5269 if (type_entry->id == TypeTableEntryIdInvalid) {5298 if (type_entry->id == TypeTableEntryIdInvalid) {
5270 return type_entry;5299 return type_entry;
5271 } else if (type_entry->id == TypeTableEntryIdEnum) {5300 } else if (type_entry->id == TypeTableEntryIdEnum) {
5272 uint64_t value_count = type_entry->data.enumeration.field_count;5301 uint64_t value_count = type_entry->data.enumeration.src_field_count;
5273 return resolve_expr_const_val_as_unsigned_num_lit(g, node, expected_type,5302 return resolve_expr_const_val_as_unsigned_num_lit(g, node, expected_type,
5274 value_count, false);5303 value_count, false);
5275 } else {5304 } else {
...@@ -6130,7 +6159,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,...@@ -6130,7 +6159,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,
6130 size_t *field_use_counts = nullptr;6159 size_t *field_use_counts = nullptr;
6131 HashMap<int, AstNode *, int_hash, int_eq> err_use_nodes = {};6160 HashMap<int, AstNode *, int_hash, int_eq> err_use_nodes = {};
6132 if (expr_type->id == TypeTableEntryIdEnum) {6161 if (expr_type->id == TypeTableEntryIdEnum) {
6133 field_use_counts = allocate<size_t>(expr_type->data.enumeration.field_count);6162 field_use_counts = allocate<size_t>(expr_type->data.enumeration.src_field_count);
6134 } else if (expr_type->id == TypeTableEntryIdErrorUnion) {6163 } else if (expr_type->id == TypeTableEntryIdErrorUnion) {
6135 err_use_nodes.init(10);6164 err_use_nodes.init(10);
6136 }6165 }
...@@ -6168,7 +6197,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,...@@ -6168,7 +6197,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,
6168 if (expr_type->id == TypeTableEntryIdEnum) {6197 if (expr_type->id == TypeTableEntryIdEnum) {
6169 if (item_node->type == NodeTypeSymbol) {6198 if (item_node->type == NodeTypeSymbol) {
6170 Buf *field_name = item_node->data.symbol_expr.symbol;6199 Buf *field_name = item_node->data.symbol_expr.symbol;
6171 TypeEnumField *type_enum_field = get_enum_field(expr_type, field_name);6200 TypeEnumField *type_enum_field = find_enum_type_field(expr_type, field_name);
6172 if (type_enum_field) {6201 if (type_enum_field) {
6173 item_node->data.symbol_expr.enum_field = type_enum_field;6202 item_node->data.symbol_expr.enum_field = type_enum_field;
6174 if (!var_type) {6203 if (!var_type) {
...@@ -6300,7 +6329,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,...@@ -6300,7 +6329,7 @@ static TypeTableEntry *analyze_switch_expr(CodeGen *g, ImportTableEntry *import,
6300 }6329 }
63016330
6302 if (expr_type->id == TypeTableEntryIdEnum && !else_prong) {6331 if (expr_type->id == TypeTableEntryIdEnum && !else_prong) {
6303 for (uint32_t i = 0; i < expr_type->data.enumeration.field_count; i += 1) {6332 for (uint32_t i = 0; i < expr_type->data.enumeration.src_field_count; i += 1) {
6304 if (field_use_counts[i] == 0) {6333 if (field_use_counts[i] == 0) {
6305 add_node_error(g, node,6334 add_node_error(g, node,
6306 buf_sprintf("enumeration value '%s' not handled in switch",6335 buf_sprintf("enumeration value '%s' not handled in switch",
src/codegen.cpp+5-5
...@@ -4605,7 +4605,7 @@ static void define_builtin_types(CodeGen *g) {...@@ -4605,7 +4605,7 @@ static void define_builtin_types(CodeGen *g) {
4605 entry->zero_bits = true; // only allowed at compile time4605 entry->zero_bits = true; // only allowed at compile time
4606 buf_init_from_str(&entry->name, "@OS");4606 buf_init_from_str(&entry->name, "@OS");
4607 uint32_t field_count = target_os_count();4607 uint32_t field_count = target_os_count();
4608 entry->data.enumeration.field_count = field_count;4608 entry->data.enumeration.src_field_count = field_count;
4609 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);4609 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);
4610 for (uint32_t i = 0; i < field_count; i += 1) {4610 for (uint32_t i = 0; i < field_count; i += 1) {
4611 TypeEnumField *type_enum_field = &entry->data.enumeration.fields[i];4611 TypeEnumField *type_enum_field = &entry->data.enumeration.fields[i];
...@@ -4631,7 +4631,7 @@ static void define_builtin_types(CodeGen *g) {...@@ -4631,7 +4631,7 @@ static void define_builtin_types(CodeGen *g) {
4631 entry->zero_bits = true; // only allowed at compile time4631 entry->zero_bits = true; // only allowed at compile time
4632 buf_init_from_str(&entry->name, "@Arch");4632 buf_init_from_str(&entry->name, "@Arch");
4633 uint32_t field_count = target_arch_count();4633 uint32_t field_count = target_arch_count();
4634 entry->data.enumeration.field_count = field_count;4634 entry->data.enumeration.src_field_count = field_count;
4635 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);4635 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);
4636 for (uint32_t i = 0; i < field_count; i += 1) {4636 for (uint32_t i = 0; i < field_count; i += 1) {
4637 TypeEnumField *type_enum_field = &entry->data.enumeration.fields[i];4637 TypeEnumField *type_enum_field = &entry->data.enumeration.fields[i];
...@@ -4663,7 +4663,7 @@ static void define_builtin_types(CodeGen *g) {...@@ -4663,7 +4663,7 @@ static void define_builtin_types(CodeGen *g) {
4663 entry->zero_bits = true; // only allowed at compile time4663 entry->zero_bits = true; // only allowed at compile time
4664 buf_init_from_str(&entry->name, "@Environ");4664 buf_init_from_str(&entry->name, "@Environ");
4665 uint32_t field_count = target_environ_count();4665 uint32_t field_count = target_environ_count();
4666 entry->data.enumeration.field_count = field_count;4666 entry->data.enumeration.src_field_count = field_count;
4667 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);4667 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);
4668 for (uint32_t i = 0; i < field_count; i += 1) {4668 for (uint32_t i = 0; i < field_count; i += 1) {
4669 TypeEnumField *type_enum_field = &entry->data.enumeration.fields[i];4669 TypeEnumField *type_enum_field = &entry->data.enumeration.fields[i];
...@@ -4690,7 +4690,7 @@ static void define_builtin_types(CodeGen *g) {...@@ -4690,7 +4690,7 @@ static void define_builtin_types(CodeGen *g) {
4690 entry->zero_bits = true; // only allowed at compile time4690 entry->zero_bits = true; // only allowed at compile time
4691 buf_init_from_str(&entry->name, "@ObjectFormat");4691 buf_init_from_str(&entry->name, "@ObjectFormat");
4692 uint32_t field_count = target_oformat_count();4692 uint32_t field_count = target_oformat_count();
4693 entry->data.enumeration.field_count = field_count;4693 entry->data.enumeration.src_field_count = field_count;
4694 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);4694 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);
4695 for (uint32_t i = 0; i < field_count; i += 1) {4695 for (uint32_t i = 0; i < field_count; i += 1) {
4696 TypeEnumField *type_enum_field = &entry->data.enumeration.fields[i];4696 TypeEnumField *type_enum_field = &entry->data.enumeration.fields[i];
...@@ -4716,7 +4716,7 @@ static void define_builtin_types(CodeGen *g) {...@@ -4716,7 +4716,7 @@ static void define_builtin_types(CodeGen *g) {
4716 entry->deep_const = true;4716 entry->deep_const = true;
4717 buf_init_from_str(&entry->name, "AtomicOrder");4717 buf_init_from_str(&entry->name, "AtomicOrder");
4718 uint32_t field_count = 6;4718 uint32_t field_count = 6;
4719 entry->data.enumeration.field_count = field_count;4719 entry->data.enumeration.src_field_count = field_count;
4720 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);4720 entry->data.enumeration.fields = allocate<TypeEnumField>(field_count);
4721 entry->data.enumeration.fields[0].name = buf_create_from_str("Unordered");4721 entry->data.enumeration.fields[0].name = buf_create_from_str("Unordered");
4722 entry->data.enumeration.fields[0].value = AtomicOrderUnordered;4722 entry->data.enumeration.fields[0].value = AtomicOrderUnordered;
src/eval.cpp+1-1
...@@ -683,7 +683,7 @@ void eval_const_expr_implicit_cast(CastOp cast_op,...@@ -683,7 +683,7 @@ void eval_const_expr_implicit_cast(CastOp cast_op,
683 {683 {
684 uint64_t value = other_val->data.x_bignum.data.x_uint;684 uint64_t value = other_val->data.x_bignum.data.x_uint;
685 assert(new_type->id == TypeTableEntryIdEnum);685 assert(new_type->id == TypeTableEntryIdEnum);
686 assert(value < new_type->data.enumeration.field_count);686 assert(value < new_type->data.enumeration.src_field_count);
687 const_val->data.x_enum.tag = value;687 const_val->data.x_enum.tag = value;
688 const_val->data.x_enum.payload = NULL;688 const_val->data.x_enum.payload = NULL;
689 const_val->ok = true;689 const_val->ok = true;
src/parseh.cpp+2-2
...@@ -870,7 +870,7 @@ static TypeTableEntry *resolve_enum_decl(Context *c, const EnumDecl *enum_decl)...@@ -870,7 +870,7 @@ static TypeTableEntry *resolve_enum_decl(Context *c, const EnumDecl *enum_decl)
870 enum_type->data.enumeration.complete = true;870 enum_type->data.enumeration.complete = true;
871 enum_type->data.enumeration.tag_type = tag_type_entry;871 enum_type->data.enumeration.tag_type = tag_type_entry;
872872
873 enum_type->data.enumeration.field_count = field_count;873 enum_type->data.enumeration.src_field_count = field_count;
874 enum_type->data.enumeration.fields = allocate<TypeEnumField>(field_count);874 enum_type->data.enumeration.fields = allocate<TypeEnumField>(field_count);
875 ZigLLVMDIEnumerator **di_enumerators = allocate<ZigLLVMDIEnumerator*>(field_count);875 ZigLLVMDIEnumerator **di_enumerators = allocate<ZigLLVMDIEnumerator*>(field_count);
876876
...@@ -977,7 +977,7 @@ static void visit_enum_decl(Context *c, const EnumDecl *enum_decl) {...@@ -977,7 +977,7 @@ static void visit_enum_decl(Context *c, const EnumDecl *enum_decl) {
977 enum_node->data.struct_decl.top_level_decl.visib_mod = VisibModExport;977 enum_node->data.struct_decl.top_level_decl.visib_mod = VisibModExport;
978 enum_node->data.struct_decl.type_entry = enum_type;978 enum_node->data.struct_decl.type_entry = enum_type;
979979
980 for (uint32_t i = 0; i < enum_type->data.enumeration.field_count; i += 1) {980 for (uint32_t i = 0; i < enum_type->data.enumeration.src_field_count; i += 1) {
981 TypeEnumField *type_enum_field = &enum_type->data.enumeration.fields[i];981 TypeEnumField *type_enum_field = &enum_type->data.enumeration.fields[i];
982 AstNode *type_node = make_type_node(c, type_enum_field->type_entry);982 AstNode *type_node = make_type_node(c, type_enum_field->type_entry);
983 AstNode *field_node = create_struct_field_node(c, buf_ptr(type_enum_field->name), type_node);983 AstNode *field_node = create_struct_field_node(c, buf_ptr(type_enum_field->name), type_node);
test/cases/enum_with_members.zig created+30
...@@ -0,0 +1,30 @@
1const std = @import("std");
2const assert = std.debug.assert;
3const io = std.io;
4const str = std.str;
5
6enum ET {
7 SINT: i32,
8 UINT: u32,
9
10 pub fn print(a: &ET, buf: []u8) -> %usize {
11 return switch (*a) {
12 SINT => |x| { io.bufPrintInt(i32, buf, x) },
13 UINT => |x| { io.bufPrintInt(u32, buf, x) },
14 }
15 }
16}
17
18#attribute("test")
19fn enumWithMembers() {
20 const a = ET.SINT { -42 };
21 const b = ET.UINT { 42 };
22 var buf: [20]u8 = undefined;
23
24 assert(%%a.print(buf) == 3);
25 assert(str.eql(buf[0...3], "-42"));
26
27 assert(%%b.print(buf) == 2);
28 assert(str.eql(buf[0...2], "42"));
29}
30
test/self_hosted.zig+1
...@@ -13,6 +13,7 @@ const test_var_params = @import("cases/var_params.zig");...@@ -13,6 +13,7 @@ const test_var_params = @import("cases/var_params.zig");
13const test_const_slice_child = @import("cases/const_slice_child.zig");13const test_const_slice_child = @import("cases/const_slice_child.zig");
14const test_switch_prong_implicit_cast = @import("cases/switch_prong_implicit_cast.zig");14const test_switch_prong_implicit_cast = @import("cases/switch_prong_implicit_cast.zig");
15const test_switch_prong_err_enum = @import("cases/switch_prong_err_enum.zig");15const test_switch_prong_err_enum = @import("cases/switch_prong_err_enum.zig");
16const test_enum_with_members = @import("cases/enum_with_members.zig");
1617
17// normal comment18// normal comment
18/// this is a documentation comment19/// this is a documentation comment