diff options
| author | gingerBill <bill@gingerbill.org> | 2021-06-14 11:15:25 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-06-14 11:15:25 +0100 |
| commit | 86649e6b44877df3c5d0b81ed2f97aaa063a6f1d (patch) | |
| tree | 700029b1021d4702e4877dd0c0355d3443df3865 /core/strings | |
| parent | 3ca887a60ae1e681fd441edfe17805df97b6d6a3 (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.odin | 4 | ||||
| -rw-r--r-- | core/strings/conversion.odin | 6 | ||||
| -rw-r--r-- | core/strings/strings.odin | 2 |
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; } |