aboutsummaryrefslogtreecommitdiff
path: root/core/strings
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2021-06-14 11:15:25 +0100
committergingerBill <bill@gingerbill.org>2021-06-14 11:15:25 +0100
commit86649e6b44877df3c5d0b81ed2f97aaa063a6f1d (patch)
tree700029b1021d4702e4877dd0c0355d3443df3865 /core/strings
parent3ca887a60ae1e681fd441edfe17805df97b6d6a3 (diff)
Core library clean up: Make range expressions more consistent and replace uses of `..` with `..=`
Diffstat (limited to 'core/strings')
-rw-r--r--core/strings/builder.odin4
-rw-r--r--core/strings/conversion.odin6
-rw-r--r--core/strings/strings.odin2
3 files changed, 6 insertions, 6 deletions
diff --git a/core/strings/builder.odin b/core/strings/builder.odin
index 843f79381..f2926b969 100644
--- a/core/strings/builder.odin
+++ b/core/strings/builder.odin
@@ -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; //
}
}
diff --git a/core/strings/conversion.odin b/core/strings/conversion.odin
index c03bed86a..26535f8c0 100644
--- a/core/strings/conversion.odin
+++ b/core/strings/conversion.odin
@@ -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;
diff --git a/core/strings/strings.odin b/core/strings/strings.odin
index 5537822a8..e81b41222 100644
--- a/core/strings/strings.odin
+++ b/core/strings/strings.odin
@@ -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;
}