Core library clean up: Make range expressions more consistent and replace uses of .. with ..=

This commit is contained in:
gingerBill
2021-06-14 11:15:25 +01:00
parent 3ca887a60a
commit 86649e6b44
23 changed files with 80 additions and 84 deletions
+2 -2
View File
@@ -314,9 +314,9 @@ write_escaped_rune_writer :: proc(w: io.Writer, r: rune, quote: byte, html_safe
is_printable :: proc(r: rune) -> bool {
if r <= 0xff {
switch r {
case 0x20..0x7e:
case 0x20..=0x7e:
return true;
case 0xa1..0xff: // ¡ through ÿ except for the soft hyphen
case 0xa1..=0xff: // ¡ through ÿ except for the soft hyphen
return r != 0xad; //
}
}
+3 -3
View File
@@ -85,9 +85,9 @@ is_delimiter :: proc(c: rune) -> bool {
is_separator :: proc(r: rune) -> bool {
if r <= 0x7f {
switch r {
case '0'..'9': return false;
case 'a'..'z': return false;
case 'A'..'Z': return false;
case '0'..='9': return false;
case 'a'..='z': return false;
case 'A'..='Z': return false;
case '_': return false;
}
return true;
+1 -1
View File
@@ -104,7 +104,7 @@ equal_fold :: proc(u, v: string) -> bool {
if tr < utf8.RUNE_SELF {
switch sr {
case 'A'..'Z':
case 'A'..='Z':
if tr == (sr+'a')-'A' {
continue loop;
}