Reduce number of range and slice operators #239

Replace .. and ... with : and ..
This commit is contained in:
gingerBill
2018-08-01 21:34:59 +01:00
parent a6fe656f21
commit 0718f14774
31 changed files with 204 additions and 219 deletions

View File

@@ -6110,8 +6110,6 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
// It is okay to continue as it will assume the 1st index is zero
}
TokenKind interval_kind = se->interval.kind;
i64 indices[2] = {};
Ast *nodes[2] = {se->low, se->high};
for (isize i = 0; i < gb_count_of(nodes); i++) {
@@ -6122,7 +6120,7 @@ ExprKind check_expr_base_internal(CheckerContext *c, Operand *o, Ast *node, Type
capacity = max_count;
}
i64 j = 0;
if (check_index_value(c, interval_kind == Token_Ellipsis, nodes[i], capacity, &j)) {
if (check_index_value(c, false, nodes[i], capacity, &j)) {
index = j;
}
} else if (i == 0) {