diff options
| author | gingerBill <bill@gingerbill.org> | 2018-08-01 21:34:59 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2018-08-01 21:34:59 +0100 |
| commit | 0718f14774c152b84edb747c03ca53b9400407b9 (patch) | |
| tree | af1c16de9e6aa15bd023cb9d0ac3290c0cc229e8 /src/ir.cpp | |
| parent | a6fe656f21863d578c1c408f158ed5bc567a8f23 (diff) | |
Reduce number of range and slice operators #239
Replace .. and ... with : and ..
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 5c58b1a2b..274075dfa 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -5820,10 +5820,6 @@ irAddr ir_build_addr(irProcedure *proc, Ast *expr) { if (se->low != nullptr) low = ir_build_expr(proc, se->low); if (se->high != nullptr) high = ir_build_expr(proc, se->high); - if (high != nullptr && se->interval.kind == Token_Ellipsis) { - high = ir_emit_arith(proc, Token_Add, high, v_one, t_int); - } - irValue *addr = ir_build_addr_ptr(proc, se->expr); irValue *base = ir_emit_load(proc, addr); Type *type = base_type(ir_type(base)); @@ -6625,8 +6621,7 @@ void ir_build_range_interval(irProcedure *proc, AstBinaryExpr *node, Type *val_t TokenKind op = Token_Lt; switch (node->op.kind) { - case Token_Ellipsis: op = Token_LtEq; break; - case Token_HalfClosed: op = Token_Lt; break; + case Token_Ellipsis: op = Token_LtEq; break; default: GB_PANIC("Invalid interval operator"); break; } @@ -7224,8 +7219,7 @@ void ir_build_stmt_internal(irProcedure *proc, Ast *node) { ast_node(ie, BinaryExpr, expr); TokenKind op = Token_Invalid; switch (ie->op.kind) { - case Token_Ellipsis: op = Token_LtEq; break; - case Token_HalfClosed: op = Token_Lt; break; + case Token_Ellipsis: op = Token_LtEq; break; default: GB_PANIC("Invalid interval operator"); break; } irValue *lhs = ir_build_expr(proc, ie->left); |