Skip to content

Commit ba5f7c4

Browse files
committed
Deprecate a..b based ranges in favour of ..=
1 parent 487bd3d commit ba5f7c4

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

core/encoding/entity/entity.odin

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,16 +231,16 @@ xml_decode_entity :: proc(entity: string) -> (decoded: rune, ok: bool) {
231231
for len(entity) > 0 {
232232
r := entity[0]
233233
switch r {
234-
case '0'..'9':
234+
case '0'..='9':
235235
val *= base
236236
val += int(r - '0')
237237

238-
case 'a'..'f':
238+
case 'a'..='f':
239239
if base == 10 { return -1, false }
240240
val *= base
241241
val += int(r - 'a' + 10)
242242

243-
case 'A'..'F':
243+
case 'A'..='F':
244244
if base == 10 { return -1, false }
245245
val *= base
246246
val += int(r - 'A' + 10)

core/encoding/xml/tokenizer.odin

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ is_valid_identifier_rune :: proc(r: rune) -> bool {
198198
switch r {
199199
case '_', '-', ':': return true
200200
case 'A'..='Z', 'a'..='z': return true
201-
case '0'..'9': return true
201+
case '0'..='9': return true
202202
case -1: return false
203203
}
204204
}

src/parser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,6 +1428,7 @@ Token expect_operator(AstFile *f) {
14281428
LIT(p));
14291429
}
14301430
if (f->curr_token.kind == Token_Ellipsis) {
1431+
syntax_warning(f->curr_token, "'..' for ranges has now be deprecated, prefer '..='");
14311432
f->tokens[f->curr_token_index].flags |= TokenFlag_Replace;
14321433
}
14331434

0 commit comments

Comments
 (0)