diff options
| author | gingerBill <bill@gingerbill.org> | 2018-08-16 15:16:57 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-08-16 15:16:57 +0100 |
| commit | 884d5fed9f2894a91ede38fb073338b1fe94a483 (patch) | |
| tree | 41867331fdc096743e0072bf55067f77ebc306fb /src/check_stmt.cpp | |
| parent | ec84188597b6558970e66ec7918851f1267888df (diff) | |
bit_set['A'..'Z'], bit_set[0..8]
Diffstat (limited to 'src/check_stmt.cpp')
| -rw-r--r-- | src/check_stmt.cpp | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index 2040471b5..907754cbf 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -706,42 +706,27 @@ void check_switch_stmt(CheckerContext *ctx, Ast *node, u32 mod_flags) { } - TokenKind op = Token_Invalid; - Operand a = lhs; Operand b = rhs; check_comparison(ctx, &a, &x, Token_LtEq); if (a.mode == Addressing_Invalid) { continue; } - switch (ie->op.kind) { - case Token_Ellipsis: op = Token_GtEq; break; - default: error(ie->op, "Invalid interval operator"); continue; - } - check_comparison(ctx, &b, &x, op); + check_comparison(ctx, &b, &x, Token_GtEq); if (b.mode == Addressing_Invalid) { continue; } - switch (ie->op.kind) { - case Token_Ellipsis: op = Token_LtEq; break; - default: error(ie->op, "Invalid interval operator"); continue; - } - - - Operand a1 = lhs; Operand b1 = rhs; - check_comparison(ctx, &a1, &b1, op); + check_comparison(ctx, &a1, &b1, Token_LtEq); if (complete) { error(lhs.expr, "#complete switch statement does not allow ranges"); } add_constant_switch_case(ctx, &seen, lhs); - if (op == Token_LtEq) { - add_constant_switch_case(ctx, &seen, rhs); - } + add_constant_switch_case(ctx, &seen, rhs); } else { Operand y = {}; check_expr(ctx, &y, expr); |