| ... | ... | @@ -2625,6 +2625,9 @@ fn transSwitch( |
| 2625 | 2625 | const else_prong = try transCreateNodeSwitchCase(rp.c, try transCreateNodeSwitchElse(rp.c)); |
| 2626 | 2626 | else_prong.expr = &(try transCreateNodeBreak(rp.c, "__switch")).base; |
| 2627 | 2627 | _ = try appendToken(rp.c, .Comma, ","); |
| 2628 | |
| 2629 | if (switch_scope.case_index >= switch_scope.cases.len) |
| 2630 | return revertAndWarn(rp, error.UnsupportedTranslation, ZigClangStmt_getBeginLoc(@ptrCast(*const ZigClangStmt, stmt)), "TODO complex switch cases", .{}); |
| 2628 | 2631 | switch_scope.cases[switch_scope.case_index] = &else_prong.base; |
| 2629 | 2632 | switch_scope.case_index += 1; |
| 2630 | 2633 | } |
| ... | ... | @@ -2666,6 +2669,9 @@ fn transCase( |
| 2666 | 2669 | const switch_prong = try transCreateNodeSwitchCase(rp.c, expr); |
| 2667 | 2670 | switch_prong.expr = &(try transCreateNodeBreak(rp.c, label)).base; |
| 2668 | 2671 | _ = try appendToken(rp.c, .Comma, ","); |
| 2672 | |
| 2673 | if (switch_scope.case_index >= switch_scope.cases.len) |
| 2674 | return revertAndWarn(rp, error.UnsupportedTranslation, ZigClangStmt_getBeginLoc(@ptrCast(*const ZigClangStmt, stmt)), "TODO complex switch cases", .{}); |
| 2669 | 2675 | switch_scope.cases[switch_scope.case_index] = &switch_prong.base; |
| 2670 | 2676 | switch_scope.case_index += 1; |
| 2671 | 2677 | |
| ... | ... | @@ -2699,6 +2705,9 @@ fn transDefault( |
| 2699 | 2705 | const else_prong = try transCreateNodeSwitchCase(rp.c, try transCreateNodeSwitchElse(rp.c)); |
| 2700 | 2706 | else_prong.expr = &(try transCreateNodeBreak(rp.c, label)).base; |
| 2701 | 2707 | _ = try appendToken(rp.c, .Comma, ","); |
| 2708 | |
| 2709 | if (switch_scope.case_index >= switch_scope.cases.len) |
| 2710 | return revertAndWarn(rp, error.UnsupportedTranslation, ZigClangStmt_getBeginLoc(@ptrCast(*const ZigClangStmt, stmt)), "TODO complex switch cases", .{}); |
| 2702 | 2711 | switch_scope.cases[switch_scope.case_index] = &else_prong.base; |
| 2703 | 2712 | switch_scope.case_index += 1; |
| 2704 | 2713 | |